2022-06-23 14:07:04 +08:00
|
|
|
<section id="d-splash">
|
|
|
|
<style>
|
|
|
|
html {
|
2022-06-25 12:59:16 +08:00
|
|
|
overflow-y: hidden !important;
|
2022-07-25 18:02:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* user picked a theme where the "regular" scheme is dark */
|
|
|
|
<%- if dark_color_scheme? %>
|
|
|
|
html {
|
|
|
|
background-color: #<%= ColorScheme.hex_for_name("secondary", scheme_id) %>;
|
|
|
|
}
|
|
|
|
|
2024-12-30 19:31:08 +08:00
|
|
|
#d-splash {
|
|
|
|
--dot-color: #<%= ColorScheme.hex_for_name("tertiary", scheme_id) %>;
|
2022-07-25 18:02:21 +08:00
|
|
|
}
|
2024-12-30 19:31:08 +08:00
|
|
|
<%- else %>
|
|
|
|
/* user picked a theme a light scheme and also enabled a dark scheme */
|
2022-07-25 18:02:21 +08:00
|
|
|
|
2024-12-30 19:31:08 +08:00
|
|
|
/* deal with light scheme first */
|
|
|
|
@media (prefers-color-scheme: light) {
|
|
|
|
html {
|
|
|
|
background-color: #<%= ColorScheme.hex_for_name("secondary", scheme_id) %>;
|
|
|
|
}
|
|
|
|
|
|
|
|
#d-splash {
|
|
|
|
--dot-color: #<%= ColorScheme.hex_for_name("tertiary", scheme_id) %>;
|
|
|
|
}
|
2022-07-25 18:02:21 +08:00
|
|
|
}
|
|
|
|
|
2024-12-30 19:31:08 +08:00
|
|
|
/* then deal with dark scheme */
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
|
html {
|
|
|
|
background-color: #<%= ColorScheme.hex_for_name("secondary", dark_scheme_id) %>;
|
|
|
|
}
|
|
|
|
|
|
|
|
#d-splash {
|
|
|
|
--dot-color: #<%= ColorScheme.hex_for_name("tertiary", dark_scheme_id) %>;
|
|
|
|
}
|
2022-07-25 18:02:21 +08:00
|
|
|
}
|
|
|
|
<%- end %>
|
|
|
|
|
2022-06-23 14:07:04 +08:00
|
|
|
#d-splash {
|
|
|
|
display: grid;
|
|
|
|
place-items: center;
|
2022-06-25 12:59:16 +08:00
|
|
|
position: absolute;
|
2022-07-06 06:33:09 +08:00
|
|
|
left: 0;
|
|
|
|
top: 0;
|
2024-12-30 19:31:08 +08:00
|
|
|
width: 100vw;
|
2022-06-30 21:22:00 +08:00
|
|
|
z-index: 1001;
|
2022-06-23 14:07:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#d-splash .preloader-image {
|
2024-12-30 19:31:08 +08:00
|
|
|
--splash-dot-size: max(1vw, 25px);
|
|
|
|
--splash-dot-spacing: calc(var(--splash-dot-size) * 1.5);
|
|
|
|
width: calc((var(--splash-dot-size) + var(--splash-dot-spacing)) * 5);
|
2022-06-23 14:07:04 +08:00
|
|
|
height: 100vh;
|
2024-12-30 19:31:08 +08:00
|
|
|
background-size: cover;
|
2022-06-23 14:07:04 +08:00
|
|
|
}
|
|
|
|
|
2024-12-30 19:31:08 +08:00
|
|
|
@keyframes d-splash-fade-in {
|
2022-06-23 14:07:04 +08:00
|
|
|
0% {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-12-30 19:31:08 +08:00
|
|
|
.dots {
|
|
|
|
animation-name: d-splash-loader;
|
|
|
|
animation-timing-function: ease-in-out;
|
|
|
|
animation-duration: 3s;
|
|
|
|
animation-iteration-count: infinite;
|
|
|
|
animation-delay: calc(var(--n) * 0.15s);
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
top: calc(50% - var(--splash-dot-size) / 2);
|
|
|
|
left: calc((50% - var(--splash-dot-size) / 2) + (var(--n) * var(--splash-dot-spacing)));
|
|
|
|
transform-origin: calc((var(--splash-dot-spacing) * var(--n) * -1) + var(--splash-dot-size)/2) center;
|
|
|
|
|
|
|
|
width: var(--splash-dot-size);
|
|
|
|
height: var(--splash-dot-size);
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
|
|
border: 0.5px solid #fff;
|
|
|
|
background-color: var(--dot-color);
|
|
|
|
filter: saturate(2) opacity(0.85);
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes d-splash-loader {
|
2022-06-23 14:07:04 +08:00
|
|
|
0% {
|
2024-12-30 19:31:08 +08:00
|
|
|
opacity: 0;
|
|
|
|
transform: scale(1);
|
2022-06-23 14:07:04 +08:00
|
|
|
}
|
2024-12-30 19:31:08 +08:00
|
|
|
45% {
|
|
|
|
opacity: 1;
|
|
|
|
transform: scale(0.7);
|
2022-06-23 14:07:04 +08:00
|
|
|
}
|
2024-12-30 19:31:08 +08:00
|
|
|
65% {
|
|
|
|
opacity: 1;
|
|
|
|
transform: scale(0.7);
|
2022-06-23 14:07:04 +08:00
|
|
|
}
|
2024-12-30 19:31:08 +08:00
|
|
|
100% {
|
|
|
|
opacity: 0;
|
|
|
|
transform: scale(1);
|
2022-06-23 14:07:04 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2024-12-30 19:31:08 +08:00
|
|
|
<div class="preloader-image" elementtiming="discourse-splash-visible">
|
|
|
|
<div class="dots" style="--n:-2;"></div>
|
|
|
|
<div class="dots" style="--n:-1;"></div>
|
|
|
|
<div class="dots" style="--n:0;"></div>
|
|
|
|
<div class="dots" style="--n:1;"></div>
|
|
|
|
<div class="dots" style="--n:2;"></div>
|
2022-06-23 14:07:04 +08:00
|
|
|
</div>
|
2024-12-30 19:31:08 +08:00
|
|
|
<script nonce="<%= csp_nonce_placeholder %>">
|
|
|
|
const svg = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"><!-- LCP candidate image ${".".repeat(5000)} --></svg>`;
|
|
|
|
document.querySelector("#d-splash .preloader-image").style.backgroundImage = `url('data:image/svg+xml,${svg}')`
|
|
|
|
</script>
|
2022-06-24 17:38:42 +08:00
|
|
|
|
|
|
|
<noscript>
|
|
|
|
<style>
|
|
|
|
html {
|
2022-06-25 12:59:16 +08:00
|
|
|
overflow-y: revert !important;
|
2022-06-24 17:38:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#d-splash {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</noscript>
|
2022-06-23 14:07:04 +08:00
|
|
|
</section>
|