deploy: 1e10b0a49c
@@ -238,16 +238,15 @@
|
||||
}
|
||||
|
||||
.transition {
|
||||
transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter;
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter;
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms
|
||||
}
|
||||
|
||||
.hover\:underline:hover {
|
||||
-webkit-text-decoration-line: underline;
|
||||
text-decoration-line: underline
|
||||
text-decoration-line: underline
|
||||
}
|
||||
|
||||
.hover\:shadow-md:hover {
|
||||
|
||||
BIN
hero-phone-dark/fastImages/Darkphone1_0000.png
Executable file
|
After Width: | Height: | Size: 24 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0001.png
Executable file
|
After Width: | Height: | Size: 25 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0002.png
Executable file
|
After Width: | Height: | Size: 30 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0003.png
Executable file
|
After Width: | Height: | Size: 35 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0004.png
Executable file
|
After Width: | Height: | Size: 45 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0005.png
Executable file
|
After Width: | Height: | Size: 54 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0006.png
Executable file
|
After Width: | Height: | Size: 58 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0007.png
Executable file
|
After Width: | Height: | Size: 62 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0008.png
Executable file
|
After Width: | Height: | Size: 123 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0009.png
Executable file
|
After Width: | Height: | Size: 183 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0010.png
Executable file
|
After Width: | Height: | Size: 199 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0011.png
Executable file
|
After Width: | Height: | Size: 202 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0012.png
Executable file
|
After Width: | Height: | Size: 170 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0013.png
Executable file
|
After Width: | Height: | Size: 104 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0014.png
Executable file
|
After Width: | Height: | Size: 119 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0015.png
Executable file
|
After Width: | Height: | Size: 156 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0016.png
Executable file
|
After Width: | Height: | Size: 199 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0017.png
Executable file
|
After Width: | Height: | Size: 240 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0018.png
Executable file
|
After Width: | Height: | Size: 295 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0019.png
Executable file
|
After Width: | Height: | Size: 304 KiB |
BIN
hero-phone-dark/fastImages/Darkphone1_0020.png
Executable file
|
After Width: | Height: | Size: 303 KiB |
15
hero-phone-dark/index.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Page Title</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- <link rel="stylesheet" type="text/css" media="screen" href="./index.css"> -->
|
||||
<script src="./index.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<img id="hero-phone" />
|
||||
<div id="hero-phone-preload" style="display: none;"></div>
|
||||
</body>
|
||||
</html>
|
||||
69
hero-phone-dark/index.js
Normal file
@@ -0,0 +1,69 @@
|
||||
(function () {
|
||||
|
||||
const fastImages = mkSequence("./fastImages/Darkphone1_", 0, 20, ".png")
|
||||
const slowImages = mkSequence("./slowImages/Darkphone1_", 8, 38, ".png")
|
||||
|
||||
|
||||
let complete = false
|
||||
run()
|
||||
window.onload = run
|
||||
|
||||
function mkSequence(prefix, from, to, ext) {
|
||||
const seq = []
|
||||
for (let n = from; n <= to; n++) {
|
||||
let suffix = '' + n
|
||||
suffix = '0'.repeat(4 - suffix.length) + suffix
|
||||
seq.push(prefix + suffix + ext)
|
||||
}
|
||||
return seq
|
||||
}
|
||||
|
||||
async function run() {
|
||||
const imageEl = document.getElementById("hero-phone");
|
||||
const preloadEl = document.getElementById("hero-phone-preload");
|
||||
if (complete || !imageEl || !preloadEl) return
|
||||
complete = true
|
||||
await preload(fastImages.concat(slowImages))
|
||||
await animate(fastImages, 100)
|
||||
await animate(slowImages, 500)
|
||||
|
||||
async function preload(images) {
|
||||
let imgEls = []
|
||||
let resolved = false
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
if (!resolved) {
|
||||
resolved = true
|
||||
resolve()
|
||||
}
|
||||
}, 2000)
|
||||
for (const img of images) {
|
||||
const el = document.createElement("img");
|
||||
el.src = img
|
||||
imgEls.push(el)
|
||||
preloadEl.appendChild(el)
|
||||
const loaded = () => {
|
||||
imgEls = imgEls.filter((e) => e !== el)
|
||||
if (imgEls.length === 0 && !resolved) {
|
||||
resolved = true
|
||||
resolve()
|
||||
}
|
||||
}
|
||||
el.addEventListener('load', loaded)
|
||||
el.addEventListener('error', loaded)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async function animate(images, ms) {
|
||||
for (const img of images) {
|
||||
imageEl.src = img
|
||||
await delay(ms)
|
||||
}
|
||||
}
|
||||
|
||||
async function delay(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms))
|
||||
}
|
||||
}
|
||||
})();
|
||||
BIN
hero-phone-dark/slowImages/Darkphone1_0008.png
Executable file
|
After Width: | Height: | Size: 323 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0009.png
Executable file
|
After Width: | Height: | Size: 323 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0010.png
Executable file
|
After Width: | Height: | Size: 319 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0011.png
Executable file
|
After Width: | Height: | Size: 330 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0012.png
Executable file
|
After Width: | Height: | Size: 330 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0013.png
Executable file
|
After Width: | Height: | Size: 326 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0014.png
Executable file
|
After Width: | Height: | Size: 343 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0015.png
Executable file
|
After Width: | Height: | Size: 341 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0016.png
Executable file
|
After Width: | Height: | Size: 362 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0017.png
Executable file
|
After Width: | Height: | Size: 365 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0018.png
Executable file
|
After Width: | Height: | Size: 364 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0019.png
Executable file
|
After Width: | Height: | Size: 363 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0020.png
Executable file
|
After Width: | Height: | Size: 374 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0021.png
Executable file
|
After Width: | Height: | Size: 375 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0022.png
Executable file
|
After Width: | Height: | Size: 377 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0023.png
Executable file
|
After Width: | Height: | Size: 376 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0024.png
Executable file
|
After Width: | Height: | Size: 461 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0025.png
Executable file
|
After Width: | Height: | Size: 460 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0026.png
Executable file
|
After Width: | Height: | Size: 456 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0027.png
Executable file
|
After Width: | Height: | Size: 461 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0028.png
Executable file
|
After Width: | Height: | Size: 456 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0029.png
Executable file
|
After Width: | Height: | Size: 457 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0030.png
Executable file
|
After Width: | Height: | Size: 473 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0031.png
Executable file
|
After Width: | Height: | Size: 469 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0032.png
Executable file
|
After Width: | Height: | Size: 422 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0033.png
Executable file
|
After Width: | Height: | Size: 419 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0034.png
Executable file
|
After Width: | Height: | Size: 416 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0035.png
Executable file
|
After Width: | Height: | Size: 420 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0036.png
Executable file
|
After Width: | Height: | Size: 419 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0037.png
Executable file
|
After Width: | Height: | Size: 415 KiB |
BIN
hero-phone-dark/slowImages/Darkphone1_0038.png
Executable file
|
After Width: | Height: | Size: 431 KiB |
BIN
hero-phone/fastImages/Lightphone1_0000.png
Executable file
|
After Width: | Height: | Size: 25 KiB |
BIN
hero-phone/fastImages/Lightphone1_0001.png
Executable file
|
After Width: | Height: | Size: 27 KiB |
BIN
hero-phone/fastImages/Lightphone1_0002.png
Executable file
|
After Width: | Height: | Size: 32 KiB |
BIN
hero-phone/fastImages/Lightphone1_0003.png
Executable file
|
After Width: | Height: | Size: 40 KiB |
BIN
hero-phone/fastImages/Lightphone1_0004.png
Executable file
|
After Width: | Height: | Size: 52 KiB |
BIN
hero-phone/fastImages/Lightphone1_0005.png
Executable file
|
After Width: | Height: | Size: 60 KiB |
BIN
hero-phone/fastImages/Lightphone1_0006.png
Executable file
|
After Width: | Height: | Size: 60 KiB |
BIN
hero-phone/fastImages/Lightphone1_0007.png
Executable file
|
After Width: | Height: | Size: 62 KiB |
BIN
hero-phone/fastImages/Lightphone1_0008.png
Executable file
|
After Width: | Height: | Size: 123 KiB |
BIN
hero-phone/fastImages/Lightphone1_0009.png
Executable file
|
After Width: | Height: | Size: 184 KiB |
BIN
hero-phone/fastImages/Lightphone1_0010.png
Executable file
|
After Width: | Height: | Size: 199 KiB |
BIN
hero-phone/fastImages/Lightphone1_0011.png
Executable file
|
After Width: | Height: | Size: 202 KiB |
BIN
hero-phone/fastImages/Lightphone1_0012.png
Executable file
|
After Width: | Height: | Size: 172 KiB |
BIN
hero-phone/fastImages/Lightphone1_0013.png
Executable file
|
After Width: | Height: | Size: 109 KiB |
BIN
hero-phone/fastImages/Lightphone1_0014.png
Executable file
|
After Width: | Height: | Size: 154 KiB |
BIN
hero-phone/fastImages/Lightphone1_0015.png
Executable file
|
After Width: | Height: | Size: 244 KiB |
BIN
hero-phone/fastImages/Lightphone1_0016.png
Executable file
|
After Width: | Height: | Size: 337 KiB |
BIN
hero-phone/fastImages/Lightphone1_0017.png
Executable file
|
After Width: | Height: | Size: 417 KiB |
BIN
hero-phone/fastImages/Lightphone1_0018.png
Executable file
|
After Width: | Height: | Size: 442 KiB |
BIN
hero-phone/fastImages/Lightphone1_0019.png
Executable file
|
After Width: | Height: | Size: 454 KiB |
BIN
hero-phone/fastImages/Lightphone1_0020.png
Executable file
|
After Width: | Height: | Size: 448 KiB |
BIN
hero-phone/fastImages/Lightphone1_0021.png
Executable file
|
After Width: | Height: | Size: 444 KiB |
BIN
hero-phone/fastImages/Lightphone1_0022.png
Executable file
|
After Width: | Height: | Size: 446 KiB |
BIN
hero-phone/fastImages/Lightphone1_0023.png
Executable file
|
After Width: | Height: | Size: 449 KiB |
BIN
hero-phone/fastImages/Lightphone1_0024.png
Executable file
|
After Width: | Height: | Size: 442 KiB |
BIN
hero-phone/fastImages/Lightphone1_0025.png
Executable file
|
After Width: | Height: | Size: 448 KiB |
BIN
hero-phone/fastImages/Lightphone1_0026.png
Executable file
|
After Width: | Height: | Size: 452 KiB |
BIN
hero-phone/fastImages/Lightphone1_0027.png
Executable file
|
After Width: | Height: | Size: 446 KiB |
BIN
hero-phone/fastImages/Lightphone1_0028.png
Executable file
|
After Width: | Height: | Size: 452 KiB |
BIN
hero-phone/fastImages/Lightphone1_0029.png
Executable file
|
After Width: | Height: | Size: 448 KiB |
BIN
hero-phone/fastImages/Lightphone1_0030.png
Executable file
|
After Width: | Height: | Size: 460 KiB |
15
hero-phone/index.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Page Title</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- <link rel="stylesheet" type="text/css" media="screen" href="./index.css"> -->
|
||||
<script src="./index.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<img id="hero-phone" />
|
||||
<div id="hero-phone-preload" style="display: none;"></div>
|
||||
</body>
|
||||
</html>
|
||||
70
hero-phone/index.js
Normal file
@@ -0,0 +1,70 @@
|
||||
(function () {
|
||||
|
||||
const fastImages = mkSequence("./fastImages/Lightphone1_", 0, 30, ".png")
|
||||
const slowImages = mkSequence("./slowImages1/Lightphone1_", 8, 39, ".png")
|
||||
// const slowImages = mkSequence("./slowImages2/Lightphone1_", 8, 39, ".png")
|
||||
|
||||
|
||||
let complete = false
|
||||
run()
|
||||
window.onload = run
|
||||
|
||||
function mkSequence(prefix, from, to, ext) {
|
||||
const seq = []
|
||||
for (let n = from; n <= to; n++) {
|
||||
let suffix = '' + n
|
||||
suffix = '0'.repeat(4 - suffix.length) + suffix
|
||||
seq.push(prefix + suffix + ext)
|
||||
}
|
||||
return seq
|
||||
}
|
||||
|
||||
async function run() {
|
||||
const imageEl = document.getElementById("hero-phone");
|
||||
const preloadEl = document.getElementById("hero-phone-preload");
|
||||
if (complete || !imageEl || !preloadEl) return
|
||||
complete = true
|
||||
await preload(fastImages.concat(slowImages))
|
||||
await animate(fastImages, 100)
|
||||
await animate(slowImages, 500)
|
||||
|
||||
async function preload(images) {
|
||||
let imgEls = []
|
||||
let resolved = false
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
if (!resolved) {
|
||||
resolved = true
|
||||
resolve()
|
||||
}
|
||||
}, 2000)
|
||||
for (const img of images) {
|
||||
const el = document.createElement("img");
|
||||
el.src = img
|
||||
imgEls.push(el)
|
||||
preloadEl.appendChild(el)
|
||||
const loaded = () => {
|
||||
imgEls = imgEls.filter((e) => e !== el)
|
||||
if (imgEls.length === 0 && !resolved) {
|
||||
resolved = true
|
||||
resolve()
|
||||
}
|
||||
}
|
||||
el.addEventListener('load', loaded)
|
||||
el.addEventListener('error', loaded)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async function animate(images, ms) {
|
||||
for (const img of images) {
|
||||
imageEl.src = img
|
||||
await delay(ms)
|
||||
}
|
||||
}
|
||||
|
||||
async function delay(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms))
|
||||
}
|
||||
}
|
||||
})();
|
||||
BIN
hero-phone/slowImages1/Lightphone1_0008.jpg
Normal file
|
After Width: | Height: | Size: 85 KiB |
BIN
hero-phone/slowImages1/Lightphone1_0008.png
Executable file
|
After Width: | Height: | Size: 467 KiB |
BIN
hero-phone/slowImages1/Lightphone1_0009.jpg
Normal file
|
After Width: | Height: | Size: 85 KiB |
BIN
hero-phone/slowImages1/Lightphone1_0009.png
Executable file
|
After Width: | Height: | Size: 466 KiB |
BIN
hero-phone/slowImages1/Lightphone1_0010.jpg
Normal file
|
After Width: | Height: | Size: 83 KiB |
BIN
hero-phone/slowImages1/Lightphone1_0010.png
Executable file
|
After Width: | Height: | Size: 458 KiB |
BIN
hero-phone/slowImages1/Lightphone1_0011.jpg
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
hero-phone/slowImages1/Lightphone1_0011.png
Executable file
|
After Width: | Height: | Size: 465 KiB |
BIN
hero-phone/slowImages1/Lightphone1_0012.jpg
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
hero-phone/slowImages1/Lightphone1_0012.png
Executable file
|
After Width: | Height: | Size: 471 KiB |
BIN
hero-phone/slowImages1/Lightphone1_0013.jpg
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
hero-phone/slowImages1/Lightphone1_0013.png
Executable file
|
After Width: | Height: | Size: 469 KiB |