diff --git a/apps/static/src/assets/preloader.css b/apps/static/src/assets/preloader.css index 9ea72991c..7abb6fa99 100644 --- a/apps/static/src/assets/preloader.css +++ b/apps/static/src/assets/preloader.css @@ -21,75 +21,75 @@ display: flex; flex-wrap: wrap; } -.loader-item:nth-child(0) { +.pre-loader .loader-item:nth-child(0) { animation-delay: 0ms; animation-direction: reverse; } -.loader-item:first-child { - animation-delay: -0.2s; +.pre-loader .loader-item:first-child { + animation-delay: -50ms; animation-direction: alternate; } -.loader-item:nth-child(2) { +.pre-loader .loader-item:nth-child(2) { + animation-delay: 0.2s; + animation-direction: reverse; +} +.pre-loader .loader-item:nth-child(3) { + animation-delay: -0.6s; + animation-direction: alternate; +} +.pre-loader .loader-item:nth-child(4) { animation-delay: 0.4s; animation-direction: reverse; } -.loader-item:nth-child(3) { - animation-delay: -0.15s; +.pre-loader .loader-item:nth-child(5) { + animation-delay: -0.5s; animation-direction: alternate; } -.loader-item:nth-child(4) { - animation-delay: 0.6s; - animation-direction: reverse; -} -.loader-item:nth-child(5) { - animation-delay: -1s; - animation-direction: alternate; -} -.loader-item:nth-child(6) { +.pre-loader .loader-item:nth-child(6) { animation-delay: 0.3s; animation-direction: reverse; } -.loader-item:nth-child(7) { - animation-delay: -0.35s; +.pre-loader .loader-item:nth-child(7) { + animation-delay: -1.4s; animation-direction: alternate; } -.loader-item:nth-child(8) { +.pre-loader .loader-item:nth-child(8) { animation-delay: 2s; animation-direction: reverse; } -.loader-item:nth-child(9) { - animation-delay: -0.45s; +.pre-loader .loader-item:nth-child(9) { + animation-delay: -0.9s; animation-direction: alternate; } -.loader-item:nth-child(10) { - animation-delay: 2s; +.pre-loader .loader-item:nth-child(10) { + animation-delay: 1.5s; animation-direction: reverse; } -.loader-item:nth-child(11) { +.pre-loader .loader-item:nth-child(11) { animation-delay: -0.55s; animation-direction: alternate; } -.loader-item:nth-child(12) { +.pre-loader .loader-item:nth-child(12) { animation-delay: 1.2s; animation-direction: reverse; } -.loader-item:nth-child(13) { - animation-delay: -2.6s; +.pre-loader .loader-item:nth-child(13) { + animation-delay: -0.65s; animation-direction: alternate; } -.loader-item:nth-child(14) { - animation-delay: 2.8s; +.pre-loader .loader-item:nth-child(14) { + animation-delay: 0.7s; animation-direction: reverse; } -.loader-item:nth-child(15) { - animation-delay: -3s; +.pre-loader .loader-item:nth-child(15) { + animation-delay: -3.75s; animation-direction: alternate; } -.loader-item:nth-child(16) { +.pre-loader .loader-item:nth-child(16) { animation-delay: 1.6s; animation-direction: reverse; } -.loader-item { +.pre-loader .loader-item { animation: flickering 0.4s linear infinite alternate; } @keyframes flickering { @@ -106,3 +106,6 @@ opacity: 0; } } +html.dark .pre-loader .loader-item { + background: #fff; +} diff --git a/apps/static/src/assets/theme-setter.js b/apps/static/src/assets/theme-setter.js new file mode 100644 index 000000000..0fc7ae061 --- /dev/null +++ b/apps/static/src/assets/theme-setter.js @@ -0,0 +1,9 @@ +(function () { + var storedTheme = window.localStorage.getItem('theme'); + if ( + storedTheme === 'dark' || + (!storedTheme && window.matchMedia('(prefers-color-scheme: dark)').matches) + ) { + document.documentElement.classList.add('dark'); + } +})(); diff --git a/apps/trading/components/preloader/preloader.tsx b/apps/trading/components/preloader/preloader.tsx index a973d590b..f5d366057 100644 --- a/apps/trading/components/preloader/preloader.tsx +++ b/apps/trading/components/preloader/preloader.tsx @@ -9,11 +9,15 @@ export const Preloader = () => { display: block; width: 100%; height: 100%; + margin: 0; } + html.dark body{ + background: #000; + } `}
- +
); diff --git a/apps/trading/pages/_app.page.tsx b/apps/trading/pages/_app.page.tsx index f7a58f46e..d2a2f7c37 100644 --- a/apps/trading/pages/_app.page.tsx +++ b/apps/trading/pages/_app.page.tsx @@ -22,7 +22,6 @@ import { useInitializeEnv, } from '@vegaprotocol/environment'; import './styles.css'; -import './gen-styles.scss'; import { useGlobalStore, usePageTitleStore } from '../stores'; import { Footer } from '../components/footer'; import { useMemo, useState } from 'react'; diff --git a/apps/trading/pages/_document.page.tsx b/apps/trading/pages/_document.page.tsx index 2cd2bd8ba..8d42dcc68 100644 --- a/apps/trading/pages/_document.page.tsx +++ b/apps/trading/pages/_document.page.tsx @@ -19,12 +19,13 @@ export default function Document() { type="image/x-icon" href="https://static.vega.xyz/favicon.ico" /> +