create a website where you can search a database of films to check for potential triggers of emetophobia (a fear of vomit). Don't use the word vomit unless censored (e.g. v*mit). Make it searchable and make it easy to users to contribute to the database.
Browse files- README.md +8 -5
- components/footer.js +84 -0
- components/navbar.js +64 -0
- index.html +120 -19
- script.js +97 -0
- style.css +30 -18
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: Trigger
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Trigger-Free Flicks Database 🎬
|
| 3 |
+
colorFrom: green
|
| 4 |
+
colorTo: yellow
|
| 5 |
+
emoji: 🐳
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://huggingface.co/deepsite).
|
components/footer.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomFooter extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
.footer-link:hover {
|
| 7 |
+
color: #d946ef;
|
| 8 |
+
transform: translateX(2px);
|
| 9 |
+
}
|
| 10 |
+
</style>
|
| 11 |
+
<footer class="bg-gray-800 border-t border-gray-700 mt-16">
|
| 12 |
+
<div class="container mx-auto px-4 py-8">
|
| 13 |
+
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
|
| 14 |
+
<div>
|
| 15 |
+
<h3 class="text-lg font-bold text-white mb-4">TriggerFreeFlicks</h3>
|
| 16 |
+
<p class="text-gray-400">Helping you enjoy movies without unexpected triggers.</p>
|
| 17 |
+
</div>
|
| 18 |
+
|
| 19 |
+
<div>
|
| 20 |
+
<h4 class="text-white font-medium mb-4">Navigation</h4>
|
| 21 |
+
<ul class="space-y-2">
|
| 22 |
+
<li><a href="/" class="text-gray-400 footer-link hover:text-primary-500 transition flex items-center gap-1">
|
| 23 |
+
<i data-feather="chevron-right" class="w-4 h-4"></i>
|
| 24 |
+
<span>Home</span>
|
| 25 |
+
</a></li>
|
| 26 |
+
<li><a href="/browse" class="text-gray-400 footer-link hover:text-primary-500 transition flex items-center gap-1">
|
| 27 |
+
<i data-feather="chevron-right" class="w-4 h-4"></i>
|
| 28 |
+
<span>Browse Movies</span>
|
| 29 |
+
</a></li>
|
| 30 |
+
<li><a href="/contribute" class="text-gray-400 footer-link hover:text-primary-500 transition flex items-center gap-1">
|
| 31 |
+
<i data-feather="chevron-right" class="w-4 h-4"></i>
|
| 32 |
+
<span>Contribute</span>
|
| 33 |
+
</a></li>
|
| 34 |
+
<li><a href="/about" class="text-gray-400 footer-link hover:text-primary-500 transition flex items-center gap-1">
|
| 35 |
+
<i data-feather="chevron-right" class="w-4 h-4"></i>
|
| 36 |
+
<span>About</span>
|
| 37 |
+
</a></li>
|
| 38 |
+
</ul>
|
| 39 |
+
</div>
|
| 40 |
+
|
| 41 |
+
<div>
|
| 42 |
+
<h4 class="text-white font-medium mb-4">Resources</h4>
|
| 43 |
+
<ul class="space-y-2">
|
| 44 |
+
<li><a href="/faq" class="text-gray-400 footer-link hover:text-primary-500 transition flex items-center gap-1">
|
| 45 |
+
<i data-feather="chevron-right" class="w-4 h-4"></i>
|
| 46 |
+
<span>FAQ</span>
|
| 47 |
+
</a></li>
|
| 48 |
+
<li><a href="/guidelines" class="text-gray-400 footer-link hover:text-primary-500 transition flex items-center gap-1">
|
| 49 |
+
<i data-feather="chevron-right" class="w-4 h-4"></i>
|
| 50 |
+
<span>Submission Guidelines</span>
|
| 51 |
+
</a></li>
|
| 52 |
+
<li><a href="/support" class="text-gray-400 footer-link hover:text-primary-500 transition flex items-center gap-1">
|
| 53 |
+
<i data-feather="chevron-right" class="w-4 h-4"></i>
|
| 54 |
+
<span>Support</span>
|
| 55 |
+
</a></li>
|
| 56 |
+
</ul>
|
| 57 |
+
</div>
|
| 58 |
+
|
| 59 |
+
<div>
|
| 60 |
+
<h4 class="text-white font-medium mb-4">Connect</h4>
|
| 61 |
+
<div class="flex space-x-4">
|
| 62 |
+
<a href="#" class="text-gray-400 hover:text-primary-500 transition">
|
| 63 |
+
<i data-feather="twitter"></i>
|
| 64 |
+
</a>
|
| 65 |
+
<a href="#" class="text-gray-400 hover:text-primary-500 transition">
|
| 66 |
+
<i data-feather="instagram"></i>
|
| 67 |
+
</a>
|
| 68 |
+
<a href="#" class="text-gray-400 hover:text-primary-500 transition">
|
| 69 |
+
<i data-feather="facebook"></i>
|
| 70 |
+
</a>
|
| 71 |
+
</div>
|
| 72 |
+
</div>
|
| 73 |
+
</div>
|
| 74 |
+
|
| 75 |
+
<div class="border-t border-gray-700 mt-8 pt-6 text-center text-gray-500 text-sm">
|
| 76 |
+
<p>© 2023 TriggerFreeFlicks. All rights reserved.</p>
|
| 77 |
+
</div>
|
| 78 |
+
</div>
|
| 79 |
+
</footer>
|
| 80 |
+
`;
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
customElements.define('custom-footer', CustomFooter);
|
components/navbar.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomNavbar extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
.navbar {
|
| 7 |
+
backdrop-filter: blur(10px);
|
| 8 |
+
background-color: rgba(17, 24, 39, 0.8);
|
| 9 |
+
}
|
| 10 |
+
</style>
|
| 11 |
+
<nav class="navbar border-b border-gray-800 sticky top-0 z-50">
|
| 12 |
+
<div class="container mx-auto px-4">
|
| 13 |
+
<div class="flex items-center justify-between py-4">
|
| 14 |
+
<a href="/" class="flex items-center space-x-2">
|
| 15 |
+
<i data-feather="film" class="text-primary-500"></i>
|
| 16 |
+
<span class="text-xl font-bold text-white">TriggerFreeFlicks</span>
|
| 17 |
+
</a>
|
| 18 |
+
|
| 19 |
+
<div class="hidden md:flex items-center space-x-8">
|
| 20 |
+
<a href="/" class="text-gray-300 hover:text-primary-500 transition">Home</a>
|
| 21 |
+
<a href="/browse" class="text-gray-300 hover:text-primary-500 transition">Browse</a>
|
| 22 |
+
<a href="/contribute" class="text-gray-300 hover:text-primary-500 transition">Contribute</a>
|
| 23 |
+
<a href="/about" class="text-gray-300 hover:text-primary-500 transition">About</a>
|
| 24 |
+
</div>
|
| 25 |
+
|
| 26 |
+
<div class="flex items-center space-x-4">
|
| 27 |
+
<button class="text-gray-300 hover:text-primary-500 transition">
|
| 28 |
+
<i data-feather="user"></i>
|
| 29 |
+
</button>
|
| 30 |
+
<button class="md:hidden text-gray-300 hover:text-primary-500 transition" id="mobileMenuButton">
|
| 31 |
+
<i data-feather="menu"></i>
|
| 32 |
+
</button>
|
| 33 |
+
</div>
|
| 34 |
+
</div>
|
| 35 |
+
|
| 36 |
+
<!-- Mobile menu (hidden by default) -->
|
| 37 |
+
<div class="hidden md:hidden py-2 border-t border-gray-800" id="mobileMenu">
|
| 38 |
+
<a href="/" class="block py-2 px-4 text-gray-300 hover:text-primary-500 hover:bg-gray-800 rounded transition">Home</a>
|
| 39 |
+
<a href="/browse" class="block py-2 px-4 text-gray-300 hover:text-primary-500 hover:bg-gray-800 rounded transition">Browse</a>
|
| 40 |
+
<a href="/contribute" class="block py-2 px-4 text-gray-300 hover:text-primary-500 hover:bg-gray-800 rounded transition">Contribute</a>
|
| 41 |
+
<a href="/about" class="block py-2 px-4 text-gray-300 hover:text-primary-500 hover:bg-gray-800 rounded transition">About</a>
|
| 42 |
+
</div>
|
| 43 |
+
</div>
|
| 44 |
+
</nav>
|
| 45 |
+
`;
|
| 46 |
+
|
| 47 |
+
// Mobile menu toggle
|
| 48 |
+
const mobileMenuButton = this.shadowRoot.getElementById('mobileMenuButton');
|
| 49 |
+
const mobileMenu = this.shadowRoot.getElementById('mobileMenu');
|
| 50 |
+
|
| 51 |
+
mobileMenuButton.addEventListener('click', () => {
|
| 52 |
+
mobileMenu.classList.toggle('hidden');
|
| 53 |
+
const icon = mobileMenuButton.querySelector('i');
|
| 54 |
+
if (mobileMenu.classList.contains('hidden')) {
|
| 55 |
+
icon.setAttribute('data-feather', 'menu');
|
| 56 |
+
} else {
|
| 57 |
+
icon.setAttribute('data-feather', 'x');
|
| 58 |
+
}
|
| 59 |
+
feather.replace();
|
| 60 |
+
});
|
| 61 |
+
}
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
customElements.define('custom-navbar', CustomNavbar);
|
index.html
CHANGED
|
@@ -1,19 +1,120 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en" class="dark">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Trigger-Free Flicks | Safe Movie Search</title>
|
| 7 |
+
<link rel="stylesheet" href="style.css">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 11 |
+
<script>
|
| 12 |
+
tailwind.config = {
|
| 13 |
+
darkMode: 'class',
|
| 14 |
+
theme: {
|
| 15 |
+
extend: {
|
| 16 |
+
colors: {
|
| 17 |
+
primary: {
|
| 18 |
+
500: '#d946ef',
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
</script>
|
| 25 |
+
</head>
|
| 26 |
+
<body class="bg-gray-900 text-gray-100 min-h-screen">
|
| 27 |
+
<custom-navbar></custom-navbar>
|
| 28 |
+
|
| 29 |
+
<main class="container mx-auto px-4 py-8">
|
| 30 |
+
<section class="mb-16 text-center">
|
| 31 |
+
<h1 class="text-4xl md:text-5xl font-bold mb-4 text-primary-500">Trigger-Free Flicks</h1>
|
| 32 |
+
<p class="text-xl text-gray-300 max-w-2xl mx-auto">Find movies safe from emetophobia triggers</p>
|
| 33 |
+
|
| 34 |
+
<div class="relative max-w-2xl mx-auto mt-8">
|
| 35 |
+
<input type="text" id="searchInput" placeholder="Search for a movie..."
|
| 36 |
+
class="w-full px-6 py-3 rounded-full bg-gray-800 border border-gray-700 focus:outline-none focus:ring-2 focus:ring-primary-500 text-white">
|
| 37 |
+
<button id="searchBtn" class="absolute right-2 top-1/2 transform -translate-y-1/2 bg-primary-500 text-white p-2 rounded-full hover:bg-primary-600 transition">
|
| 38 |
+
<i data-feather="search"></i>
|
| 39 |
+
</button>
|
| 40 |
+
</div>
|
| 41 |
+
</section>
|
| 42 |
+
|
| 43 |
+
<section id="resultsSection" class="hidden">
|
| 44 |
+
<h2 class="text-2xl font-bold mb-6">Search Results</h2>
|
| 45 |
+
<div id="resultsContainer" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"></div>
|
| 46 |
+
</section>
|
| 47 |
+
|
| 48 |
+
<section id="popularSection" class="mt-16">
|
| 49 |
+
<div class="flex justify-between items-center mb-6">
|
| 50 |
+
<h2 class="text-2xl font-bold">Recently Added</h2>
|
| 51 |
+
<a href="/contribute" class="text-primary-500 hover:underline flex items-center gap-1">
|
| 52 |
+
<span>Contribute</span>
|
| 53 |
+
<i data-feather="plus" class="w-4 h-4"></i>
|
| 54 |
+
</a>
|
| 55 |
+
</div>
|
| 56 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
| 57 |
+
<!-- Popular movies will be loaded here -->
|
| 58 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
|
| 59 |
+
<div class="h-48 bg-gray-700 relative">
|
| 60 |
+
<img src="http://static.photos/movie/640x360/1" alt="Movie Poster" class="w-full h-full object-cover">
|
| 61 |
+
<div class="absolute top-2 right-2 bg-black bg-opacity-70 rounded-full px-2 py-1 text-xs">
|
| 62 |
+
<span class="text-green-400">Safe</span>
|
| 63 |
+
</div>
|
| 64 |
+
</div>
|
| 65 |
+
<div class="p-4">
|
| 66 |
+
<h3 class="font-bold text-lg">The Shawshank Redemption</h3>
|
| 67 |
+
<p class="text-gray-400 text-sm mt-1">No reported triggers</p>
|
| 68 |
+
</div>
|
| 69 |
+
</div>
|
| 70 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
|
| 71 |
+
<div class="h-48 bg-gray-700 relative">
|
| 72 |
+
<img src="http://static.photos/movie/640x360/2" alt="Movie Poster" class="w-full h-full object-cover">
|
| 73 |
+
<div class="absolute top-2 right-2 bg-black bg-opacity-70 rounded-full px-2 py-1 text-xs">
|
| 74 |
+
<span class="text-red-400">Warning</span>
|
| 75 |
+
</div>
|
| 76 |
+
</div>
|
| 77 |
+
<div class="p-4">
|
| 78 |
+
<h3 class="font-bold text-lg">Bridesmaids</h3>
|
| 79 |
+
<p class="text-gray-400 text-sm mt-1">1 v*mit scene</p>
|
| 80 |
+
</div>
|
| 81 |
+
</div>
|
| 82 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
|
| 83 |
+
<div class="h-48 bg-gray-700 relative">
|
| 84 |
+
<img src="http://static.photos/movie/640x360/3" alt="Movie Poster" class="w-full h-full object-cover">
|
| 85 |
+
<div class="absolute top-2 right-2 bg-black bg-opacity-70 rounded-full px-2 py-1 text-xs">
|
| 86 |
+
<span class="text-yellow-400">Caution</span>
|
| 87 |
+
</div>
|
| 88 |
+
</div>
|
| 89 |
+
<div class="p-4">
|
| 90 |
+
<h3 class="font-bold text-lg">Stand By Me</h3>
|
| 91 |
+
<p class="text-gray-400 text-sm mt-1">Brief mention</p>
|
| 92 |
+
</div>
|
| 93 |
+
</div>
|
| 94 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
|
| 95 |
+
<div class="h-48 bg-gray-700 relative">
|
| 96 |
+
<img src="http://static.photos/movie/640x360/4" alt="Movie Poster" class="w-full h-full object-cover">
|
| 97 |
+
<div class="absolute top-2 right-2 bg-black bg-opacity-70 rounded-full px-2 py-1 text-xs">
|
| 98 |
+
<span class="text-green-400">Safe</span>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
<div class="p-4">
|
| 102 |
+
<h3 class="font-bold text-lg">Toy Story</h3>
|
| 103 |
+
<p class="text-gray-400 text-sm mt-1">No triggers</p>
|
| 104 |
+
</div>
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
</section>
|
| 108 |
+
</main>
|
| 109 |
+
|
| 110 |
+
<custom-footer></custom-footer>
|
| 111 |
+
|
| 112 |
+
<script src="components/navbar.js"></script>
|
| 113 |
+
<script src="components/footer.js"></script>
|
| 114 |
+
<script src="script.js"></script>
|
| 115 |
+
<script>
|
| 116 |
+
feather.replace();
|
| 117 |
+
</script>
|
| 118 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 119 |
+
</body>
|
| 120 |
+
</html>
|
script.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 2 |
+
// Search functionality
|
| 3 |
+
const searchBtn = document.getElementById('searchBtn');
|
| 4 |
+
const searchInput = document.getElementById('searchInput');
|
| 5 |
+
const resultsSection = document.getElementById('resultsSection');
|
| 6 |
+
const resultsContainer = document.getElementById('resultsContainer');
|
| 7 |
+
const popularSection = document.getElementById('popularSection');
|
| 8 |
+
|
| 9 |
+
searchBtn.addEventListener('click', performSearch);
|
| 10 |
+
searchInput.addEventListener('keypress', function(e) {
|
| 11 |
+
if (e.key === 'Enter') {
|
| 12 |
+
performSearch();
|
| 13 |
+
}
|
| 14 |
+
});
|
| 15 |
+
|
| 16 |
+
function performSearch() {
|
| 17 |
+
const query = searchInput.value.trim();
|
| 18 |
+
if (query) {
|
| 19 |
+
// In a real app, this would fetch from an API
|
| 20 |
+
simulateSearch(query);
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
function simulateSearch(query) {
|
| 25 |
+
// Show loading state
|
| 26 |
+
resultsContainer.innerHTML = '<div class="col-span-full py-8 text-center text-gray-400">Searching...</div>';
|
| 27 |
+
resultsSection.classList.remove('hidden');
|
| 28 |
+
popularSection.classList.add('hidden');
|
| 29 |
+
|
| 30 |
+
// Simulate API delay
|
| 31 |
+
setTimeout(() => {
|
| 32 |
+
if (query.toLowerCase() === 'no results') {
|
| 33 |
+
resultsContainer.innerHTML = `
|
| 34 |
+
<div class="col-span-full py-12 text-center">
|
| 35 |
+
<i data-feather="alert-circle" class="w-12 h-12 mx-auto text-gray-500 mb-4"></i>
|
| 36 |
+
<h3 class="text-xl font-medium text-gray-300">No movies found</h3>
|
| 37 |
+
<p class="text-gray-500 mt-2">Try a different search term</p>
|
| 38 |
+
</div>
|
| 39 |
+
`;
|
| 40 |
+
} else {
|
| 41 |
+
// Mock results
|
| 42 |
+
resultsContainer.innerHTML = '';
|
| 43 |
+
|
| 44 |
+
const mockResults = [
|
| 45 |
+
{
|
| 46 |
+
title: 'Pulp Fiction',
|
| 47 |
+
status: 'warning',
|
| 48 |
+
description: 'Brief v*mit scene (non-graphic)',
|
| 49 |
+
image: 'http://static.photos/movie/640x360/5'
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
title: 'The Matrix',
|
| 53 |
+
status: 'safe',
|
| 54 |
+
description: 'No reported triggers',
|
| 55 |
+
image: 'http://static.photos/movie/640x360/6'
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
title: 'Forrest Gump',
|
| 59 |
+
status: 'caution',
|
| 60 |
+
description: 'Multiple v*mit references',
|
| 61 |
+
image: 'http://static.photos/movie/640x360/7'
|
| 62 |
+
}
|
| 63 |
+
];
|
| 64 |
+
|
| 65 |
+
mockResults.forEach((movie, index) => {
|
| 66 |
+
const statusColor = movie.status === 'safe' ? 'green' :
|
| 67 |
+
movie.status === 'warning' ? 'red' : 'yellow';
|
| 68 |
+
const statusText = movie.status === 'safe' ? 'Safe' :
|
| 69 |
+
movie.status === 'warning' ? 'Warning' : 'Caution';
|
| 70 |
+
|
| 71 |
+
const card = document.createElement('div');
|
| 72 |
+
card.className = 'movie-card bg-gray-800 rounded-lg overflow-hidden shadow-lg';
|
| 73 |
+
card.style.animationDelay = `${index * 0.1}s`;
|
| 74 |
+
card.innerHTML = `
|
| 75 |
+
<div class="h-48 bg-gray-700 relative">
|
| 76 |
+
<img src="${movie.image}" alt="${movie.title}" class="w-full h-full object-cover">
|
| 77 |
+
<div class="absolute top-2 right-2 bg-black bg-opacity-70 rounded-full px-2 py-1 text-xs">
|
| 78 |
+
<span class="text-${statusColor}-400">${statusText}</span>
|
| 79 |
+
</div>
|
| 80 |
+
</div>
|
| 81 |
+
<div class="p-4">
|
| 82 |
+
<h3 class="font-bold text-lg">${movie.title}</h3>
|
| 83 |
+
<p class="text-gray-400 text-sm mt-1">${movie.description}</p>
|
| 84 |
+
<button class="mt-3 text-primary-500 text-sm font-medium hover:underline flex items-center gap-1">
|
| 85 |
+
<span>View Details</span>
|
| 86 |
+
<i data-feather="chevron-right" class="w-4 h-4"></i>
|
| 87 |
+
</button>
|
| 88 |
+
</div>
|
| 89 |
+
`;
|
| 90 |
+
resultsContainer.appendChild(card);
|
| 91 |
+
});
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
feather.replace();
|
| 95 |
+
}, 800);
|
| 96 |
+
}
|
| 97 |
+
});
|
style.css
CHANGED
|
@@ -1,28 +1,40 @@
|
|
|
|
|
|
|
|
| 1 |
body {
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
margin-top: 0;
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
margin-bottom: 10px;
|
| 15 |
-
margin-top: 5px;
|
| 16 |
}
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
margin: 0 auto;
|
| 21 |
-
padding: 16px;
|
| 22 |
-
border: 1px solid lightgray;
|
| 23 |
-
border-radius: 16px;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
|
| 2 |
+
|
| 3 |
body {
|
| 4 |
+
font-family: 'Poppins', sans-serif;
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
/* Custom scrollbar */
|
| 8 |
+
::-webkit-scrollbar {
|
| 9 |
+
width: 8px;
|
| 10 |
}
|
| 11 |
|
| 12 |
+
::-webkit-scrollbar-track {
|
| 13 |
+
background: #1a1a1a;
|
|
|
|
| 14 |
}
|
| 15 |
|
| 16 |
+
::-webkit-scrollbar-thumb {
|
| 17 |
+
background: #d946ef;
|
| 18 |
+
border-radius: 4px;
|
|
|
|
|
|
|
| 19 |
}
|
| 20 |
|
| 21 |
+
::-webkit-scrollbar-thumb:hover {
|
| 22 |
+
background: #c026d3;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
}
|
| 24 |
|
| 25 |
+
/* Animation for search results */
|
| 26 |
+
@keyframes fadeIn {
|
| 27 |
+
from { opacity: 0; transform: translateY(10px); }
|
| 28 |
+
to { opacity: 1; transform: translateY(0); }
|
| 29 |
}
|
| 30 |
+
|
| 31 |
+
.movie-card {
|
| 32 |
+
animation: fadeIn 0.3s ease-out forwards;
|
| 33 |
+
opacity: 0;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
.movie-card:nth-child(1) { animation-delay: 0.1s; }
|
| 37 |
+
.movie-card:nth-child(2) { animation-delay: 0.2s; }
|
| 38 |
+
.movie-card:nth-child(3) { animation-delay: 0.3s; }
|
| 39 |
+
.movie-card:nth-child(4) { animation-delay: 0.4s; }
|
| 40 |
+
.movie-card:nth-child(5) { animation-delay: 0.5s; }
|