summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authors1n <[email protected]>2020-01-03 19:22:48 -0800
committers1n <[email protected]>2020-01-03 19:22:48 -0800
commitd19298cb97655c0d7c4e96508f9ff20387bcdf42 (patch)
tree47c77b8c22f97b1e7bf7d06098345c4441d95f55 /js
parentmedia queries for navbar size (diff)
downloads1n.pw-admin-d19298cb97655c0d7c4e96508f9ff20387bcdf42.tar.xz
s1n.pw-admin-d19298cb97655c0d7c4e96508f9ff20387bcdf42.zip
remove snow, comment normal colours, correct key
Diffstat (limited to 'js')
-rw-r--r--js/app.js2
-rw-r--r--js/background-sparkles.js6
-rw-r--r--js/snow.js115
3 files changed, 5 insertions, 118 deletions
diff --git a/js/app.js b/js/app.js
index 2bd1818..2282f1a 100644
--- a/js/app.js
+++ b/js/app.js
@@ -146,8 +146,6 @@ function Cheats() {
`;
}
- document.getElementById("snow").innerHTML = ``;
-
document.title = "// s1n.ical // Landing Page //"
CheatsState = true;
diff --git a/js/background-sparkles.js b/js/background-sparkles.js
index d4690ec..9c67fc2 100644
--- a/js/background-sparkles.js
+++ b/js/background-sparkles.js
@@ -13,13 +13,17 @@ var pattern = Trianglify({
height: window.innerHeight, // White: #fdfbfb, Salmon: #cc3300
width: window.innerWidth,
// Christmas Colours:
- x_colors: ['#0F8A5F', '#f9f9f9', '#fffff4', '#fbf7f5', '#CC231E'], // Cappuccino: ['#854442', '#3c2f2f', '#fff4e6', '#be9b7b', '#4b3832']
+ x_colors: ['#040404', '#f9f9f9', '#fffff4', '#fbf7f5', '#d55454'], // Cappuccino: ['#854442', '#3c2f2f', '#fff4e6', '#be9b7b', '#4b3832']
y_colors: ['#f9f1f1', '#f9f9f9', '#fffff4', '#fbf7f5', '#f9f1f1'], // Random colour generator: "#"+((1<<24)*Math.random()|0).toString(16)
//
// Normal Colours:
// x_colors: ['#040404', '#f9f9f9', '#fffff4', '#fbf7f5', '#d55454'],
// y_colors: ['#f9f1f1', '#f9f9f9', '#fffff4', '#fbf7f5', '#f9f1f1'],
//
+ // Christmas Colours:
+ // x_colors: ['#0F8A5F', '#f9f9f9', '#fffff4', '#fbf7f5', '#CC231E'],
+ // y_colors: ['#f9f1f1', '#f9f9f9', '#fffff4', '#fbf7f5', '#f9f1f1'],
+ //
variance: 10, // Gives it more style
seed: Number.parseInt(Math.floor(Math.random() * 100)), // TODO: Live seed transitioning.
cell_size: 160 // Cell size
diff --git a/js/snow.js b/js/snow.js
deleted file mode 100644
index 174b321..0000000
--- a/js/snow.js
+++ /dev/null
@@ -1,115 +0,0 @@
-var canvas = document.querySelector('.snow'),
- ctx = canvas.getContext('2d'),
- windowW = window.innerWidth,
- windowH = window.innerHeight,
- numFlakes = 125,
- flakes = [];
-
-if (screen.width < 768) {
- numFlakes = 50;
-} // If Mobile
-
-function Flake(x, y) {
- var maxWeight = 5,
- maxSpeed = 1.2;
-
- if (screen.width < 768) {
- maxSpeed = 1;
- } // If Mobile
-
- this.x = x;
- this.y = y;
- this.r = randomBetween(0, 1);
- this.a = randomBetween(0, Math.PI);
- this.aStep = 0.01;
-
- this.weight = randomBetween(2, maxWeight);
- this.alpha = (this.weight / maxWeight);
- this.speed = (this.weight / maxWeight) * maxSpeed;
-
- this.update = function () {
- this.x += Math.cos(this.a) * this.r;
- this.a += this.aStep;
-
- this.y += this.speed;
- }
-}
-
-function init() {
- var i = numFlakes,
- flake,
- x,
- y;
-
- while (i--) {
- x = randomBetween(0, windowW, true);
- y = randomBetween(0, windowH, true);
-
- flake = new Flake(x, y);
- flakes.push(flake);
- }
-
- scaleCanvas();
- loop();
-}
-
-function scaleCanvas() {
- canvas.width = windowW;
- canvas.height = windowH;
-}
-
-function loop() {
- var i = flakes.length,
- z,
- dist,
- flakeA,
- flakeB;
-
- // clear canvas
- ctx.save();
- ctx.setTransform(1, 0, 0, 1, 0, 0);
- ctx.clearRect(0, 0, windowW, windowH);
- ctx.restore();
-
- // loop of hell
- while (i--) {
-
- flakeA = flakes[i];
- flakeA.update();
-
-
- /*for (z = 0; z < flakes.length; z++) { flakeB=flakes[z]; if (flakeA !==flakeB && distanceBetween(flakeA,
- flakeB) < 150) { ctx.beginPath(); ctx.moveTo(flakeA.x, flakeA.y); ctx.lineTo(flakeB.x, flakeB.y);
- ctx.strokeStyle='#444444' ; ctx.stroke(); ctx.closePath(); } }*/
-
- ctx.beginPath();
- ctx.arc(flakeA.x, flakeA.y, flakeA.weight, 0, 2 * Math.PI, false);
- ctx.fillStyle = 'rgba(255, 255, 255, ' + flakeA.alpha + ')';
- ctx.fill();
-
- if (flakeA.y >= windowH) {
- flakeA.y = -flakeA.weight;
- }
- }
-
- requestAnimationFrame(loop);
-}
-
-function randomBetween(min, max, round) {
- var num = Math.random() * (max - min + 1) + min;
-
- if (round) {
- return Math.floor(num);
- } else {
- return num;
- }
-}
-
-function distanceBetween(vector1, vector2) {
- var dx = vector2.x - vector1.x,
- dy = vector2.y - vector1.y;
-
- return Math.sqrt(dx * dx + dy * dy);
-}
-
-init();