popup.html 3.0 KB

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