Repository navigation
Expand file tree
/
Copy pathsearch.html
More file actions
141 lines (138 loc) · 7.52 KB
/
Copy pathsearch.html
File metadata and controls
141 lines (138 loc) · 7.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="keywords" content="social media, social network, meme, memes, sarcasm, based">
<meta name="description" content="The Ultimate Meme Sanctuary">
<meta name="author" content="KylGO, Inc44">
<meta http-equiv="refresh" content="1440">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="neuille/neuille_svgo.svg" type="image/svg+xml">
<link rel="stylesheet" href="styles.css">
<title>Into the Abyss - Based.meme</title>
<script src="theme.js"></script>
<script src="search.js"></script>
</head>
<body id="top">
<header>
<div class="left">
<div class="logo">
<a href="index.php">
<h1 class="glitch" data-text="Based.meme">Based.meme</h1>
</a>
</div>
</div>
<form class="search" action="search.php" method="GET">
<input type="search" name="query" value="<?= htmlspecialchars($query) ?>">
<button type="submit">🔍</button>
</form>
<div class="right">
<nav>
<button id="themeToggle">🌙</button>
<a href="profile.php" class="btn btn-login">Profile</a>
<a href="logout.php" class="btn btn-signup">Logout</a>
</nav>
</div>
</header>
<main class="main-aby">
<section class="sec-aby">
<div class="title-aby">
<h2 class="tagline">Into the Abyss</h2>
<p class="subtitle">Into the Abyss allows you to search for memes.</p>
</div>
<div class="formulaire-aby">
<form class="formabyss" action="search.php" method="GET">
<div class="filter-potions">
<div class="potion-filter">
<input type="radio" id="filter-memers" name="type" value="memers" <?= ($type === 'memers') ? 'checked' : '' ?>>
<label for="filter-memers"><span>Memers</span></label>
</div>
<div class="potion-filter">
<input type="radio" id="filter-memes" name="type" value="memes" <?= ($type === 'memes') ? 'checked' : '' ?>>
<label for="filter-memes"><span>Memes</span></label>
</div>
<div class="potion-filter">
<input type="radio" id="filter-tags" name="type" value="tags" <?= ($type === 'tags') ? 'checked' : '' ?>>
<label for="filter-tags"><span>Tags</span></label>
</div>
</div>
<div class="user-insert">
<div class="auth-form">
<label for="query">MEME/USER/TAG</label>
<input type="text" id="query" name="query" value="<?= htmlspecialchars($query) ?>">
</div>
<div class="meme-tag-container">
<label>TAGS</label>
<div class="tag-container"><?php if (!empty($tags)): ?><?php foreach ($tags as $tag): ?><input type="checkbox" name="tags[]" value="<?= htmlspecialchars($tag['slug']) ?>" id="tag-<?= htmlspecialchars($tag['slug']) ?>" <?= in_array($tag['slug'], $selected_tags) ? 'checked' : '' ?>>
<label for="tag-<?= htmlspecialchars($tag['slug']) ?>"><?= htmlspecialchars($tag['name']) ?></label><?php endforeach; ?><?php endif; ?>
</div>
</div>
</div>
<button type="submit" class="btn-aby">Find</button>
</form>
</div>
</section>
<section>
<br><?php if (!empty($query)): ?><h2>You searched for "<?= htmlspecialchars($query) ?>". Why tho?</h2><?php else: ?><h2>📄 Results:</h2><?php endif; ?><br><?php if ($perform_search): ?><?php if ($type === 'memes'): ?><?php if (empty($meme_results)): ?><div class="empty-state">
<h3>No memes found</h3>
<p>The void stares back. Or maybe your search term was just bad.</p>
</div><?php else: ?><div class="meme-grid"><?php foreach ($meme_results as $meme): ?><div class="meme-card">
<a href="meme.php?id=<?= htmlspecialchars($meme['meme_id']) ?>" class="meme-image-link">
<div class="meme-image"><?php if (!empty($meme["media_url"])): ?><img src="<?= htmlspecialchars($meme["media_url"]) ?>" alt="<?= htmlspecialchars($meme["title"]) ?>" loading="lazy" onerror="this.style.display='none'; this.nextElementSibling.style.display='flex';">
<div class="placeholder-image" data-text="Broken Link" style="display: none;"></div><?php else: ?><div class="placeholder-image" data-text="Quality Meme"></div><?php endif; ?><a href="profile.php?handle=<?= htmlspecialchars($meme["creator"]) ?>" class="creator-badge">@<?= htmlspecialchars($meme["creator"]) ?></a>
</div>
</a>
<div class="meme-info">
<h4><a href="meme.php?id=<?= htmlspecialchars($meme['meme_id']) ?>" class="meme-title-link"><?= htmlspecialchars($meme["title"]) ?></a></h4>
<div class="tag-list"><?php foreach (array_slice($meme["tags"] ?? [], 0, 4) as $tag): ?><a href="search.php?type=memes&tags[]=<?= urlencode($tag['slug']) ?>" class="tag primary-bg"><?= htmlspecialchars($tag['name']) ?></a><?php endforeach; ?></div>
<div class="meme-stats">
<span>❤️ <?= number_format($meme["like_count"]) ?></span>
<span>💬 <?= number_format($meme["comment_count"]) ?></span>
<span class="spiciness <?php
$spiciness = $meme["spiciness"];
if ($spiciness >= 0.84) {
echo "spiciness-extreme";
} elseif ($spiciness >= 0.69) {
echo "spiciness-high";
} elseif ($spiciness >= 0.42) {
echo "spiciness-medium";
} else {
echo "spiciness-low";
} ?>
">🌶️ <?= number_format($spiciness * 100) ?></span>
</div>
</div>
</div><?php endforeach; ?></div><?php endif; ?><?php elseif ($type === 'memers'): ?><?php if (empty($user_results)): ?><div class="empty-state">
<h3>No memers found</h3>
<p>Are they all hiding? Or maybe they just don't exist.</p>
</div><?php else: ?><div class="user-grid"><?php foreach ($user_results as $user): ?><a href="profile.php?handle=<?= urlencode($user['handle']) ?>" class="user-card">
<div class="user-avatar-sm"><?php if (!empty($user["avatar"])): ?><img src="<?= htmlspecialchars($user["avatar"]); ?>" alt="<?= htmlspecialchars($user['display_name'] ?: $user['handle']); ?>" loading="lazy"><?php else: ?><?= htmlspecialchars(strtoupper(substr($user["handle"], 0, 1))); ?><?php endif; ?></div>
<div class="user-info">
<h4><?= htmlspecialchars($user['display_name'] ?: $user['handle']) ?></h4>
<p class="handle">@<?= htmlspecialchars($user['handle']) ?></p><?php if (!empty($user['bio_snippet'])): ?><p class="bio-snippet"><?= htmlspecialchars($user['bio_snippet']) ?>...</p><?php endif; ?>
</div>
</a><?php endforeach; ?></div><?php endif; ?><?php elseif ($type === 'tags'): ?><?php if (empty($tag_results)): ?><div class="empty-state">
<h3>No tags found</h3>
<p>Maybe make some up? Be the change you want to see.</p>
</div><?php else: ?><div class="tag-grid"><?php foreach ($tag_results as $tag): ?><a href="search.php?type=memes&tags[]=<?= urlencode($tag['slug']) ?>" class="tag-card" title="Search memes with this tag">
<span>#<?= htmlspecialchars($tag['name']) ?></span>
<span class="usage-count"><?= number_format($tag['usage_count']) ?></span>
</a><?php endforeach; ?></div><?php endif; ?><?php endif; ?><div class="seen-enough-section">
<a href="index.php" class="btn btn-seen-enough secondary-bg">I've seen enough</a>
</div><?php else: ?><p>Enter a query or select tags to start searching.</p><?php endif; ?>
</section>
</main>
<footer>
<div class="footer-content">
<div class="footer-links">
<a href="about.html">About</a>
<a href="privacy_policy.html">Privacy Policy</a>
<a href="terms_of_service.html">Terms of Service</a>
<a href="contact.php">Contact</a>
</div>
<p class="copyright">© 2025 Based.meme | All rights reserved | No normies allowed.</p>
<a href="#top" id="scrollToTop">⬆️</a>
</div>
</footer>
</body>
</html>