App.vue 23 KB

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