popup.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>My Playlists</title>
  7. <link rel="stylesheet" href="popup.css" />
  8. <script src="alpine.min.js" defer></script>
  9. <script src="popup.js"></script>
  10. </head>
  11. <body>
  12. <div id="app" x-data="playlistManager">
  13. <header>
  14. <h1>My Playlists</h1>
  15. </header>
  16. <div class="playlists-container">
  17. <template
  18. x-for="(videos, playlistName) in playlists"
  19. :key="playlistName"
  20. >
  21. <div class="playlist">
  22. <h2 x-text="formatPlaylistName(playlistName)"></h2>
  23. <div class="video-list">
  24. <template x-for="(video, index) in videos" :key="index">
  25. <div class="video-item" :title="video.url">
  26. <span
  27. class="video-title"
  28. x-text="video.title || 'Untitled Video'"
  29. ></span>
  30. <div class="video-actions">
  31. <button @click="openVideo(video.url)" class="play-btn">
  32. Play
  33. </button>
  34. <button
  35. @click="removeVideo(playlistName, index)"
  36. class="remove-btn"
  37. >
  38. Remove
  39. </button>
  40. </div>
  41. </div>
  42. </template>
  43. <div x-show="videos.length === 0" class="empty-playlist">
  44. No videos in this playlist
  45. </div>
  46. </div>
  47. </div>
  48. </template>
  49. </div>
  50. </div>
  51. </body>
  52. </html>