Skip to content

Commit

Permalink
Updates for Smashing Conf
Browse files Browse the repository at this point in the history
  • Loading branch information
sebleedelisle committed Mar 18, 2014
1 parent 30c0c75 commit 5155847
Show file tree
Hide file tree
Showing 31 changed files with 171 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
49 changes: 49 additions & 0 deletions 2013/naconf.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE HTML>
<html lang="en">
<meta charset="utf-8">
<head>
<title></title>
<style type="text/css">
body
{
margin:0;
}
</style>
</head>
<body>
<script>

var canvas = document.createElement('canvas');
document.body.appendChild(canvas);
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;

var c = canvas.getContext('2d');
var particles = [];

setInterval(loop, 1000/30);

function loop() {
c.clearRect(0,0,canvas.width, canvas.height);

var p = {
x : canvas.width/2,
y : canvas.height/2,
xVel : Math.random()*10 - 5,
yVel : Math.random()*10 - 5};
particles.push(p);

for(var i = 0; i<particles.length; i++) {
var p = particles[i];
c.fillRect(p.x,p.y,20,20);
p.x+=p.xVel;
p.y+=p.yVel;
}
}




</script>
</body>
</html>
60 changes: 60 additions & 0 deletions BathUniversityParticles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE HTML>
<html lang="en">
<meta charset="utf-8">
<head>
<title> Particles!</title>
<style type="text/css">
body {
background-color:black;
margin:0px;
overflow : hidden;
}
</style>
</head>

<body>
<script>

var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
document.body.appendChild(canvas);
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;

var particles = [];

setInterval(draw, 16);


function draw() {

ctx.clearRect(0,0,canvas.width, canvas.height);


var p = {x : canvas.width/2,
y : canvas.height/2,
xSpeed : Math.random() * 10 - 5,
ySpeed : Math.random() * 10 - 5,
colour : 'hsl('+Math.random()*360+', 100%, 50%)'
}

particles.push(p);


for(var i = 0; i<particles.length; i++) {

p = particles[i];

ctx.fillStyle = p.colour;
ctx.fillRect(p.x,p.y,10,10);

p.x = p.x+p.xSpeed;
p.y = p.y+p.ySpeed;
}
}
</script>
</body>


</html>

62 changes: 62 additions & 0 deletions SmashingConf2014.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!DOCTYPE HTML>
<html lang="en">
<meta charset="utf-8">
<head>
<title> Particles!</title>
<style type="text/css">
body {
background-color:black;
margin:0px;
overflow : hidden;
}
</style>
</head>

<body>
<script>

var canvas = document.createElement('canvas');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;

var ctx = canvas.getContext('2d');

document.body.appendChild(canvas);

var rotation = 0;

setInterval(loop, 16);


function loop() {
ctx.fillStyle = 'black';
ctx.fillRect(0,0,canvas.width, canvas.height);
ctx.save();

ctx.translate(canvas.width/2, canvas.height/2);
ctx.rotate(rotation * Math.PI/180);
ctx.globalCompositeOperation = 'lighter';

for(var i = 0; i< 36; i++) {
ctx.lineWidth = 5;
ctx.scale(0.96,0.96);
ctx.rotate(rotation *0.1 * Math.PI/180);
ctx.strokeStyle = 'hsla('+i*10+',100%, 70%, 1)';
ctx.strokeRect(50,0,300,300);
}

rotation +=0.1;

ctx.restore();

}




</script>
</body>


</html>

0 comments on commit 5155847

Please sign in to comment.