-
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
0 parents
commit 9fa038b
Showing
3 changed files
with
97 additions
and
0 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,87 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>1f574, LLC</title> | ||
<script src="proton-2.1.0.min.js" type="text/javascript"></script> | ||
</head> | ||
|
||
<body onload="resizeCanvas();" onresize="resizeCanvas();"> | ||
<div> | ||
<canvas style="position:fixed; top:0; left:0;" id="canvas"> | ||
</canvas> | ||
<div style="z-index: 1; position:relative;"> | ||
<center> | ||
<h1 id="maninbusinesssuitlevitating" onmouseover="activate();">🕴</h1> | ||
<h2>1f574, LLC</h2> | ||
Contract product and engineering management.<br /> | ||
<a href="mailto:[email protected]">[email protected]</a> | ||
</center> | ||
</div> | ||
</div> | ||
<script type="text/javascript"> | ||
function resizeCanvas(){ | ||
const canvas = document.getElementById("canvas"); | ||
if (canvas.width < window.innerWidth) | ||
{ | ||
canvas.width = window.innerWidth; | ||
} | ||
|
||
if (canvas.height < window.innerHeight) | ||
{ | ||
canvas.height = window.innerHeight; | ||
} | ||
} | ||
|
||
var canvas; | ||
var context; | ||
var proton; | ||
var renderer; | ||
var emitter; | ||
var stats; | ||
|
||
function activate() { | ||
canvas = document.getElementById("canvas"); | ||
canvas.width = window.innerWidth; | ||
canvas.height = window.innerHeight; | ||
context = canvas.getContext('2d'); | ||
context.globalCompositeOperation = "lighter"; | ||
loadImage(); | ||
} | ||
|
||
function loadImage() { | ||
var image = new Image() | ||
image.onload = function(e) { | ||
createProton(e.target); | ||
tick(); | ||
} | ||
image.src = 'lev3.png'; | ||
} | ||
|
||
function createProton(image) { | ||
proton = new Proton; | ||
emitter = new Proton.Emitter(); | ||
emitter.rate = new Proton.Rate(new Proton.Span(1, 10), new Proton.Span(.5, 2)); | ||
emitter.addInitialize(new Proton.ImageTarget(image)); | ||
emitter.addInitialize(new Proton.Mass(1)); | ||
emitter.addInitialize(new Proton.Life(2, 4)); | ||
emitter.addInitialize(new Proton.V(new Proton.Span(0.5, 1.5), new Proton.Span(0, 360), 'polar')); | ||
emitter.addBehaviour(new Proton.Alpha(1, [.7, 1])); | ||
emitter.addBehaviour(new Proton.Scale(1, 0)); | ||
emitter.addBehaviour(new Proton.Color('random', 'random', Infinity, Proton.easeInSine)); | ||
const box = document.getElementById('maninbusinesssuitlevitating').getBoundingClientRect(); | ||
emitter.p.x = box.left + box.width / 2; | ||
emitter.p.y = box.top + box.height / 2; | ||
emitter.emit(); | ||
proton.addEmitter(emitter); | ||
|
||
renderer = new Proton.Renderer('canvas', proton, canvas); | ||
renderer.start(); | ||
} | ||
|
||
function tick() { | ||
requestAnimationFrame(tick); | ||
proton.update(); | ||
} | ||
</script> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.