popup.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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="playlistName"></h2>
  23. <div class="video-list">
  24. <template x-for="(video, index) in videos" :key="index">
  25. <div
  26. class="video-item"
  27. :title="video.title"
  28. :data-playlist-name="playlistName"
  29. :data-playlist-index="index"
  30. x-bind="videoItemClass"
  31. >
  32. <span
  33. class="video-title"
  34. x-text="video.title"
  35. x-bind="videotitle"
  36. ></span>
  37. <div class="video-actions">
  38. <a
  39. :href="video.url"
  40. class="play-btn"
  41. x-bind="videoPlayLink"
  42. >
  43. </a>
  44. <button
  45. :data-playlist-name="playlistName"
  46. :data-playlist-index="index"
  47. x-bind="moveUpButton"
  48. class="move-up-btn"
  49. title="Move up"
  50. >
  51. </button>
  52. <button
  53. :data-playlist-name="playlistName"
  54. :data-playlist-index="index"
  55. x-bind="moveDownButton"
  56. class="move-down-btn"
  57. title="Move down"
  58. >
  59. </button>
  60. <button
  61. :data-playlist-name="playlistName"
  62. :data-playlist-index="index"
  63. x-bind="removeVideoButton"
  64. class="remove-btn"
  65. >
  66. X
  67. </button>
  68. </div>
  69. </div>
  70. </template>
  71. <!--
  72. <div x-show="videos.length === 0" class="empty-playlist">
  73. No videos in this playlist
  74. </div>
  75. -->
  76. </div>
  77. </div>
  78. </template>
  79. </div>
  80. <!-- Export/Import buttons -->
  81. <div class="export-container">
  82. <button class="export-btn" x-bind="exportButton">
  83. Export Playlists
  84. </button>
  85. <button class="import-btn" x-bind="importButton">
  86. Import Playlists
  87. </button>
  88. <input
  89. type="file"
  90. id="import-file-input"
  91. accept=".json"
  92. style="display: none"
  93. @change="importFile($event)"
  94. />
  95. </div>
  96. </div>
  97. </body>
  98. </html>