Browse Source

snow is now sparks

master
Victor Giers 5 years ago
parent
commit
38bc91b8bd
1 changed files with 15 additions and 14 deletions
  1. 15
    14
      index.html

+ 15
- 14
index.html View File

@@ -67,13 +67,11 @@
let mspertick = 12;
let snowflakes = []; // array to hold snowflake objects
let startSmall = false;
let flakeR = 255;
let flakeG = 255;
let flakeB = 255;
let sw = 0;

function setup() {
canvas = createCanvas(window.innerWidth, window.innerHeight);
//"Hot coal" by Surukai is licensed under CC BY-NC-SA 2.0 https://www.flickr.com/photos/39113645@N08/4872013756
bgimg = loadImage("potemkin.jpg");
if(hochkant()) startSmall = true;
imageMode(CENTER);
@@ -125,9 +123,7 @@
} else {
image(bgimg, window.innerWidth/2, window.innerHeight/2,window.innerWidth,window.innerWidth/bgimg.width*bgimg.height);
}
stroke(255);
strokeWeight(sw);
fill(flakeR, flakeG, flakeB);
fill(255);


while(millis() > runtime){
@@ -173,6 +169,7 @@
}
}


//snowflakes
let t = frameCount / 60;
snowflakes.push(new snowflake());
@@ -192,22 +189,26 @@

function snowflake() {
this.posX = 0;
this.posY = random(-50, 0);
this.posY = random(window.innerHeight/4, window.innerHeight+50);
this.initialangle = random(0, 2 * PI);
this.size = random(2, 5);
this.radius = sqrt(random(pow(width / 2, 2)));
this.r = random(0,255);
this.g = random(0,this.r);
this.b = 0;

this.update = function(time) {
let w = 0.4;
let angle = w * time + this.initialangle;
this.posX = width / 2 + this.radius * sin(angle);
this.posY += pow(this.size, 0.5);
if (this.posY > height) {
this.posY -= pow(this.size, 0.5);
if (this.posY < 0) {
let index = snowflakes.indexOf(this);
snowflakes.splice(index, 1);
}
};
this.display = function() {
fill(this.r,this.g,this.b);
ellipse(this.posX, this.posY, this.size);
};
}
@@ -226,13 +227,13 @@
<p>
This place is going to be a hub for <b>collaborative work</b> in the fields of <b>media art</b> and <b>design</b> regarding <b>knowledge</b> and <b>social interaction</b> on the <b>internet</b>.<br>
The community is based on <b>European standards</b>, <b>the whole world is invited</b> to collaborate.<br>
It is registered and hosted at <a href="https://www.manitu.de/" target="_blank"><b>Manitu</b></a>, a web host service based in <b>Saarland, Germany</b>.<br><br>
<b>We'd love you to get in contact with us!</b><br><br>
<h3><a href="https://discord.gg/nGDYYKE">Discord invitation</a></h3>
It is registered and hosted at <a href="https://www.manitu.de/" target="_blank"><b>Manitu</b></a>, a web host service based in <b>St. Wendel, Saarland, Germany</b>.<br><br>
<b>We'd love to hear from you!</b>
<h3><a href="https://discord.gg/nGDYYKE">Discord invitation</a></h3><br>
</p>
<p>
There's a <a href="http://coal.ddns.net:3000/ember/coalmedia.eu">git</a> for this website.<br>
Following links are not functioning properly yet and only here for construction purpose.
There's a <a href="http://coal.ddns.net:3000/ember/coalmedia.eu">git-repository</a> for this website.<br>
Progress:
<ul>
<li><a href="chat">Chat</a></li>
<li><a href="cloud">Cloud</a></li>

Loading…
Cancel
Save