Commit a3665acd authored by Milan's avatar Milan

replace fireflies

parent 516a0e00
......@@ -72,11 +72,11 @@ GEM
ffi (1.9.14)
font-awesome-rails (4.6.3.1)
railties (>= 3.2, < 5.1)
geocoder (1.3.7)
globalid (0.3.7)
activesupport (>= 4.1.0)
haml (4.0.7)
tilt
http_accept_language (2.0.5)
i18n (0.7.0)
jbuilder (2.6.0)
activesupport (>= 3.0.0, < 5.1)
......@@ -202,7 +202,7 @@ DEPENDENCIES
byebug
coffee-rails (~> 4.2)
devise
geocoder
http_accept_language (~> 2.0.5)
jbuilder (~> 2.5)
jquery-rails
listen
......@@ -218,4 +218,4 @@ DEPENDENCIES
uglifier (>= 1.3.0)
BUNDLED WITH
1.12.5
1.13.6
// based on http://codepen.io/andrewreifman/pen/vgGjb
var WIDTH;
var HEIGHT;
var canvas;
var con;
var g;
var pxs = new Array();
var rint = 50;
$(document).ready(function(){
WIDTH = window.innerWidth;
HEIGHT = window.innerHeight;
$('#container').width(WIDTH).height(HEIGHT);
canvas = document.getElementById('pixie');
$(canvas).attr('width', WIDTH).attr('height',HEIGHT);
con = canvas.getContext('2d');
for(var i = 0; i < 50; i++) {
pxs[i] = new Circle();
pxs[i].reset();
}
setInterval(draw,rint);
setInterval(draw,rint2);
});
function draw() {
con.clearRect(0,0,WIDTH,HEIGHT);
for(var i = 0; i < pxs.length; i++) {
pxs[i].fade();
pxs[i].move();
pxs[i].draw();
}
}
function Circle() {
this.s = {ttl:8000, xmax:5, ymax:2, rmax:10, rt:1, xdef:960, ydef:540, xdrift:4, ydrift: 4, random:true, blink:true};
this.reset = function() {
this.x = (this.s.random ? WIDTH*Math.random() : this.s.xdef);
this.y = (this.s.random ? HEIGHT*Math.random() : this.s.ydef);
this.r = ((this.s.rmax-1)*Math.random()) + 1;
this.dx = (Math.random()*this.s.xmax) * (Math.random() < .5 ? -1 : 1);
this.dy = (Math.random()*this.s.ymax) * (Math.random() < .5 ? -1 : 1);
this.hl = (this.s.ttl/rint)*(this.r/this.s.rmax);
this.rt = Math.random()*this.hl;
this.s.rt = Math.random()+1;
this.stop = Math.random()*.2+.4;
this.s.xdrift *= Math.random() * (Math.random() < .5 ? -1 : 1);
this.s.ydrift *= Math.random() * (Math.random() < .5 ? -1 : 1);
}
this.fade = function() {
this.rt += this.s.rt;
}
this.draw = function() {
if(this.s.blink && (this.rt <= 0 || this.rt >= this.hl)) this.s.rt = this.s.rt*-1;
else if(this.rt >= this.hl) this.reset();
var newo = 1-(this.rt/this.hl);
con.beginPath();
con.arc(this.x,this.y,this.r,0,Math.PI*2,true);
con.closePath();
var cr = this.r*newo;
g = con.createRadialGradient(this.x,this.y,0,this.x,this.y,(cr <= 0 ? 1 : cr));
g.addColorStop(0.0, 'rgba(234,111,31,'+newo+')');
g.addColorStop(this.stop, 'rgba(234,111,31,'+(newo*.2)+')');
g.addColorStop(1.0, 'rgba(234,111,31,0)');
con.fillStyle = g;
con.fill();
}
this.move = function() {
this.x += (this.rt/this.hl)*this.dx;
this.y += (this.rt/this.hl)*this.dy;
if(this.x > WIDTH || this.x < 0) this.dx *= -1;
if(this.y > HEIGHT || this.y < 0) this.dy *= -1;
}
this.getX = function() { return this.x; }
this.getY = function() { return this.y; }
}
......@@ -15,4 +15,5 @@
@import 'body';
@import 'content';
@import 'carousel';
@import 'fireflies';
@import 'footer';
#pixie {
z-index:-1;
position: absolute;
top: 0;
left: 0;
}
......@@ -55,15 +55,16 @@
</div>
</nav>
<div class="space-top"></div>
<div class="container shader" id="content">
<% if notice %>
<p class="alert alert-success"><%= notice %></p>
<% end %>
<% if alert %>
<p class="alert alert-danger"><%= alert %></p>
<% end %>
<%= yield %>
</div>
<div class="container shader" id="content">
<canvas id="pixie"></canvas>
<% if notice %>
<p class="alert alert-success"><%= notice %></p>
<% end %>
<% if alert %>
<p class="alert alert-danger"><%= alert %></p>
<% end %>
<%= yield %>
</div>
</body>
<footer class="footer">
<div class="container">
......@@ -99,9 +100,6 @@
</footer>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<script src="//assets.illuna-minetest.tk/bootstrap/js/bootstrap.min.js"></script>
<script src="//assets.illuna-minetest.tk/js/firefly.js"></script>
<script>$.firefly({color:'#c46430',minPixel:1,maxPixel:3,total:20,on:'body',borderRadius:"50%",});</script>
<script>$.firefly({color:'orange',minPixel:1,maxPixel:5,total:20,on:'body',borderRadius:"50%",});</script>
<script src="//assets.illuna-minetest.tk/js/piwik.js"></script>
<script src="//assets.tchncs.de/js/cookie-consent.js"></script>"
<%= yield(:after) %>
......
......@@ -23,14 +23,6 @@ ActiveRecord::Schema.define(version: 20160831090736) do
t.datetime "updated_at", null: false
end
create_table "feeds", force: :cascade do |t|
t.string "name"
t.string "url"
t.text "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment