App.vue 30 KB

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