JSFiddle - React, Tailwind, and code Playground

by velo_ninja

HTML

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Video Portfolio</title>
  <style>
    body {
      margin: 0;
      font-family: "Segoe UI", sans-serif;
      background: #1a1a1a;
      color: #fff;
      padding: 2rem;
    }

    h2 {
      margin-top: 2rem;
      font-size: 2rem;
      border-bottom: 2px solid #555;
      padding-bottom: 0.5rem;
    }

    .video-section {
      margin-top: 1rem;
    }

    .video-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: 24px;
      margin-top: 1rem;
    }

    .video-thumb {
      position: relative;
      padding-top: 56.25%; /* 16:9 ratio */
      background-size: cover;
      background-position: center;
      border-radius: 10px;
      overflow: hidden;
      cursor: pointer;
      box-shadow: 0 4px 20px rgba(0,0,0,0.4);
      transition: transform 0.3s ease;
    }

    .video-thumb:hover {
      transform: scale(1.03);
    }

    .video-thumb .overlay {
      position: absolute;
      top: 0; left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.4);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: opacity 0.4s ease;
    }

    .video-thumb .overlay .play-btn {
      font-size: 3.5rem;
      color: #fff;
      opacity: 0.8;
      transition: transform 0.3s ease;
    }

    .video-thumb:hover .play-btn {
      transform: scale(1.2);
    }

    .video-thumb iframe {
      position: absolute;
      top: 0; left: 0;
      width: 100%;
      height: 100%;
      border: none;
      display: none;
    }

    .video-thumb.playing .overlay {
      opacity: 0;
      pointer-events: none;
    }

    .video-thumb.playing iframe {
      display: block;
    }

    @media (max-width: 768px) {
      body {
     ...