forked from isuttell/sine-waves
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Isaac Suttell
committed
Dec 1, 2014
1 parent
63a0130
commit 02a14fd
Showing
4 changed files
with
182 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
<title>SineWaves</title> | ||
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> | ||
<style> | ||
@import url(http://fonts.googleapis.com/css?family=Raleway:100,300); | ||
body { | ||
background-color: #222; | ||
background-image: -moz-linear-gradient(top, #111111 0%, #222222 50%, #111111 100%); | ||
background-image: -webkit-linear-gradient(top, #111111 0%, #222222 50%, #111111 100%); | ||
background-image: linear-gradient(to bottom, #111111 0%, #222222 50%, #111111 100%); | ||
font-family: 'Raleway', sans-serif; | ||
font-weight: 100; | ||
color: rgba(255, 255, 255, 0.5); | ||
height: 100vh; | ||
width: 100vw; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
#waves { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
#title { | ||
position: fixed; | ||
top: 10px; | ||
left: 10px; | ||
font-size: 20px; | ||
letter-spacing: 0.1em; | ||
z-index: 100; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<h1 id="title">SineWaves</h1> | ||
<canvas id="waves"></canvas> | ||
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> | ||
<script src="../sine-waves.js"></script> | ||
<script> | ||
$(function(){ | ||
var waves = new SineWaves({ | ||
el: document.getElementById('waves'), | ||
|
||
speed: 8, | ||
|
||
width: function() { | ||
return $(window).width(); | ||
}, | ||
|
||
height: function() { | ||
return $(window).height(); | ||
}, | ||
|
||
rotate: 90, | ||
|
||
waves: [ | ||
{ | ||
timeModifier: 1, | ||
lineWidth: 3, | ||
amplitude: 150, | ||
wavelength: 200, | ||
segmentLength: 20 | ||
}, | ||
{ | ||
timeModifier: 1, | ||
lineWidth: 2, | ||
amplitude: 150, | ||
wavelength: 100, | ||
}, | ||
{ | ||
timeModifier: 1, | ||
lineWidth: 1, | ||
amplitude: -150, | ||
wavelength: 50, | ||
segmentLength: 10, | ||
}, | ||
{ | ||
timeModifier: 1, | ||
lineWidth: 0.5, | ||
amplitude: -100, | ||
wavelength: 100, | ||
segmentLength: 10, | ||
} | ||
], | ||
|
||
initialize: function (){ | ||
|
||
}, | ||
|
||
resizeEvent: function() { | ||
var gradient = this.ctx.createLinearGradient(0, 0, this.width, 0); | ||
gradient.addColorStop(0,"rgba(0, 0, 0, 0)"); | ||
gradient.addColorStop(0.5,"rgba(255, 255, 255, 0.5)"); | ||
gradient.addColorStop(1,"rgba(0, 0, 0, 0)"); | ||
|
||
var index = -1; | ||
var length = this.waves.length; | ||
while(++index < length){ | ||
this.waves[index].strokeStyle = gradient; | ||
} | ||
|
||
// Clean Up | ||
index = void 0; | ||
length = void 0; | ||
gradient = void 0; | ||
} | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters