Add randomize

This commit is contained in:
Hirame1 2022-01-09 00:14:23 +07:00 committed by Andrei Andreev
parent 5aa524cff8
commit 9b42a0796b
2 changed files with 25 additions and 8 deletions

View File

@ -1,11 +1,28 @@
Vue.component("blob-snow", {
methods: {
text() {
LEN = 23;
START = "\uE010";
START_HEX = START.codePointAt(0) || 65;
const BLOBS = [];
for (i = 0; i < LEN; i++) {
char = String.fromCharCode(START_HEX + i);
BLOBS.push(char);
}
return `${BLOBS[Math.floor(Math.random() * BLOBS.length)]}`;
}
},
template: `
<div class="snowflakes" aria-hidden="true">
<div class="snowflake"></div>
<div class="snowflake"></div>
<div class="snowflake"></div>
<div class="snowflake"></div>
<div class="snowflake"></div>
<div class="snowflake"></div>
<div class="snowflake"></div>
<div class="snowflake">{{ text() }}</div>
<div class="snowflake">{{ text() }}</div>
<div class="snowflake">{{ text() }}</div>
<div class="snowflake">{{ text() }}</div>
<div class="snowflake">{{ text() }}</div>
<div class="snowflake">{{ text() }}</div>
<div class="snowflake">{{ text() }}</div>
<div class="snowflake">{{ text() }}</div>
<div class="snowflake">{{ text() }}</div>
</div>` });

View File

@ -85,7 +85,7 @@
-ms-user-select: none;
user-select:none; cursor:default;
-webkit-animation-name: snowflakes-fall, snowflakes-shake;
-webkit-animation-duration: 10s, 3s;
-webkit-animation-duration: 15s, 5s;
-webkit-animation-timing-function: linear, ease-in-out;
-webkit-animation-iteration-count: infinite, infinite;
-webkit-animation-play-state: running, running;