untitled

Pasted Oct 8, 2026, 6:16 AM1 file201 lines

Scan to open on your phone

Point a camera at the QR code - it opens this exact paste, no app needed.

https://codepastes.com/zzgt19892n9n53jq
untitled
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Video Portal</title>
    <style>
        :root {
            --bg-color: #0f0f0f;
            --text-color: #ffffff;
            --accent-color: #ff0000;
            --card-bg: #1f1f1f;
        }
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: var(--bg-color);
            color: var(--text-color);
            margin: 0;
            padding: 20px;
        }
        header {
            text-align: center;
            padding: 20px 0;
        }
        h1 { margin: 0; font-size: 2.5rem; }
        
        /* Category Navigation */
        .categories {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin: 20px 0 30px 0;
            flex-wrap: wrap;
        }
        .category-btn {
            background-color: var(--card-bg);
            color: white;
            border: 1px solid #333;
            padding: 8px 16px;
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .category-btn.active, .category-btn:hover {
            background-color: var(--accent-color);
            border-color: var(--accent-color);
        }

        /* Video Showcase Area */
        .main-player-container {
            max-width: 900px;
            margin: 0 auto 40px auto;
            display: none; /* Hidden until a video is clicked */
        }
        .video-wrapper {
            position: relative;
            padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
            height: 0;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        }
        .video-wrapper iframe {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: none;
        }

        /* Video Grid Layout */
        .video-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 25px;
            max-width: 1200px;
            margin: 0 auto;
        }
        .video-card {
            background-color: var(--card-bg);
            border-radius: 8px;
            overflow: hidden;
            cursor: pointer;
            transition: transform 0.2s ease;
        }
        .video-card:hover {
            transform: scale(1.03);
        }
        .thumbnail-box {
            position: relative;
            width: 100%;
            padding-top: 56.25%;
            background-size: cover;
            background-position: center;
        }
        .video-info { padding: 15px; }
        .video-title {
            margin: 0 0 5px 0;
            font-size: 1.1rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .video-desc {
            margin: 0;
            font-size: 0.9rem;
            color: #aaa;
        }
    </style>
</head>
<body>

    <header>
        <h1>🎥 Curated Video Hub</h1>
        <div class="categories" id="category-container">
            <button class="category-btn active" onclick="filterVideos('all')">All</button>
            <button class="category-btn" onclick="filterVideos('gaming')">Gaming</button>
            <button class="category-btn" onclick="filterVideos('education')">Education</button>
            <button class="category-btn" onclick="filterVideos('music')">Music</button>
        </div>
    </header>

    <!-- The Active Main Video Player -->
    <div class="main-player-container" id="player-container">
        <div class="video-wrapper">
            <iframe id="main-iframe" src="" allowfullscreen></iframe>
        </div>
        <h2 id="player-title" style="margin-top: 15px;"></h2>
    </div>

    <!-- The Selection Grid -->
    <main class="video-grid" id="grid-container"></main>

    <script>
        // 1. ADD YOUR OWN YOUTUBE VIDEOS HERE
        // Just swap the videoIds with the actual YouTube links you want to feature!
        const videoData = [
            { id: "dQw4w9WgXcQ", title: "Awesome Music Video", desc: "A classic musical masterpiece.", category: "music" },
            { id: "9bZkp7q19f0", title: "Amazing PSY Track", desc: "Incredible music video visuals.", category: "music" },
            { id: "jNQXAC9IVRw", title: "Learn Coding in 15 Minutes", desc: "A fast, straightforward tutorial.", category: "education" },
            { id: "ScMzIvxBSi4", title: "The Ultimate Science Theory", desc: "Breaking down complex physics concept.", category: "education" },
            { id: "tV8P074f07s", title: "Epic Speedrun World Record", desc: "Insane gameplay mechanics on display.", category: "gaming" }
        ];

        const gridContainer = document.getElementById('grid-container');
        const playerContainer = document.getElementById('player-container');
        const mainIframe = document.getElementById('main-iframe');
        const playerTitle = document.getElementById('player-title');

        // Render standard grid items
        function renderGrid(videos) {
            gridContainer.innerHTML = "";
            videos.forEach(video => {
                const card = document.createElement('div');
                card.className = 'video-card';
                card.onclick = () => playVideo(video.id, video.title);
                
                // Uses YouTube's official hqdefault thumbnail URL format dynamically
                const thumbUrl = `https://youtube.com{video.id}/hqdefault.jpg`;

                card.innerHTML = `
                    <div class="thumbnail-box" style="background-image: url('${thumbUrl}')"></div>
                    <div class="video-info">
                        <h3 class="video-title">${video.title}</h3>
                        <p class="video-desc">${video.desc}</p>
                    </div>
                `;
                gridContainer.appendChild(card);
            });
        }

        // Handle filtering selections
        function filterVideos(category) {
            // Update button styles
            document.querySelectorAll('.category-btn').forEach(btn => btn.classList.remove('active'));
            event.target.classList.add('active');

            if(category === 'all') {
                renderGrid(videoData);
            } else {
                const filtered = videoData.filter(v => v.category === category);
                renderGrid(filtered);
            }
        }

        // Load video cleanly into top player frame
        function playVideo(id, title) {
            // rel=0 ensures recommendations at the end stay restricted
            mainIframe.src = `https://youtube.com{id}?rel=0&autoplay=1`;
            playerTitle.innerText = title;
            playerContainer.style.display = "block";
            window.scrollTo({ top: 0, behavior: 'smooth' });
        }

        // Initialize display
        renderGrid(videoData);
    </script>
</body>
</html>

7,150 chars · codepastes.com