From c0c0ed00666b710b270d64d99fdb0d70003c9299 Mon Sep 17 00:00:00 2001 From: Sander Hautvast Date: Wed, 2 Dec 2020 13:52:05 +0100 Subject: [PATCH] last commit --- .gitignore | 2 ++ README.md | 3 +++ index.html | 12 ++++++++++++ sky.css | 4 ++++ sky.js | 26 ++++++++++++++++++++++++++ 5 files changed, 47 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 index.html create mode 100644 sky.css create mode 100644 sky.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0cc2124 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.iml +.idea/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..c7875d7 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +__Gradients are pretty magic!__ + +Just a simple app that lets you stare at the sky \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..bf525d6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + sky + + + + + + + \ No newline at end of file diff --git a/sky.css b/sky.css new file mode 100644 index 0000000..6908300 --- /dev/null +++ b/sky.css @@ -0,0 +1,4 @@ +span { + width: 100%; + height: 100%; +} \ No newline at end of file diff --git a/sky.js b/sky.js new file mode 100644 index 0000000..741e506 --- /dev/null +++ b/sky.js @@ -0,0 +1,26 @@ +(function () { + let canvas = document.getElementsByTagName("canvas")[0]; + canvas.width = window.innerWidth; + canvas.height = window.innerHeight; + canvas.onclick = () => { + canvas.requestFullscreen().then(); + }; + + window.onresize = () => { + canvas.width = window.innerWidth; + canvas.height = window.innerHeight; + }; + + let i = 0, di = 1, + step = function () { + if ((i < 1000 && di > 0) || (i > 0 && di < 0)) { + i += di; + canvas.style.background = 'linear-gradient(' + i + 'deg, white , rgb(20,56,200))'; + } else { + di = -di; + } + setTimeout(step, 150); + }; + + step(); +})() \ No newline at end of file