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 class="video-item" :title="video.title">
  26. <span
  27. class="video-title"
  28. x-text="video.title"
  29. x-bind="videotitle"
  30. ></span>
  31. <div class="video-actions">
  32. <a
  33. :href="video.url"
  34. class="play-btn"
  35. x-bind="videoPlayLink"
  36. >
  37. ⏵
  38. </a>
  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. <button
  58. :data-playlist-name="playlistName"
  59. :data-playlist-index="index"
  60. x-bind="removeVideoButton"
  61. class="remove-btn"
  62. >
  63. X
  64. </button>
  65. </div>
  66. </div>
  67. </template>
  68. <!--
  69. <div x-show="videos.length === 0" class="empty-playlist">
  70. No videos in this playlist
  71. </div>
  72. -->
  73. </div>
  74. </div>
  75. </template>
  76. </div>
  77. <!-- Export/Import buttons -->
  78. <div class="export-container">
  79. <button class="export-btn" x-bind="exportButton">
  80. Export Playlists
  81. </button>
  82. <button class="import-btn" x-bind="importButton">
  83. Import Playlists
  84. </button>
  85. <input
  86. type="file"
  87. id="import-file-input"
  88. accept=".json"
  89. style="display: none"
  90. @change="importFile($event)"
  91. />
  92. </div>
  93. </div>
  94. </body>
  95. </html>