-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
123 lines (116 loc) · 5.04 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<html>
<head>
<title>Evil Russian Calculator</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<style>
span {
font-weight: bold;
}
</style>
</head>
<body>
<div class="container">
<br><br>
<h1>Evil Russian Push-Up Calculator</h1>
<hr>
<a style="padding:12px; color: black; font-weight: bold;" href="?darkmode=true" id="darkModeButton">🌙 Switch to Dark Mode</a>
<br><br>
<h3>The Rules</h3>
<ol>
<li>14 days, number and frequency will change</li>
<li>No skipping times or days, anywhere, anytime, push-up!</li>
<li>When you do 100% test, go until you can't do anymore</li>
<li>If you are awake do push-ups, except 1hr before going to sleep</li>
</ol>
<hr>
<h3>The Calculator</h3>
<form>
Drop down, do push-ups, enter number:
<input type="number" value="10" id="base">
<br>
</form>
<hr>
<h3>The Results</h3>
<br>
<pre>
Week 1
Monday <span class="100">...</span> Initial push-ups (test your max), then <span class="30">...</span> push-ups every 60 min
Tuesday <span class="50">...</span> push-ups every 60 min
Wednesday <span class="60">...</span> push-ups every 45 min
Thursday <span class="25">...</span> push-ups every 60 min
Friday <span class="45">...</span> push-ups every 30 min
Saturday <span class="40">...</span> push-ups every 60 min
Sunday <span class="20">...</span> push-ups every 90 min
Week 2
Monday <span class="100">...</span> push-ups (re-test your max), then <span class="35">...</span> push-ups every 45 min
Tuesday <span class="55">...</span> push-ups every 20 min
Wednesday <span class="30">...</span> push-ups every 15 min
Thursday <span class="65">...</span> push-ups every 60 min
Friday <span class="35">...</span> push-ups every 45 min
Saturday <span class="45">...</span> push-ups every 60 min
Sunday <span class="25">...</span> push-ups every 120 min
Week 3
Mon: <span class="100">...</span> re-test your max
</pre>
</div>
<script src="jquery-3.3.1.min.js "></script>
<script>
$(document).ready(function() {
function update() {
var baseVal = $("#base").val();
console.log("Updating with new push-up count of: " + baseVal);
$(".100").text(Math.round(baseVal * 1));
$(".65").text(Math.round(baseVal * 0.65));
$(".60").text(Math.round(baseVal * 0.60));
$(".55").text(Math.round(baseVal * 0.55));
$(".50").text(Math.round(baseVal * 0.50));
$(".45").text(Math.round(baseVal * 0.45));
$(".40").text(Math.round(baseVal * 0.40));
$(".35").text(Math.round(baseVal * 0.35));
$(".30").text(Math.round(baseVal * 0.30));
$(".25").text(Math.round(baseVal * 0.25));
$(".20").text(Math.round(baseVal * 0.20));
}
$("#base").change(function() {
update();
});
$(window).keydown(function(event) {
if (event.keyCode == 13) {
event.preventDefault();
update();
return false;
}
});
// Dark Mode
var $_GET = [];
window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(a, name, value) {
$_GET[name] = value;
});
console.log($_GET['darkmode']);
if ($_GET['darkmode'] == 'true') {
$("body").css("background-color", "#1c1c1c");
$("body").css("color", "#ffffff");
$("h1").css("color", "#ffffff");
$("h3").css("color", "#ffffff");
$("ol").css("color", "#ffffff");
$("span").css("color", "#ffffff");
$("pre").css("color", "#ffffff");
$("a").css("color", "#ffffff");
$("a").css("background-color", "#1c1c1c");
$("a").css("border-color", "#1c1c1c");
$("a").css("border-radius", "5px");
$("a").css("padding", "5px");
$("a").css("margin", "5px");
$("a").css("text-decoration", "none");
$("a").css("text-shadow", "0 0 5px #ffffff");
// Get the dark mode button and change it to light mode
var darkModeButton = document.getElementById("darkModeButton");
darkModeButton.innerHTML = "☀️ Switch to Light Mode";
darkModeButton.href = "?darkmode=false";
}
// Run update once
update();
});
</script>
</body>
</html>