<?php
session_start();
require_once 'db_config.php';
// Check if user is logged in (optional for explorer)
$is_logged_in = isset($_SESSION['user_id']);
$username = $is_logged_in ? $_SESSION['username'] : '';
$plan_type = $is_logged_in ? $_SESSION['plan_type'] : '';
// Handle logout
if (isset($_GET['logout'])) {
session_destroy();
header('Location: index.php');
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Explorer - DevBrewing.com</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
.top-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
padding: 0 10px;
}
.logo {
font-size: 1.5rem;
font-weight: 700;
color: white;
text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.header-buttons {
display: flex;
gap: 10px;
align-items: center;
}
.user-info {
color: white;
font-size: 0.9rem;
margin-right: 15px;
text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.plan-badge {
background: rgba(255, 255, 255, 0.3);
padding: 2px 8px;
border-radius: 12px;
font-size: 0.8rem;
margin-left: 5px;
}
.plan-badge.free { background: rgba(156, 163, 175, 0.8); }
.plan-badge.creator { background: rgba(59, 130, 246, 0.8); }
.plan-badge.professional { background: rgba(245, 158, 11, 0.8); }
.nav-btn, .settings-btn, .logout-btn {
background: rgba(255, 255, 255, 0.2);
border: 2px solid rgba(255, 255, 255, 0.3);
color: white;
padding: 10px 20px;
border-radius: 25px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
backdrop-filter: blur(10px);
text-decoration: none;
display: inline-block;
}
.nav-btn:hover, .settings-btn:hover, .logout-btn:hover {
background: rgba(255, 255, 255, 0.3);
border-color: rgba(255, 255, 255, 0.5);
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.logout-btn {
background: rgba(239, 68, 68, 0.7);
border-color: rgba(239, 68, 68, 0.8);
}
.logout-btn:hover {
background: rgba(239, 68, 68, 0.9);
border-color: rgba(239, 68, 68, 1);
}
h1 {
text-align: center;
color: white;
font-size: 2.5rem;
margin-bottom: 2rem;
text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.breadcrumb {
background: rgba(255, 255, 255, 0.1);
color: white;
padding: 10px 20px;
border-radius: 10px;
margin-bottom: 2rem;
backdrop-filter: blur(10px);
}
.breadcrumb a {
color: #fbbf24;
text-decoration: none;
}
.breadcrumb a:hover {
text-decoration: underline;
}
.filter-bar {
background: rgba(255, 255, 255, 0.1);
padding: 15px;
border-radius: 10px;
margin-bottom: 2rem;
backdrop-filter: blur(10px);
display: flex;
gap: 10px;
align-items: center;
flex-wrap: wrap;
}
.filter-btn {
background: rgba(255, 255, 255, 0.2);
border: 1px solid rgba(255, 255, 255, 0.3);
color: white;
padding: 8px 16px;
border-radius: 20px;
font-size: 0.9rem;
cursor: pointer;
transition: all 0.3s ease;
}
.filter-btn.active, .filter-btn:hover {
background: rgba(255, 255, 255, 0.3);
border-color: rgba(255, 255, 255, 0.5);
}
.stats-bar {
background: rgba(255, 255, 255, 0.1);
color: white;
padding: 15px;
border-radius: 10px;
margin-bottom: 2rem;
backdrop-filter: blur(10px);
display: flex;
justify-content: space-around;
text-align: center;
}
.stat-item {
flex: 1;
}
.stat-number {
font-size: 1.5rem;
font-weight: 700;
}
.stat-label {
font-size: 0.9rem;
opacity: 0.9;
}
.grid {
display: grid;
gap: 20px;
grid-template-columns: 1fr;
}
/* Desktop layout - 4 columns */
@media (min-width: 768px) {
.grid {
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
}
.content-card {
background: rgba(255, 255, 255, 0.95);
border-radius: 16px;
padding: 2rem;
text-align: center;
box-shadow: 0 10px 30px rgba(0,0,0,0.2);
transition: all 0.3s ease;
cursor: pointer;
backdrop-filter: blur(10px);
border: 1px solid rgba(255,255,255,0.2);
min-height: 280px;
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
}
.content-card:hover {
transform: translateY(-5px);
box-shadow: 0 20px 40px rgba(0,0,0,0.3);
background: rgba(255, 255, 255, 1);
}
.content-preview {
width: 100%;
height: 120px;
background: #f0f0f0;
border-radius: 8px;
margin-bottom: 1rem;
display: flex;
align-items: center;
justify-content: center;
font-size: 3rem;
overflow: hidden;
}
.content-info {
flex: 1;
}
.content-title {
font-size: 1.2rem;
font-weight: 700;
color: #2d3748;
margin-bottom: 0.5rem;
}
.content-description {
color: #4a5568;
line-height: 1.4;
font-size: 0.9rem;
margin-bottom: 1rem;
}
.content-meta {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.8rem;
color: #666;
}
.content-author {
font-weight: 600;
}
.content-stats {
display: flex;
gap: 10px;
}
.content-type {
position: absolute;
top: 10px;
left: 10px;
background: rgba(59, 130, 246, 0.9);
color: white;
font-size: 0.7rem;
padding: 4px 8px;
border-radius: 12px;
font-weight: 600;
}
.content-type.vector { background: rgba(34, 197, 94, 0.9); }
.content-type.pixel { background: rgba(245, 158, 11, 0.9); }
.content-type.html { background: rgba(139, 92, 246, 0.9); }
.likes-btn {
background: none;
border: none;
color: #e53e3e;
cursor: pointer;
font-size: 0.8rem;
display: flex;
align-items: center;
gap: 3px;
}
.likes-btn:hover {
color: #c53030;
}
/* Mobile - full width cards */
@media (max-width: 767px) {
.logo {
font-size: 1.2rem;
}
.nav-btn, .settings-btn, .logout-btn {
padding: 8px 16px;
font-size: 0.9rem;
}
.header-buttons {
gap: 8px;
}
.user-info {
font-size: 0.8rem;
margin-right: 10px;
}
.content-card {
min-height: 260px;
padding: 1.5rem;
}
.content-preview {
height: 100px;
font-size: 2.5rem;
}
h1 {
font-size: 2rem;
}
.stats-bar {
flex-direction: column;
gap: 10px;
}
.filter-bar {
gap: 8px;
}
.filter-btn {
padding: 6px 12px;
font-size: 0.8rem;
}
}
/* Tablet - 2 columns */
@media (min-width: 768px) and (max-width: 1024px) {
.grid {
grid-template-columns: repeat(2, 1fr);
}
}
/* Large desktop - 4 columns */
@media (min-width: 1025px) {
.grid {
grid-template-columns: repeat(4, 1fr);
}
}
</style>
</head>
<body>
<div class="container">
<header class="top-header">
<div class="logo">Explorer</div>
<div class="header-buttons">
<?php if ($is_logged_in): ?>
<div class="user-info">
<?php echo htmlspecialchars($username); ?>
<span class="plan-badge <?php echo $plan_type; ?>"><?php echo ucfirst($plan_type); ?></span>
</div>
<a href="index.php" class="nav-btn">← Dashboard</a>
<button class="settings-btn">⚙️ Settings</button>
<a href="?logout=1" class="logout-btn">Logout</a>
<?php else: ?>
<a href="index.php" class="nav-btn">← Home</a>
<a href="login.php" class="nav-btn">Login</a>
<a href="signup.php" class="settings-btn">Sign Up</a>
<?php endif; ?>
</div>
</header>
<div class="breadcrumb">
<a href="index.php">Home</a> / Explorer
</div>
<h1>Community Explorer</h1>
<div class="filter-bar">
<span style="color: white; font-weight: 600;">Filter by type:</span>
<button class="filter-btn active">All</button>
<button class="filter-btn">Vectors</button>
<button class="filter-btn">Pixel Art</button>
<button class="filter-btn">HTML Sites</button>
<button class="filter-btn">Most Liked</button>
<button class="filter-btn">Recent</button>
</div>
<div class="stats-bar">
<div class="stat-item">
<div class="stat-number">127</div>
<div class="stat-label">Total Projects</div>
</div>
<div class="stat-item">
<div class="stat-number">45</div>
<div class="stat-label">Vectors</div>
</div>
<div class="stat-item">
<div class="stat-number">38</div>
<div class="stat-label">Pixel Art</div>
</div>
<div class="stat-item">
<div class="stat-number">44</div>
<div class="stat-label">HTML Sites</div>
</div>
</div>
<div class="grid">
<!-- Vector Art Examples -->
<div class="content-card">
<div class="content-type vector">Vector</div>
<div class="content-preview" style="background: linear-gradient(45deg, #ff6b6b, #feca57);">
✏️
</div>
<div class="content-info">
<h3 class="content-title">Modern Logo Design</h3>
<p class="content-description">Clean, professional logo with geometric shapes and vibrant colors</p>
</div>
<div class="content-meta">
<span class="content-author">@designpro</span>
<div class="content-stats">
<button class="likes-btn">❤️ 23</button>
<span>👁️ 145</span>
</div>
</div>
</div>
<div class="content-card">
<div class="content-type vector">Vector</div>
<div class="content-preview" style="background: linear-gradient(135deg, #667eea, #764ba2);">
🎨
</div>
<div class="content-info">
<h3 class="content-title">Abstract Art Piece</h3>
<p class="content-description">Flowing abstract design with smooth curves and gradients</p>
</div>
<div class="content-meta">
<span class="content-author">@vectorartist</span>
<div class="content-stats">
<button class="likes-btn">❤️ 18</button>
<span>👁️ 89</span>
</div>
</div>
</div>
<!-- Pixel Art Examples -->
<div class="content-card">
<div class="content-type pixel">Pixel</div>
<div class="content-preview" style="background: #8B5A2B; image-rendering: pixelated;">
🏰
</div>
<div class="content-info">
<h3 class="content-title">Retro Game Castle</h3>
<p class="content-description">16-bit style castle sprite perfect for indie games</p>
</div>
<div class="content-meta">
<span class="content-author">@pixelmaster</span>
<div class="content-stats">
<button class="likes-btn">❤️ 31</button>
<span>👁️ 203</span>
</div>
</div>
</div>
<div class="content-card">
<div class="content-type pixel">Pixel</div>
<div class="content-preview" style="background: linear-gradient(to bottom, #87CEEB, #90EE90);">
🌳
</div>
<div class="content-info">
<h3 class="content-title">Nature Scene</h3>
<p class="content-description">Detailed pixel art landscape with trees and mountains</p>
</div>
<div class="content-meta">
<span class="content-author">@pixelnature</span>
<div class="content-stats">
<button class="likes-btn">❤️ 27</button>
<span>👁️ 156</span>
</div>
</div>
</div>
<!-- HTML Site Examples -->
<div class="content-card">
<div class="content-type html">HTML</div>
<div class="content-preview" style="background: linear-gradient(45deg, #1e3c72, #2a5298);">
🌐
</div>
<div class="content-info">
<h3 class="content-title">Portfolio Website</h3>
<p class="content-description">Responsive portfolio site with modern CSS animations</p>
</div>
<div class="content-meta">
<span class="content-author">@webdev123</span>
<div class="content-stats">
<button class="likes-btn">❤️ 42</button>
<span>👁️ 287</span>
</div>
</div>
</div>
<div class="content-card">
<div class="content-type html">HTML</div>
<div class="content-preview" style="background: linear-gradient(135deg, #ff9a9e, #fecfef);">
📱
</div>
<div class="content-info">
<h3 class="content-title">Mobile App Landing</h3>
<p class="content-description">Beautiful landing page for mobile app with smooth scrolling</p>
</div>
<div class="content-meta">
<span class="content-author">@appdesigner</span>
<div class="content-stats">
<button class="likes-btn">❤️ 35</button>
<span>👁️ 198</span>
</div>
</div>
</div>
<!-- More Vector Examples -->
<div class="content-card">
<div class="content-type vector">Vector</div>
<div class="content-preview" style="background: radial-gradient(circle, #ff9a56, #ff6b6b);">
🦄
</div>
<div class="content-info">
<h3 class="content-title">Fantasy Illustration</h3>
<p class="content-description">Magical unicorn design with rainbow elements</p>
</div>
<div class="content-meta">
<span class="content-author">@fantasyart</span>
<div class="content-stats">
<button class="likes-btn">❤️ 67</button>
<span>👁️ 324</span>
</div>
</div>
</div>
<!-- More Pixel Examples -->
<div class="content-card">
<div class="content-type pixel">Pixel</div>
<div class="content-preview" style="background: #2C2C54;">
🚀
</div>
<div class="content-info">
<h3 class="content-title">Space Ship Sprite</h3>
<p class="content-description">Retro spaceship perfect for arcade-style games</p>
</div>
<div class="content-meta">
<span class="content-author">@gamesprites</span>
<div class="content-stats">
<button class="likes-btn">❤️ 29</button>
<span>👁️ 167</span>
</div>
</div>
</div>
</div>
</div>
<script>
// Filter functionality
document.querySelectorAll('.filter-btn').forEach(btn => {
btn.addEventListener('click', () => {
// Remove active class from all buttons
document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active'));
// Add active class to clicked button
btn.classList.add('active');
// Here you would typically filter the content
console.log('Filtering by:', btn.textContent);
});
});
// Like functionality
document.querySelectorAll('.likes-btn').forEach(btn => {
btn.addEventListener('click', (e) => {
e.stopPropagation();
const currentLikes = parseInt(btn.textContent.split(' ')[1]);
btn.innerHTML = `❤️ ${currentLikes + 1}`;
btn.style.color = '#c53030';
});
});
// Card click functionality
document.querySelectorAll('.content-card').forEach(card => {
card.addEventListener('click', () => {
const title = card.querySelector('.content-title').textContent;
console.log('Opening:', title);
// Here you would open the project viewer
});
});
</script>
</body>
</html>