-
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
Showing
10 changed files
with
2,433 additions
and
493 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 @@ | ||
node_modules |
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 |
---|---|---|
@@ -1,29 +1,31 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>ASAP</title> | ||
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet"> | ||
<link href='style.css' rel='stylesheet'> | ||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=0"/> | ||
</head> | ||
<body> | ||
<h1>press space or tap the screen</h1> | ||
<div class='center'> | ||
<ul class='options terminal'> | ||
<li> | ||
<span class='cursor'>b</span>ounds? <span class="option active">y</span>/<span class='option'>n</span> | ||
</li> | ||
<li> | ||
gravity? <span class='option active'>[wiggly]</span>/<span class='option'>[wigglyInverse]</span>/<span class='option'>[regular]</span> | ||
</li> | ||
<li> | ||
collisions? <span class='option'>[boring]</span>/<span class='option active'>[care]</span> | ||
</li> | ||
|
||
</ul> | ||
</div> | ||
|
||
<canvas width="1000" height="1000">If you can read this, your browser does not support HTML5 canvas.</canvas> | ||
</body> | ||
<script src='load.js'></script> | ||
</html> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>ASAP</title> | ||
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet"> | ||
<link href='style.css' rel='stylesheet'> | ||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=0"/> | ||
</head> | ||
<body> | ||
<main> | ||
</main> | ||
<h1>press space or tap the screen</h1> | ||
<div class='center'> | ||
<ul class='options terminal'> | ||
<li> | ||
<span class='cursor'>b</span>ounds? <span class="option active">y</span>/<span class='option'>n</span> | ||
</li> | ||
<li> | ||
gravity? <span class='option active'>[wiggly]</span>/<span class='option'>[wigglyInverse]</span>/<span class='option'>[regular]</span> | ||
</li> | ||
<li> | ||
collisions? <span class='option'>[boring]</span>/<span class='option active'>[care]</span> | ||
</li> | ||
|
||
</ul> | ||
</div> | ||
|
||
<canvas width="1000" height="1000">If you can read this, your browser does not support HTML5 canvas.</canvas> | ||
</body> | ||
<script src='load.js'></script> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,55 @@ | ||
"use strict" | ||
|
||
const select = selector => document.querySelector(selector) | ||
|
||
const selectAll = selector => document.querySelectorAll(selector) | ||
|
||
const loadScript = _ => { | ||
let script = document.createElement("script") | ||
script.setAttribute("src","main.js") | ||
select("head").appendChild(script) | ||
select('h1').innerText = "A Simple Aesthetic Particle engine" | ||
select('.options').setAttribute('style','display:none;') | ||
} | ||
|
||
const canvas = select('canvas') | ||
|
||
|
||
window.onresize = _ => { | ||
canvas.width = window.innerWidth | ||
canvas.height = window.innerHeight | ||
} | ||
|
||
window.onload = window.onresize | ||
|
||
// look I'll fix this later lol. | ||
const moveCursor = { | ||
left: ev => { | ||
const terminal = select('.terminal') | ||
const match = terminal | ||
.innerHTML | ||
.replace(/(.)<span class="cursor">(.*?)<\/span>/,'<span class="cursor">$1</span>$2') | ||
terminal.innerHTML = match | ||
}, | ||
right: ev => { | ||
const terminal = select('.terminal') | ||
const match = terminal | ||
.innerHTML | ||
.replace(/<span class="cursor">(.*?)<\/span>(.)/,'$1<span class="cursor">$2</span>') | ||
terminal.innerHTML = match | ||
}, | ||
} | ||
|
||
|
||
const keys = [] | ||
keys[32] = loadScript | ||
keys[37] = moveCursor.left | ||
// keys[38] = moveCursor | ||
keys[39] = moveCursor.right | ||
// keys[40] = moveCursor | ||
|
||
// call the function corresponding to the key. | ||
window.onkeydown = e => keys[e.keyCode]() | ||
window.onclick = loadScript | ||
|
||
"use strict" | ||
|
||
const select = selector => document.querySelector(selector) | ||
|
||
const selectAll = selector => document.querySelectorAll(selector) | ||
|
||
const loadScript = _ => { | ||
let script = document.createElement("script") | ||
script.setAttribute("src","main.js") | ||
select("head").appendChild(script) | ||
select('h1').innerText = "A Simple Aesthetic Particle engine" | ||
select('.options').setAttribute('style','display:none;') | ||
} | ||
|
||
const canvas = select('canvas') | ||
|
||
|
||
window.onresize = _ => { | ||
canvas.width = window.innerWidth | ||
canvas.height = window.innerHeight | ||
} | ||
|
||
window.onload = window.onresize | ||
|
||
// look I'll fix this later lol. | ||
const moveCursor = { | ||
left: ev => { | ||
const terminal = select('.terminal') | ||
const match = terminal | ||
.innerHTML | ||
.replace(/(.)<span class="cursor">(.*?)<\/span>/,'<span class="cursor">$1</span>$2') | ||
terminal.innerHTML = match | ||
}, | ||
right: ev => { | ||
const terminal = select('.terminal') | ||
const match = terminal | ||
.innerHTML | ||
.replace(/<span class="cursor">(.*?)<\/span>(.)/,'$1<span class="cursor">$2</span>') | ||
terminal.innerHTML = match | ||
}, | ||
} | ||
|
||
|
||
const keys = [] | ||
keys[32] = loadScript | ||
keys[37] = moveCursor.left | ||
// keys[38] = moveCursor | ||
keys[39] = moveCursor.right | ||
// keys[40] = moveCursor | ||
|
||
// call the function corresponding to the key. | ||
window.onkeydown = e => keys[e.keyCode]() | ||
window.onclick = loadScript | ||
|
||
//document.querySelectorAll('.option').forEach(el => el.onclick = ev => el.setAttribute('class','active')) |
Oops, something went wrong.