Skip to content

Commit 5a67eb3

Browse files
committed
update to browser
1 parent 32e67d6 commit 5a67eb3

File tree

3 files changed

+40
-25
lines changed

3 files changed

+40
-25
lines changed

css/styles.css

+12-4
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,20 @@ header {
6060

6161
.orange:hover {
6262
background-color: #FF983C;
63+
color: #CD6509;
6364
}
6465

65-
canvas {
66-
box-shadow: 0 0 5px rgba(0,0,0,.5);
66+
.green {
67+
text-shadow: 0 -1px 0 #096d14;
68+
background-color: rgb(15, 145, 30);
69+
box-shadow: 0px 5px 0px 0px #096d14;
6770
}
6871

69-
.back, .next {
70-
background-color: rgb(15, 145, 30);
72+
.green:hover {
73+
background-color: #26af36;
74+
color: #096d14;
7175
}
76+
77+
canvas {
78+
box-shadow: 0 0 5px rgba(0, 0, 0, .5);
79+
}

index.html

+23-20
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,33 @@
1414
<h1>Looper</h1>
1515
<h2>A tool to create looperinos · <a href="https://github.com/spite/looper" >GitHub</a> | <b>Chrome and Safari Tech Preview only</b></h2>
1616
<div class="recordPanel">
17-
<a href="#" class="btn orange" id="start">Record</a>
18-
</div>
19-
20-
<div>
21-
<button class="btn back" style="margin-right: 4px" onclick="back()" >Before</button>
22-
<button class="btn next" onclick="next()" >Next</button>
17+
<a href="#" class="btn orange" id="start">⚫ Record</a>
18+
<a href="#" id="backButton" class="btn green">◀&nbsp;&nbsp;Previous</a>
19+
<a href="#" id="nextButton" class="btn green">Next&nbsp;&nbsp;▶</a>
2320
</div>
2421
</header>
25-
2622
<script>
27-
function getIndex() {
28-
return parseInt(window.location.hash.replace('#', ''));
29-
}
30-
function back() {
31-
let index = getIndex();
23+
function getIndex() {
24+
return parseInt(window.location.hash.replace('#', ''));
25+
}
26+
27+
function prev(e) {
28+
let index = getIndex();
29+
30+
// beginning, dont do anything
31+
if (index === 1) return;
32+
window.location.hash = `${--index}`;
33+
e.preventDefault();
34+
}
35+
36+
function next(e) {
37+
let index = getIndex();
38+
window.location.hash = ++index;
39+
e.preventDefault();
40+
}
3241

33-
// beginning, dont do anything
34-
if (index === 1) return;
35-
window.location.hash = --index;
36-
}
37-
function next() {
38-
let index = getIndex();
39-
window.location.hash = ++index;
40-
}
42+
document.getElementById('backButton').addEventListener('click', (e) => prev(e));
43+
document.getElementById('nextButton').addEventListener('click', (e) => next(e));
4144
</script>
4245
<script src="js/CCapture.all.min.js"></script>
4346
<script async type="module" src="modules/looper.js"></script>

modules/looper.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ async function init() {
1111

1212
async function reload() {
1313
if (module && module.canvas) {
14-
document.body.removeChild(module.canvas);
14+
try {
15+
document.body.removeChild(module.canvas);
16+
} catch (e) {
17+
18+
}
1519
}
1620
module = await loadModule();
1721
}

0 commit comments

Comments
 (0)