App.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350
  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. // background-color: var(--black);
  263. color: var(--light-grey-2);
  264. }
  265. // #toasts-container .toast {
  266. // color: var(--dark-grey-2);
  267. // background-color: var(--light-grey-3) !important;
  268. .input,
  269. .textarea,
  270. .select select {
  271. background-color: var(--dark-grey);
  272. border-color: var(--grey-3);
  273. color: var(--white);
  274. &::placeholder {
  275. color: var(--light-grey-3);
  276. }
  277. }
  278. // &:last-of-type {
  279. // background-color: var(--light-grey) !important;
  280. // }
  281. // }
  282. h1,
  283. h2,
  284. h3,
  285. h4,
  286. h5,
  287. h6 {
  288. color: var(--white) !important;
  289. }
  290. p:not(.help),
  291. label,
  292. .label {
  293. color: var(--light-grey-2) !important;
  294. }
  295. .section,
  296. .content {
  297. background-color: var(--dark-grey-3) !important;
  298. }
  299. .content-box,
  300. .step:not(.selected) {
  301. background-color: var(--dark-grey-3) !important;
  302. }
  303. .tippy-box[data-theme~="songActions"] {
  304. background-color: var(--dark-grey);
  305. }
  306. }
  307. body.night-mode {
  308. background-color: var(--black) !important;
  309. }
  310. #toasts-container {
  311. z-index: 10000 !important;
  312. .toast {
  313. font-weight: 600;
  314. // background-color: var(--dark-grey) !important;
  315. // &:last-of-type {
  316. // background-color: var(--dark-grey-2) !important;
  317. // }
  318. }
  319. }
  320. html {
  321. overflow: auto !important;
  322. height: 100%;
  323. }
  324. body {
  325. background-color: var(--light-grey);
  326. color: var(--dark-grey);
  327. height: 100%;
  328. font-family: "Inter", Helvetica, Arial, sans-serif;
  329. }
  330. h1,
  331. h2,
  332. h3,
  333. h4,
  334. h5,
  335. h6,
  336. .sidebar-title {
  337. font-family: "Inter", Helvetica, Arial, sans-serif;
  338. }
  339. .modal-card-title {
  340. font-weight: 600;
  341. font-family: "Inter", Helvetica, Arial, sans-serif;
  342. }
  343. p,
  344. button,
  345. input,
  346. select,
  347. textarea {
  348. font-family: "Inter", Helvetica, Arial, sans-serif;
  349. }
  350. #page-title {
  351. margin-top: 0;
  352. font-size: 35px;
  353. text-align: center;
  354. }
  355. @media only screen and (min-width: 700px) {
  356. #page-title {
  357. margin: 0;
  358. margin-bottom: 30px;
  359. font-size: 40px;
  360. }
  361. }
  362. .upper-container {
  363. height: 100%;
  364. }
  365. .main-container {
  366. height: 100%;
  367. min-height: 100vh;
  368. display: flex;
  369. flex-direction: column;
  370. > .container {
  371. flex: 1 0 auto;
  372. }
  373. }
  374. .main-container.main-container-modal-active {
  375. height: 100% !important;
  376. overflow: hidden !important;
  377. }
  378. a {
  379. color: var(--primary-color);
  380. text-decoration: none;
  381. }
  382. .modal-card {
  383. margin: 0 !important;
  384. }
  385. .absolute-a {
  386. width: 100%;
  387. height: 100%;
  388. position: absolute;
  389. top: 0;
  390. left: 0;
  391. }
  392. .alert {
  393. padding: 20px;
  394. color: var(--white);
  395. background-color: var(--red);
  396. position: fixed;
  397. top: 50px;
  398. right: 50px;
  399. font-size: 2em;
  400. border-radius: 5px;
  401. z-index: 10000000;
  402. }
  403. .night-mode {
  404. .tippy-box {
  405. border: 1px solid var(--light-grey-3);
  406. box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25),
  407. 0 10px 10px rgba(0, 0, 0, 0.22);
  408. background-color: var(--white);
  409. .tippy-content {
  410. color: var(--black);
  411. }
  412. &[data-theme~="songActions"],
  413. &[data-theme~="addToPlaylist"],
  414. &[data-theme~="stationSettings"] {
  415. background-color: var(--dark-grey-2);
  416. border: 0 !important;
  417. }
  418. &[data-theme~="songActions"] {
  419. background-color: var(--dark-grey-2);
  420. border: 0 !important;
  421. i,
  422. a {
  423. color: var(--white);
  424. }
  425. .youtube-icon {
  426. background-color: var(--white);
  427. }
  428. }
  429. &[data-theme~="addToPlaylist"] {
  430. background-color: var(--dark-grey-2);
  431. border: 0 !important;
  432. .nav-dropdown-items {
  433. .nav-item {
  434. background-color: var(--dark-grey);
  435. &:focus {
  436. outline-color: var(--dark-grey);
  437. }
  438. p {
  439. color: var(--white);
  440. }
  441. }
  442. }
  443. }
  444. }
  445. .tippy-box[data-placement^="top"] {
  446. &[data-theme~="songActions"],
  447. &[data-theme~="addToPlaylist"] {
  448. > .tippy-arrow::before {
  449. border-top-color: var(--dark-grey-2);
  450. }
  451. }
  452. }
  453. .tippy-box[data-placement^="bottom"] {
  454. &[data-theme~="songActions"],
  455. &[data-theme~="addToPlaylist"],
  456. &[data-theme~="stationSettings"] {
  457. > .tippy-arrow::before {
  458. border-bottom-color: var(--dark-grey-2);
  459. }
  460. }
  461. }
  462. .tippy-box[data-placement^="left"] {
  463. &[data-theme~="songActions"],
  464. &[data-theme~="addToPlaylist"] {
  465. > .tippy-arrow::before {
  466. border-left-color: var(--dark-grey-2);
  467. }
  468. }
  469. }
  470. .tippy-box[data-placement^="right"] {
  471. &[data-theme~="songActions"],
  472. &[data-theme~="addToPlaylist"] {
  473. > .tippy-arrow::before {
  474. border-right-color: var(--dark-grey-2);
  475. }
  476. }
  477. }
  478. }
  479. .tippy-box[data-theme~="info"] {
  480. font-size: 12px;
  481. letter-spacing: 1px;
  482. }
  483. .tippy-box[data-theme~="confirm"] {
  484. background-color: var(--red);
  485. border: 0;
  486. .tippy-content {
  487. padding: 0;
  488. }
  489. a {
  490. padding: 15px;
  491. line-height: 30px;
  492. color: var(--white);
  493. border-bottom: 0;
  494. font-size: 15px;
  495. font-weight: 600;
  496. &:hover,
  497. &:focus {
  498. filter: brightness(90%);
  499. }
  500. }
  501. }
  502. .tippy-box[data-theme~="songActions"] {
  503. font-size: 15px;
  504. padding: 5px 10px;
  505. border: 1px solid var(--light-grey-3);
  506. box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  507. background-color: var(--white);
  508. .button {
  509. width: 146px;
  510. }
  511. i,
  512. a {
  513. display: inline-block;
  514. cursor: pointer;
  515. color: var(--dark-grey);
  516. vertical-align: middle;
  517. &:hover,
  518. &:focus {
  519. filter: brightness(90%);
  520. }
  521. &:not(:first) {
  522. margin-left: 5px;
  523. }
  524. }
  525. .play-icon,
  526. .added-to-playlist-icon {
  527. color: var(--green);
  528. }
  529. .edit-icon,
  530. .view-icon,
  531. .add-to-playlist-icon,
  532. .add-to-queue-icon {
  533. color: var(--primary-color);
  534. }
  535. .hide-icon {
  536. color: var(--light-grey-3);
  537. }
  538. .stop-icon,
  539. .delete-icon {
  540. color: var(--red);
  541. }
  542. .report-icon {
  543. color: var(--yellow);
  544. }
  545. }
  546. .tippy-box[data-placement^="top"] {
  547. &[data-theme~="songActions"],
  548. &[data-theme~="addToPlaylist"] {
  549. > .tippy-arrow::before {
  550. border-top-color: var(--white);
  551. }
  552. }
  553. &[data-theme~="confirm"] > .tippy-arrow::before {
  554. border-top-color: var(--red);
  555. }
  556. }
  557. .tippy-box[data-placement^="bottom"] {
  558. &[data-theme~="songActions"],
  559. &[data-theme~="addToPlaylist"],
  560. &[data-theme~="stationSettings"] {
  561. > .tippy-arrow::before {
  562. border-bottom-color: var(--white);
  563. }
  564. }
  565. &[data-theme~="confirm"] > .tippy-arrow::before {
  566. border-bottom-color: var(--red);
  567. }
  568. }
  569. .tippy-box[data-placement^="left"] {
  570. &[data-theme~="songActions"],
  571. &[data-theme~="addToPlaylist"] {
  572. > .tippy-arrow::before {
  573. border-left-color: var(--white);
  574. }
  575. }
  576. &[data-theme~="confirm"] > .tippy-arrow::before {
  577. border-left-color: var(--red);
  578. }
  579. }
  580. .tippy-box[data-placement^="right"] {
  581. &[data-theme~="songActions"],
  582. &[data-theme~="addToPlaylist"] {
  583. > .tippy-arrow::before {
  584. border-right-color: var(--white);
  585. }
  586. }
  587. &[data-theme~="confirm"] > .tippy-arrow::before {
  588. border-right-color: var(--red);
  589. }
  590. }
  591. .tippy-box[data-theme~="stationSettings"] {
  592. border: 1px solid var(--light-grey-3);
  593. box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  594. background-color: var(--white);
  595. button:not(:last-of-type) {
  596. margin-bottom: 5px;
  597. }
  598. }
  599. .tippy-box[data-theme~="addToPlaylist"] {
  600. font-size: 15px;
  601. padding: 5px;
  602. border: 1px solid var(--light-grey-3);
  603. box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  604. background-color: var(--white);
  605. color: var(--dark-grey);
  606. width: 100%;
  607. .nav-dropdown-items {
  608. .nav-item {
  609. width: 100%;
  610. justify-content: flex-start;
  611. border: 0;
  612. padding: 10px;
  613. font-size: 15.5px;
  614. min-height: 36px;
  615. background: var(--light-grey);
  616. border-radius: 5px;
  617. cursor: pointer;
  618. .checkbox-control {
  619. display: flex;
  620. flex-direction: row;
  621. align-items: center;
  622. overflow-wrap: anywhere;
  623. p {
  624. margin-left: 10px;
  625. }
  626. .switch {
  627. position: relative;
  628. display: inline-block;
  629. flex-shrink: 0;
  630. width: 40px;
  631. height: 24px;
  632. }
  633. .switch input {
  634. opacity: 0;
  635. width: 0;
  636. height: 0;
  637. }
  638. .slider {
  639. width: 100%;
  640. position: absolute;
  641. cursor: pointer;
  642. top: 0;
  643. left: 0;
  644. right: 0;
  645. bottom: 0;
  646. background-color: #ccc;
  647. transition: 0.2s;
  648. border-radius: 34px;
  649. }
  650. .slider:before {
  651. position: absolute;
  652. content: "";
  653. height: 16px;
  654. width: 16px;
  655. left: 4px;
  656. bottom: 4px;
  657. background-color: white;
  658. transition: 0.2s;
  659. border-radius: 50%;
  660. }
  661. input:checked + .slider {
  662. background-color: var(--primary-color);
  663. }
  664. input:focus + .slider {
  665. box-shadow: 0 0 1px var(--primary-color);
  666. }
  667. input:checked + .slider:before {
  668. transform: translateX(16px);
  669. }
  670. }
  671. &:focus {
  672. outline-color: var(--light-grey-3);
  673. }
  674. &:not(:last-of-type) {
  675. margin-bottom: 5px;
  676. }
  677. }
  678. }
  679. .tippy-content > span {
  680. display: flex;
  681. flex-direction: column;
  682. button {
  683. width: 100%;
  684. &:not(:last-of-type) {
  685. margin-bottom: 10px;
  686. }
  687. }
  688. }
  689. }
  690. .select {
  691. &:after {
  692. border-color: var(--primary-color);
  693. border-width: 1.5px;
  694. margin-top: -3px;
  695. }
  696. select {
  697. height: 36px;
  698. }
  699. }
  700. .button:focus,
  701. .button:active {
  702. border-color: var(--light-grey-2) !important;
  703. }
  704. .input:focus,
  705. .input:active,
  706. .textarea:focus,
  707. .textarea:active,
  708. .select select:focus,
  709. .select select:active {
  710. border-color: var(--primary-color) !important;
  711. }
  712. button.delete:focus {
  713. background-color: rgba(10, 10, 10, 0.3);
  714. }
  715. .tag {
  716. padding-right: 6px !important;
  717. }
  718. .button {
  719. &:hover,
  720. &:focus {
  721. filter: brightness(95%);
  722. }
  723. &.is-success {
  724. background-color: var(--green) !important;
  725. }
  726. &.is-primary {
  727. background-color: var(--primary-color) !important;
  728. }
  729. &.is-danger {
  730. background-color: var(--red) !important;
  731. }
  732. &.is-info {
  733. background-color: var(--primary-color) !important;
  734. }
  735. &.is-warning {
  736. background-color: var(--yellow) !important;
  737. }
  738. }
  739. .input,
  740. .button {
  741. height: 36px;
  742. }
  743. .fadein-helpbox-enter-active {
  744. transition-duration: 0.3s;
  745. transition-timing-function: ease-in;
  746. }
  747. .fadein-helpbox-leave-active {
  748. transition-duration: 0.3s;
  749. transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
  750. }
  751. .fadein-helpbox-enter-to,
  752. .fadein-helpbox-leave {
  753. max-height: 100px;
  754. overflow: hidden;
  755. }
  756. .fadein-helpbox-enter,
  757. .fadein-helpbox-leave-to {
  758. overflow: hidden;
  759. max-height: 0;
  760. }
  761. .control {
  762. margin-bottom: 5px !important;
  763. }
  764. .input-with-button {
  765. .control {
  766. margin-right: 0px !important;
  767. }
  768. input,
  769. select {
  770. width: 100%;
  771. height: 36px;
  772. border-radius: 3px 0 0 3px;
  773. border-right: 0;
  774. border-color: var(--light-grey-3);
  775. }
  776. .button {
  777. height: 36px;
  778. border-radius: 0 3px 3px 0;
  779. }
  780. }
  781. .page-title {
  782. margin: 0 0 50px 0;
  783. }
  784. .material-icons {
  785. user-select: none;
  786. -webkit-user-select: none;
  787. }
  788. .icon-with-button {
  789. margin-right: 3px;
  790. font-size: 18px;
  791. }
  792. .verified-song {
  793. font-size: 17px;
  794. color: var(--primary-color);
  795. }
  796. .section-title,
  797. h4.section-title {
  798. font-size: 26px;
  799. font-weight: 600;
  800. margin: 0px;
  801. }
  802. .section-description {
  803. font-size: 16px;
  804. font-weight: 400;
  805. margin-bottom: 10px !important;
  806. }
  807. .section-horizontal-rule {
  808. margin: 15px 0 30px 0;
  809. }
  810. .section-margin-bottom {
  811. height: 30px;
  812. }
  813. .margin-top-zero {
  814. margin-top: 0 !important;
  815. }
  816. .margin-bottom-zero {
  817. margin-bottom: 0 !important;
  818. }
  819. /** Universial items e.g. playlist items, queue items, activity items */
  820. .item-draggable {
  821. cursor: move;
  822. }
  823. .universal-item {
  824. display: flex;
  825. flex-direction: row;
  826. flex-grow: 1;
  827. align-items: center;
  828. justify-content: space-between;
  829. padding: 7.5px;
  830. border: 1px solid var(--light-grey-3);
  831. border-radius: 3px;
  832. overflow: hidden;
  833. .item-thumbnail {
  834. width: 65px;
  835. height: 65px;
  836. margin: -7.5px;
  837. border-radius: 3px 0 0 3px;
  838. }
  839. .item-title {
  840. font-size: 20px;
  841. overflow: hidden;
  842. text-overflow: ellipsis;
  843. white-space: nowrap;
  844. }
  845. .item-description {
  846. font-size: 14px;
  847. overflow: hidden;
  848. text-overflow: ellipsis;
  849. white-space: nowrap;
  850. }
  851. .universal-item-actions {
  852. display: flex;
  853. flex-direction: row;
  854. margin-left: 10px;
  855. justify-content: center;
  856. @media screen and (max-width: 800px) {
  857. flex-wrap: wrap;
  858. }
  859. .action-dropdown-icon {
  860. display: flex;
  861. color: var(--primary-color);
  862. }
  863. .icons-group {
  864. display: flex;
  865. align-items: center;
  866. a {
  867. padding: 0;
  868. }
  869. }
  870. .button {
  871. width: 146px;
  872. }
  873. i,
  874. span {
  875. cursor: pointer;
  876. // color: var(--dark-grey);
  877. &:not(:first-child) {
  878. margin-left: 5px;
  879. }
  880. }
  881. .play-icon,
  882. .added-to-playlist-icon {
  883. color: var(--green);
  884. }
  885. .edit-icon,
  886. .view-icon,
  887. .add-to-playlist-icon,
  888. .add-to-queue-icon {
  889. color: var(--primary-color);
  890. }
  891. .hide-icon {
  892. color: var(--light-grey-3);
  893. }
  894. .stop-icon,
  895. .delete-icon {
  896. color: var(--red);
  897. }
  898. .report-icon {
  899. color: var(--yellow);
  900. }
  901. }
  902. }
  903. .save-button-mixin {
  904. min-width: 200px;
  905. &:disabled {
  906. background-color: var(--light-grey) !important;
  907. color: var(--black);
  908. }
  909. }
  910. .save-button-transition-enter-active {
  911. transition: all 0.1s ease;
  912. }
  913. .save-button-transition-enter {
  914. transform: translateX(20px);
  915. opacity: 0;
  916. }
  917. .youtube-icon {
  918. margin-right: 3px;
  919. height: 20px;
  920. width: 20px;
  921. -webkit-mask: url("/assets/social/youtube.svg") no-repeat center;
  922. mask: url("/assets/social/youtube.svg") no-repeat center;
  923. background-color: var(--youtube);
  924. }
  925. #forgot-password {
  926. display: flex;
  927. justify-content: flex-start;
  928. margin: 5px 0;
  929. }
  930. .steps-fade-enter-active,
  931. .steps-fade-leave-active {
  932. transition: all 0.3s ease;
  933. }
  934. .steps-fade-enter-from,
  935. .steps-fade-leave-to {
  936. opacity: 0;
  937. }
  938. .skip-step {
  939. background-color: var(--grey-3);
  940. color: var(--white);
  941. }
  942. #steps {
  943. display: flex;
  944. align-items: center;
  945. justify-content: center;
  946. height: 50px;
  947. margin-top: 36px;
  948. @media screen and (max-width: 300px) {
  949. display: none;
  950. }
  951. .step {
  952. display: flex;
  953. align-items: center;
  954. justify-content: center;
  955. border-radius: 100%;
  956. border: 1px solid var(--dark-grey);
  957. min-width: 50px;
  958. min-height: 50px;
  959. background-color: var(--white);
  960. font-size: 30px;
  961. user-select: none;
  962. &.selected {
  963. background-color: var(--primary-color);
  964. color: var(--white) !important;
  965. border: 0;
  966. }
  967. }
  968. .divider {
  969. display: flex;
  970. justify-content: center;
  971. width: 180px;
  972. height: 1px;
  973. background-color: var(--dark-grey);
  974. }
  975. }
  976. /* This class is used for content-box in ResetPassword, but not in RemoveAccount. This is because ResetPassword uses transitions and RemoveAccount does not */
  977. .content-box-wrapper {
  978. position: relative;
  979. width: 100%;
  980. display: flex;
  981. flex-direction: column;
  982. align-items: center;
  983. min-height: 200px;
  984. .content-box {
  985. position: absolute;
  986. }
  987. }
  988. .content-box {
  989. margin-top: 90px;
  990. border-radius: 3px;
  991. background-color: var(--white);
  992. border: 1px solid var(--dark-grey);
  993. max-width: 580px;
  994. padding: 40px;
  995. @media screen and (max-width: 300px) {
  996. margin-top: 30px;
  997. padding: 30px 20px;
  998. }
  999. }
  1000. .content-box-optional-helper {
  1001. margin-top: 15px;
  1002. color: var(--primary-color);
  1003. text-decoration: underline;
  1004. font-size: 16px;
  1005. a {
  1006. color: var(--primary-color);
  1007. }
  1008. }
  1009. .content-box-title {
  1010. font-size: 25px;
  1011. color: var(--black);
  1012. }
  1013. .content-box-description {
  1014. font-size: 14px;
  1015. color: var(--dark-grey);
  1016. }
  1017. .content-box-inputs {
  1018. margin-top: 35px;
  1019. .input-with-button {
  1020. .button {
  1021. width: 105px;
  1022. }
  1023. @media screen and (max-width: 450px) {
  1024. flex-direction: column;
  1025. }
  1026. }
  1027. label {
  1028. font-size: 11px;
  1029. }
  1030. #change-password-button {
  1031. margin-top: 36px;
  1032. width: 175px;
  1033. }
  1034. }
  1035. #password-visibility-container {
  1036. display: flex;
  1037. align-items: center;
  1038. a {
  1039. width: 0;
  1040. margin-left: -30px;
  1041. z-index: 0;
  1042. top: 2px;
  1043. position: relative;
  1044. color: var(--light-grey-1);
  1045. }
  1046. }
  1047. .news-item {
  1048. font-family: "Karla";
  1049. border-radius: 5px;
  1050. padding: 20px;
  1051. border: unset !important;
  1052. box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1);
  1053. * {
  1054. font-family: Karla, Arial, sans-serif;
  1055. font-size: 16px;
  1056. }
  1057. h1 {
  1058. font-size: 40px;
  1059. &:first-of-type {
  1060. margin-top: 0;
  1061. }
  1062. }
  1063. h2 {
  1064. font-size: 30px;
  1065. }
  1066. h3 {
  1067. font-size: 25px;
  1068. }
  1069. h4,
  1070. h5,
  1071. h6 {
  1072. font-size: 20px;
  1073. }
  1074. h1,
  1075. h2,
  1076. h3,
  1077. h4,
  1078. h5,
  1079. h6 {
  1080. margin: 10px 0;
  1081. }
  1082. ul {
  1083. list-style: unset;
  1084. }
  1085. li {
  1086. margin-left: 30px;
  1087. }
  1088. blockquote {
  1089. padding: 0px 15px;
  1090. color: #6a737d;
  1091. border-left: 0.25em solid #dfe2e5;
  1092. }
  1093. code {
  1094. font-style: italic;
  1095. }
  1096. }
  1097. .checkbox-control {
  1098. display: flex;
  1099. flex-direction: row;
  1100. align-items: center;
  1101. p {
  1102. margin-left: 10px;
  1103. }
  1104. .switch {
  1105. position: relative;
  1106. display: inline-block;
  1107. flex-shrink: 0;
  1108. width: 40px;
  1109. height: 24px;
  1110. }
  1111. .switch input {
  1112. opacity: 0;
  1113. width: 0;
  1114. height: 0;
  1115. }
  1116. .slider {
  1117. position: absolute;
  1118. cursor: pointer;
  1119. top: 0;
  1120. left: 0;
  1121. right: 0;
  1122. bottom: 0;
  1123. background-color: #ccc;
  1124. transition: 0.2s;
  1125. border-radius: 34px;
  1126. }
  1127. .slider:before {
  1128. position: absolute;
  1129. content: "";
  1130. height: 16px;
  1131. width: 16px;
  1132. left: 4px;
  1133. bottom: 4px;
  1134. background-color: white;
  1135. transition: 0.2s;
  1136. border-radius: 50%;
  1137. }
  1138. input:checked + .slider {
  1139. background-color: var(--primary-color);
  1140. }
  1141. input:focus + .slider {
  1142. box-shadow: 0 0 1px var(--primary-color);
  1143. }
  1144. input:checked + .slider:before {
  1145. transform: translateX(16px);
  1146. }
  1147. }
  1148. </style>