Nuxt/packages/ui-templates/templates/loading/index.html

164 lines
7.6 KiB
HTML
Raw Normal View History

2021-12-22 13:04:06 +00:00
<!DOCTYPE html>
<html>
<head>
<title>{{ messages.loading }} | {{ messages.appName }}</title>
<meta charset="utf-8"/>
2022-09-05 13:33:39 +00:00
<meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0" name="viewport"/>
2021-12-22 13:04:06 +00:00
<script type="module" src="/styles.ts"></script>
<style>
.spotlight {
filter: blur(20vh);
2022-03-31 07:38:13 +00:00
height: 50vh;
2021-12-22 13:04:06 +00:00
}
.spotlight-wrapper {
2022-03-31 07:38:13 +00:00
opacity: 0.5;
transition: opacity 0.4s ease-in;
2021-12-22 13:04:06 +00:00
}
.nuxt-loader-bar {
background: repeating-linear-gradient(to right, #0047E1 0%, #34CDFE 25%, #00DC82 50%, #36E4DA 75%, #0047E1 100%);
height: 100px;
background-size: 200% auto;
2022-03-30 23:04:28 +00:00
background-position: 0 0;
animation: gradient 2s infinite;
animation-fill-mode: forwards;
animation-timing-function: linear;
filter: blur(100px);
position: fixed;
bottom: -50px;
left: -50px;
right: -50px;
}
.mouse-gradient {
background: repeating-linear-gradient(to right, #0047E1 0%, #34CDFE 50%, #00DC82 100%);
filter: blur(100px);
opacity: 0.5;
}
@keyframes gradient {
2021-12-22 13:04:06 +00:00
0% {
background-position: 0 0;
2021-12-22 13:04:06 +00:00
}
100% {
background-position: -200% 0;
2021-12-22 13:04:06 +00:00
}
}
@keyframes width {
0% {
width: 100%;
}
50% {
2022-09-05 13:33:39 +00:00
width: 0;
}
100% {
width: 100%;
}
}
@media (prefers-color-scheme: dark) {
#nuxtImageDigit3 {
fill: #00DC82 !important;
}
.nuxt-loader-bar {
opacity: 0.5;
}
}
</style>
</head>
<body class="relative overflow-hidden min-h-screen bg-white dark:bg-black flex flex-col justify-center items-center text-center">
<div id="mouseLight" class="absolute top-0 rounded-full mouse-gradient transition-opacity h-[200px] w-[200px]"></div>
2022-03-31 07:38:13 +00:00
<a href="https://v3.nuxtjs.org" target="_blank" rel="noopener" class="nuxt-logo z-20">
2022-09-05 13:33:39 +00:00
<svg id="nuxtImg" viewBox="0 0 221 65" fill="none" xmlns="http://www.w3.org/2000/svg"
class="w-40 h-16 mb-4 text-black dark:text-white transition-opacity">
2022-09-05 13:33:39 +00:00
<g>
<path
d="M82.5623 18.5705H89.864L105.338 43.312V18.5705H112.079V53.6281H104.827L89.3025 28.938V53.6281H82.5623V18.5705ZM142.207 53.628H135.925V49.712C134.496 52.4679 131.586 54.0196 127.91 54.0196C122.088 54.0196 118.307 49.9127 118.307 44.0021V28.3847H124.589V42.7098C124.589 46.1656 126.735 48.569 129.951 48.569C133.475 48.569 135.925 45.8646 135.925 42.1591V28.3847H142.207V53.628ZM164.064 53.2289L158.038 44.8145L152.011 53.2289H145.321L154.617 40.0566L146.037 27.9857H152.88L158.038 35.2498L163.144 27.9857H170.039L161.407 40.0566L170.702 53.2289H164.064V53.2289ZM183.469 20.7726V28.3842H190.618V33.5435H183.469V46.0746C183.469 46.4954 183.639 46.8991 183.942 47.1969C184.245 47.4947 184.657 47.6623 185.086 47.663H190.618V53.6177H186.481C180.864 53.6177 177.188 50.4115 177.188 44.8068V33.5484H172.132V28.3842H175.304C176.783 28.3842 177.644 27.5203 177.644 26.091V20.7726H183.469Z"
2022-09-05 13:33:39 +00:00
fill="currentColor"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M30.1185 11.5456C28.2332 8.30393 23.5198 8.30392 21.6345 11.5456L1.08737 46.8747C-0.797952 50.1164 1.5587 54.1685 5.32936 54.1685H21.3695C19.7583 52.7604 19.1616 50.3244 20.3809 48.2344L35.9424 21.5594L30.1185 11.5456V11.5456Z"
2022-09-05 13:33:39 +00:00
fill="#80EEC0"/>
<path
d="M43.1374 19.2952C44.6977 16.6429 48.5984 16.6429 50.1586 19.2952L67.1631 48.2009C68.7234 50.8531 66.7731 54.1685 63.6525 54.1685H29.6435C26.5229 54.1685 24.5726 50.8531 26.1329 48.2009L43.1374 19.2952Z"
2022-09-05 13:33:39 +00:00
fill="#00DC82"/>
<path id="nuxtImageDigit3"
d="M198.483 53.8005H209.174C211.776 53.8005 213.961 53.3168 215.729 52.3494C217.531 51.382 218.898 50.0977 219.832 48.4965C220.766 46.8953 221.234 45.1272 221.234 43.1925C221.234 40.8907 220.616 38.9893 219.382 37.4882C218.148 35.9537 216.547 34.9863 214.578 34.586C216.18 34.1189 217.514 33.2183 218.582 31.8839C219.682 30.5162 220.233 28.8483 220.233 26.8802C220.233 25.1789 219.799 23.6277 218.932 22.2266C218.098 20.8256 216.847 19.7081 215.179 18.8741C213.544 18.0068 211.526 17.5731 209.124 17.5731C205.755 17.5731 203.003 18.5072 200.868 20.3752C198.767 22.2433 197.649 24.7952 197.516 28.031H203.77C203.87 26.63 204.371 25.4457 205.271 24.4783C206.206 23.5109 207.49 23.0272 209.124 23.0272C210.626 23.0272 211.793 23.4275 212.627 24.2282C213.494 24.9954 213.928 26.0295 213.928 27.3305C213.928 28.8983 213.361 30.0826 212.227 30.8832C211.093 31.6838 209.675 32.0841 207.974 32.0841H205.322V37.338H207.923C209.992 37.338 211.676 37.8217 212.977 38.7891C214.312 39.7232 214.979 41.1076 214.979 42.9423C214.979 44.5101 214.478 45.8111 213.478 46.8452C212.477 47.8793 210.992 47.7792 209.124 47.7792H198.483C198.55 50.3479 198.483 51.9491 198.483 53.8005Z"
2022-09-05 13:33:39 +00:00
fill="currentColor"/>
</g>
</svg>
</a>
<div class="spotlight-wrapper">
2022-03-31 07:38:13 +00:00
<div class="fixed left-0 right-0 spotlight spotlight-top z-10"></div>
</div>
<div class="spotlight-wrapper">
2022-03-31 07:38:13 +00:00
<div class="fixed left-0 right-0 spotlight spotlight-bottom z-q0"></div>
</div>
2022-09-05 13:33:39 +00:00
<div class="nuxt-loader-bar"></div>
<script>
2022-09-05 13:33:39 +00:00
const nuxtImg = window
.document
.getElementById('nuxtImg')
const body = window.document.body
2022-09-05 13:33:39 +00:00
const mouseLightContainer = window
.document
.getElementById('mouseLight')
let bodyRect
function calculateDistance(elem, mouseX, mouseY) {
2022-09-05 13:33:39 +00:00
return Math.floor(Math.sqrt(Math.pow(mouseX - (elem.x + (elem.width / 2)), 2) + Math.pow(mouseY - (elem.top + (elem.height / 2)), 2)));
}
const hide = () => {
mouseLight.style.opacity = 0
nuxtImg.style.opacity = 0
}
const mouseMove = (e) => {
const pointerRect = nuxtImg.getBoundingClientRect()
if (!bodyRect) {
bodyRect = body.getBoundingClientRect()
}
const distance = calculateDistance(pointerRect, e.pageX, e.pageY)
const size = Math.max((1000 - distance) / 2 / 100, 1)
mouseLight.style.top = `${e.clientY - bodyRect.y - mouseLight.clientHeight / 2}px`
mouseLight.style.left = `${e.clientX - mouseLight.clientWidth / 2}px`
mouseLight.style.width = mouseLight.style.height = `${Math.max(Math.round(size * 100), 300)}px`
mouseLight.style.filter = `blur(${Math.min(Math.max(size * 50, 100), 160)}px)`
mouseLight.style.opacity = Math.min(Math.max(size / 4, 0.6), 1)
const dx = e.pageX - pointerRect.left
const dy = e.pageY - pointerRect.top
const logoGradient = `radial-gradient(circle at ${dx}px ${dy}px, black 50%, transparent 100%)`
nuxtImg.style['-webkit-mask-image'] = logoGradient
nuxtImg.style['mask-image'] = logoGradient
nuxtImg.style.opacity = Math.min(Math.max(size / 4, 0.6), 1)
}
hide()
body.addEventListener('mousemove', mouseMove)
body.addEventListener('mouseleave', hide)
2022-09-05 13:33:39 +00:00
window.onunload = function () {
body.removeEventListener('mousemove', mouseMove);
body.removeEventListener('mouseleave', hide);
}
if (typeof window.fetch === 'undefined') {
setTimeout(() => window.location.reload(), 1000)
} else {
const check = async () => {
try {
const body = await window
.fetch(window.location.href)
.then(r => r.text())
if (!body.includes('__NUXT_LOADING__')) {
return window
.location
.reload()
}
} catch {}
setTimeout(check, 1000)
2021-12-22 13:04:06 +00:00
}
check()
2021-12-22 13:04:06 +00:00
}
</script>
2021-12-22 13:04:06 +00:00
</body>
</html>