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