157 lines
6.4 KiB
HTML
157 lines
6.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Picta — Share Your World</title>
|
|
<link rel="stylesheet" href="/css/style.css">
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
|
</head>
|
|
<body>
|
|
<!-- Header -->
|
|
<header class="header">
|
|
<div class="header-inner">
|
|
<div class="logo" onclick="navigateHome()">
|
|
<img src="/logo.svg" class="logo-img" alt="Picta">
|
|
<span class="logo-text">Picta</span>
|
|
</div>
|
|
<div class="search-bar">
|
|
<input type="text" id="searchInput" placeholder="Search images..." oninput="filterPosts()">
|
|
<button onclick="filterPosts()" aria-label="Search">🔍</button>
|
|
</div>
|
|
<button class="btn-new-post" onclick="openUploadModal()">+ New Post</button>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Filter Bar -->
|
|
<div class="filter-bar">
|
|
<div class="filter-tabs">
|
|
<button class="filter-tab active" data-sort="new" onclick="setSort('new')">🆕 New</button>
|
|
<button class="filter-tab" data-sort="viral" onclick="setSort('viral')">🔥 Most Viral</button>
|
|
<button class="filter-tab" data-sort="user" onclick="setSort('user')">👤 User Submitted</button>
|
|
<button class="filter-tab" data-sort="top" onclick="setSort('top')">📈 Top Today</button>
|
|
</div>
|
|
<div class="post-count" id="postCount"></div>
|
|
</div>
|
|
|
|
<!-- Main Gallery -->
|
|
<main class="gallery-container">
|
|
<div class="gallery-grid" id="gallery">
|
|
<!-- Posts rendered here -->
|
|
</div>
|
|
<div class="loading" id="loading">
|
|
<div class="spinner"></div>
|
|
<p>Loading images...</p>
|
|
</div>
|
|
</main>
|
|
|
|
<!-- Floating Action Button -->
|
|
<button class="fab" onclick="openUploadModal()" aria-label="Upload image" title="Upload image (or paste with Ctrl+V)">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
<line x1="12" y1="5" x2="12" y2="19"></line>
|
|
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
</svg>
|
|
</button>
|
|
|
|
<!-- Upload Modal -->
|
|
<div class="modal-overlay" id="uploadModal">
|
|
<div class="modal">
|
|
<div class="modal-header">
|
|
<h2>Share</h2>
|
|
<button class="modal-close" onclick="closeUploadModal()" aria-label="Close">✕</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="upload-zone" id="uploadZone">
|
|
<div class="upload-prompt" id="uploadPrompt">
|
|
<div class="upload-icon">📁</div>
|
|
<p class="upload-main-text">Drop an image, click to browse, or paste</p>
|
|
<p class="upload-paste-hint"><kbd>Ctrl</kbd>+<kbd>V</kbd> works anywhere</p>
|
|
<p class="upload-formats">JPEG, PNG, GIF, WebP (max 20MB)</p>
|
|
</div>
|
|
<input type="file" id="fileInput" accept="image/jpeg,image/png,image/gif,image/webp" hidden>
|
|
<div class="upload-preview" id="uploadPreview" style="display:none;">
|
|
<img id="previewImage" src="" alt="Preview">
|
|
<button class="btn-remove" onclick="removePreview()" aria-label="Remove image">✕</button>
|
|
</div>
|
|
<div class="upload-processing" id="uploadProcessing" style="display:none;">
|
|
<div class="spinner spinner-sm"></div>
|
|
<p>Optimizing for 4K...</p>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="postTitle">Title</label>
|
|
<input type="text" id="postTitle" placeholder="Give your post a title..." maxlength="100">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="postTags">Tags (comma separated)</label>
|
|
<input type="text" id="postTags" placeholder="e.g., nature, sunset, photography">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="postAuthor">Your Name</label>
|
|
<input type="text" id="postAuthor" placeholder="Anonymous" maxlength="30">
|
|
</div>
|
|
<div id="uploadError" class="error-message" style="display:none;"></div>
|
|
<button class="btn-submit" id="submitBtn" onclick="submitPost()">Share</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Post Detail Modal -->
|
|
<div class="modal-overlay" id="postModal">
|
|
<div class="modal modal-large">
|
|
<div class="modal-header">
|
|
<h2 id="postModalTitle"></h2>
|
|
<button class="modal-close" onclick="closePostModal()" aria-label="Close">✕</button>
|
|
</div>
|
|
<div class="modal-body post-detail">
|
|
<div class="post-detail-grid">
|
|
<div class="post-image-container">
|
|
<img id="postModalImage" src="" alt="" onclick="openFullscreen()">
|
|
</div>
|
|
<div class="post-sidebar">
|
|
<div class="vote-box">
|
|
<button class="vote-btn upvote" onclick="votePost('up')" aria-label="Upvote">▲</button>
|
|
<span class="vote-count" id="postModalVotes">0</span>
|
|
<button class="vote-btn downvote" onclick="votePost('down')" aria-label="Downvote">▼</button>
|
|
</div>
|
|
<div class="post-meta">
|
|
<span class="meta-item">👁️ <span id="postModalViews">0</span> views</span>
|
|
<span class="meta-item">💬 <span id="postModalComments">0</span> comments</span>
|
|
</div>
|
|
<div class="post-tags" id="postModalTags"></div>
|
|
<div class="post-author" id="postModalAuthor"></div>
|
|
<div class="post-date" id="postModalDate"></div>
|
|
</div>
|
|
</div>
|
|
<div class="comments-section">
|
|
<h3>Comments</h3>
|
|
<div class="comment-form">
|
|
<input type="text" id="commentInput" placeholder="Add a comment..." maxlength="500">
|
|
<button class="btn-comment" onclick="postComment()">Post</button>
|
|
</div>
|
|
<div class="comments-list" id="commentsList"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Fullscreen Image -->
|
|
<div class="fullscreen-overlay" id="fullscreenOverlay" onclick="closeFullscreen()">
|
|
<img id="fullscreenImage" src="" alt="">
|
|
</div>
|
|
|
|
<!-- Full-page Drag Overlay -->
|
|
<div class="drag-overlay" id="dragOverlay">
|
|
<div class="drag-overlay-inner">
|
|
<div class="drag-overlay-icon">📥</div>
|
|
<p class="drag-overlay-text">Drop to share</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Toast Notifications -->
|
|
<div class="toast-container" id="toastContainer"></div>
|
|
|
|
<script src="/js/app.js"></script>
|
|
</body>
|
|
</html>
|