diff options
Diffstat (limited to 'content')
| -rw-r--r-- | content/script.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/content/script.js b/content/script.js index 7143b25..df5a9c0 100644 --- a/content/script.js +++ b/content/script.js | |||
| @@ -1,4 +1,14 @@ | |||
| 1 | let i = 0; | ||
| 2 | |||
| 1 | function createSnowFlake() { | 3 | function createSnowFlake() { |
| 4 | const threshold = -10 * Math.log10(window.innerWidth / 1000); | ||
| 5 | |||
| 6 | if (++i < threshold) { | ||
| 7 | return; | ||
| 8 | } | ||
| 9 | |||
| 10 | i = 0; | ||
| 11 | |||
| 2 | const snowFlake = document.createElementNS("http://www.w3.org/2000/svg", "svg"); | 12 | const snowFlake = document.createElementNS("http://www.w3.org/2000/svg", "svg"); |
| 3 | const snowFlakeInner = document.createElementNS("http://www.w3.org/2000/svg", "use"); | 13 | const snowFlakeInner = document.createElementNS("http://www.w3.org/2000/svg", "use"); |
| 4 | 14 | ||
