popup.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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 x-bind="playlistsHeader">
  14. <h1>My Playlists</h1>
  15. </header>
  16. <header x-bind="historyHeader">
  17. <button class="back-btn" x-bind="backButton">← Back</button>
  18. <h1>History</h1>
  19. </header>
  20. <div class="playlists-container" x-bind="playlistsContainer">
  21. <template
  22. x-for="(videos, playlistName) in playlists"
  23. :key="playlistName"
  24. >
  25. <div class="playlist">
  26. <h2 x-text="playlistName"></h2>
  27. <div class="video-list">
  28. <template x-for="(video, index) in videos" :key="index">
  29. <div
  30. class="video-item"
  31. :title="video.title"
  32. :data-playlist-name="playlistName"
  33. :data-playlist-index="index"
  34. x-bind="videoItemClass"
  35. >
  36. <a
  37. class="video-title"
  38. :href="video.url"
  39. x-text="video.title"
  40. x-bind="videoPlayLink"
  41. ></a>
  42. <div class="video-actions">
  43. <button
  44. :data-playlist-name="playlistName"
  45. :data-playlist-index="index"
  46. x-bind="moveUpButton"
  47. class="move-up-btn"
  48. title="Move up"
  49. >
  50. </button>
  51. <button
  52. :data-playlist-name="playlistName"
  53. :data-playlist-index="index"
  54. x-bind="moveDownButton"
  55. class="move-down-btn"
  56. title="Move down"
  57. >
  58. </button>
  59. <div class="more-menu-container">
  60. <button
  61. :data-playlist-name="playlistName"
  62. :data-playlist-index="index"
  63. x-bind="moreMenuButton"
  64. class="more-btn"
  65. title="More actions"
  66. >
  67. </button>
  68. <div
  69. class="more-menu"
  70. :data-playlist-name="playlistName"
  71. :data-playlist-index="index"
  72. x-bind="moreMenu"
  73. >
  74. <button
  75. :data-playlist-name="playlistName"
  76. :data-playlist-index="index"
  77. x-bind="removeVideoButton"
  78. class="menu-item remove-item"
  79. >
  80. Remove
  81. </button>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </template>
  87. <!--
  88. <div x-show="videos.length === 0" class="empty-playlist">
  89. No videos in this playlist
  90. </div>
  91. -->
  92. </div>
  93. </div>
  94. </template>
  95. </div>
  96. <!-- History view -->
  97. <div class="history-container" x-bind="historyContainer">
  98. <!-- History content will go here -->
  99. </div>
  100. <!-- Export/Import/History buttons -->
  101. <div class="export-container" x-bind="exportContainer">
  102. <button class="export-btn" x-bind="exportButton">
  103. Export Playlists
  104. </button>
  105. <button class="import-btn" x-bind="importButton">
  106. Import Playlists
  107. </button>
  108. <button class="history-btn" x-bind="historyButton">
  109. History
  110. </button>
  111. <input
  112. type="file"
  113. id="import-file-input"
  114. accept=".json"
  115. style="display: none"
  116. @change="importFile($event)"
  117. />
  118. </div>
  119. </div>
  120. </body>
  121. </html>