App.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737
  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. hr {
  550. background-color: #dbdbdb;
  551. border: none;
  552. height: 1px;
  553. }
  554. p,
  555. button,
  556. input,
  557. select,
  558. textarea {
  559. font-family: "Inter", Helvetica, Arial, sans-serif;
  560. }
  561. input,
  562. select,
  563. textarea {
  564. outline: none;
  565. }
  566. .label {
  567. display: flex;
  568. font-weight: 700;
  569. &:not(:last-child) {
  570. margin-bottom: 5px;
  571. }
  572. }
  573. #page-title {
  574. margin-top: 0;
  575. font-size: 35px;
  576. text-align: center;
  577. }
  578. @media only screen and (min-width: 700px) {
  579. #page-title {
  580. margin: 0;
  581. margin-bottom: 30px;
  582. font-size: 40px;
  583. }
  584. }
  585. @media screen and (min-width: 980px) {
  586. .container {
  587. max-width: 960px;
  588. margin-left: auto;
  589. margin-right: auto;
  590. }
  591. }
  592. @media screen and (min-width: 1180px) {
  593. .container {
  594. max-width: 1200px;
  595. }
  596. }
  597. .upper-container {
  598. height: 100%;
  599. }
  600. .main-container {
  601. height: 100%;
  602. min-height: 100vh;
  603. display: flex;
  604. flex-direction: column;
  605. &.main-container-modal-active {
  606. height: 100% !important;
  607. overflow: hidden !important;
  608. }
  609. > .container {
  610. position: relative;
  611. flex: 1 0 auto;
  612. margin: 0 auto;
  613. max-width: 1200px;
  614. }
  615. }
  616. a {
  617. color: var(--primary-color);
  618. text-decoration: none;
  619. }
  620. table {
  621. border-collapse: collapse;
  622. width: 100%;
  623. thead {
  624. td {
  625. border-width: 0 0 2px;
  626. }
  627. }
  628. td {
  629. border: 1px solid #dbdbdb;
  630. border-width: 0 0 1px;
  631. padding: 8px 10px;
  632. }
  633. tbody {
  634. tr:last-child {
  635. td {
  636. border-bottom-width: 0;
  637. }
  638. }
  639. }
  640. }
  641. .absolute-a {
  642. width: 100%;
  643. height: 100%;
  644. position: absolute;
  645. top: 0;
  646. left: 0;
  647. }
  648. .alert {
  649. padding: 20px;
  650. color: var(--white);
  651. background-color: var(--red);
  652. position: fixed;
  653. top: 50px;
  654. right: 50px;
  655. font-size: 2em;
  656. border-radius: 5px;
  657. z-index: 10000000;
  658. }
  659. .night-mode {
  660. .tippy-box {
  661. border: 1px solid var(--light-grey-3);
  662. box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25),
  663. 0 10px 10px rgba(0, 0, 0, 0.22);
  664. background-color: var(--white);
  665. .tippy-content {
  666. color: var(--black);
  667. }
  668. &[data-theme~="songActions"],
  669. &[data-theme~="addToPlaylist"],
  670. &[data-theme~="stationSettings"] {
  671. background-color: var(--dark-grey-2);
  672. border: 0 !important;
  673. }
  674. &[data-theme~="songActions"] {
  675. background-color: var(--dark-grey-2);
  676. border: 0 !important;
  677. i,
  678. a {
  679. color: var(--white);
  680. }
  681. .youtube-icon {
  682. background-color: var(--white);
  683. }
  684. }
  685. &[data-theme~="addToPlaylist"] {
  686. background-color: var(--dark-grey-2);
  687. border: 0 !important;
  688. .nav-dropdown-items {
  689. .nav-item {
  690. background-color: var(--dark-grey);
  691. &:focus {
  692. outline-color: var(--dark-grey);
  693. }
  694. p {
  695. color: var(--white);
  696. }
  697. }
  698. }
  699. }
  700. }
  701. .tippy-box[data-placement^="top"] {
  702. &[data-theme~="songActions"],
  703. &[data-theme~="addToPlaylist"] {
  704. > .tippy-arrow::before {
  705. border-top-color: var(--dark-grey-2);
  706. }
  707. }
  708. }
  709. .tippy-box[data-placement^="bottom"] {
  710. &[data-theme~="songActions"],
  711. &[data-theme~="addToPlaylist"],
  712. &[data-theme~="stationSettings"] {
  713. > .tippy-arrow::before {
  714. border-bottom-color: var(--dark-grey-2);
  715. }
  716. }
  717. }
  718. .tippy-box[data-placement^="left"] {
  719. &[data-theme~="songActions"],
  720. &[data-theme~="addToPlaylist"] {
  721. > .tippy-arrow::before {
  722. border-left-color: var(--dark-grey-2);
  723. }
  724. }
  725. }
  726. .tippy-box[data-placement^="right"] {
  727. &[data-theme~="songActions"],
  728. &[data-theme~="addToPlaylist"] {
  729. > .tippy-arrow::before {
  730. border-right-color: var(--dark-grey-2);
  731. }
  732. }
  733. }
  734. }
  735. .tippy-box[data-theme~="info"] {
  736. font-size: 12px;
  737. letter-spacing: 1px;
  738. }
  739. .tippy-box[data-theme~="confirm"] {
  740. background-color: var(--red);
  741. border: 0;
  742. .tippy-content {
  743. padding: 0;
  744. }
  745. a {
  746. padding: 15px;
  747. line-height: 30px;
  748. color: var(--white);
  749. border-bottom: 0;
  750. font-size: 15px;
  751. font-weight: 600;
  752. &:hover,
  753. &:focus {
  754. filter: brightness(90%);
  755. }
  756. }
  757. }
  758. .tippy-box[data-theme~="songActions"] {
  759. font-size: 15px;
  760. padding: 5px 10px;
  761. border: 1px solid var(--light-grey-3);
  762. box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  763. background-color: var(--white);
  764. .button {
  765. width: 146px;
  766. }
  767. i,
  768. a {
  769. display: inline-block;
  770. cursor: pointer;
  771. color: var(--dark-grey);
  772. vertical-align: middle;
  773. &:hover,
  774. &:focus {
  775. filter: brightness(90%);
  776. }
  777. &:not(:first) {
  778. margin-left: 5px;
  779. }
  780. }
  781. .play-icon,
  782. .added-to-playlist-icon {
  783. color: var(--green);
  784. }
  785. .edit-icon,
  786. .view-icon,
  787. .add-to-playlist-icon,
  788. .add-to-queue-icon {
  789. color: var(--primary-color);
  790. }
  791. .hide-icon {
  792. color: var(--light-grey-3);
  793. }
  794. .stop-icon,
  795. .delete-icon {
  796. color: var(--red);
  797. }
  798. .report-icon {
  799. color: var(--yellow);
  800. }
  801. }
  802. .tippy-box[data-placement^="top"] {
  803. &[data-theme~="songActions"],
  804. &[data-theme~="addToPlaylist"] {
  805. > .tippy-arrow::before {
  806. border-top-color: var(--white);
  807. }
  808. }
  809. &[data-theme~="confirm"] > .tippy-arrow::before {
  810. border-top-color: var(--red);
  811. }
  812. }
  813. .tippy-box[data-placement^="bottom"] {
  814. &[data-theme~="songActions"],
  815. &[data-theme~="addToPlaylist"],
  816. &[data-theme~="stationSettings"] {
  817. > .tippy-arrow::before {
  818. border-bottom-color: var(--white);
  819. }
  820. }
  821. &[data-theme~="confirm"] > .tippy-arrow::before {
  822. border-bottom-color: var(--red);
  823. }
  824. }
  825. .tippy-box[data-placement^="left"] {
  826. &[data-theme~="songActions"],
  827. &[data-theme~="addToPlaylist"] {
  828. > .tippy-arrow::before {
  829. border-left-color: var(--white);
  830. }
  831. }
  832. &[data-theme~="confirm"] > .tippy-arrow::before {
  833. border-left-color: var(--red);
  834. }
  835. }
  836. .tippy-box[data-placement^="right"] {
  837. &[data-theme~="songActions"],
  838. &[data-theme~="addToPlaylist"] {
  839. > .tippy-arrow::before {
  840. border-right-color: var(--white);
  841. }
  842. }
  843. &[data-theme~="confirm"] > .tippy-arrow::before {
  844. border-right-color: var(--red);
  845. }
  846. }
  847. .tippy-box[data-theme~="stationSettings"] {
  848. border: 1px solid var(--light-grey-3);
  849. box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  850. background-color: var(--white);
  851. button:not(:last-of-type) {
  852. margin-bottom: 5px;
  853. }
  854. }
  855. .tippy-box[data-theme~="addToPlaylist"] {
  856. font-size: 15px;
  857. padding: 0;
  858. border: 1px solid var(--light-grey-3);
  859. box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  860. background-color: var(--white);
  861. color: var(--dark-grey);
  862. width: 350px;
  863. .tippy-content {
  864. padding: 0;
  865. }
  866. .nav-dropdown-items {
  867. max-height: 220px;
  868. overflow-y: auto;
  869. padding: 10px 10px 0 10px;
  870. .nav-item {
  871. width: 100%;
  872. justify-content: flex-start;
  873. border: 0;
  874. padding: 8px 4px;
  875. font-size: 15.5px;
  876. min-height: 36px;
  877. background: var(--light-grey);
  878. border-radius: 5px;
  879. cursor: pointer;
  880. .checkbox-control {
  881. display: flex;
  882. flex-direction: row;
  883. align-items: center;
  884. overflow-wrap: anywhere;
  885. margin: 0 !important;
  886. p {
  887. margin-left: 10px;
  888. }
  889. .switch {
  890. position: relative;
  891. display: inline-block;
  892. flex-shrink: 0;
  893. width: 40px;
  894. height: 24px;
  895. }
  896. .switch input {
  897. opacity: 0;
  898. width: 0;
  899. height: 0;
  900. }
  901. .slider {
  902. width: 100%;
  903. position: absolute;
  904. cursor: pointer;
  905. top: 0;
  906. left: 0;
  907. right: 0;
  908. bottom: 0;
  909. background-color: #ccc;
  910. transition: 0.2s;
  911. border-radius: 34px;
  912. }
  913. .slider:before {
  914. position: absolute;
  915. content: "";
  916. height: 16px;
  917. width: 16px;
  918. left: 4px;
  919. bottom: 4px;
  920. background-color: white;
  921. transition: 0.2s;
  922. border-radius: 50%;
  923. }
  924. input:checked + .slider {
  925. background-color: var(--primary-color);
  926. }
  927. input:focus + .slider {
  928. box-shadow: 0 0 1px var(--primary-color);
  929. }
  930. input:checked + .slider:before {
  931. transform: translateX(16px);
  932. }
  933. }
  934. &:focus {
  935. outline-color: var(--light-grey-3);
  936. }
  937. &:not(:last-of-type) {
  938. margin-bottom: 5px;
  939. }
  940. }
  941. }
  942. .tippy-content > span {
  943. display: flex;
  944. flex-direction: column;
  945. button.nav-item {
  946. &:not(:last-of-type) {
  947. margin-bottom: 10px;
  948. }
  949. }
  950. }
  951. #create-playlist {
  952. margin: 10px 10px 10px 10px;
  953. width: unset;
  954. }
  955. }
  956. .has-text-centered {
  957. text-align: center;
  958. }
  959. .select {
  960. position: relative;
  961. &:after {
  962. content: " ";
  963. border: 1.5px solid var(--primary-color);
  964. border-right: 0;
  965. border-top: 0;
  966. height: 7px;
  967. pointer-events: none;
  968. position: absolute;
  969. transform: rotate(-45deg);
  970. width: 7px;
  971. margin-top: -6px;
  972. right: 16px;
  973. top: 50%;
  974. }
  975. select {
  976. height: 36px;
  977. background-color: var(--white);
  978. border: 1px solid #dbdbdb;
  979. color: #363636;
  980. appearance: none;
  981. border-radius: 3px;
  982. font-size: 14px;
  983. line-height: 24px;
  984. padding-left: 8px;
  985. position: relative;
  986. padding-right: 36px;
  987. cursor: pointer;
  988. }
  989. }
  990. .button:focus,
  991. .button:active {
  992. border-color: var(--light-grey-2) !important;
  993. }
  994. .input:focus,
  995. .input:active,
  996. .textarea:focus,
  997. .textarea:active,
  998. .select select:focus,
  999. .select select:active {
  1000. border-color: var(--primary-color) !important;
  1001. }
  1002. button.delete:focus {
  1003. background-color: rgba(10, 10, 10, 0.3);
  1004. }
  1005. .tag {
  1006. padding-right: 6px !important;
  1007. }
  1008. .button {
  1009. border: 1px solid #dbdbdb;
  1010. border-radius: 3px;
  1011. line-height: 24px;
  1012. align-items: center;
  1013. display: inline-flex;
  1014. font-size: 14px;
  1015. padding-left: 10px;
  1016. padding-right: 10px;
  1017. justify-content: center;
  1018. cursor: pointer;
  1019. user-select: none;
  1020. &:hover,
  1021. &:focus {
  1022. filter: brightness(95%);
  1023. }
  1024. &.is-success {
  1025. background-color: var(--green) !important;
  1026. border-width: 0;
  1027. color: white;
  1028. }
  1029. &.is-primary {
  1030. background-color: var(--primary-color) !important;
  1031. border-width: 0;
  1032. color: white;
  1033. }
  1034. &.is-danger {
  1035. background-color: var(--red) !important;
  1036. border-width: 0;
  1037. color: white;
  1038. }
  1039. &.is-info {
  1040. background-color: var(--primary-color) !important;
  1041. border-width: 0;
  1042. color: white;
  1043. }
  1044. &.is-warning {
  1045. background-color: var(--yellow) !important;
  1046. border-width: 0;
  1047. color: white;
  1048. }
  1049. }
  1050. .input,
  1051. .textarea {
  1052. width: 100%;
  1053. padding-left: 8px;
  1054. padding-right: 8px;
  1055. line-height: 24px;
  1056. font-size: 14px;
  1057. border-radius: 3px;
  1058. box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1);
  1059. border: 1px solid #dbdbdb;
  1060. }
  1061. .input,
  1062. .button {
  1063. height: 36px;
  1064. }
  1065. .textarea {
  1066. display: block;
  1067. line-height: 1.2;
  1068. padding: 10px;
  1069. max-height: 600px;
  1070. min-height: 120px;
  1071. min-width: 100%;
  1072. resize: vertical;
  1073. }
  1074. .fadein-helpbox-enter-active {
  1075. transition-duration: 0.3s;
  1076. transition-timing-function: ease-in;
  1077. }
  1078. .fadein-helpbox-leave-active {
  1079. transition-duration: 0.3s;
  1080. transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
  1081. }
  1082. .fadein-helpbox-enter-to,
  1083. .fadein-helpbox-leave {
  1084. max-height: 100px;
  1085. overflow: hidden;
  1086. }
  1087. .fadein-helpbox-enter,
  1088. .fadein-helpbox-leave-to {
  1089. overflow: hidden;
  1090. max-height: 0;
  1091. }
  1092. .control {
  1093. margin-bottom: 5px !important;
  1094. &.is-grouped {
  1095. display: flex;
  1096. }
  1097. &.is-expanded {
  1098. flex: 1;
  1099. }
  1100. }
  1101. .input-with-button {
  1102. .control {
  1103. margin-right: 0px !important;
  1104. }
  1105. input,
  1106. select {
  1107. width: 100%;
  1108. height: 36px;
  1109. border-radius: 3px 0 0 3px;
  1110. border-right: 0;
  1111. border-color: var(--light-grey-3);
  1112. }
  1113. .button {
  1114. height: 36px;
  1115. border-radius: 0 3px 3px 0;
  1116. }
  1117. }
  1118. .page-title {
  1119. margin: 0 0 50px 0;
  1120. }
  1121. .material-icons {
  1122. user-select: none;
  1123. -webkit-user-select: none;
  1124. }
  1125. .icon-with-button {
  1126. margin-right: 3px;
  1127. font-size: 18px;
  1128. }
  1129. .verified-song {
  1130. font-size: 17px;
  1131. color: var(--primary-color);
  1132. }
  1133. .section-title,
  1134. h4.section-title {
  1135. font-size: 26px;
  1136. font-weight: 600;
  1137. margin: 0px;
  1138. }
  1139. .section-description {
  1140. font-size: 16px;
  1141. font-weight: 400;
  1142. margin-bottom: 10px !important;
  1143. }
  1144. .section-horizontal-rule {
  1145. margin: 15px 0 30px 0;
  1146. }
  1147. .section-margin-bottom {
  1148. height: 30px;
  1149. }
  1150. .margin-top-zero {
  1151. margin-top: 0 !important;
  1152. }
  1153. .margin-bottom-zero {
  1154. margin-bottom: 0 !important;
  1155. }
  1156. /** Universial items e.g. playlist items, queue items, activity items */
  1157. .item-draggable {
  1158. cursor: move;
  1159. }
  1160. .universal-item {
  1161. display: flex;
  1162. flex-direction: row;
  1163. flex-grow: 1;
  1164. align-items: center;
  1165. justify-content: space-between;
  1166. padding: 7.5px;
  1167. border: 1px solid var(--light-grey-3);
  1168. border-radius: 3px;
  1169. overflow: hidden;
  1170. .item-thumbnail {
  1171. width: 65px;
  1172. height: 65px;
  1173. margin: -7.5px;
  1174. border-radius: 3px 0 0 3px;
  1175. }
  1176. .item-title {
  1177. font-size: 20px;
  1178. overflow: hidden;
  1179. text-overflow: ellipsis;
  1180. white-space: nowrap;
  1181. }
  1182. .item-description {
  1183. font-size: 14px;
  1184. overflow: hidden;
  1185. text-overflow: ellipsis;
  1186. white-space: nowrap;
  1187. }
  1188. .universal-item-actions {
  1189. display: flex;
  1190. flex-direction: row;
  1191. margin-left: 10px;
  1192. justify-content: center;
  1193. @media screen and (max-width: 800px) {
  1194. flex-wrap: wrap;
  1195. }
  1196. .action-dropdown-icon {
  1197. display: flex;
  1198. color: var(--primary-color);
  1199. }
  1200. .icons-group {
  1201. display: flex;
  1202. align-items: center;
  1203. a {
  1204. padding: 0;
  1205. }
  1206. }
  1207. .button {
  1208. width: 146px;
  1209. }
  1210. i,
  1211. span {
  1212. cursor: pointer;
  1213. &:not(:first-child) {
  1214. margin-left: 5px;
  1215. }
  1216. }
  1217. .play-icon,
  1218. .added-to-playlist-icon {
  1219. color: var(--green);
  1220. }
  1221. .edit-icon,
  1222. .view-icon,
  1223. .add-to-playlist-icon,
  1224. .add-to-queue-icon {
  1225. color: var(--primary-color);
  1226. }
  1227. .hide-icon {
  1228. color: var(--light-grey-3);
  1229. }
  1230. .stop-icon,
  1231. .delete-icon {
  1232. color: var(--red);
  1233. }
  1234. .report-icon {
  1235. color: var(--yellow);
  1236. }
  1237. }
  1238. }
  1239. .save-button-mixin {
  1240. min-width: 200px;
  1241. &:disabled {
  1242. background-color: var(--light-grey) !important;
  1243. color: var(--black);
  1244. }
  1245. }
  1246. .save-button-transition-enter-active {
  1247. transition: all 0.1s ease;
  1248. }
  1249. .save-button-transition-enter {
  1250. transform: translateX(20px);
  1251. opacity: 0;
  1252. }
  1253. .youtube-icon {
  1254. margin-right: 3px;
  1255. height: 20px;
  1256. width: 20px;
  1257. -webkit-mask: url("/assets/social/youtube.svg") no-repeat center;
  1258. mask: url("/assets/social/youtube.svg") no-repeat center;
  1259. background-color: var(--youtube);
  1260. }
  1261. #forgot-password {
  1262. display: flex;
  1263. justify-content: flex-start;
  1264. margin: 5px 0;
  1265. }
  1266. .steps-fade-enter-active,
  1267. .steps-fade-leave-active {
  1268. transition: all 0.3s ease;
  1269. }
  1270. .steps-fade-enter-from,
  1271. .steps-fade-leave-to {
  1272. opacity: 0;
  1273. }
  1274. .skip-step {
  1275. background-color: var(--grey-3);
  1276. color: var(--white);
  1277. }
  1278. #steps {
  1279. display: flex;
  1280. align-items: center;
  1281. justify-content: center;
  1282. height: 50px;
  1283. margin-top: 36px;
  1284. @media screen and (max-width: 300px) {
  1285. display: none;
  1286. }
  1287. .step {
  1288. display: flex;
  1289. align-items: center;
  1290. justify-content: center;
  1291. border-radius: 100%;
  1292. border: 1px solid var(--dark-grey);
  1293. min-width: 50px;
  1294. min-height: 50px;
  1295. background-color: var(--white);
  1296. font-size: 30px;
  1297. user-select: none;
  1298. &.selected {
  1299. background-color: var(--primary-color);
  1300. color: var(--white) !important;
  1301. border: 0;
  1302. }
  1303. }
  1304. .divider {
  1305. display: flex;
  1306. justify-content: center;
  1307. width: 180px;
  1308. height: 1px;
  1309. background-color: var(--dark-grey);
  1310. }
  1311. }
  1312. /* This class is used for content-box in ResetPassword, but not in RemoveAccount. This is because ResetPassword uses transitions and RemoveAccount does not */
  1313. .content-box-wrapper {
  1314. position: relative;
  1315. width: 100%;
  1316. display: flex;
  1317. flex-direction: column;
  1318. align-items: center;
  1319. min-height: 200px;
  1320. .content-box {
  1321. position: absolute;
  1322. }
  1323. }
  1324. .content-box {
  1325. margin-top: 90px;
  1326. border-radius: 3px;
  1327. background-color: var(--white);
  1328. border: 1px solid var(--dark-grey);
  1329. max-width: 580px;
  1330. padding: 40px;
  1331. @media screen and (max-width: 300px) {
  1332. margin-top: 30px;
  1333. padding: 30px 20px;
  1334. }
  1335. }
  1336. .content-box-optional-helper {
  1337. margin-top: 15px;
  1338. color: var(--primary-color);
  1339. text-decoration: underline;
  1340. font-size: 16px;
  1341. a {
  1342. color: var(--primary-color);
  1343. }
  1344. }
  1345. .content-box-title {
  1346. font-size: 25px;
  1347. color: var(--black);
  1348. }
  1349. .content-box-description {
  1350. font-size: 14px;
  1351. color: var(--dark-grey);
  1352. }
  1353. .content-box-inputs {
  1354. margin-top: 35px;
  1355. .input-with-button {
  1356. .button {
  1357. width: 105px;
  1358. }
  1359. @media screen and (max-width: 450px) {
  1360. flex-direction: column;
  1361. }
  1362. }
  1363. label {
  1364. font-size: 11px;
  1365. }
  1366. #change-password-button {
  1367. margin-top: 36px;
  1368. width: 175px;
  1369. }
  1370. }
  1371. #password-visibility-container {
  1372. display: flex;
  1373. align-items: center;
  1374. a {
  1375. width: 0;
  1376. margin-left: -30px;
  1377. z-index: 0;
  1378. top: 2px;
  1379. position: relative;
  1380. color: var(--light-grey-1);
  1381. }
  1382. }
  1383. .news-item {
  1384. font-family: "Karla";
  1385. border-radius: 5px;
  1386. padding: 20px;
  1387. border: unset !important;
  1388. box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1);
  1389. * {
  1390. font-family: Karla, Arial, sans-serif;
  1391. font-size: 16px;
  1392. }
  1393. h1 {
  1394. font-size: 40px;
  1395. &:first-of-type {
  1396. margin-top: 0;
  1397. }
  1398. }
  1399. h2 {
  1400. font-size: 30px;
  1401. }
  1402. h3 {
  1403. font-size: 25px;
  1404. }
  1405. h4,
  1406. h5,
  1407. h6 {
  1408. font-size: 20px;
  1409. }
  1410. h1,
  1411. h2,
  1412. h3,
  1413. h4,
  1414. h5,
  1415. h6 {
  1416. margin: 10px 0;
  1417. }
  1418. ul {
  1419. list-style: unset;
  1420. }
  1421. li {
  1422. margin-left: 30px;
  1423. }
  1424. blockquote {
  1425. padding: 0px 15px;
  1426. color: #6a737d;
  1427. border-left: 0.25em solid #dfe2e5;
  1428. }
  1429. code {
  1430. font-style: italic;
  1431. }
  1432. }
  1433. .checkbox-control {
  1434. display: flex;
  1435. flex-direction: row;
  1436. align-items: center;
  1437. p {
  1438. margin-left: 10px;
  1439. }
  1440. .switch {
  1441. position: relative;
  1442. display: inline-block;
  1443. flex-shrink: 0;
  1444. width: 40px;
  1445. height: 24px;
  1446. }
  1447. .switch input {
  1448. opacity: 0;
  1449. width: 0;
  1450. height: 0;
  1451. }
  1452. .slider {
  1453. position: absolute;
  1454. cursor: pointer;
  1455. top: 0;
  1456. left: 0;
  1457. right: 0;
  1458. bottom: 0;
  1459. background-color: #ccc;
  1460. transition: 0.2s;
  1461. border-radius: 34px;
  1462. }
  1463. .slider:before {
  1464. position: absolute;
  1465. content: "";
  1466. height: 16px;
  1467. width: 16px;
  1468. left: 4px;
  1469. bottom: 4px;
  1470. background-color: white;
  1471. transition: 0.2s;
  1472. border-radius: 50%;
  1473. }
  1474. input:checked + .slider {
  1475. background-color: var(--primary-color);
  1476. }
  1477. input:focus + .slider {
  1478. box-shadow: 0 0 1px var(--primary-color);
  1479. }
  1480. input:checked + .slider:before {
  1481. transform: translateX(16px);
  1482. }
  1483. }
  1484. </style>