App.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666
  1. <template>
  2. <div class="upper-container">
  3. <banned v-if="banned" />
  4. <div v-else class="upper-container">
  5. <router-view
  6. :key="$route.fullPath"
  7. class="main-container"
  8. :class="{ 'main-container-modal-active': aModalIsOpen2 }"
  9. />
  10. <what-is-new v-show="modals.whatIsNew" />
  11. <login-modal v-if="modals.login" />
  12. <register-modal v-if="modals.register" />
  13. <create-playlist-modal v-if="modals.createPlaylist" />
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. import { mapState, mapActions, mapGetters } from "vuex";
  19. import Toast from "toasters";
  20. import { defineAsyncComponent } from "vue";
  21. import ws from "./ws";
  22. import aw from "./aw";
  23. import keyboardShortcuts from "./keyboardShortcuts";
  24. export default {
  25. components: {
  26. WhatIsNew: defineAsyncComponent(() =>
  27. import("@/components/modals/WhatIsNew.vue")
  28. ),
  29. LoginModal: defineAsyncComponent(() =>
  30. import("@/components/modals/Login.vue")
  31. ),
  32. RegisterModal: defineAsyncComponent(() =>
  33. import("@/components/modals/Register.vue")
  34. ),
  35. CreatePlaylistModal: defineAsyncComponent(() =>
  36. import("@/components/modals/CreatePlaylist.vue")
  37. ),
  38. Banned: defineAsyncComponent(() => import("@/pages/Banned.vue"))
  39. },
  40. replace: false,
  41. data() {
  42. return {
  43. apiDomain: "",
  44. socketConnected: true,
  45. keyIsDown: false,
  46. scrollPosition: { y: 0, x: 0 },
  47. aModalIsOpen2: false
  48. };
  49. },
  50. computed: {
  51. ...mapState({
  52. loggedIn: state => state.user.auth.loggedIn,
  53. role: state => state.user.auth.role,
  54. username: state => state.user.auth.username,
  55. userId: state => state.user.auth.userId,
  56. banned: state => state.user.auth.banned,
  57. modals: state => state.modalVisibility.modals,
  58. currentlyActive: state => state.modalVisibility.currentlyActive,
  59. nightmode: state => state.user.preferences.nightmode,
  60. activityWatch: state => state.user.preferences.activityWatch
  61. }),
  62. ...mapGetters({
  63. socket: "websockets/getSocket"
  64. }),
  65. aModalIsOpen() {
  66. return Object.keys(this.currentlyActive).length > 0;
  67. }
  68. },
  69. watch: {
  70. socketConnected(connected) {
  71. if (!connected) this.disconnectedMessage.show();
  72. else this.disconnectedMessage.hide();
  73. },
  74. nightmode(nightmode) {
  75. if (nightmode) this.enableNightmode();
  76. else this.disableNightmode();
  77. },
  78. activityWatch(activityWatch) {
  79. if (activityWatch) aw.enable();
  80. else aw.disable();
  81. },
  82. aModalIsOpen(aModalIsOpen) {
  83. if (aModalIsOpen) {
  84. this.scrollPosition = {
  85. x: window.scrollX,
  86. y: window.scrollY
  87. };
  88. this.aModalIsOpen2 = true;
  89. } else {
  90. this.aModalIsOpen2 = false;
  91. setTimeout(() => {
  92. window.scrollTo(
  93. this.scrollPosition.x,
  94. this.scrollPosition.y
  95. );
  96. }, 10);
  97. }
  98. }
  99. },
  100. async mounted() {
  101. window
  102. .matchMedia("(prefers-color-scheme: dark)")
  103. .addEventListener("change", e => {
  104. if (e.matches === !this.nightmode) this.toggleNightMode();
  105. });
  106. document.onkeydown = ev => {
  107. const event = ev || window.event;
  108. const { keyCode } = event;
  109. const shift = event.shiftKey;
  110. const ctrl = event.ctrlKey;
  111. const alt = event.altKey;
  112. const identifier = `${keyCode}.${shift}.${ctrl}`;
  113. if (this.keyIsDown === identifier) return;
  114. this.keyIsDown = identifier;
  115. keyboardShortcuts.handleKeyDown(event, keyCode, shift, ctrl, alt);
  116. };
  117. document.onkeyup = () => {
  118. this.keyIsDown = "";
  119. };
  120. // ctrl + alt + n
  121. keyboardShortcuts.registerShortcut("nightmode", {
  122. keyCode: 78,
  123. ctrl: true,
  124. alt: true,
  125. handler: () => this.toggleNightMode()
  126. });
  127. keyboardShortcuts.registerShortcut("closeModal", {
  128. keyCode: 27,
  129. shift: false,
  130. ctrl: false,
  131. handler: () => {
  132. if (Object.keys(this.currentlyActive).length !== 0)
  133. this.closeCurrentModal();
  134. }
  135. });
  136. this.disconnectedMessage = new Toast({
  137. content: "Could not connect to the server.",
  138. persistent: true,
  139. interactable: false
  140. });
  141. this.disconnectedMessage.hide();
  142. ws.onConnect(() => {
  143. this.socketConnected = true;
  144. this.socket.dispatch("users.getPreferences", res => {
  145. if (res.status === "success") {
  146. const { preferences } = res.data;
  147. this.changeAutoSkipDisliked(preferences.autoSkipDisliked);
  148. this.changeNightmode(preferences.nightmode);
  149. this.changeActivityLogPublic(preferences.activityLogPublic);
  150. this.changeAnonymousSongRequests(
  151. preferences.anonymousSongRequests
  152. );
  153. this.changeActivityWatch(preferences.activityWatch);
  154. if (this.nightmode) this.enableNightmode();
  155. else this.disableNightmode();
  156. }
  157. });
  158. this.socket.on("keep.event:user.session.deleted", () =>
  159. window.location.reload()
  160. );
  161. });
  162. ws.onDisconnect(true, () => {
  163. this.socketConnected = false;
  164. });
  165. this.apiDomain = await lofig.get("backend.apiDomain");
  166. this.$router.isReady().then(() => {
  167. if (this.$route.query.err) {
  168. let { err } = this.$route.query;
  169. err = err
  170. .replace(new RegExp("<", "g"), "&lt;")
  171. .replace(new RegExp(">", "g"), "&gt;");
  172. this.$router.push({ query: {} });
  173. new Toast({ content: err, timeout: 20000 });
  174. }
  175. if (this.$route.query.msg) {
  176. let { msg } = this.$route.query;
  177. msg = msg
  178. .replace(new RegExp("<", "g"), "&lt;")
  179. .replace(new RegExp(">", "g"), "&gt;");
  180. this.$router.push({ query: {} });
  181. new Toast({ content: msg, timeout: 20000 });
  182. }
  183. if (localStorage.getItem("github_redirect")) {
  184. this.$router.push(localStorage.getItem("github_redirect"));
  185. localStorage.removeItem("github_redirect");
  186. }
  187. });
  188. if (localStorage.getItem("nightmode") === "true") {
  189. this.changeNightmode(true);
  190. this.enableNightmode();
  191. }
  192. },
  193. methods: {
  194. toggleNightMode() {
  195. localStorage.setItem("nightmode", !this.nightmode);
  196. if (this.loggedIn) {
  197. this.socket.dispatch(
  198. "users.updatePreferences",
  199. { nightmode: !this.nightmode },
  200. res => {
  201. if (res.status !== "success") new Toast(res.message);
  202. }
  203. );
  204. }
  205. this.changeNightmode(!this.nightmode);
  206. },
  207. enableNightmode: () => {
  208. document
  209. .getElementsByTagName("body")[0]
  210. .classList.add("night-mode");
  211. },
  212. disableNightmode: () => {
  213. document
  214. .getElementsByTagName("body")[0]
  215. .classList.remove("night-mode");
  216. },
  217. ...mapActions("modalVisibility", ["closeCurrentModal"]),
  218. ...mapActions("user/preferences", [
  219. "changeNightmode",
  220. "changeAutoSkipDisliked",
  221. "changeActivityLogPublic",
  222. "changeAnonymousSongRequests",
  223. "changeActivityWatch"
  224. ])
  225. }
  226. };
  227. </script>
  228. <style lang="scss">
  229. @import "tippy.js/dist/tippy.css";
  230. @import "tippy.js/animations/scale.css";
  231. :root {
  232. --primary-color: var(--blue);
  233. --blue: rgb(2, 166, 242);
  234. --light-blue: rgb(163, 224, 255);
  235. --dark-blue: rgb(0, 102, 244);
  236. --teal: rgb(0, 209, 178);
  237. --purple: rgb(143, 40, 140);
  238. --light-purple: rgb(170, 141, 216);
  239. --yellow: rgb(241, 196, 15);
  240. --light-pink: rgb(228, 155, 166);
  241. --dark-pink: rgb(234, 72, 97);
  242. --orange: rgb(255, 94, 0);
  243. --dark-orange: rgb(250, 50, 0);
  244. --green: rgb(68, 189, 50);
  245. --red: rgb(231, 77, 60);
  246. --white: rgb(255, 255, 255);
  247. --black: rgb(0, 0, 0);
  248. --light-grey: rgb(245, 245, 245);
  249. --light-grey-2: rgb(221, 221, 221);
  250. --light-grey-3: rgb(195, 193, 195);
  251. --grey: rgb(107, 107, 107);
  252. --grey-2: rgb(113, 113, 113);
  253. --grey-3: rgb(126, 126, 126);
  254. --dark-grey: rgb(77, 77, 77);
  255. --dark-grey-2: rgb(51, 51, 51);
  256. --dark-grey-3: rgb(34, 34, 34);
  257. --dark-grey-4: rgb(26, 26, 26);
  258. --youtube: rgb(189, 46, 46);
  259. }
  260. .night-mode {
  261. div {
  262. color: var(--light-grey-2);
  263. }
  264. .input,
  265. .textarea,
  266. .select select {
  267. background-color: var(--dark-grey);
  268. border-color: var(--grey-3);
  269. color: var(--white);
  270. &::placeholder {
  271. color: var(--light-grey-3);
  272. }
  273. }
  274. h1,
  275. h2,
  276. h3,
  277. h4,
  278. h5,
  279. h6 {
  280. color: var(--white) !important;
  281. }
  282. p:not(.help),
  283. label,
  284. .label {
  285. color: var(--light-grey-2) !important;
  286. }
  287. .section,
  288. .content {
  289. background-color: var(--dark-grey-3) !important;
  290. }
  291. .content-box,
  292. .step:not(.selected) {
  293. background-color: var(--dark-grey-3) !important;
  294. }
  295. .tippy-box[data-theme~="songActions"] {
  296. background-color: var(--dark-grey);
  297. }
  298. code {
  299. background-color: var(--dark-grey-2) !important;
  300. }
  301. }
  302. /* inter-regular - latin */
  303. @font-face {
  304. font-family: "Inter";
  305. font-style: normal;
  306. font-weight: 400;
  307. src: url("/fonts/inter-v3-latin-regular.eot"); /* IE9 Compat Modes */
  308. src: local(""),
  309. url("/fonts/inter-v3-latin-regular.eot?#iefix")
  310. format("embedded-opentype"),
  311. /* IE6-IE8 */ url("/fonts/inter-v3-latin-regular.woff2") format("woff2"),
  312. /* Super Modern Browsers */ url("/fonts/inter-v3-latin-regular.woff")
  313. format("woff"),
  314. /* Modern Browsers */ url("/fonts/inter-v3-latin-regular.ttf")
  315. format("truetype"),
  316. /* Safari, Android, iOS */
  317. url("/fonts/inter-v3-latin-regular.svg#Inter") format("svg"); /* Legacy iOS */
  318. }
  319. /* inter-200 - latin */
  320. @font-face {
  321. font-family: "Inter";
  322. font-style: normal;
  323. font-weight: 200;
  324. src: url("/fonts/inter-v3-latin-200.eot"); /* IE9 Compat Modes */
  325. src: local(""),
  326. url("/fonts/inter-v3-latin-200.eot?#iefix") format("embedded-opentype"),
  327. /* IE6-IE8 */ url("/fonts/inter-v3-latin-200.woff2") format("woff2"),
  328. /* Super Modern Browsers */ url("/fonts/inter-v3-latin-200.woff")
  329. format("woff"),
  330. /* Modern Browsers */ url("/fonts/inter-v3-latin-200.ttf")
  331. format("truetype"),
  332. /* Safari, Android, iOS */ url("/fonts/inter-v3-latin-200.svg#Inter")
  333. format("svg"); /* Legacy iOS */
  334. }
  335. /* inter-800 - latin */
  336. @font-face {
  337. font-family: "Inter";
  338. font-style: normal;
  339. font-weight: 800;
  340. src: url("/fonts/inter-v3-latin-800.eot"); /* IE9 Compat Modes */
  341. src: local(""),
  342. url("/fonts/inter-v3-latin-800.eot?#iefix") format("embedded-opentype"),
  343. /* IE6-IE8 */ url("/fonts/inter-v3-latin-800.woff2") format("woff2"),
  344. /* Super Modern Browsers */ url("/fonts/inter-v3-latin-800.woff")
  345. format("woff"),
  346. /* Modern Browsers */ url("/fonts/inter-v3-latin-800.ttf")
  347. format("truetype"),
  348. /* Safari, Android, iOS */ url("/fonts/inter-v3-latin-800.svg#Inter")
  349. format("svg"); /* Legacy iOS */
  350. }
  351. /* inter-600 - latin */
  352. @font-face {
  353. font-family: "Inter";
  354. font-style: normal;
  355. font-weight: 600;
  356. src: url("/fonts/inter-v3-latin-600.eot"); /* IE9 Compat Modes */
  357. src: local(""),
  358. url("/fonts/inter-v3-latin-600.eot?#iefix") format("embedded-opentype"),
  359. /* IE6-IE8 */ url("/fonts/inter-v3-latin-600.woff2") format("woff2"),
  360. /* Super Modern Browsers */ url("/fonts/inter-v3-latin-600.woff")
  361. format("woff"),
  362. /* Modern Browsers */ url("/fonts/inter-v3-latin-600.ttf")
  363. format("truetype"),
  364. /* Safari, Android, iOS */ url("/fonts/inter-v3-latin-600.svg#Inter")
  365. format("svg"); /* Legacy iOS */
  366. }
  367. /* pacifico-regular - latin */
  368. @font-face {
  369. font-family: "Pacifico";
  370. font-style: normal;
  371. font-weight: 400;
  372. src: url("/fonts/pacifico-v17-latin-regular.eot"); /* IE9 Compat Modes */
  373. src: local(""),
  374. url("/fonts/pacifico-v17-latin-regular.eot?#iefix")
  375. format("embedded-opentype"),
  376. /* IE6-IE8 */ url("/fonts/pacifico-v17-latin-regular.woff2")
  377. format("woff2"),
  378. /* Super Modern Browsers */
  379. url("/fonts/pacifico-v17-latin-regular.woff") format("woff"),
  380. /* Modern Browsers */ url("/fonts/pacifico-v17-latin-regular.ttf")
  381. format("truetype"),
  382. /* Safari, Android, iOS */
  383. url("/fonts/pacifico-v17-latin-regular.svg#Pacifico") format("svg"); /* Legacy iOS */
  384. }
  385. @font-face {
  386. font-family: "Material Icons";
  387. font-style: normal;
  388. font-weight: 400;
  389. src: url(/fonts/MaterialIcons-Regular.ttf); /* For IE6-8 */
  390. src: local("Material Icons"), local("MaterialIcons-Regular"),
  391. url(/fonts/MaterialIcons-Regular.ttf) format("truetype");
  392. }
  393. .material-icons {
  394. font-family: "Material Icons";
  395. font-weight: normal;
  396. font-style: normal;
  397. font-size: 24px; /* Preferred icon size */
  398. display: inline-block;
  399. line-height: 1;
  400. text-transform: none;
  401. letter-spacing: normal;
  402. word-wrap: normal;
  403. white-space: nowrap;
  404. direction: ltr;
  405. /* Support for all WebKit browsers. */
  406. -webkit-font-smoothing: antialiased;
  407. /* Support for Safari and Chrome. */
  408. text-rendering: optimizeLegibility;
  409. /* Support for Firefox. */
  410. -moz-osx-font-smoothing: grayscale;
  411. /* Support for IE. */
  412. font-feature-settings: "liga";
  413. }
  414. code {
  415. background-color: var(--light-grey) !important;
  416. color: var(--red) !important;
  417. }
  418. body.night-mode {
  419. background-color: var(--black) !important;
  420. }
  421. #toasts-container {
  422. z-index: 10000 !important;
  423. .toast {
  424. font-weight: 600;
  425. z-index: 10000 !important;
  426. }
  427. }
  428. html {
  429. overflow: auto !important;
  430. height: 100%;
  431. background-color: inherit;
  432. font-size: 14px;
  433. }
  434. body {
  435. background-color: var(--light-grey);
  436. color: var(--dark-grey);
  437. height: 100%;
  438. line-height: 1.428;
  439. font-size: 1rem;
  440. font-family: "Inter", Helvetica, Arial, sans-serif;
  441. }
  442. .app {
  443. min-height: 100vh;
  444. position: relative;
  445. }
  446. #root {
  447. height: 100%;
  448. }
  449. .content-wrapper {
  450. /* padding: 60px 0 calc(230px + 60px) 0; */
  451. padding-top: 60px;
  452. }
  453. .card {
  454. position: relative;
  455. background-color: var(--white);
  456. color: var(--dark-grey);
  457. .card-image,
  458. .card-image .image,
  459. .card-header {
  460. display: flex;
  461. position: relative;
  462. }
  463. .card-image .image {
  464. padding-top: 100%;
  465. }
  466. .card-content {
  467. padding: 20px;
  468. }
  469. }
  470. .column {
  471. display: flex;
  472. flex: 1 1 0;
  473. padding: 10px;
  474. }
  475. ul {
  476. list-style: none;
  477. margin: 0;
  478. display: block;
  479. }
  480. h1,
  481. h2,
  482. h3,
  483. h4,
  484. h5,
  485. h6 {
  486. font-family: "Inter", Helvetica, Arial, sans-serif;
  487. font-weight: 400;
  488. line-height: 1.1;
  489. a {
  490. font-weight: inherit;
  491. }
  492. }
  493. h1 {
  494. font-size: 4.2rem;
  495. line-height: 110%;
  496. margin: 2.1rem 0 1.68rem 0;
  497. }
  498. h2 {
  499. font-size: 3.56rem;
  500. line-height: 110%;
  501. margin: 1.78rem 0 1.424rem 0;
  502. }
  503. h3 {
  504. font-size: 2.92rem;
  505. line-height: 110%;
  506. margin: 1.46rem 0 1.168rem 0;
  507. }
  508. h4 {
  509. font-size: 2.28rem;
  510. line-height: 110%;
  511. margin: 1.14rem 0 0.912rem 0;
  512. }
  513. h5 {
  514. font-size: 1.64rem;
  515. line-height: 110%;
  516. margin: 0.82rem 0 0.656rem 0;
  517. }
  518. h6 {
  519. font-size: 1rem;
  520. line-height: 110%;
  521. margin: 0.5rem 0 0.4rem 0;
  522. }
  523. .thin {
  524. font-weight: 200;
  525. }
  526. .left {
  527. float: left !important;
  528. }
  529. .right {
  530. float: right !important;
  531. }
  532. .white {
  533. background-color: #ffffff !important;
  534. }
  535. .btn-search {
  536. font-size: 14px;
  537. }
  538. a.nav-item.is-tab {
  539. border-bottom: 1px solid transparent;
  540. border-top: 1px solid transparent;
  541. }
  542. .button.is-info {
  543. border-width: 0;
  544. color: #fff;
  545. }
  546. strong {
  547. color: inherit;
  548. }
  549. .modal-card-title {
  550. font-weight: 600;
  551. font-family: "Inter", Helvetica, Arial, sans-serif;
  552. }
  553. p,
  554. button,
  555. input,
  556. select,
  557. textarea {
  558. font-family: "Inter", Helvetica, Arial, sans-serif;
  559. }
  560. #page-title {
  561. margin-top: 0;
  562. font-size: 35px;
  563. text-align: center;
  564. }
  565. @media only screen and (min-width: 700px) {
  566. #page-title {
  567. margin: 0;
  568. margin-bottom: 30px;
  569. font-size: 40px;
  570. }
  571. }
  572. .upper-container {
  573. height: 100%;
  574. }
  575. .main-container {
  576. height: 100%;
  577. min-height: 100vh;
  578. display: flex;
  579. flex-direction: column;
  580. &.main-container-modal-active {
  581. height: 100% !important;
  582. overflow: hidden !important;
  583. }
  584. > .container {
  585. position: relative;
  586. flex: 1 0 auto;
  587. margin: 0 auto;
  588. max-width: 1200px;
  589. }
  590. }
  591. a {
  592. color: var(--primary-color);
  593. text-decoration: none;
  594. }
  595. table {
  596. border-collapse: collapse;
  597. width: 100%;
  598. thead {
  599. td {
  600. border-width: 0 0 2px;
  601. }
  602. }
  603. td {
  604. border: 1px solid #dbdbdb;
  605. border-width: 0 0 1px;
  606. padding: 8px 10px;
  607. }
  608. tbody {
  609. tr:last-child {
  610. td {
  611. border-bottom-width: 0;
  612. }
  613. }
  614. }
  615. }
  616. .modal-card {
  617. margin: 0 !important;
  618. }
  619. .absolute-a {
  620. width: 100%;
  621. height: 100%;
  622. position: absolute;
  623. top: 0;
  624. left: 0;
  625. }
  626. .alert {
  627. padding: 20px;
  628. color: var(--white);
  629. background-color: var(--red);
  630. position: fixed;
  631. top: 50px;
  632. right: 50px;
  633. font-size: 2em;
  634. border-radius: 5px;
  635. z-index: 10000000;
  636. }
  637. .night-mode {
  638. .tippy-box {
  639. border: 1px solid var(--light-grey-3);
  640. box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25),
  641. 0 10px 10px rgba(0, 0, 0, 0.22);
  642. background-color: var(--white);
  643. .tippy-content {
  644. color: var(--black);
  645. }
  646. &[data-theme~="songActions"],
  647. &[data-theme~="addToPlaylist"],
  648. &[data-theme~="stationSettings"] {
  649. background-color: var(--dark-grey-2);
  650. border: 0 !important;
  651. }
  652. &[data-theme~="songActions"] {
  653. background-color: var(--dark-grey-2);
  654. border: 0 !important;
  655. i,
  656. a {
  657. color: var(--white);
  658. }
  659. .youtube-icon {
  660. background-color: var(--white);
  661. }
  662. }
  663. &[data-theme~="addToPlaylist"] {
  664. background-color: var(--dark-grey-2);
  665. border: 0 !important;
  666. .nav-dropdown-items {
  667. .nav-item {
  668. background-color: var(--dark-grey);
  669. &:focus {
  670. outline-color: var(--dark-grey);
  671. }
  672. p {
  673. color: var(--white);
  674. }
  675. }
  676. }
  677. }
  678. }
  679. .tippy-box[data-placement^="top"] {
  680. &[data-theme~="songActions"],
  681. &[data-theme~="addToPlaylist"] {
  682. > .tippy-arrow::before {
  683. border-top-color: var(--dark-grey-2);
  684. }
  685. }
  686. }
  687. .tippy-box[data-placement^="bottom"] {
  688. &[data-theme~="songActions"],
  689. &[data-theme~="addToPlaylist"],
  690. &[data-theme~="stationSettings"] {
  691. > .tippy-arrow::before {
  692. border-bottom-color: var(--dark-grey-2);
  693. }
  694. }
  695. }
  696. .tippy-box[data-placement^="left"] {
  697. &[data-theme~="songActions"],
  698. &[data-theme~="addToPlaylist"] {
  699. > .tippy-arrow::before {
  700. border-left-color: var(--dark-grey-2);
  701. }
  702. }
  703. }
  704. .tippy-box[data-placement^="right"] {
  705. &[data-theme~="songActions"],
  706. &[data-theme~="addToPlaylist"] {
  707. > .tippy-arrow::before {
  708. border-right-color: var(--dark-grey-2);
  709. }
  710. }
  711. }
  712. }
  713. .tippy-box[data-theme~="info"] {
  714. font-size: 12px;
  715. letter-spacing: 1px;
  716. }
  717. .tippy-box[data-theme~="confirm"] {
  718. background-color: var(--red);
  719. border: 0;
  720. .tippy-content {
  721. padding: 0;
  722. }
  723. a {
  724. padding: 15px;
  725. line-height: 30px;
  726. color: var(--white);
  727. border-bottom: 0;
  728. font-size: 15px;
  729. font-weight: 600;
  730. &:hover,
  731. &:focus {
  732. filter: brightness(90%);
  733. }
  734. }
  735. }
  736. .tippy-box[data-theme~="songActions"] {
  737. font-size: 15px;
  738. padding: 5px 10px;
  739. border: 1px solid var(--light-grey-3);
  740. box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  741. background-color: var(--white);
  742. .button {
  743. width: 146px;
  744. }
  745. i,
  746. a {
  747. display: inline-block;
  748. cursor: pointer;
  749. color: var(--dark-grey);
  750. vertical-align: middle;
  751. &:hover,
  752. &:focus {
  753. filter: brightness(90%);
  754. }
  755. &:not(:first) {
  756. margin-left: 5px;
  757. }
  758. }
  759. .play-icon,
  760. .added-to-playlist-icon {
  761. color: var(--green);
  762. }
  763. .edit-icon,
  764. .view-icon,
  765. .add-to-playlist-icon,
  766. .add-to-queue-icon {
  767. color: var(--primary-color);
  768. }
  769. .hide-icon {
  770. color: var(--light-grey-3);
  771. }
  772. .stop-icon,
  773. .delete-icon {
  774. color: var(--red);
  775. }
  776. .report-icon {
  777. color: var(--yellow);
  778. }
  779. }
  780. .tippy-box[data-placement^="top"] {
  781. &[data-theme~="songActions"],
  782. &[data-theme~="addToPlaylist"] {
  783. > .tippy-arrow::before {
  784. border-top-color: var(--white);
  785. }
  786. }
  787. &[data-theme~="confirm"] > .tippy-arrow::before {
  788. border-top-color: var(--red);
  789. }
  790. }
  791. .tippy-box[data-placement^="bottom"] {
  792. &[data-theme~="songActions"],
  793. &[data-theme~="addToPlaylist"],
  794. &[data-theme~="stationSettings"] {
  795. > .tippy-arrow::before {
  796. border-bottom-color: var(--white);
  797. }
  798. }
  799. &[data-theme~="confirm"] > .tippy-arrow::before {
  800. border-bottom-color: var(--red);
  801. }
  802. }
  803. .tippy-box[data-placement^="left"] {
  804. &[data-theme~="songActions"],
  805. &[data-theme~="addToPlaylist"] {
  806. > .tippy-arrow::before {
  807. border-left-color: var(--white);
  808. }
  809. }
  810. &[data-theme~="confirm"] > .tippy-arrow::before {
  811. border-left-color: var(--red);
  812. }
  813. }
  814. .tippy-box[data-placement^="right"] {
  815. &[data-theme~="songActions"],
  816. &[data-theme~="addToPlaylist"] {
  817. > .tippy-arrow::before {
  818. border-right-color: var(--white);
  819. }
  820. }
  821. &[data-theme~="confirm"] > .tippy-arrow::before {
  822. border-right-color: var(--red);
  823. }
  824. }
  825. .tippy-box[data-theme~="stationSettings"] {
  826. border: 1px solid var(--light-grey-3);
  827. box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  828. background-color: var(--white);
  829. button:not(:last-of-type) {
  830. margin-bottom: 5px;
  831. }
  832. }
  833. .tippy-box[data-theme~="addToPlaylist"] {
  834. font-size: 15px;
  835. padding: 0;
  836. border: 1px solid var(--light-grey-3);
  837. box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  838. background-color: var(--white);
  839. color: var(--dark-grey);
  840. width: 350px;
  841. .tippy-content {
  842. padding: 0;
  843. }
  844. .nav-dropdown-items {
  845. max-height: 220px;
  846. overflow-y: auto;
  847. padding: 10px 10px 0 10px;
  848. .nav-item {
  849. width: 100%;
  850. justify-content: flex-start;
  851. border: 0;
  852. padding: 8px 4px;
  853. font-size: 15.5px;
  854. min-height: 36px;
  855. background: var(--light-grey);
  856. border-radius: 5px;
  857. cursor: pointer;
  858. .checkbox-control {
  859. display: flex;
  860. flex-direction: row;
  861. align-items: center;
  862. overflow-wrap: anywhere;
  863. margin: 0 !important;
  864. p {
  865. margin-left: 10px;
  866. }
  867. .switch {
  868. position: relative;
  869. display: inline-block;
  870. flex-shrink: 0;
  871. width: 40px;
  872. height: 24px;
  873. }
  874. .switch input {
  875. opacity: 0;
  876. width: 0;
  877. height: 0;
  878. }
  879. .slider {
  880. width: 100%;
  881. position: absolute;
  882. cursor: pointer;
  883. top: 0;
  884. left: 0;
  885. right: 0;
  886. bottom: 0;
  887. background-color: #ccc;
  888. transition: 0.2s;
  889. border-radius: 34px;
  890. }
  891. .slider:before {
  892. position: absolute;
  893. content: "";
  894. height: 16px;
  895. width: 16px;
  896. left: 4px;
  897. bottom: 4px;
  898. background-color: white;
  899. transition: 0.2s;
  900. border-radius: 50%;
  901. }
  902. input:checked + .slider {
  903. background-color: var(--primary-color);
  904. }
  905. input:focus + .slider {
  906. box-shadow: 0 0 1px var(--primary-color);
  907. }
  908. input:checked + .slider:before {
  909. transform: translateX(16px);
  910. }
  911. }
  912. &:focus {
  913. outline-color: var(--light-grey-3);
  914. }
  915. &:not(:last-of-type) {
  916. margin-bottom: 5px;
  917. }
  918. }
  919. }
  920. .tippy-content > span {
  921. display: flex;
  922. flex-direction: column;
  923. button.nav-item {
  924. &:not(:last-of-type) {
  925. margin-bottom: 10px;
  926. }
  927. }
  928. }
  929. #create-playlist {
  930. margin: 10px 10px 10px 10px;
  931. width: unset;
  932. }
  933. }
  934. .select {
  935. &:after {
  936. border-color: var(--primary-color);
  937. border-width: 1.5px;
  938. margin-top: -3px;
  939. }
  940. select {
  941. height: 36px;
  942. }
  943. }
  944. .button:focus,
  945. .button:active {
  946. border-color: var(--light-grey-2) !important;
  947. }
  948. .input:focus,
  949. .input:active,
  950. .textarea:focus,
  951. .textarea:active,
  952. .select select:focus,
  953. .select select:active {
  954. border-color: var(--primary-color) !important;
  955. }
  956. button.delete:focus {
  957. background-color: rgba(10, 10, 10, 0.3);
  958. }
  959. .tag {
  960. padding-right: 6px !important;
  961. }
  962. .button {
  963. border: 1px solid #dbdbdb;
  964. border-radius: 3px;
  965. line-height: 24px;
  966. align-items: center;
  967. display: inline-flex;
  968. font-size: 14px;
  969. padding-left: 10px;
  970. padding-right: 10px;
  971. justify-content: center;
  972. cursor: pointer;
  973. user-select: none;
  974. &:hover,
  975. &:focus {
  976. filter: brightness(95%);
  977. }
  978. &.is-success {
  979. background-color: var(--green) !important;
  980. border-width: 0;
  981. color: white;
  982. }
  983. &.is-primary {
  984. background-color: var(--primary-color) !important;
  985. border-width: 0;
  986. color: white;
  987. }
  988. &.is-danger {
  989. background-color: var(--red) !important;
  990. border-width: 0;
  991. color: white;
  992. }
  993. &.is-info {
  994. background-color: var(--primary-color) !important;
  995. border-width: 0;
  996. color: white;
  997. }
  998. &.is-warning {
  999. background-color: var(--yellow) !important;
  1000. border-width: 0;
  1001. color: white;
  1002. }
  1003. }
  1004. .input {
  1005. width: 100%;
  1006. padding-left: 8px;
  1007. padding-right: 8px;
  1008. line-height: 24px;
  1009. font-size: 14px;
  1010. border-radius: 3px;
  1011. box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1);
  1012. border: 1px solid #dbdbdb;
  1013. }
  1014. .input,
  1015. .button {
  1016. height: 36px;
  1017. }
  1018. .fadein-helpbox-enter-active {
  1019. transition-duration: 0.3s;
  1020. transition-timing-function: ease-in;
  1021. }
  1022. .fadein-helpbox-leave-active {
  1023. transition-duration: 0.3s;
  1024. transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
  1025. }
  1026. .fadein-helpbox-enter-to,
  1027. .fadein-helpbox-leave {
  1028. max-height: 100px;
  1029. overflow: hidden;
  1030. }
  1031. .fadein-helpbox-enter,
  1032. .fadein-helpbox-leave-to {
  1033. overflow: hidden;
  1034. max-height: 0;
  1035. }
  1036. .control {
  1037. margin-bottom: 5px !important;
  1038. }
  1039. .input-with-button {
  1040. .control {
  1041. margin-right: 0px !important;
  1042. }
  1043. input,
  1044. select {
  1045. width: 100%;
  1046. height: 36px;
  1047. border-radius: 3px 0 0 3px;
  1048. border-right: 0;
  1049. border-color: var(--light-grey-3);
  1050. }
  1051. .button {
  1052. height: 36px;
  1053. border-radius: 0 3px 3px 0;
  1054. }
  1055. }
  1056. .page-title {
  1057. margin: 0 0 50px 0;
  1058. }
  1059. .material-icons {
  1060. user-select: none;
  1061. -webkit-user-select: none;
  1062. }
  1063. .icon-with-button {
  1064. margin-right: 3px;
  1065. font-size: 18px;
  1066. }
  1067. .verified-song {
  1068. font-size: 17px;
  1069. color: var(--primary-color);
  1070. }
  1071. .section-title,
  1072. h4.section-title {
  1073. font-size: 26px;
  1074. font-weight: 600;
  1075. margin: 0px;
  1076. }
  1077. .section-description {
  1078. font-size: 16px;
  1079. font-weight: 400;
  1080. margin-bottom: 10px !important;
  1081. }
  1082. .section-horizontal-rule {
  1083. margin: 15px 0 30px 0;
  1084. }
  1085. .section-margin-bottom {
  1086. height: 30px;
  1087. }
  1088. .margin-top-zero {
  1089. margin-top: 0 !important;
  1090. }
  1091. .margin-bottom-zero {
  1092. margin-bottom: 0 !important;
  1093. }
  1094. /** Universial items e.g. playlist items, queue items, activity items */
  1095. .item-draggable {
  1096. cursor: move;
  1097. }
  1098. .universal-item {
  1099. display: flex;
  1100. flex-direction: row;
  1101. flex-grow: 1;
  1102. align-items: center;
  1103. justify-content: space-between;
  1104. padding: 7.5px;
  1105. border: 1px solid var(--light-grey-3);
  1106. border-radius: 3px;
  1107. overflow: hidden;
  1108. .item-thumbnail {
  1109. width: 65px;
  1110. height: 65px;
  1111. margin: -7.5px;
  1112. border-radius: 3px 0 0 3px;
  1113. }
  1114. .item-title {
  1115. font-size: 20px;
  1116. overflow: hidden;
  1117. text-overflow: ellipsis;
  1118. white-space: nowrap;
  1119. }
  1120. .item-description {
  1121. font-size: 14px;
  1122. overflow: hidden;
  1123. text-overflow: ellipsis;
  1124. white-space: nowrap;
  1125. }
  1126. .universal-item-actions {
  1127. display: flex;
  1128. flex-direction: row;
  1129. margin-left: 10px;
  1130. justify-content: center;
  1131. @media screen and (max-width: 800px) {
  1132. flex-wrap: wrap;
  1133. }
  1134. .action-dropdown-icon {
  1135. display: flex;
  1136. color: var(--primary-color);
  1137. }
  1138. .icons-group {
  1139. display: flex;
  1140. align-items: center;
  1141. a {
  1142. padding: 0;
  1143. }
  1144. }
  1145. .button {
  1146. width: 146px;
  1147. }
  1148. i,
  1149. span {
  1150. cursor: pointer;
  1151. &:not(:first-child) {
  1152. margin-left: 5px;
  1153. }
  1154. }
  1155. .play-icon,
  1156. .added-to-playlist-icon {
  1157. color: var(--green);
  1158. }
  1159. .edit-icon,
  1160. .view-icon,
  1161. .add-to-playlist-icon,
  1162. .add-to-queue-icon {
  1163. color: var(--primary-color);
  1164. }
  1165. .hide-icon {
  1166. color: var(--light-grey-3);
  1167. }
  1168. .stop-icon,
  1169. .delete-icon {
  1170. color: var(--red);
  1171. }
  1172. .report-icon {
  1173. color: var(--yellow);
  1174. }
  1175. }
  1176. }
  1177. .save-button-mixin {
  1178. min-width: 200px;
  1179. &:disabled {
  1180. background-color: var(--light-grey) !important;
  1181. color: var(--black);
  1182. }
  1183. }
  1184. .save-button-transition-enter-active {
  1185. transition: all 0.1s ease;
  1186. }
  1187. .save-button-transition-enter {
  1188. transform: translateX(20px);
  1189. opacity: 0;
  1190. }
  1191. .youtube-icon {
  1192. margin-right: 3px;
  1193. height: 20px;
  1194. width: 20px;
  1195. -webkit-mask: url("/assets/social/youtube.svg") no-repeat center;
  1196. mask: url("/assets/social/youtube.svg") no-repeat center;
  1197. background-color: var(--youtube);
  1198. }
  1199. #forgot-password {
  1200. display: flex;
  1201. justify-content: flex-start;
  1202. margin: 5px 0;
  1203. }
  1204. .steps-fade-enter-active,
  1205. .steps-fade-leave-active {
  1206. transition: all 0.3s ease;
  1207. }
  1208. .steps-fade-enter-from,
  1209. .steps-fade-leave-to {
  1210. opacity: 0;
  1211. }
  1212. .skip-step {
  1213. background-color: var(--grey-3);
  1214. color: var(--white);
  1215. }
  1216. #steps {
  1217. display: flex;
  1218. align-items: center;
  1219. justify-content: center;
  1220. height: 50px;
  1221. margin-top: 36px;
  1222. @media screen and (max-width: 300px) {
  1223. display: none;
  1224. }
  1225. .step {
  1226. display: flex;
  1227. align-items: center;
  1228. justify-content: center;
  1229. border-radius: 100%;
  1230. border: 1px solid var(--dark-grey);
  1231. min-width: 50px;
  1232. min-height: 50px;
  1233. background-color: var(--white);
  1234. font-size: 30px;
  1235. user-select: none;
  1236. &.selected {
  1237. background-color: var(--primary-color);
  1238. color: var(--white) !important;
  1239. border: 0;
  1240. }
  1241. }
  1242. .divider {
  1243. display: flex;
  1244. justify-content: center;
  1245. width: 180px;
  1246. height: 1px;
  1247. background-color: var(--dark-grey);
  1248. }
  1249. }
  1250. /* This class is used for content-box in ResetPassword, but not in RemoveAccount. This is because ResetPassword uses transitions and RemoveAccount does not */
  1251. .content-box-wrapper {
  1252. position: relative;
  1253. width: 100%;
  1254. display: flex;
  1255. flex-direction: column;
  1256. align-items: center;
  1257. min-height: 200px;
  1258. .content-box {
  1259. position: absolute;
  1260. }
  1261. }
  1262. .content-box {
  1263. margin-top: 90px;
  1264. border-radius: 3px;
  1265. background-color: var(--white);
  1266. border: 1px solid var(--dark-grey);
  1267. max-width: 580px;
  1268. padding: 40px;
  1269. @media screen and (max-width: 300px) {
  1270. margin-top: 30px;
  1271. padding: 30px 20px;
  1272. }
  1273. }
  1274. .content-box-optional-helper {
  1275. margin-top: 15px;
  1276. color: var(--primary-color);
  1277. text-decoration: underline;
  1278. font-size: 16px;
  1279. a {
  1280. color: var(--primary-color);
  1281. }
  1282. }
  1283. .content-box-title {
  1284. font-size: 25px;
  1285. color: var(--black);
  1286. }
  1287. .content-box-description {
  1288. font-size: 14px;
  1289. color: var(--dark-grey);
  1290. }
  1291. .content-box-inputs {
  1292. margin-top: 35px;
  1293. .input-with-button {
  1294. .button {
  1295. width: 105px;
  1296. }
  1297. @media screen and (max-width: 450px) {
  1298. flex-direction: column;
  1299. }
  1300. }
  1301. label {
  1302. font-size: 11px;
  1303. }
  1304. #change-password-button {
  1305. margin-top: 36px;
  1306. width: 175px;
  1307. }
  1308. }
  1309. #password-visibility-container {
  1310. display: flex;
  1311. align-items: center;
  1312. a {
  1313. width: 0;
  1314. margin-left: -30px;
  1315. z-index: 0;
  1316. top: 2px;
  1317. position: relative;
  1318. color: var(--light-grey-1);
  1319. }
  1320. }
  1321. .news-item {
  1322. font-family: "Karla";
  1323. border-radius: 5px;
  1324. padding: 20px;
  1325. border: unset !important;
  1326. box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1);
  1327. * {
  1328. font-family: Karla, Arial, sans-serif;
  1329. font-size: 16px;
  1330. }
  1331. h1 {
  1332. font-size: 40px;
  1333. &:first-of-type {
  1334. margin-top: 0;
  1335. }
  1336. }
  1337. h2 {
  1338. font-size: 30px;
  1339. }
  1340. h3 {
  1341. font-size: 25px;
  1342. }
  1343. h4,
  1344. h5,
  1345. h6 {
  1346. font-size: 20px;
  1347. }
  1348. h1,
  1349. h2,
  1350. h3,
  1351. h4,
  1352. h5,
  1353. h6 {
  1354. margin: 10px 0;
  1355. }
  1356. ul {
  1357. list-style: unset;
  1358. }
  1359. li {
  1360. margin-left: 30px;
  1361. }
  1362. blockquote {
  1363. padding: 0px 15px;
  1364. color: #6a737d;
  1365. border-left: 0.25em solid #dfe2e5;
  1366. }
  1367. code {
  1368. font-style: italic;
  1369. }
  1370. }
  1371. .checkbox-control {
  1372. display: flex;
  1373. flex-direction: row;
  1374. align-items: center;
  1375. p {
  1376. margin-left: 10px;
  1377. }
  1378. .switch {
  1379. position: relative;
  1380. display: inline-block;
  1381. flex-shrink: 0;
  1382. width: 40px;
  1383. height: 24px;
  1384. }
  1385. .switch input {
  1386. opacity: 0;
  1387. width: 0;
  1388. height: 0;
  1389. }
  1390. .slider {
  1391. position: absolute;
  1392. cursor: pointer;
  1393. top: 0;
  1394. left: 0;
  1395. right: 0;
  1396. bottom: 0;
  1397. background-color: #ccc;
  1398. transition: 0.2s;
  1399. border-radius: 34px;
  1400. }
  1401. .slider:before {
  1402. position: absolute;
  1403. content: "";
  1404. height: 16px;
  1405. width: 16px;
  1406. left: 4px;
  1407. bottom: 4px;
  1408. background-color: white;
  1409. transition: 0.2s;
  1410. border-radius: 50%;
  1411. }
  1412. input:checked + .slider {
  1413. background-color: var(--primary-color);
  1414. }
  1415. input:focus + .slider {
  1416. box-shadow: 0 0 1px var(--primary-color);
  1417. }
  1418. input:checked + .slider:before {
  1419. transform: translateX(16px);
  1420. }
  1421. }
  1422. </style>