EditSong.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833
  1. <template>
  2. <div>
  3. <modal title="Edit Song" class="song-modal">
  4. <div slot="body">
  5. <div class="left-section">
  6. <div class="top-section">
  7. <div class="player-section">
  8. <div id="player"></div>
  9. <canvas
  10. id="durationCanvas"
  11. height="20"
  12. width="530"
  13. ></canvas>
  14. <div class="player-footer">
  15. <div class="player-footer-left">
  16. <i
  17. class="material-icons player-play-pause"
  18. v-on:click="settings('play')"
  19. v-if="video.paused"
  20. >play_arrow</i
  21. >
  22. <i
  23. class="material-icons player-play-pause"
  24. v-on:click="settings('pause')"
  25. v-if="!video.paused"
  26. >pause</i
  27. >
  28. <i
  29. class="material-icons player-stop"
  30. v-on:click="settings('stop')"
  31. >stop</i
  32. >
  33. <i
  34. class="material-icons player-fast-forward"
  35. v-on:click="
  36. settings('skipToLast10Secs')
  37. "
  38. >fast_forward</i
  39. >
  40. </div>
  41. <div class="player-footer-center">
  42. <img src="/assets/social/youtube.svg" />
  43. <span>
  44. <span>
  45. {{ youtubeVideoCurrentTime }}
  46. </span>
  47. /
  48. <span>
  49. {{ youtubeVideoDuration }}
  50. {{ youtubeVideoNote }}
  51. </span>
  52. </span>
  53. </div>
  54. <div class="player-footer-right">
  55. <input
  56. type="range"
  57. id="volumeSlider"
  58. min="0"
  59. max="100"
  60. class="active"
  61. v-on:change="changeVolume()"
  62. v-on:input="changeVolume()"
  63. />
  64. </div>
  65. </div>
  66. </div>
  67. <img
  68. class="thumbnail-preview"
  69. :src="editing.song.thumbnail"
  70. onerror="this.src='/assets/notes-transparent.png'"
  71. />
  72. </div>
  73. <div class="edit-section">
  74. <div class="control is-grouped">
  75. <div class="title-container">
  76. <label class="label">Title</label>
  77. <p class="control has-addons">
  78. <input
  79. class="input"
  80. type="text"
  81. v-model="editing.song.title"
  82. />
  83. <button
  84. class="button album-get-button"
  85. v-on:click="getAlbumData('title')"
  86. >
  87. <i class="material-icons album-get-icon"
  88. >album</i
  89. >
  90. </button>
  91. </p>
  92. </div>
  93. <div class="duration-container">
  94. <label class="label">Duration</label>
  95. <p class="control">
  96. <input
  97. class="input"
  98. type="text"
  99. v-model="editing.song.duration"
  100. />
  101. </p>
  102. </div>
  103. <div class="skip-duration-container">
  104. <label class="label">Skip duration</label>
  105. <p class="control">
  106. <input
  107. class="input"
  108. type="text"
  109. v-model="editing.song.skipDuration"
  110. />
  111. </p>
  112. </div>
  113. </div>
  114. <div class="control is-grouped">
  115. <div class="album-art-container">
  116. <label class="label">Album art</label>
  117. <p class="control has-addons">
  118. <input
  119. class="input"
  120. type="text"
  121. v-model="editing.song.thumbnail"
  122. />
  123. <button
  124. class="button album-get-button"
  125. v-on:click="getAlbumData('albumArt')"
  126. >
  127. <i class="material-icons album-get-icon"
  128. >album</i
  129. >
  130. </button>
  131. </p>
  132. </div>
  133. </div>
  134. <div class="control is-grouped">
  135. <div class="artists-container">
  136. <label class="label">Artists</label>
  137. <p class="control has-addons">
  138. <input
  139. class="input"
  140. type="text"
  141. id="new-artist"
  142. v-model="artistInputValue"
  143. v-on:blur="blurArtistInput()"
  144. v-on:focus="focusArtistInput()"
  145. v-on:keydown="keydownArtistInput()"
  146. />
  147. <button
  148. class="button album-get-button"
  149. v-on:click="getAlbumData('artists')"
  150. >
  151. <i class="material-icons album-get-icon"
  152. >album</i
  153. >
  154. </button>
  155. <button
  156. class="button is-info add-button"
  157. v-on:click="addTag('artists')"
  158. >
  159. <i class="material-icons">add</i>
  160. </button>
  161. </p>
  162. <div
  163. class="autosuggest-container"
  164. v-if="
  165. (artistInputFocussed ||
  166. artistAutosuggestContainerFocussed) &&
  167. artistAutosuggestItems.length > 0
  168. "
  169. @mouseover="focusArtistContainer()"
  170. @mouseleave="blurArtistContainer()"
  171. >
  172. <span
  173. class="autosuggest-item"
  174. tabindex="0"
  175. v-on:click="
  176. selectArtistAutosuggest(item)
  177. "
  178. v-for="(item,
  179. index) in artistAutosuggestItems"
  180. :key="index"
  181. >{{ item }}</span
  182. >
  183. </div>
  184. <div class="list-container">
  185. <div
  186. class="list-item"
  187. v-for="(artist, index) in editing.song
  188. .artists"
  189. :key="index"
  190. >
  191. <div
  192. class="list-item-circle"
  193. v-on:click="
  194. removeTag('artists', index)
  195. "
  196. >
  197. <i class="material-icons">close</i>
  198. </div>
  199. <p>{{ artist }}</p>
  200. </div>
  201. </div>
  202. </div>
  203. <div class="genres-container">
  204. <label class="label">
  205. <span>Genres</span>
  206. <i
  207. class="material-icons"
  208. @click="toggleGenreHelper"
  209. @dblclick="resetGenreHelper"
  210. >info</i
  211. >
  212. </label>
  213. <p class="control has-addons">
  214. <input
  215. class="input"
  216. type="text"
  217. id="new-genre"
  218. v-model="genreInputValue"
  219. v-on:blur="blurGenreInput()"
  220. v-on:focus="focusGenreInput()"
  221. v-on:keydown="keydownGenreInput()"
  222. />
  223. <button
  224. class="button album-get-button"
  225. v-on:click="getAlbumData('genres')"
  226. >
  227. <i class="material-icons album-get-icon"
  228. >album</i
  229. >
  230. </button>
  231. <button
  232. class="button is-info add-button"
  233. v-on:click="addTag('genres')"
  234. >
  235. <i class="material-icons">add</i>
  236. </button>
  237. </p>
  238. <div
  239. class="autosuggest-container"
  240. v-if="
  241. (genreInputFocussed ||
  242. genreAutosuggestContainerFocussed) &&
  243. genreAutosuggestItems.length > 0
  244. "
  245. @mouseover="focusGenreContainer()"
  246. @mouseleave="blurGenreContainer()"
  247. >
  248. <span
  249. class="autosuggest-item"
  250. tabindex="0"
  251. v-on:click="
  252. selectGenreAutosuggest(item)
  253. "
  254. v-for="(item,
  255. index) in genreAutosuggestItems"
  256. :key="index"
  257. >{{ item }}</span
  258. >
  259. </div>
  260. <div class="list-container">
  261. <div
  262. class="list-item"
  263. v-for="(genre, index) in editing.song
  264. .genres"
  265. :key="index"
  266. >
  267. <div
  268. class="list-item-circle"
  269. v-on:click="
  270. removeTag('genres', index)
  271. "
  272. >
  273. <i class="material-icons">close</i>
  274. </div>
  275. <p>{{ genre }}</p>
  276. </div>
  277. </div>
  278. </div>
  279. <div class="youtube-id-container">
  280. <label class="label">YouTube ID</label>
  281. <p class="control">
  282. <input
  283. class="input"
  284. type="text"
  285. v-model="editing.song.songId"
  286. />
  287. </p>
  288. </div>
  289. </div>
  290. </div>
  291. </div>
  292. <div class="right-section">
  293. <div class="api-section">
  294. <div
  295. class="selected-discogs-info"
  296. v-if="!editing.song.discogs"
  297. >
  298. <p class="selected-discogs-info-none">None</p>
  299. </div>
  300. <div
  301. class="selected-discogs-info"
  302. v-if="editing.song.discogs"
  303. >
  304. <div class="top-container">
  305. <img
  306. :src="editing.song.discogs.album.albumArt"
  307. />
  308. <div class="right-container">
  309. <p class="album-title">
  310. {{ editing.song.discogs.album.title }}
  311. </p>
  312. <div class="bottom-row">
  313. <p class="type-year">
  314. <span>{{
  315. editing.song.discogs.album.type
  316. }}</span>
  317. <span>{{
  318. editing.song.discogs.album.year
  319. }}</span>
  320. </p>
  321. </div>
  322. </div>
  323. </div>
  324. <div class="bottom-container">
  325. <p class="bottom-container-field">
  326. Artists:
  327. <span>{{
  328. editing.song.discogs.album.artists.join(
  329. ", "
  330. )
  331. }}</span>
  332. </p>
  333. <p class="bottom-container-field">
  334. Genres:
  335. <span>{{
  336. editing.song.discogs.album.genres.join(
  337. ", "
  338. )
  339. }}</span>
  340. </p>
  341. <p class="bottom-container-field">
  342. Data quality:
  343. <span>{{
  344. editing.song.discogs.dataQuality
  345. }}</span>
  346. </p>
  347. <p class="bottom-container-field">
  348. Track:
  349. <span
  350. >{{
  351. editing.song.discogs.track.position
  352. }}.
  353. {{
  354. editing.song.discogs.track.title
  355. }}</span
  356. >
  357. </p>
  358. </div>
  359. </div>
  360. <p class="control is-expanded">
  361. <label class="label">Search query</label>
  362. <input
  363. class="input"
  364. type="text"
  365. v-model="discogsQuery"
  366. @change="onDiscogsQueryChange"
  367. />
  368. </p>
  369. <button
  370. class="button is-info is-fullwidth"
  371. v-on:click="searchDiscogsForPage(1)"
  372. >
  373. Search
  374. </button>
  375. <label
  376. class="label"
  377. v-if="discogs.apiResults.length > 0"
  378. >API results</label
  379. >
  380. <div
  381. class="api-results-container"
  382. v-if="discogs.apiResults.length > 0"
  383. >
  384. <div
  385. class="api-result"
  386. v-for="(result, index) in discogs.apiResults"
  387. :key="index"
  388. >
  389. <div class="top-container">
  390. <img :src="result.album.albumArt" />
  391. <div class="right-container">
  392. <p class="album-title">
  393. {{ result.album.title }}
  394. </p>
  395. <div class="bottom-row">
  396. <img
  397. src="/assets/arrow_up.svg"
  398. v-if="result.expanded"
  399. v-on:click="
  400. toggleAPIResult(index)
  401. "
  402. />
  403. <img
  404. src="/assets/arrow_down.svg"
  405. v-if="!result.expanded"
  406. v-on:click="
  407. toggleAPIResult(index)
  408. "
  409. />
  410. <p class="type-year">
  411. <span>{{
  412. result.album.type
  413. }}</span>
  414. <span>{{
  415. result.album.year
  416. }}</span>
  417. </p>
  418. </div>
  419. </div>
  420. </div>
  421. <div
  422. class="bottom-container"
  423. v-if="result.expanded"
  424. >
  425. <p class="bottom-container-field">
  426. Artists:
  427. <span>{{
  428. result.album.artists.join(", ")
  429. }}</span>
  430. </p>
  431. <p class="bottom-container-field">
  432. Genres:
  433. <span>{{
  434. result.album.genres.join(", ")
  435. }}</span>
  436. </p>
  437. <p class="bottom-container-field">
  438. Data quality:
  439. <span>{{ result.dataQuality }}</span>
  440. </p>
  441. <div class="tracks">
  442. <div
  443. class="track"
  444. tabindex="0"
  445. v-for="(track,
  446. trackIndex) in result.tracks"
  447. :key="trackIndex"
  448. v-on:click="
  449. selectTrack(index, trackIndex)
  450. "
  451. >
  452. <span>{{ track.position }}.</span>
  453. <p>{{ track.title }}</p>
  454. </div>
  455. </div>
  456. </div>
  457. </div>
  458. </div>
  459. <button
  460. v-if="
  461. discogs.apiResults.length > 0 &&
  462. !discogs.disableLoadMore &&
  463. discogs.page < discogs.pages
  464. "
  465. class="button is-fullwidth is-info discogs-load-more"
  466. @click="loadNextDiscogsPage()"
  467. >
  468. Load more...
  469. </button>
  470. </div>
  471. </div>
  472. </div>
  473. <div slot="footer" class="footer-buttons">
  474. <button
  475. class="button is-success"
  476. v-on:click="save(editing.song, false)"
  477. >
  478. <i class="material-icons save-changes">done</i>
  479. <span>&nbsp;Save</span>
  480. </button>
  481. <button
  482. class="button is-success"
  483. v-on:click="save(editing.song, true)"
  484. >
  485. <i class="material-icons save-changes">done</i>
  486. <span>&nbsp;Save and close</span>
  487. </button>
  488. <button
  489. class="button is-danger"
  490. v-on:click="
  491. closeModal({ sector: 'admin', modal: 'editSong' })
  492. "
  493. >
  494. <span>&nbsp;Close</span>
  495. </button>
  496. </div>
  497. </modal>
  498. <div
  499. id="genre-helper-container"
  500. v-bind:style="{
  501. width: genreHelper.width + 'px',
  502. height: genreHelper.height + 'px',
  503. top: genreHelper.top + 'px',
  504. left: genreHelper.left + 'px'
  505. }"
  506. v-if="genreHelper.shown"
  507. @mousedown="onResizeGenreHelper"
  508. >
  509. <div
  510. class="genre-helper-header"
  511. @mousedown="onDragGenreHelper"
  512. ></div>
  513. <div class="genre-helper-body">
  514. <span>Blues</span><span>Classic rock</span><span>Country</span
  515. ><span>Dance</span><span>Disco</span><span>Funk</span
  516. ><span>Grunge</span><span>Hip-Hop</span><span>Jazz</span
  517. ><span>Metal</span><span>New Age</span><span>Oldies</span
  518. ><span>Other</span><span>Pop</span><span>Rhythm and Blues</span
  519. ><span>Rap</span><span>Reggae</span><span>Rock</span
  520. ><span>Techno</span><span>Industrial</span
  521. ><span>Alternative</span><span>Ska</span><span>Death metal</span
  522. ><span>Pranks</span><span>Soundtrack</span
  523. ><span>Euro-Techno</span><span>Ambient</span
  524. ><span>Trip-Hop</span><span>Vocal</span><span>Jazz & Funk</span
  525. ><span>Fusion</span><span>Trance</span><span>Classical</span
  526. ><span>Instrumental</span><span>Acid</span><span>House</span
  527. ><span>Game</span><span>Sound clip</span><span>Gospel</span
  528. ><span>Noise</span><span>Alternative Rock</span><span>Bass</span
  529. ><span>Soul</span><span>Punk</span><span>Space</span
  530. ><span>Meditative</span><span>Instrumental Pop</span
  531. ><span>Instrumental Rock</span><span>Ethnic</span
  532. ><span>Gothic</span><span>Darkwave</span
  533. ><span>Techno-Industrial</span><span>Electronic</span
  534. ><span>Pop-Folk</span><span>Eurodance</span><span>Dream</span
  535. ><span>Southern Rock</span><span>Comedy</span><span>Cult</span
  536. ><span>Gangsta</span><span>Top 40</span
  537. ><span>Christian Rap</span><span>Pop/Funk</span
  538. ><span>Jungle</span><span>Native US</span><span>Cabaret</span
  539. ><span>New Wave</span><span>Psychedelic</span><span>Rave</span
  540. ><span>Show tunes</span><span>Trailer</span><span>Lo-Fi</span
  541. ><span>Tribal</span><span>Acid Punk</span><span>Acid Jazz</span
  542. ><span>Polka</span><span>Retro</span><span>Musical</span
  543. ><span>Rock ’n’ Roll </span><span>Hard Rock</span>
  544. <span>Folk</span><span>Folk-Rock</span
  545. ><span>National Folk</span> <span>Swing</span
  546. ><span>Fast Fusion</span><span>Bebop</span><span>Latin</span
  547. ><span>Revival</span><span>Celtic</span><span>Bluegrass</span
  548. ><span>Avantgarde</span><span>Gothic Rock</span
  549. ><span>Progressive Rock</span><span>Psychedelic Rock</span
  550. ><span>Symphonic Rock</span><span>Slow rock</span
  551. ><span>Big Band</span><span>Chorus</span
  552. ><span>Easy Listening</span><span>Acoustic</span
  553. ><span>Humour</span><span>Speech</span><span>Chanson</span
  554. ><span>Opera</span><span>Chamber music</span><span>Sonata</span
  555. ><span>Symphony</span><span>Booty bass</span><span>Primus</span
  556. ><span>Porn groove</span><span>Satire</span><span>Slow jam</span
  557. ><span>Club</span><span>Tango</span><span>Samba</span
  558. ><span>Folklore</span><span>Ballad</span
  559. ><span>Power ballad</span><span>Rhythmic Soul</span
  560. ><span>Freestyle</span><span>Duet</span><span>Punk Rock</span
  561. ><span>Drum solo</span><span>A cappella</span
  562. ><span>Euro-House</span><span>Dance Hall</span><span>Goa</span
  563. ><span>Drum & Bass</span><span>Club-House</span
  564. ><span>Hardcore Techno</span><span>Terror</span
  565. ><span>Indie</span><span>BritPop</span><span>Negerpunk</span
  566. ><span>Polsk Punk</span><span>Beat</span
  567. ><span>Christian Gangsta Rap</span><span>Heavy Metal</span
  568. ><span>Black Metal</span><span>Crossover</span
  569. ><span>Contemporary Christian</span><span>Christian rock</span
  570. ><span>Merengue</span><span>Salsa</span><span>Thrash Metal</span
  571. ><span>Anime</span><span>Jpop</span><span>Synthpop</span
  572. ><span>Abstract</span><span>Art Rock</span><span>Baroque</span
  573. ><span>Bhangra</span><span>Big beat</span><span>Breakbeat</span
  574. ><span>Chillout</span><span>Downtempo</span><span>Dub</span
  575. ><span>EBM</span><span>Eclectic</span><span>Electro</span
  576. ><span>Electroclash</span><span>Emo</span
  577. ><span>Experimental</span><span>Garage</span><span>Global</span
  578. ><span>IDM</span><span>Illbient</span><span>Industro-Goth</span
  579. ><span>Jam Band</span><span>Krautrock</span
  580. ><span>Leftfield</span><span>Lounge</span><span>Math Rock</span
  581. ><span>New Romantic</span><span>Nu-Breakz</span
  582. ><span>Post-Punk</span><span>Post-Rock</span
  583. ><span>Psytrance</span><span>Shoegaze</span
  584. ><span>Space Rock</span><span>Trop Rock</span
  585. ><span>World Music</span><span>Neoclassical</span
  586. ><span>Audiobook</span><span>Audio theatre</span
  587. ><span>Neue Deutsche Welle</span><span>Podcast</span
  588. ><span>Indie-Rock</span><span>G-Funk</span><span>Dubstep</span
  589. ><span>Garage Rock</span><span>Psybient</span>
  590. </div>
  591. </div>
  592. </div>
  593. </template>
  594. <script>
  595. import { mapState, mapActions } from "vuex";
  596. import { Toast } from "vue-roaster";
  597. import io from "../../io";
  598. import validation from "../../validation";
  599. import Modal from "./Modal.vue";
  600. export default {
  601. components: { Modal },
  602. data() {
  603. return {
  604. discogsQuery: "",
  605. youtubeVideoDuration: 0.0,
  606. youtubeVideoCurrentTime: 0.0,
  607. youtubeVideoNote: "",
  608. useHTTPS: false,
  609. discogs: {
  610. apiResults: [],
  611. page: 1,
  612. pages: 1,
  613. disableLoadMore: false
  614. },
  615. artistInputValue: "",
  616. genreInputValue: "",
  617. artistInputFocussed: false,
  618. genreInputFocussed: false,
  619. genreAutosuggestContainerFocussed: false,
  620. artistAutosuggestContainerFocussed: false,
  621. keydownArtistInputTimeout: 0,
  622. keydownGenreInputTimeout: 0,
  623. artistAutosuggestItems: [],
  624. genreAutosuggestItems: [],
  625. genreHelper: {
  626. width: 200,
  627. height: 200,
  628. top: 0,
  629. left: 0,
  630. shown: false,
  631. pos1: 0,
  632. pos2: 0,
  633. pos3: 0,
  634. pos4: 0
  635. }
  636. };
  637. },
  638. computed: {
  639. ...mapState("admin/songs", {
  640. video: state => state.video,
  641. editing: state => state.editing,
  642. songs: state => state.songs
  643. }),
  644. ...mapState("modals", {
  645. modals: state => state.modals.admin
  646. })
  647. },
  648. methods: {
  649. save(songToCopy, close) {
  650. const song = JSON.parse(JSON.stringify(songToCopy));
  651. if (!song.title)
  652. return Toast.methods.addToast(
  653. "Please fill in all fields",
  654. 8000
  655. );
  656. if (!song.thumbnail)
  657. return Toast.methods.addToast(
  658. "Please fill in all fields",
  659. 8000
  660. );
  661. // Duration
  662. if (
  663. Number(song.skipDuration) + Number(song.duration) >
  664. this.youtubeVideoDuration
  665. ) {
  666. return Toast.methods.addToast(
  667. "Duration can't be higher than the length of the video",
  668. 8000
  669. );
  670. }
  671. // Title
  672. if (!validation.isLength(song.title, 1, 100))
  673. return Toast.methods.addToast(
  674. "Title must have between 1 and 100 characters.",
  675. 8000
  676. );
  677. /* if (!validation.regex.ascii.test(song.title))
  678. return Toast.methods.addToast(
  679. "Invalid title format. Only ascii characters are allowed.",
  680. 8000
  681. ); */
  682. // Artists
  683. if (song.artists.length < 1 || song.artists.length > 10)
  684. return Toast.methods.addToast(
  685. "Invalid artists. You must have at least 1 artist and a maximum of 10 artists.",
  686. 8000
  687. );
  688. let error;
  689. song.artists.forEach(artist => {
  690. if (!validation.isLength(artist, 1, 32)) {
  691. error = "Artist must have between 1 and 32 characters.";
  692. return error;
  693. }
  694. if (!validation.regex.ascii.test(artist)) {
  695. error =
  696. "Invalid artist format. Only ascii characters are allowed.";
  697. return error;
  698. }
  699. if (artist === "NONE") {
  700. error =
  701. 'Invalid artist format. Artists are not allowed to be named "NONE".';
  702. return error;
  703. }
  704. return false;
  705. });
  706. if (error) return Toast.methods.addToast(error, 8000);
  707. // Genres
  708. /* error = undefined;
  709. song.genres.forEach(genre => {
  710. if (!validation.isLength(genre, 1, 16)) {
  711. error = "Genre must have between 1 and 16 characters.";
  712. return error;
  713. }
  714. if (!validation.regex.azAZ09_.test(genre)) {
  715. error =
  716. "Invalid genre format. Only ascii characters are allowed.";
  717. return error;
  718. }
  719. return false;
  720. });
  721. if (error) return Toast.methods.addToast(error, 8000); */
  722. // Thumbnail
  723. if (!validation.isLength(song.thumbnail, 8, 256))
  724. return Toast.methods.addToast(
  725. "Thumbnail must have between 8 and 256 characters.",
  726. 8000
  727. );
  728. if (this.useHTTPS && song.thumbnail.indexOf("https://") !== 0) {
  729. return Toast.methods.addToast(
  730. 'Thumbnail must start with "https://".',
  731. 8000
  732. );
  733. }
  734. if (
  735. !this.useHTTPS &&
  736. (song.thumbnail.indexOf("http://") !== 0 &&
  737. song.thumbnail.indexOf("https://") !== 0)
  738. ) {
  739. return Toast.methods.addToast(
  740. 'Thumbnail must start with "http://".',
  741. 8000
  742. );
  743. }
  744. return this.socket.emit(
  745. `${this.editing.type}.update`,
  746. song._id,
  747. song,
  748. res => {
  749. Toast.methods.addToast(res.message, 4000);
  750. if (res.status === "success") {
  751. this.songs.forEach(originalSong => {
  752. const updatedSong = song;
  753. if (originalSong._id === updatedSong._id) {
  754. Object.keys(originalSong).forEach(n => {
  755. updatedSong[n] = originalSong[n];
  756. return originalSong[n];
  757. });
  758. }
  759. });
  760. }
  761. if (close)
  762. this.closeModal({
  763. sector: "admin",
  764. modal: "editSong"
  765. });
  766. }
  767. );
  768. },
  769. toggleAPIResult(index) {
  770. const apiResult = this.discogs.apiResults[index];
  771. if (apiResult.expanded === true) apiResult.expanded = false;
  772. else if (apiResult.gotMoreInfo === true) apiResult.expanded = true;
  773. else {
  774. fetch(apiResult.album.resourceUrl)
  775. .then(response => {
  776. return response.json();
  777. })
  778. .then(data => {
  779. apiResult.album.artists = [];
  780. apiResult.album.artistIds = [];
  781. const artistRegex = new RegExp(" \\([0-9]\\)$");
  782. apiResult.dataQuality = data.data_quality;
  783. data.artists.forEach(artist => {
  784. apiResult.album.artists.push(
  785. artist.name.replace(artistRegex, "")
  786. );
  787. apiResult.album.artistIds.push(artist.id);
  788. });
  789. apiResult.tracks = data.tracklist.map(track => {
  790. return {
  791. position: track.position,
  792. title: track.title
  793. };
  794. });
  795. apiResult.expanded = true;
  796. apiResult.gotMoreInfo = true;
  797. });
  798. }
  799. },
  800. getAlbumData(type) {
  801. if (!this.editing.song.discogs) return;
  802. if (type === "title")
  803. this.updateSongField({
  804. field: "title",
  805. value: this.editing.song.discogs.track.title
  806. });
  807. if (type === "albumArt")
  808. this.updateSongField({
  809. field: "thumbnail",
  810. value: this.editing.song.discogs.album.albumArt
  811. });
  812. if (type === "genres")
  813. this.updateSongField({
  814. field: "genres",
  815. value: this.editing.song.discogs.album.genres
  816. });
  817. if (type === "artists")
  818. this.updateSongField({
  819. field: "artists",
  820. value: this.editing.song.discogs.album.artists
  821. });
  822. },
  823. searchDiscogsForPage(page) {
  824. const query = this.discogsQuery;
  825. this.socket.emit("apis.searchDiscogs", query, page, res => {
  826. if (res.status === "success") {
  827. if (page === 1)
  828. Toast.methods.addToast(
  829. `Successfully searched. Got ${res.results.length} results.`,
  830. 4000
  831. );
  832. else
  833. Toast.methods.addToast(
  834. `Successfully got ${res.results.length} more results.`,
  835. 4000
  836. );
  837. if (page === 1) {
  838. this.discogs.apiResults = [];
  839. }
  840. this.discogs.pages = res.pages;
  841. this.discogs.apiResults = this.discogs.apiResults.concat(
  842. res.results.map(result => {
  843. const type =
  844. result.type.charAt(0).toUpperCase() +
  845. result.type.slice(1);
  846. return {
  847. expanded: false,
  848. gotMoreInfo: false,
  849. album: {
  850. id: result.id,
  851. title: result.title,
  852. type,
  853. year: result.year,
  854. genres: result.genre,
  855. albumArt: result.cover_image,
  856. resourceUrl: result.resource_url
  857. }
  858. };
  859. })
  860. );
  861. this.discogs.page = page;
  862. this.discogs.disableLoadMore = false;
  863. } else Toast.methods.addToast(res.message, 8000);
  864. });
  865. },
  866. loadNextDiscogsPage() {
  867. this.discogs.disableLoadMore = true;
  868. this.searchDiscogsForPage(this.discogs.page + 1);
  869. },
  870. onDiscogsQueryChange() {
  871. this.discogs.page = 1;
  872. this.discogs.pages = 1;
  873. this.discogs.apiResults = [];
  874. this.discogs.disableLoadMore = false;
  875. },
  876. selectTrack(apiResultIndex, trackIndex) {
  877. const apiResult = JSON.parse(
  878. JSON.stringify(this.discogs.apiResults[apiResultIndex])
  879. );
  880. apiResult.track = apiResult.tracks[trackIndex];
  881. delete apiResult.tracks;
  882. delete apiResult.expanded;
  883. delete apiResult.gotMoreInfo;
  884. this.selectDiscogsInfo(apiResult);
  885. },
  886. blurArtistInput() {
  887. this.artistInputFocussed = false;
  888. },
  889. focusArtistInput() {
  890. this.artistInputFocussed = true;
  891. },
  892. blurArtistContainer() {
  893. this.artistAutosuggestContainerFocussed = false;
  894. },
  895. focusArtistContainer() {
  896. this.artistAutosuggestContainerFocussed = true;
  897. },
  898. keydownArtistInput() {
  899. clearTimeout(this.keydownArtistInputTimeout);
  900. this.keydownArtistInputTimeout = setTimeout(() => {
  901. // Do things here to query the artist
  902. }, 1000);
  903. },
  904. selectArtistAutosuggest(value) {
  905. this.artistInputValue = value;
  906. },
  907. blurGenreInput() {
  908. this.genreInputFocussed = false;
  909. },
  910. focusGenreInput() {
  911. this.genreInputFocussed = true;
  912. },
  913. blurGenreContainer() {
  914. this.genreAutosuggestContainerFocussed = false;
  915. },
  916. focusGenreContainer() {
  917. this.genreAutosuggestContainerFocussed = true;
  918. },
  919. keydownGenreInput() {
  920. clearTimeout(this.keydownGenreInputTimeout);
  921. this.keydownGenreInputTimeout = setTimeout(() => {
  922. if (this.genreInputValue.length > 1) {
  923. const genres = ["EDM", "Pop", "Rock"];
  924. this.genreAutosuggestItems = genres.filter(genre => {
  925. return genre
  926. .toLowerCase()
  927. .startsWith(this.genreInputValue.toLowerCase());
  928. });
  929. } else this.genreAutosuggestItems = [];
  930. }, 1000);
  931. },
  932. selectGenreAutosuggest(value) {
  933. this.genreInputValue = value;
  934. },
  935. settings(type) {
  936. switch (type) {
  937. default:
  938. break;
  939. case "stop":
  940. this.stopVideo();
  941. this.pauseVideo(true);
  942. break;
  943. case "pause":
  944. this.pauseVideo(true);
  945. break;
  946. case "play":
  947. this.pauseVideo(false);
  948. break;
  949. case "skipToLast10Secs":
  950. this.video.player.seekTo(
  951. this.editing.song.duration -
  952. 10 +
  953. this.editing.song.skipDuration
  954. );
  955. break;
  956. }
  957. },
  958. changeVolume() {
  959. const volume = document.getElementById("volumeSlider").value;
  960. localStorage.setItem("volume", volume);
  961. this.video.player.setVolume(volume);
  962. if (volume > 0) this.video.player.unMute();
  963. },
  964. addTag(type) {
  965. if (type === "genres") {
  966. const genre = document
  967. .getElementById("new-genre")
  968. .value.toLowerCase()
  969. .trim();
  970. if (this.editing.song.genres.indexOf(genre) !== -1)
  971. return Toast.methods.addToast("Genre already exists", 3000);
  972. if (genre) {
  973. this.editing.song.genres.push(genre);
  974. document.getElementById("new-genre").value = "";
  975. return false;
  976. }
  977. return Toast.methods.addToast("Genre cannot be empty", 3000);
  978. }
  979. if (type === "artists") {
  980. const artist = document.getElementById("new-artist").value;
  981. if (this.editing.song.artists.indexOf(artist) !== -1)
  982. return Toast.methods.addToast(
  983. "Artist already exists",
  984. 3000
  985. );
  986. if (document.getElementById("new-artist").value !== "") {
  987. this.editing.song.artists.push(artist);
  988. document.getElementById("new-artist").value = "";
  989. return false;
  990. }
  991. return Toast.methods.addToast("Artist cannot be empty", 3000);
  992. }
  993. return false;
  994. },
  995. removeTag(type, index) {
  996. if (type === "genres") this.editing.song.genres.splice(index, 1);
  997. else if (type === "artists")
  998. this.editing.song.artists.splice(index, 1);
  999. },
  1000. drawCanvas() {
  1001. const canvasElement = document.getElementById("durationCanvas");
  1002. const ctx = canvasElement.getContext("2d");
  1003. const videoDuration = Number(this.youtubeVideoDuration);
  1004. const skipDuration = Number(this.editing.song.skipDuration);
  1005. const duration = Number(this.editing.song.duration);
  1006. const afterDuration = videoDuration - (skipDuration + duration);
  1007. const width = 560;
  1008. const currentTime = this.video.player.getCurrentTime();
  1009. const widthSkipDuration = (skipDuration / videoDuration) * width;
  1010. const widthDuration = (duration / videoDuration) * width;
  1011. const widthAfterDuration = (afterDuration / videoDuration) * width;
  1012. const widthCurrentTime = (currentTime / videoDuration) * width;
  1013. const skipDurationColor = "#F42003";
  1014. const durationColor = "#03A9F4";
  1015. const afterDurationColor = "#41E841";
  1016. const currentDurationColor = "#3b25e8";
  1017. ctx.fillStyle = skipDurationColor;
  1018. ctx.fillRect(0, 0, widthSkipDuration, 20);
  1019. ctx.fillStyle = durationColor;
  1020. ctx.fillRect(widthSkipDuration, 0, widthDuration, 20);
  1021. ctx.fillStyle = afterDurationColor;
  1022. ctx.fillRect(
  1023. widthSkipDuration + widthDuration,
  1024. 0,
  1025. widthAfterDuration,
  1026. 20
  1027. );
  1028. ctx.fillStyle = currentDurationColor;
  1029. ctx.fillRect(widthCurrentTime, 0, 1, 20);
  1030. },
  1031. onDragGenreHelper(e) {
  1032. const e1 = e || window.event;
  1033. e1.preventDefault();
  1034. this.genreHelper.pos3 = e1.clientX;
  1035. this.genreHelper.pos4 = e1.clientY;
  1036. document.onmousemove = e => {
  1037. const e2 = e || window.event;
  1038. e2.preventDefault();
  1039. // calculate the new cursor position:
  1040. this.genreHelper.pos1 = this.genreHelper.pos3 - e.clientX;
  1041. this.genreHelper.pos2 = this.genreHelper.pos4 - e.clientY;
  1042. this.genreHelper.pos3 = e.clientX;
  1043. this.genreHelper.pos4 = e.clientY;
  1044. // set the element's new position:
  1045. this.genreHelper.top =
  1046. this.genreHelper.top - this.genreHelper.pos2;
  1047. this.genreHelper.left =
  1048. this.genreHelper.left - this.genreHelper.pos1;
  1049. };
  1050. document.onmouseup = () => {
  1051. document.onmouseup = null;
  1052. document.onmousemove = null;
  1053. this.saveGenreHelper();
  1054. };
  1055. },
  1056. onResizeGenreHelper(e) {
  1057. if (e.target.id !== "genre-helper-container") return;
  1058. document.onmouseup = () => {
  1059. document.onmouseup = null;
  1060. const { height, width } = e.target.style;
  1061. this.genreHelper.height = Number(
  1062. height
  1063. .split("")
  1064. .splice(0, height.length - 2)
  1065. .join("")
  1066. );
  1067. this.genreHelper.width = Number(
  1068. width
  1069. .split("")
  1070. .splice(0, width.length - 2)
  1071. .join("")
  1072. );
  1073. this.saveGenreHelper();
  1074. };
  1075. },
  1076. toggleGenreHelper() {
  1077. this.genreHelper.shown = !this.genreHelper.shown;
  1078. this.saveGenreHelper();
  1079. },
  1080. resetGenreHelper() {
  1081. this.genreHelper.top = 0;
  1082. this.genreHelper.left = 0;
  1083. this.genreHelper.width = 200;
  1084. this.genreHelper.height = 200;
  1085. this.saveGenreHelper();
  1086. },
  1087. saveGenreHelper() {
  1088. localStorage.setItem(
  1089. "genreHelper",
  1090. JSON.stringify({
  1091. height: this.genreHelper.height,
  1092. width: this.genreHelper.width,
  1093. top: this.genreHelper.top,
  1094. left: this.genreHelper.left,
  1095. shown: this.genreHelper.shown
  1096. })
  1097. );
  1098. },
  1099. ...mapActions("admin/songs", [
  1100. "stopVideo",
  1101. "loadVideoById",
  1102. "pauseVideo",
  1103. "getCurrentTime",
  1104. "editSong",
  1105. "updateSongField",
  1106. "selectDiscogsInfo"
  1107. ]),
  1108. ...mapActions("modals", ["closeModal"])
  1109. },
  1110. mounted() {
  1111. // if (this.modals.editSong = false) this.video.player.stopVideo();
  1112. // this.loadVideoById(
  1113. // this.editing.song.songId,
  1114. // this.editing.song.skipDuration
  1115. // );
  1116. if (localStorage.genreHelper) {
  1117. const genreHelper = JSON.parse(localStorage.getItem("genreHelper"));
  1118. this.genreHelper.height = genreHelper.height;
  1119. this.genreHelper.width = genreHelper.width;
  1120. this.genreHelper.top = genreHelper.top;
  1121. this.genreHelper.left = genreHelper.left;
  1122. this.genreHelper.shown = genreHelper.shown;
  1123. }
  1124. this.discogsQuery = this.editing.song.title;
  1125. lofig.get("cookie.secure", res => {
  1126. this.useHTTPS = res;
  1127. });
  1128. io.getSocket(socket => {
  1129. this.socket = socket;
  1130. });
  1131. this.interval = setInterval(() => {
  1132. if (
  1133. this.video.paused === false &&
  1134. this.playerReady &&
  1135. this.video.player.getCurrentTime() -
  1136. this.editing.song.skipDuration >
  1137. this.editing.song.duration
  1138. ) {
  1139. this.video.paused = false;
  1140. this.video.player.stopVideo();
  1141. }
  1142. if (this.playerReady) {
  1143. this.youtubeVideoCurrentTime = this.video.player
  1144. .getCurrentTime()
  1145. .toFixed(3);
  1146. }
  1147. if (this.video.paused === false) this.drawCanvas();
  1148. }, 200);
  1149. this.video.player = new window.YT.Player("player", {
  1150. height: 298,
  1151. width: 530,
  1152. videoId: this.editing.song.songId,
  1153. playerVars: {
  1154. controls: 0,
  1155. iv_load_policy: 3,
  1156. rel: 0,
  1157. showinfo: 0,
  1158. autoplay: 1
  1159. },
  1160. startSeconds: this.editing.song.skipDuration,
  1161. events: {
  1162. onReady: () => {
  1163. let volume = parseInt(localStorage.getItem("volume"));
  1164. volume = typeof volume === "number" ? volume : 20;
  1165. console.log(`Seekto: ${this.editing.song.skipDuration}`);
  1166. this.video.player.seekTo(this.editing.song.skipDuration);
  1167. this.video.player.setVolume(volume);
  1168. if (volume > 0) this.video.player.unMute();
  1169. this.youtubeVideoDuration = this.video.player.getDuration();
  1170. this.youtubeVideoNote = "(~)";
  1171. this.playerReady = true;
  1172. this.drawCanvas();
  1173. },
  1174. onStateChange: event => {
  1175. if (event.data === 1) {
  1176. if (!this.video.autoPlayed) {
  1177. this.video.autoPlayed = true;
  1178. return this.video.player.stopVideo();
  1179. }
  1180. this.video.paused = false;
  1181. let youtubeDuration = this.video.player.getDuration();
  1182. this.youtubeVideoDuration = youtubeDuration;
  1183. this.youtubeVideoNote = "";
  1184. youtubeDuration -= this.editing.song.skipDuration;
  1185. if (this.editing.song.duration > youtubeDuration + 1) {
  1186. this.video.player.stopVideo();
  1187. this.video.paused = true;
  1188. return Toast.methods.addToast(
  1189. "Video can't play. Specified duration is bigger than the YouTube song duration.",
  1190. 4000
  1191. );
  1192. }
  1193. if (this.editing.song.duration <= 0) {
  1194. this.video.player.stopVideo();
  1195. this.video.paused = true;
  1196. return Toast.methods.addToast(
  1197. "Video can't play. Specified duration has to be more than 0 seconds.",
  1198. 4000
  1199. );
  1200. }
  1201. if (
  1202. this.video.player.getCurrentTime() <
  1203. this.editing.song.skipDuration
  1204. ) {
  1205. return this.video.player.seekTo(
  1206. this.editing.song.skipDuration
  1207. );
  1208. }
  1209. } else if (event.data === 2) {
  1210. this.video.paused = true;
  1211. }
  1212. return false;
  1213. }
  1214. }
  1215. });
  1216. let volume = parseInt(localStorage.getItem("volume"));
  1217. document.getElementById("volumeSlider").value = volume =
  1218. typeof volume === "number" ? volume : 20;
  1219. },
  1220. beforeDestroy() {
  1221. this.playerReady = false;
  1222. clearInterval(this.interval);
  1223. }
  1224. };
  1225. </script>
  1226. <style lang="scss">
  1227. @import "styles/global.scss";
  1228. #genre-helper-container {
  1229. background-color: white;
  1230. position: fixed;
  1231. z-index: 10000000;
  1232. resize: both;
  1233. overflow: auto;
  1234. border: 1px solid #d3d3d3;
  1235. min-height: 50px !important;
  1236. min-width: 50px !important;
  1237. .genre-helper-header {
  1238. cursor: move;
  1239. z-index: 100000001;
  1240. background-color: $musareBlue;
  1241. padding: 10px;
  1242. display: block;
  1243. height: 10px;
  1244. width: 100%;
  1245. }
  1246. .genre-helper-body {
  1247. display: flex;
  1248. flex-wrap: wrap;
  1249. justify-content: space-evenly;
  1250. span {
  1251. padding: 3px 6px;
  1252. }
  1253. }
  1254. }
  1255. .song-modal {
  1256. .modal-card-title {
  1257. text-align: center;
  1258. margin-left: 24px;
  1259. }
  1260. .modal-card {
  1261. width: 1160px;
  1262. height: 100%;
  1263. .modal-card-body {
  1264. padding: 16px;
  1265. }
  1266. }
  1267. }
  1268. </style>
  1269. <style lang="scss" scoped>
  1270. @import "styles/global.scss";
  1271. .modal-card-body > div {
  1272. display: flex;
  1273. height: 100%;
  1274. }
  1275. .left-section {
  1276. display: flex;
  1277. flex-direction: column;
  1278. margin-right: 16px;
  1279. .top-section {
  1280. display: flex;
  1281. .player-section {
  1282. width: 530px;
  1283. display: flex;
  1284. flex-direction: column;
  1285. .player-footer {
  1286. background-color: #f4f4f4;
  1287. border: 1px rgba(163, 224, 255, 0.75) solid;
  1288. border-radius: 0px 0px 5px 5px;
  1289. display: flex;
  1290. justify-content: space-between;
  1291. height: 54px;
  1292. > * {
  1293. width: 33.3%;
  1294. display: flex;
  1295. align-items: center;
  1296. }
  1297. .player-footer-left {
  1298. flex: 1;
  1299. .material-icons {
  1300. font-size: 38px;
  1301. cursor: pointer;
  1302. }
  1303. .player-play-pause {
  1304. color: $musareBlue;
  1305. }
  1306. .player-stop {
  1307. color: $red;
  1308. }
  1309. .player-fast-forward {
  1310. color: $green;
  1311. }
  1312. }
  1313. .player-footer-center {
  1314. justify-content: center;
  1315. align-items: center;
  1316. flex: 2;
  1317. font-size: 21px;
  1318. font-weight: 400;
  1319. img {
  1320. height: 21px;
  1321. margin-right: 12px;
  1322. filter: invert(26%) sepia(54%) saturate(6317%)
  1323. hue-rotate(2deg) brightness(92%) contrast(115%);
  1324. }
  1325. }
  1326. .player-footer-right {
  1327. justify-content: right;
  1328. flex: 1;
  1329. #volumeSlider {
  1330. width: 126px;
  1331. margin-right: 10px;
  1332. background-color: #f4f4f4;
  1333. }
  1334. }
  1335. }
  1336. }
  1337. .thumbnail-preview {
  1338. width: 189px;
  1339. height: 189px;
  1340. margin-left: 16px;
  1341. }
  1342. }
  1343. .edit-section {
  1344. width: 735px;
  1345. background-color: #f4f4f4;
  1346. border: 1px rgba(163, 224, 255, 0.75) solid;
  1347. margin-top: 16px;
  1348. flex: 1;
  1349. overflow: auto;
  1350. border-radius: 5px;
  1351. .album-get-button {
  1352. background-color: $purple;
  1353. color: white;
  1354. width: 32px;
  1355. text-align: center;
  1356. border-width: 0;
  1357. }
  1358. .add-button {
  1359. background-color: $musareBlue !important;
  1360. width: 32px;
  1361. i {
  1362. font-size: 32px;
  1363. }
  1364. }
  1365. > div {
  1366. margin: 16px;
  1367. }
  1368. input {
  1369. width: 100%;
  1370. }
  1371. .title-container {
  1372. width: calc((100% - 32px) / 2);
  1373. }
  1374. .duration-container {
  1375. margin-right: 16px;
  1376. margin-left: 16px;
  1377. width: calc((100% - 32px) / 4);
  1378. }
  1379. .skip-duration-container {
  1380. width: calc((100% - 32px) / 4);
  1381. }
  1382. .album-art-container {
  1383. width: 100%;
  1384. }
  1385. .artists-container {
  1386. width: calc((100% - 32px) / 3);
  1387. position: relative;
  1388. }
  1389. .genres-container {
  1390. width: calc((100% - 32px) / 3);
  1391. margin-left: 16px;
  1392. margin-right: 16px;
  1393. position: relative;
  1394. label {
  1395. display: flex;
  1396. i {
  1397. font-size: 15px;
  1398. align-self: center;
  1399. margin-left: 5px;
  1400. color: $musareBlue;
  1401. cursor: pointer;
  1402. -webkit-user-select: none;
  1403. -moz-user-select: none;
  1404. -ms-user-select: none;
  1405. user-select: none;
  1406. }
  1407. }
  1408. }
  1409. .youtube-id-container {
  1410. width: calc((100% - 32px) / 3);
  1411. }
  1412. .list-item-circle {
  1413. background-color: $musareBlue;
  1414. width: 16px;
  1415. height: 16px;
  1416. border-radius: 8px;
  1417. cursor: pointer;
  1418. margin-right: 8px;
  1419. float: left;
  1420. -webkit-touch-callout: none;
  1421. -webkit-user-select: none;
  1422. -khtml-user-select: none;
  1423. -moz-user-select: none;
  1424. -ms-user-select: none;
  1425. user-select: none;
  1426. i {
  1427. color: $musareBlue;
  1428. font-size: 14px;
  1429. margin-left: 1px;
  1430. }
  1431. }
  1432. .list-item-circle:hover,
  1433. .list-item-circle:focus {
  1434. i {
  1435. color: white;
  1436. }
  1437. }
  1438. .list-item > p {
  1439. line-height: 16px;
  1440. word-wrap: break-word;
  1441. width: calc(100% - 24px);
  1442. left: 24px;
  1443. float: left;
  1444. margin-bottom: 8px;
  1445. }
  1446. .list-item:last-child > p {
  1447. margin-bottom: 0;
  1448. }
  1449. .autosuggest-container {
  1450. position: absolute;
  1451. background: white;
  1452. width: calc(100% + 1px);
  1453. top: 57px;
  1454. z-index: 200;
  1455. overflow: auto;
  1456. max-height: 100%;
  1457. clear: both;
  1458. .autosuggest-item {
  1459. padding: 8px;
  1460. display: block;
  1461. border: 1px solid #dbdbdb;
  1462. margin-top: -1px;
  1463. line-height: 16px;
  1464. cursor: pointer;
  1465. -webkit-user-select: none;
  1466. -ms-user-select: none;
  1467. -moz-user-select: none;
  1468. user-select: none;
  1469. }
  1470. .autosuggest-item:hover,
  1471. .autosuggest-item:focus {
  1472. background-color: #eee;
  1473. }
  1474. .autosuggest-item:first-child {
  1475. border-top: none;
  1476. }
  1477. .autosuggest-item:last-child {
  1478. border-radius: 0 0 3px 3px;
  1479. }
  1480. }
  1481. }
  1482. }
  1483. .right-section {
  1484. display: flex;
  1485. flex-wrap: wrap;
  1486. .api-section {
  1487. width: 376px;
  1488. background-color: #f4f4f4;
  1489. border: 1px rgba(163, 224, 255, 0.75) solid;
  1490. border-radius: 5px;
  1491. padding: 16px;
  1492. overflow: auto;
  1493. height: 100%;
  1494. > label {
  1495. margin-top: 12px;
  1496. }
  1497. .top-container {
  1498. display: flex;
  1499. img {
  1500. height: 85px;
  1501. width: 85px;
  1502. }
  1503. .right-container {
  1504. padding: 8px;
  1505. display: flex;
  1506. flex-direction: column;
  1507. flex: 1;
  1508. .album-title {
  1509. flex: 1;
  1510. font-weight: 600;
  1511. }
  1512. .bottom-row {
  1513. display: flex;
  1514. flex-flow: row;
  1515. line-height: 15px;
  1516. img {
  1517. height: 15px;
  1518. align-self: end;
  1519. flex: 1;
  1520. user-select: none;
  1521. -moz-user-select: none;
  1522. -ms-user-select: none;
  1523. -webkit-user-select: none;
  1524. cursor: pointer;
  1525. }
  1526. p {
  1527. text-align: right;
  1528. }
  1529. .type-year {
  1530. font-size: 13px;
  1531. align-self: end;
  1532. }
  1533. }
  1534. }
  1535. }
  1536. .bottom-container {
  1537. padding: 12px;
  1538. .bottom-container-field {
  1539. line-height: 16px;
  1540. margin-bottom: 8px;
  1541. font-weight: 600;
  1542. span {
  1543. font-weight: 400;
  1544. }
  1545. }
  1546. .bottom-container-field:last-of-type {
  1547. margin-bottom: 0;
  1548. }
  1549. }
  1550. .selected-discogs-info {
  1551. background-color: white;
  1552. border: 1px solid $purple;
  1553. border-radius: 5px;
  1554. margin-bottom: 16px;
  1555. .selected-discogs-info-none {
  1556. font-size: 18px;
  1557. text-align: center;
  1558. }
  1559. .bottom-row > p {
  1560. flex: 1;
  1561. }
  1562. }
  1563. .api-result {
  1564. background-color: white;
  1565. border: 0.5px solid $musareBlue;
  1566. border-radius: 5px;
  1567. margin-bottom: 16px;
  1568. }
  1569. button {
  1570. background-color: $musareBlue !important;
  1571. }
  1572. .tracks {
  1573. margin-top: 12px;
  1574. .track:first-child {
  1575. margin-top: 0;
  1576. border-radius: 3px 3px 0 0;
  1577. }
  1578. .track:last-child {
  1579. border-radius: 0 0 3px 3px;
  1580. }
  1581. .track {
  1582. border: 0.5px solid black;
  1583. margin-top: -1px;
  1584. line-height: 16px;
  1585. display: flex;
  1586. cursor: pointer;
  1587. span {
  1588. font-weight: 600;
  1589. display: inline-block;
  1590. margin-top: 7px;
  1591. margin-bottom: 7px;
  1592. margin-left: 7px;
  1593. }
  1594. p {
  1595. display: inline-block;
  1596. margin: 7px;
  1597. flex: 1;
  1598. }
  1599. }
  1600. .track:hover,
  1601. .track:focus {
  1602. background-color: #f4f4f4;
  1603. }
  1604. }
  1605. .discogs-load-more {
  1606. margin-bottom: 8px;
  1607. }
  1608. }
  1609. }
  1610. .footer-buttons {
  1611. margin-left: auto;
  1612. margin-right: auto;
  1613. }
  1614. input[type="range"] {
  1615. -webkit-appearance: none;
  1616. width: 100%;
  1617. margin: 8.5px 0;
  1618. }
  1619. input[type="range"]:focus {
  1620. outline: none;
  1621. }
  1622. input[type="range"]::-webkit-slider-runnable-track {
  1623. width: 100%;
  1624. height: 3px;
  1625. cursor: pointer;
  1626. box-shadow: none;
  1627. background: #7e7e7e;
  1628. border-radius: none;
  1629. border: none;
  1630. }
  1631. input[type="range"]::-webkit-slider-thumb {
  1632. box-shadow: none;
  1633. border: none;
  1634. height: 20px;
  1635. width: 20px;
  1636. border-radius: 100px;
  1637. background: #03a9f4;
  1638. cursor: pointer;
  1639. -webkit-appearance: none;
  1640. margin-top: -8.5px;
  1641. }
  1642. input[type="range"]:focus::-webkit-slider-runnable-track {
  1643. background: #7e7e7e;
  1644. }
  1645. input[type="range"]::-moz-range-track {
  1646. width: 100%;
  1647. height: 3px;
  1648. cursor: pointer;
  1649. box-shadow: none;
  1650. background: #7e7e7e;
  1651. border-radius: none;
  1652. border: none;
  1653. }
  1654. input[type="range"]::-moz-range-thumb {
  1655. box-shadow: none;
  1656. border: none;
  1657. height: 20px;
  1658. width: 20px;
  1659. border-radius: 100px;
  1660. background: #03a9f4;
  1661. cursor: pointer;
  1662. }
  1663. input[type="range"]::-ms-track {
  1664. width: 100%;
  1665. height: 3px;
  1666. cursor: pointer;
  1667. background: transparent;
  1668. border-color: transparent;
  1669. color: transparent;
  1670. }
  1671. input[type="range"]::-ms-fill-lower {
  1672. background: #717171;
  1673. border: none;
  1674. border-radius: none;
  1675. box-shadow: none;
  1676. }
  1677. input[type="range"]::-ms-fill-upper {
  1678. background: #7e7e7e;
  1679. border: none;
  1680. border-radius: none;
  1681. box-shadow: none;
  1682. }
  1683. input[type="range"]::-ms-thumb {
  1684. box-shadow: none;
  1685. border: none;
  1686. height: 20px;
  1687. width: 20px;
  1688. border-radius: 100px;
  1689. background: #03a9f4;
  1690. cursor: pointer;
  1691. height: 3px;
  1692. }
  1693. input[type="range"]:focus::-ms-fill-lower {
  1694. background: #7e7e7e;
  1695. }
  1696. input[type="range"]:focus::-ms-fill-upper {
  1697. background: #7e7e7e;
  1698. }
  1699. </style>