ImportAlbum.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943
  1. <template>
  2. <div>
  3. <modal title="Import Album" class="import-album-modal">
  4. <template #body>
  5. <div class="search-discogs-album">
  6. <p class="control is-expanded">
  7. <label class="label">Search query</label>
  8. <input
  9. class="input"
  10. type="text"
  11. ref="discogs-input"
  12. v-model="discogsQuery"
  13. @keyup.enter="searchDiscogsForPage(1)"
  14. @change="onDiscogsQueryChange"
  15. v-focus
  16. />
  17. </p>
  18. <button
  19. class="button is-fullwidth is-info"
  20. @click="searchDiscogsForPage(1)"
  21. >
  22. Search
  23. </button>
  24. <button
  25. class="button is-fullwidth is-danger"
  26. @click="clearDiscogsResults()"
  27. >
  28. Clear
  29. </button>
  30. <label class="label" v-if="discogs.apiResults.length > 0"
  31. >API results</label
  32. >
  33. <div
  34. class="api-results-container"
  35. v-if="discogs.apiResults.length > 0"
  36. >
  37. <div
  38. class="api-result"
  39. v-for="(result, index) in discogs.apiResults"
  40. :key="result.album.id"
  41. tabindex="0"
  42. @keydown.space.prevent
  43. @keyup.enter="toggleAPIResult(index)"
  44. >
  45. <div class="top-container">
  46. <img :src="result.album.albumArt" />
  47. <div class="right-container">
  48. <p class="album-title">
  49. {{ result.album.title }}
  50. </p>
  51. <div class="bottom-row">
  52. <img
  53. src="/assets/arrow_up.svg"
  54. v-if="result.expanded"
  55. @click="toggleAPIResult(index)"
  56. />
  57. <img
  58. src="/assets/arrow_down.svg"
  59. v-if="!result.expanded"
  60. @click="toggleAPIResult(index)"
  61. />
  62. <p class="type-year">
  63. <span>{{ result.album.type }}</span>
  64. <span>{{ result.album.year }}</span>
  65. </p>
  66. </div>
  67. </div>
  68. </div>
  69. <div
  70. class="bottom-container"
  71. v-if="result.expanded"
  72. >
  73. <p class="bottom-container-field">
  74. Artists:
  75. <span>{{
  76. result.album.artists.join(", ")
  77. }}</span>
  78. </p>
  79. <p class="bottom-container-field">
  80. Genres:
  81. <span>{{
  82. result.album.genres.join(", ")
  83. }}</span>
  84. </p>
  85. <p class="bottom-container-field">
  86. Data quality:
  87. <span>{{ result.dataQuality }}</span>
  88. </p>
  89. <button
  90. class="button is-primary"
  91. @click="selectAlbum(result)"
  92. >
  93. Import album
  94. </button>
  95. <div class="tracks">
  96. <div
  97. class="track"
  98. v-for="track in result.tracks"
  99. :key="`${track.position}-${track.title}`"
  100. >
  101. <span>{{ track.position }}.</span>
  102. <p>{{ track.title }}</p>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <button
  109. v-if="
  110. discogs.apiResults.length > 0 &&
  111. !discogs.disableLoadMore &&
  112. discogs.page < discogs.pages
  113. "
  114. class="button is-fullwidth is-info discogs-load-more"
  115. @click="loadNextDiscogsPage()"
  116. >
  117. Load more...
  118. </button>
  119. </div>
  120. <div
  121. class="discogs-album"
  122. v-if="discogsAlbum && discogsAlbum.album"
  123. >
  124. <div class="top-container">
  125. <img :src="discogsAlbum.album.albumArt" />
  126. <div class="right-container">
  127. <p class="album-title">
  128. {{ discogsAlbum.album.title }}
  129. </p>
  130. <div class="bottom-row">
  131. <img
  132. src="/assets/arrow_up.svg"
  133. v-if="discogsAlbum.expanded"
  134. @click="toggleDiscogsAlbum()"
  135. />
  136. <img
  137. src="/assets/arrow_down.svg"
  138. v-if="!discogsAlbum.expanded"
  139. @click="toggleDiscogsAlbum()"
  140. />
  141. <p class="type-year">
  142. <span>{{ discogsAlbum.album.type }}</span>
  143. <span>{{ discogsAlbum.album.year }}</span>
  144. </p>
  145. </div>
  146. </div>
  147. </div>
  148. <div class="bottom-container" v-if="discogsAlbum.expanded">
  149. <p class="bottom-container-field">
  150. Artists:
  151. <span>{{
  152. discogsAlbum.album.artists.join(", ")
  153. }}</span>
  154. </p>
  155. <p class="bottom-container-field">
  156. Genres:
  157. <span>{{
  158. discogsAlbum.album.genres.join(", ")
  159. }}</span>
  160. </p>
  161. <p class="bottom-container-field">
  162. Data quality:
  163. <span>{{ discogsAlbum.dataQuality }}</span>
  164. </p>
  165. <div class="tracks">
  166. <div
  167. class="track"
  168. tabindex="0"
  169. v-for="track in discogsAlbum.tracks"
  170. :key="`${track.position}-${track.title}`"
  171. >
  172. <span>{{ track.position }}.</span>
  173. <p>{{ track.title }}</p>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. <div class="break"></div>
  179. <div
  180. class="import-youtube-playlist"
  181. v-if="discogsAlbum && discogsAlbum.album"
  182. >
  183. <p class="control is-expanded">
  184. <input
  185. class="input"
  186. type="text"
  187. placeholder="Enter YouTube Playlist URL here..."
  188. v-model="search.playlist.query"
  189. @keyup.enter="importPlaylist()"
  190. />
  191. </p>
  192. <button
  193. class="button is-fullwidth is-info"
  194. @click="importPlaylist()"
  195. >
  196. <i class="material-icons icon-with-button">publish</i
  197. >Import
  198. </button>
  199. <button
  200. class="button is-fullwidth is-danger"
  201. @click="resetTrackSongs()"
  202. >
  203. Reset
  204. </button>
  205. <draggable
  206. v-if="playlistSongs.length > 0"
  207. group="songs"
  208. v-model="playlistSongs"
  209. item-key="_id"
  210. @start="drag = true"
  211. @end="drag = false"
  212. @change="log"
  213. >
  214. <template #item="{ element }">
  215. <song-item
  216. :key="`playlist-song-${element._id}`"
  217. :song="element"
  218. >
  219. </song-item>
  220. </template>
  221. </draggable>
  222. </div>
  223. <div
  224. class="track-boxes"
  225. v-if="discogsAlbum && discogsAlbum.album"
  226. >
  227. <div
  228. class="track-box"
  229. v-for="(track, index) in discogsAlbum.tracks"
  230. :key="`${track.position}-${track.title}`"
  231. >
  232. <div class="track-position-title">
  233. <span>{{ track.position }}.</span>
  234. <p>{{ track.title }}</p>
  235. </div>
  236. <draggable
  237. class="track-box-songs-drag-area"
  238. group="songs"
  239. v-model="trackSongs[index]"
  240. item-key="_id"
  241. @start="drag = true"
  242. @end="drag = false"
  243. @change="log"
  244. >
  245. <template #item="{ element }">
  246. <song-item
  247. :key="`track-song-${element._id}`"
  248. :song="element"
  249. >
  250. </song-item>
  251. </template>
  252. </draggable>
  253. </div>
  254. </div>
  255. </template>
  256. <template #footer>
  257. <button class="button is-primary" @click="tryToAutoMove()">
  258. Try to auto move
  259. </button>
  260. <button class="button is-primary" @click="editSongs()">
  261. Edit songs
  262. </button>
  263. </template>
  264. </modal>
  265. </div>
  266. </template>
  267. <script>
  268. import { mapState, mapGetters, mapActions } from "vuex";
  269. import draggable from "vuedraggable";
  270. import Toast from "toasters";
  271. import Modal from "../Modal.vue";
  272. import SongItem from "../SongItem.vue";
  273. export default {
  274. components: { Modal, SongItem, draggable },
  275. props: {
  276. sector: { type: String, default: "admin" }
  277. },
  278. data() {
  279. return {
  280. stuff: false,
  281. isImportingPlaylist: false,
  282. trackSongs: [],
  283. songsToEdit: [],
  284. currentEditSongIndex: 0,
  285. search: {
  286. playlist: {
  287. query: ""
  288. }
  289. },
  290. discogsQuery: "",
  291. discogs: {
  292. apiResults: [],
  293. page: 1,
  294. pages: 1,
  295. disableLoadMore: false
  296. }
  297. };
  298. },
  299. computed: {
  300. playlistSongs: {
  301. get() {
  302. return this.$store.state.modals.importAlbum.playlistSongs;
  303. },
  304. set(playlistSongs) {
  305. this.$store.commit(
  306. "modals/importAlbum/updatePlaylistSongs",
  307. playlistSongs
  308. );
  309. }
  310. },
  311. ...mapState("modals/importAlbum", {
  312. discogsAlbum: state => state.discogsAlbum,
  313. editingSongs: state => state.editingSongs
  314. }),
  315. ...mapState("modalVisibility", {
  316. modals: state => state.modals
  317. }),
  318. ...mapGetters({
  319. socket: "websockets/getSocket"
  320. })
  321. },
  322. watch: {
  323. /* eslint-disable */
  324. "modals.editSong": function (value) {
  325. if (!value) this.editNextSong();
  326. }
  327. /* eslint-enable */
  328. },
  329. beforeUnmount() {
  330. this.selectDiscogsAlbum({});
  331. this.setPlaylistSongs([]);
  332. },
  333. methods: {
  334. editSongs() {
  335. this.updateEditingSongs(true);
  336. this.songsToEdit = [];
  337. this.trackSongs.forEach((songs, index) => {
  338. songs.forEach(song => {
  339. const discogsAlbum = JSON.parse(
  340. JSON.stringify(this.discogsAlbum)
  341. );
  342. discogsAlbum.track = discogsAlbum.tracks[index];
  343. delete discogsAlbum.tracks;
  344. delete discogsAlbum.expanded;
  345. delete discogsAlbum.gotMoreInfo;
  346. this.songsToEdit.push({
  347. songId: song._id,
  348. discogs: discogsAlbum
  349. });
  350. });
  351. });
  352. this.editNextSong();
  353. },
  354. editNextSong() {
  355. if (this.editingSongs) {
  356. this.editSong({
  357. _id: this.songsToEdit[this.currentEditSongIndex].songId,
  358. discogs: this.songsToEdit[this.currentEditSongIndex].discogs
  359. });
  360. this.currentEditSongIndex += 1;
  361. this.openModal("editSong");
  362. }
  363. },
  364. log(evt) {
  365. window.console.log(evt);
  366. },
  367. importPlaylist() {
  368. if (this.isImportingPlaylist)
  369. return new Toast("A playlist is already importing.");
  370. this.isImportingPlaylist = true;
  371. // import query is blank
  372. if (!this.search.playlist.query)
  373. return new Toast("Please enter a YouTube playlist URL.");
  374. const regex = new RegExp(`[\\?&]list=([^&#]*)`);
  375. const splitQuery = regex.exec(this.search.playlist.query);
  376. if (!splitQuery) {
  377. return new Toast({
  378. content: "Please enter a valid YouTube playlist URL.",
  379. timeout: 4000
  380. });
  381. }
  382. // don't give starting import message instantly in case of instant error
  383. setTimeout(() => {
  384. if (this.isImportingPlaylist) {
  385. new Toast(
  386. "Starting to import your playlist. This can take some time to do."
  387. );
  388. }
  389. }, 750);
  390. return this.socket.dispatch(
  391. "songs.requestSet",
  392. this.search.playlist.query,
  393. false,
  394. true,
  395. res => {
  396. this.isImportingPlaylist = false;
  397. const songs = res.songs.filter(
  398. song => song.status !== "verified"
  399. );
  400. const songsAlreadyVerified =
  401. res.songs.length - songs.length;
  402. this.setPlaylistSongs(songs);
  403. this.trackSongs = this.discogsAlbum.tracks.map(() => []);
  404. this.tryToAutoMove();
  405. if (songsAlreadyVerified > 0)
  406. new Toast(
  407. `${songsAlreadyVerified} songs were already verified, skipping those.`
  408. );
  409. return new Toast({ content: res.message, timeout: 20000 });
  410. }
  411. );
  412. },
  413. tryToAutoMove() {
  414. const { tracks } = this.discogsAlbum;
  415. const { trackSongs } = this;
  416. const playlistSongs = JSON.parse(
  417. JSON.stringify(this.playlistSongs)
  418. );
  419. tracks.forEach((track, index) => {
  420. playlistSongs.forEach(playlistSong => {
  421. if (
  422. playlistSong.title
  423. .toLowerCase()
  424. .trim()
  425. .indexOf(track.title.toLowerCase().trim()) !== -1
  426. ) {
  427. playlistSongs.splice(
  428. playlistSongs.indexOf(playlistSong),
  429. 1
  430. );
  431. trackSongs[index].push(playlistSong);
  432. }
  433. });
  434. });
  435. this.updatePlaylistSongs(playlistSongs);
  436. },
  437. resetTrackSongs() {
  438. this.resetPlaylistSongs();
  439. this.trackSongs = this.discogsAlbum.tracks.map(() => []);
  440. },
  441. selectAlbum(result) {
  442. this.selectDiscogsAlbum(result);
  443. this.clearDiscogsResults();
  444. },
  445. toggleAPIResult(index) {
  446. const apiResult = this.discogs.apiResults[index];
  447. if (apiResult.expanded === true) apiResult.expanded = false;
  448. else if (apiResult.gotMoreInfo === true) apiResult.expanded = true;
  449. else {
  450. fetch(apiResult.album.resourceUrl)
  451. .then(response => response.json())
  452. .then(data => {
  453. apiResult.album.artists = [];
  454. apiResult.album.artistIds = [];
  455. const artistRegex = new RegExp(" \\([0-9]+\\)$");
  456. apiResult.dataQuality = data.data_quality;
  457. data.artists.forEach(artist => {
  458. apiResult.album.artists.push(
  459. artist.name.replace(artistRegex, "")
  460. );
  461. apiResult.album.artistIds.push(artist.id);
  462. });
  463. apiResult.tracks = data.tracklist.map(track => ({
  464. position: track.position,
  465. title: track.title
  466. }));
  467. apiResult.expanded = true;
  468. apiResult.gotMoreInfo = true;
  469. });
  470. }
  471. },
  472. clearDiscogsResults() {
  473. this.discogs.apiResults = [];
  474. this.discogs.page = 1;
  475. this.discogs.pages = 1;
  476. this.discogs.disableLoadMore = false;
  477. },
  478. searchDiscogsForPage(page) {
  479. const query = this.discogsQuery;
  480. this.socket.dispatch("apis.searchDiscogs", query, page, res => {
  481. if (res.status === "success") {
  482. if (page === 1)
  483. new Toast(
  484. `Successfully searched. Got ${res.data.results.length} results.`
  485. );
  486. else
  487. new Toast(
  488. `Successfully got ${res.data.results.length} more results.`
  489. );
  490. if (page === 1) {
  491. this.discogs.apiResults = [];
  492. }
  493. this.discogs.pages = res.data.pages;
  494. this.discogs.apiResults = this.discogs.apiResults.concat(
  495. res.data.results.map(result => {
  496. const type =
  497. result.type.charAt(0).toUpperCase() +
  498. result.type.slice(1);
  499. return {
  500. expanded: false,
  501. gotMoreInfo: false,
  502. album: {
  503. id: result.id,
  504. title: result.title,
  505. type,
  506. year: result.year,
  507. genres: result.genre,
  508. albumArt: result.cover_image,
  509. resourceUrl: result.resource_url
  510. }
  511. };
  512. })
  513. );
  514. this.discogs.page = page;
  515. this.discogs.disableLoadMore = false;
  516. } else new Toast(res.message);
  517. });
  518. },
  519. loadNextDiscogsPage() {
  520. this.discogs.disableLoadMore = true;
  521. this.searchDiscogsForPage(this.discogs.page + 1);
  522. },
  523. onDiscogsQueryChange() {
  524. this.discogs.page = 1;
  525. this.discogs.pages = 1;
  526. this.discogs.apiResults = [];
  527. this.discogs.disableLoadMore = false;
  528. },
  529. ...mapActions("modals/importAlbum", [
  530. "toggleDiscogsAlbum",
  531. "setPlaylistSongs",
  532. "updatePlaylistSongs",
  533. "selectDiscogsAlbum",
  534. "updateEditingSongs",
  535. "resetPlaylistSongs"
  536. ]),
  537. ...mapActions("modals/editSong", ["editSong"]),
  538. ...mapActions("modalVisibility", ["closeModal", "openModal"])
  539. }
  540. };
  541. </script>
  542. <style lang="scss">
  543. .night-mode {
  544. .search-discogs-album,
  545. .discogs-album,
  546. .import-youtube-playlist,
  547. .track-boxes,
  548. .api-result {
  549. background-color: var(--dark-grey-3) !important;
  550. }
  551. .api-result .tracks .track:hover,
  552. .api-result .tracks .track:focus,
  553. .discogs-album .tracks .track:hover,
  554. .discogs-album .tracks .track:focus {
  555. background-color: var(--dark-grey-2) !important;
  556. }
  557. .api-result .bottom-row img,
  558. .discogs-album .bottom-row img {
  559. filter: invert(100%);
  560. }
  561. .label,
  562. p,
  563. strong {
  564. color: var(--light-grey-2);
  565. }
  566. }
  567. .import-album-modal {
  568. .modal-card-title {
  569. text-align: center;
  570. margin-left: 24px;
  571. }
  572. .modal-card {
  573. width: 100%;
  574. height: 100%;
  575. .modal-card-body {
  576. padding: 16px;
  577. display: flex;
  578. flex-direction: row;
  579. flex-wrap: wrap;
  580. justify-content: space-evenly;
  581. }
  582. .modal-card-foot {
  583. .button {
  584. margin: 0;
  585. }
  586. div div {
  587. margin-right: 5px;
  588. }
  589. .right {
  590. display: flex;
  591. margin-left: auto;
  592. margin-right: 0;
  593. }
  594. }
  595. }
  596. }
  597. </style>
  598. <style lang="scss" scoped>
  599. .break {
  600. flex-basis: 100%;
  601. height: 0;
  602. border: 1px solid var(--dark-grey);
  603. margin-top: 16px;
  604. margin-bottom: 16px;
  605. }
  606. .search-discogs-album {
  607. width: 376px;
  608. background-color: var(--light-grey);
  609. border: 1px rgba(163, 224, 255, 0.75) solid;
  610. border-radius: 5px;
  611. padding: 16px;
  612. overflow: auto;
  613. height: 100%;
  614. > label {
  615. margin-top: 12px;
  616. }
  617. .top-container {
  618. display: flex;
  619. img {
  620. height: 85px;
  621. width: 85px;
  622. }
  623. .right-container {
  624. padding: 8px;
  625. display: flex;
  626. flex-direction: column;
  627. flex: 1;
  628. .album-title {
  629. flex: 1;
  630. font-weight: 600;
  631. }
  632. .bottom-row {
  633. display: flex;
  634. flex-flow: row;
  635. line-height: 15px;
  636. img {
  637. height: 15px;
  638. align-self: end;
  639. flex: 1;
  640. user-select: none;
  641. -moz-user-select: none;
  642. -ms-user-select: none;
  643. -webkit-user-select: none;
  644. cursor: pointer;
  645. }
  646. p {
  647. text-align: right;
  648. }
  649. .type-year {
  650. font-size: 13px;
  651. align-self: end;
  652. }
  653. }
  654. }
  655. }
  656. .bottom-container {
  657. padding: 12px;
  658. .bottom-container-field {
  659. line-height: 16px;
  660. margin-bottom: 8px;
  661. font-weight: 600;
  662. span {
  663. font-weight: 400;
  664. }
  665. }
  666. .bottom-container-field:last-of-type {
  667. margin-bottom: 8px;
  668. }
  669. }
  670. .api-result {
  671. background-color: var(--white);
  672. border: 0.5px solid var(--primary-color);
  673. border-radius: 5px;
  674. margin-bottom: 16px;
  675. }
  676. button {
  677. &:focus,
  678. &:hover {
  679. filter: contrast(0.75);
  680. }
  681. }
  682. .tracks {
  683. margin-top: 12px;
  684. .track:first-child {
  685. margin-top: 0;
  686. border-radius: 3px 3px 0 0;
  687. }
  688. .track:last-child {
  689. border-radius: 0 0 3px 3px;
  690. }
  691. .track {
  692. border: 0.5px solid var(--black);
  693. margin-top: -1px;
  694. line-height: 16px;
  695. display: flex;
  696. span {
  697. font-weight: 600;
  698. display: inline-block;
  699. margin-top: 7px;
  700. margin-bottom: 7px;
  701. margin-left: 7px;
  702. }
  703. p {
  704. display: inline-block;
  705. margin: 7px;
  706. flex: 1;
  707. }
  708. }
  709. }
  710. .discogs-load-more {
  711. margin-bottom: 8px;
  712. }
  713. }
  714. .discogs-album {
  715. width: 376px;
  716. background-color: var(--light-grey);
  717. border: 1px rgba(163, 224, 255, 0.75) solid;
  718. border-radius: 5px;
  719. padding: 16px;
  720. overflow: auto;
  721. height: 100%;
  722. .top-container {
  723. display: flex;
  724. img {
  725. height: 85px;
  726. width: 85px;
  727. }
  728. .right-container {
  729. padding: 8px;
  730. display: flex;
  731. flex-direction: column;
  732. flex: 1;
  733. .album-title {
  734. flex: 1;
  735. font-weight: 600;
  736. }
  737. .bottom-row {
  738. display: flex;
  739. flex-flow: row;
  740. line-height: 15px;
  741. img {
  742. height: 15px;
  743. align-self: end;
  744. flex: 1;
  745. user-select: none;
  746. -moz-user-select: none;
  747. -ms-user-select: none;
  748. -webkit-user-select: none;
  749. cursor: pointer;
  750. }
  751. p {
  752. text-align: right;
  753. }
  754. .type-year {
  755. font-size: 13px;
  756. align-self: end;
  757. }
  758. }
  759. }
  760. }
  761. .bottom-container {
  762. padding: 12px;
  763. .bottom-container-field {
  764. line-height: 16px;
  765. margin-bottom: 8px;
  766. font-weight: 600;
  767. span {
  768. font-weight: 400;
  769. }
  770. }
  771. .bottom-container-field:last-of-type {
  772. margin-bottom: 0;
  773. }
  774. .tracks {
  775. margin-top: 12px;
  776. .track:first-child {
  777. margin-top: 0;
  778. border-radius: 3px 3px 0 0;
  779. }
  780. .track:last-child {
  781. border-radius: 0 0 3px 3px;
  782. }
  783. .track {
  784. border: 0.5px solid var(--black);
  785. margin-top: -1px;
  786. line-height: 16px;
  787. display: flex;
  788. span {
  789. font-weight: 600;
  790. display: inline-block;
  791. margin-top: 7px;
  792. margin-bottom: 7px;
  793. margin-left: 7px;
  794. }
  795. p {
  796. display: inline-block;
  797. margin: 7px;
  798. flex: 1;
  799. }
  800. }
  801. .track:hover,
  802. .track:focus {
  803. background-color: var(--light-grey);
  804. }
  805. }
  806. }
  807. }
  808. .import-youtube-playlist {
  809. width: 376px;
  810. background-color: var(--light-grey);
  811. border: 1px rgba(163, 224, 255, 0.75) solid;
  812. border-radius: 5px;
  813. padding: 16px;
  814. overflow: auto;
  815. height: 100%;
  816. }
  817. .track-boxes {
  818. width: 376px;
  819. background-color: var(--light-grey);
  820. border: 1px rgba(163, 224, 255, 0.75) solid;
  821. border-radius: 5px;
  822. padding: 16px;
  823. overflow: auto;
  824. height: 100%;
  825. .track-box:first-child {
  826. margin-top: 0;
  827. border-radius: 3px 3px 0 0;
  828. }
  829. .track-box:last-child {
  830. border-radius: 0 0 3px 3px;
  831. }
  832. .track-box {
  833. border: 0.5px solid var(--black);
  834. margin-top: -1px;
  835. line-height: 16px;
  836. display: flex;
  837. flex-flow: column;
  838. .track-position-title {
  839. display: flex;
  840. span {
  841. font-weight: 600;
  842. display: inline-block;
  843. margin-top: 7px;
  844. margin-bottom: 7px;
  845. margin-left: 7px;
  846. }
  847. p {
  848. display: inline-block;
  849. margin: 7px;
  850. flex: 1;
  851. }
  852. }
  853. .track-box-songs-drag-area {
  854. flex: 1;
  855. min-height: 100px;
  856. }
  857. }
  858. }
  859. </style>