diff --git a/files/assets/events/homoween/css/haunted.css b/files/assets/events/homoween/css/haunt.css similarity index 100% rename from files/assets/events/homoween/css/haunted.css rename to files/assets/events/homoween/css/haunt.css diff --git a/files/assets/events/homoween/css/haunted2.css b/files/assets/events/homoween/css/haunt2.css similarity index 100% rename from files/assets/events/homoween/css/haunted2.css rename to files/assets/events/homoween/css/haunt2.css diff --git a/files/assets/events/homoween/js/blood.js b/files/assets/events/homoween/js/blood.js deleted file mode 100644 index bcc71f847..000000000 --- a/files/assets/events/homoween/js/blood.js +++ /dev/null @@ -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(); - } -} diff --git a/files/assets/events/homoween/js/haunted.js b/files/assets/events/homoween/js/haunt.js similarity index 97% rename from files/assets/events/homoween/js/haunted.js rename to files/assets/events/homoween/js/haunt.js index 5bbcb39ad..678feacd1 100644 --- a/files/assets/events/homoween/js/haunted.js +++ b/files/assets/events/homoween/js/haunt.js @@ -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) diff --git a/files/assets/events/homoween/js/sketch.js b/files/assets/events/homoween/js/stab.js similarity index 92% rename from files/assets/events/homoween/js/sketch.js rename to files/assets/events/homoween/js/stab.js index 14a894d54..ae1b20415 100644 --- a/files/assets/events/homoween/js/sketch.js +++ b/files/assets/events/homoween/js/stab.js @@ -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(); + } +} diff --git a/files/templates/events/homoween/awards.html b/files/templates/events/homoween/awards.html index 3cb0609a4..881f29356 100644 --- a/files/templates/events/homoween/awards.html +++ b/files/templates/events/homoween/awards.html @@ -1,6 +1,6 @@ {% if p.award_count("haunt", v) %} - - + +
{% if (not v or v.event_music) and not (hole and hole.name == 'music') and not (p.embed and p.domain == 'twitter.com') %} @@ -12,8 +12,7 @@ {% if stabs %} - - + {% endif %} {% if p.award_count("spiders", v) %}