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. ⏵
  44. </a>
  45. <button
  46. :data-playlist-name="playlistName"
  47. :data-playlist-index="index"
  48. x-bind="moveUpButton"
  49. class="move-up-btn"
  50. title="Move up"
  51. >
  52. ↑
  53. </button>
  54. <button
  55. :data-playlist-name="playlistName"
  56. :data-playlist-index="index"
  57. x-bind="moveDownButton"
  58. class="move-down-btn"
  59. title="Move down"
  60. >
  61. ↓
  62. </button>
  63. <button
  64. :data-playlist-name="playlistName"
  65. :data-playlist-index="index"
  66. x-bind="removeVideoButton"
  67. class="remove-btn"
  68. >
  69. X
  70. </button>
  71. </div>
  72. </div>
  73. </template>
  74. <!--
  75. <div x-show="videos.length === 0" class="empty-playlist">
  76. No videos in this playlist
  77. </div>
  78. -->
  79. </div>
  80. </div>
  81. </template>
  82. </div>
  83. <!-- Export/Import buttons -->
  84. <div class="export-container">
  85. <button class="export-btn" x-bind="exportButton">
  86. Export Playlists
  87. </button>
  88. <button class="import-btn" x-bind="importButton">
  89. Import Playlists
  90. </button>
  91. <input
  92. type="file"
  93. id="import-file-input"
  94. accept=".json"
  95. style="display: none"
  96. @change="importFile($event)"
  97. />
  98. </div>
  99. </div>
  100. </body>
  101. </html>