EditSong.vue 43 KB

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