forked from rDrama/rDrama
make award files the same name as the awards
parent
4de8c26861
commit
3f8a47bbc1
|
@ -1,52 +0,0 @@
|
|||
/*
|
||||
A Bloody Mess by Rob Glazebrook
|
||||
By default, canvas does not clear between frames. I'm taking advantage of that to create the running blood effect.
|
||||
This pen was inspired by Katy Decorah's BLOOD: https://codepen.io/katydecorah/pen/Lkogi
|
||||
*/
|
||||
|
||||
|
||||
let i = 0;
|
||||
|
||||
const stabs = document.getElementById('stabs').value
|
||||
|
||||
let blood = Sketch.create({autoclear: false, autopause: false}),
|
||||
drops = [],
|
||||
dropCount = stabs*4,
|
||||
maxDrops = dropCount+1,
|
||||
Drop = function() {
|
||||
this.x = random(0,blood.width);
|
||||
this.radius = random(7,12);
|
||||
this.y = -this.radius - random(50,100);
|
||||
this.vy = this.radius/6;
|
||||
this.r = ~~random(240,255);
|
||||
this.g = ~~random(0,20);
|
||||
this.b = ~~random(0,20);
|
||||
};
|
||||
|
||||
blood.update = function() {
|
||||
let d = drops.length;
|
||||
while(d < dropCount && i < maxDrops) {
|
||||
let drop = new Drop();
|
||||
drops.push(drop);
|
||||
d++;
|
||||
i++;
|
||||
}
|
||||
while(d-- && i < maxDrops) {
|
||||
let drop = drops[d];
|
||||
drop.y += drop.vy;
|
||||
if(drop.y - drop.radius > blood.height) {
|
||||
drops.splice(d,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
blood.draw = function() {
|
||||
let d = drops.length;
|
||||
while(d-- && i < maxDrops) {
|
||||
let drop = drops[d];
|
||||
blood.beginPath();
|
||||
blood.fillStyle = 'rgba('+drop.r+','+drop.g+','+drop.b+',.8)';
|
||||
blood.arc(drop.x,drop.y,drop.radius,0,TWO_PI);
|
||||
blood.fill();
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ const div = document.getElementById("haunted-effect")
|
|||
|
||||
const stylesheet_haunted = document.createElement("link")
|
||||
stylesheet_haunted.setAttribute("rel", "stylesheet")
|
||||
stylesheet_haunted.setAttribute("href", "/assets/events/homoween/css/haunted2.css?x=1")
|
||||
stylesheet_haunted.setAttribute("href", "/assets/events/homoween/css/haunt2.css?x=1")
|
||||
stylesheet_haunted.disabled = true
|
||||
document.head.appendChild(stylesheet_haunted)
|
||||
|
|
@ -626,3 +626,50 @@
|
|||
return Sketch;
|
||||
|
||||
}));
|
||||
|
||||
|
||||
let i = 0;
|
||||
|
||||
const stabs = document.getElementById('stabs').value
|
||||
|
||||
let blood = Sketch.create({autoclear: false, autopause: false}),
|
||||
drops = [],
|
||||
dropCount = stabs*4,
|
||||
maxDrops = dropCount+1,
|
||||
Drop = function() {
|
||||
this.x = random(0,blood.width);
|
||||
this.radius = random(7,12);
|
||||
this.y = -this.radius - random(50,100);
|
||||
this.vy = this.radius/6;
|
||||
this.r = ~~random(240,255);
|
||||
this.g = ~~random(0,20);
|
||||
this.b = ~~random(0,20);
|
||||
};
|
||||
|
||||
blood.update = function() {
|
||||
let d = drops.length;
|
||||
while(d < dropCount && i < maxDrops) {
|
||||
let drop = new Drop();
|
||||
drops.push(drop);
|
||||
d++;
|
||||
i++;
|
||||
}
|
||||
while(d-- && i < maxDrops) {
|
||||
let drop = drops[d];
|
||||
drop.y += drop.vy;
|
||||
if(drop.y - drop.radius > blood.height) {
|
||||
drops.splice(d,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
blood.draw = function() {
|
||||
let d = drops.length;
|
||||
while(d-- && i < maxDrops) {
|
||||
let drop = drops[d];
|
||||
blood.beginPath();
|
||||
blood.fillStyle = 'rgba('+drop.r+','+drop.g+','+drop.b+',.8)';
|
||||
blood.arc(drop.x,drop.y,drop.radius,0,TWO_PI);
|
||||
blood.fill();
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{% if p.award_count("haunt", v) %}
|
||||
<link rel="stylesheet" href="{{'events/homoween/css/haunted.css' | asset}}">
|
||||
<script defer src="{{'events/homoween/js/haunted.js' | asset}}" defer></script>
|
||||
<link rel="stylesheet" href="{{'events/homoween/css/haunt.css' | asset}}">
|
||||
<script defer src="{{'events/homoween/js/haunt.js' | asset}}" defer></script>
|
||||
<div id="haunted-effect" class="fixed-top"></div>
|
||||
{% if (not v or v.event_music) and not (hole and hole.name == 'music') and not (p.embed and p.domain == 'twitter.com') %}
|
||||
<audio id="thunder1" hidden preload="none" src="/assets/events/homoween/audio/haunted/thunder1.mp3"></audio>
|
||||
|
@ -12,8 +12,7 @@
|
|||
{% if stabs %}
|
||||
<input hidden id="stabs" value="{{stabs}}">
|
||||
<link rel="stylesheet" href="{{'events/homoween/css/stab.css' | asset}}">
|
||||
<script defer src="{{'events/homoween/js/sketch.js' | asset}}" defer></script>
|
||||
<script defer src="{{'events/homoween/js/blood.js' | asset}}" defer></script>
|
||||
<script defer src="{{'events/homoween/js/stab.js' | asset}}" defer></script>
|
||||
{% endif %}
|
||||
|
||||
{% if p.award_count("spiders", v) %}
|
||||
|
|
Loading…
Reference in New Issue