popup.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. <a
  33. class="video-title"
  34. :href="video.url"
  35. x-text="video.title"
  36. x-bind="videoPlayLink"
  37. ></a>
  38. <div class="video-actions">
  39. <button
  40. :data-playlist-name="playlistName"
  41. :data-playlist-index="index"
  42. x-bind="moveUpButton"
  43. class="move-up-btn"
  44. title="Move up"
  45. >
  46. ↑
  47. </button>
  48. <button
  49. :data-playlist-name="playlistName"
  50. :data-playlist-index="index"
  51. x-bind="moveDownButton"
  52. class="move-down-btn"
  53. title="Move down"
  54. >
  55. ↓
  56. </button>
  57. <div class="more-menu-container">
  58. <button
  59. :data-playlist-name="playlistName"
  60. :data-playlist-index="index"
  61. x-bind="moreMenuButton"
  62. class="more-btn"
  63. title="More actions"
  64. >
  65. ⋯
  66. </button>
  67. <div
  68. class="more-menu"
  69. :data-playlist-name="playlistName"
  70. :data-playlist-index="index"
  71. x-bind="moreMenu"
  72. >
  73. <button
  74. :data-playlist-name="playlistName"
  75. :data-playlist-index="index"
  76. x-bind="removeVideoButton"
  77. class="menu-item remove-item"
  78. >
  79. Remove
  80. </button>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </template>
  86. <!--
  87. <div x-show="videos.length === 0" class="empty-playlist">
  88. No videos in this playlist
  89. </div>
  90. -->
  91. </div>
  92. </div>
  93. </template>
  94. </div>
  95. <!-- Export/Import buttons -->
  96. <div class="export-container">
  97. <button class="export-btn" x-bind="exportButton">
  98. Export Playlists
  99. </button>
  100. <button class="import-btn" x-bind="importButton">
  101. Import Playlists
  102. </button>
  103. <input
  104. type="file"
  105. id="import-file-input"
  106. accept=".json"
  107. style="display: none"
  108. @change="importFile($event)"
  109. />
  110. </div>
  111. </div>
  112. </body>
  113. </html>