Skip to content

Commit 7edd87d

Browse files
Stopwatch Window
1 parent 7aec35d commit 7edd87d

File tree

4 files changed

+45
-18
lines changed

4 files changed

+45
-18
lines changed

JS/MainLoop.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function reflectParticle(particle, translation, i, particlesLeft, particlesRight
8989
//right side
9090
if (particle.x + particle.radius >= 100 + translation) {
9191
if (translation == 0 && allowCrossOver) {
92-
particle.x += 11;
92+
particle.x += 1;
9393
particlesRight.push(particle);
9494
particlesLeft.splice(i, 1);
9595
} else {
@@ -104,7 +104,7 @@ function reflectParticle(particle, translation, i, particlesLeft, particlesRight
104104
//left side
105105
if (particle.x - particle.radius <= 0 + translation) {
106106
if (translation != 0 && allowCrossOver) {
107-
particle.x -= 11;
107+
particle.x -= 1;
108108
particlesLeft.push(particle);
109109
particlesRight.splice(i, 1);
110110
} else {

JS/Start.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ function printInputs() {
144144
target.parent().children('p').html(target.val())
145145
});
146146
//Clock is http://flipclockjs.com/
147-
let clock = $('.your-clock').FlipClock({});
148-
clock.stop()
149-
$('#startClock').click(function(){clock.start()});
150-
$('#stopClock').click(function(){clock.stop()});
151-
$('#resetClock').click(function(){clock.reset()});
147+
148+
}
149+
150+
function openStopwatch(){
151+
window.open('stopwatch.html', '_blank', 'channelmode=yes');
152152
}
153153

154154
function refreshSize() {

index.html

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,9 @@
2626
</div>
2727
<div id='settings'>
2828
<format class='center block'>
29-
<span class='setting' alias='Remove Barrier' type='checkbox' var='allowCrossOver'></span>
29+
<span class='setting' alias='Remove Barrier' type='checkbox' var='allowCrossOver'></span><br/>
3030
<button onclick="resetLoop()">Reset Tanks</button>
31-
</format>
32-
33-
<format class='block center'>
34-
<div class="your-clock"></div>
35-
<format class='block collumns3'>
36-
<button class='block' id='startClock'>Start</button>
37-
<button class='block' id='stopClock'>Stop</button>
38-
<button class='block' id='resetClock'>reset</button>
39-
</format>
31+
<button onclick="openStopwatch()">Open Stopwatch</button>
4032
</format>
4133

4234
<hr/>
@@ -50,7 +42,7 @@
5042

5143
<format class='block'>
5244
<format class='center block'>Right Tank Settings</format>
53-
<span class='setting block' alias='Initial Temperatures' type='range' var='initTempRight' max='30' min='1'></span>
45+
<span class='setting block' alias='Initial Temperature' type='range' var='initTempRight' max='30' min='1'></span>
5446
<span class='setting block' alias='Number Of Particles' type='range' var='numberOfParticlesRight' max='200' min='50'></span>
5547
</format>
5648
</format>

stopwatch.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!Doctype html>
2+
<html>
3+
4+
<head>
5+
<script src="JS/JQuery.js"></script>
6+
<script src="JS/flipclock.min.js"></script>
7+
<script>
8+
$(function () {
9+
let clock = $('.your-clock').FlipClock({});
10+
clock.stop()
11+
$('#startClock').click(function () {
12+
clock.start();
13+
});
14+
$('#stopClock').click(function () {
15+
clock.stop();
16+
});
17+
$('#resetClock').click(function () {
18+
clock.reset();
19+
});
20+
});
21+
</script>
22+
<link rel="stylesheet" href="CSS/flipclock.css">
23+
<link rel="stylesheet" href="CSS/main.css">
24+
</head>
25+
26+
<body>
27+
<div class="your-clock"></div>
28+
<format class='block'>
29+
<button id='startClock'>Start</button>
30+
<button id='stopClock'>Stop</button>
31+
<button id='resetClock'>reset</button>
32+
</format>
33+
</body>
34+
35+
</html>

0 commit comments

Comments
 (0)