-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
226 lines (198 loc) · 9.56 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Badbit Breaker - Quit Bad Habits</title>
<meta
name="description"
content="Badbit Breaker helps you track the number of days since you quit a bad habit. Features include automatic progress sync, easy save/load, and more to keep you on track."
/>
<meta name="keywords" content="counter, days, day counter, quit bad habits, streak tracker, nofap, self-improvement, productivity, motivation" />
<meta name="author" content="Rezzvy" />
<link rel="stylesheet" href="./lib/bootstrap-5.3.3-dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="./lib/font-awesome-4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="./css/main.css" />
</head>
<body class="bg-body-tertiary">
<div class="min-dvh-100 d-flex flex-column gap-3">
<header class="text-bg-dark py-3">
<div class="container d-flex align-items-center justify-content-between flex-column flex-sm-row text-center text-sm-start gap-2 gap-sm-0">
<div>
<h1 class="h4 fw-bold text-uppercase m-0">Badbit Breaker</h1>
<p class="lead m-0">Track days since you quit a bad habit.</p>
</div>
<div>
<a href="javascript:void(0)" class="btn fw-bold btn-outline-light border-0" id="load-btn">Load</a>
<input type="file" accept="application/json" class="d-none" id="load-file-input" />
<a href="javascript:void(0)" class="btn fw-bold btn-light" id="save-btn">Save</a>
</div>
</div>
</header>
<main class="flex-grow-1">
<div class="container">
<section class="bg-white p-3 border mb-2">
<h2 class="h5 mb-0"><i class="fa fa-clock-o fa-fw"></i> Counter</h2>
<hr class="mt-1 mb-3" />
<div class="text-center">
<p id="main-counter-started-at" class="d-none">Started at: <span>N/A</span></p>
<div id="date-output-main">
<h3 class="display-1 mb-0 _main-time">0</h3>
<div class="fw-bold _main-unit">sec</div>
<div class="d-flex justify-content-center gap-2 mt-2 mb-3 flex-wrap">
<div class="_wrap" data-bs-toggle="tooltip">
<span class="badge text-bg-dark pe-none"><span class="years">0</span> years</span>
</div>
<div class="_wrap" data-bs-toggle="tooltip">
<span class="badge text-bg-dark pe-none"><span class="months">0</span> months</span>
</div>
<div class="_wrap" data-bs-toggle="tooltip">
<span class="badge text-bg-dark pe-none"><span class="days">0</span> days</span>
</div>
<div class="_wrap" data-bs-toggle="tooltip">
<span class="badge text-bg-dark pe-none"><span class="hours">0</span> hours</span>
</div>
<div class="_wrap" data-bs-toggle="tooltip">
<span class="badge text-bg-dark pe-none"><span class="minutes">0</span> minutes</span>
</div>
<div class="_wrap" data-bs-toggle="tooltip">
<span class="badge text-bg-dark pe-none"><span class="seconds">0</span> seconds</span>
</div>
</div>
</div>
<div>
<button class="btn btn-primary fw-bold px-4 px-sm-5" id="start-counter">Start</button>
<p id="start-button-alternative" class="small m-0 mt-1">
Or start at a specific
<a
href="javascript:void(0)"
class="link-dark link-opacity-75 link-opacity-100-hover fw-bold"
data-bs-toggle="modal"
data-bs-target="#start-at-spesific-time-modal"
>time</a
>?
</p>
</div>
</div>
</section>
<section class="bg-white p-3 border">
<h2 class="h5 mb-0"><i class="fa fa-history fa-fw"></i> History</h2>
<hr class="mt-1 mb-3" />
<div id="history-wrapper" class="d-flex flex-column gap-1"></div>
</section>
</div>
</main>
<footer class="pb-1">
<div class="container">
<p class="mb-0 small">
Made with lots of love by
<a href="https://github.com/rezzvy" class="link-dark link-opacity-100 link-opacity-75-hover fw-bold">Muhammad Reza Fahlevi</a>
</p>
</div>
</footer>
</div>
<div class="modal fade" id="stop-modal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title fs-5">Stop the counter</h2>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div>
<label>Notes</label>
<textarea
id="stop-reason-textarea-input"
class="form-control"
placeholder="Leave a note explaining why you stopped the counter."
></textarea>
</div>
<button class="btn btn-danger fw-bold px-5 w-100 mt-2" id="stop-modal-button">Stop</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="start-at-spesific-time-modal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title fs-5">Start at a spesific time</h2>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p class="d-none alert alert-danger p-2 mb-1" id="alert-invalid-date">Can't choose a time in the future.</p>
<div>
<label>Date Time</label>
<input type="datetime-local" class="form-control" id="datetime-input" />
</div>
<button class="btn btn-primary fw-bold px-5 w-100 mt-2" id="start-at-spesific-time-button">Start</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="history-detail-modal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title fs-5">Detail</h2>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row g-3">
<div class="col-12">
<div class="inner text-center" id="date-output-history">
<h3 class="display-1 mb-0 history-current-time">0</h3>
<div class="fw-bold history-current-unit">seconds</div>
<div class="d-flex justify-content-center gap-2 mt-2 mb-3 flex-wrap">
<div class="_wrap" data-bs-toggle="tooltip">
<span class="badge text-bg-dark pe-none"><span class="years">0</span> years</span>
</div>
<div class="_wrap" data-bs-toggle="tooltip">
<span class="badge text-bg-dark pe-none"><span class="months">0</span> months</span>
</div>
<div class="_wrap" data-bs-toggle="tooltip">
<span class="badge text-bg-dark pe-none"><span class="days">0</span> days</span>
</div>
<div class="_wrap" data-bs-toggle="tooltip">
<span class="badge text-bg-dark pe-none"><span class="hours">0</span> hours</span>
</div>
<div class="_wrap" data-bs-toggle="tooltip">
<span class="badge text-bg-dark pe-none"><span class="minutes">0</span> minutes</span>
</div>
<div class="_wrap" data-bs-toggle="tooltip">
<span class="badge text-bg-dark pe-none"><span class="seconds">0</span> seconds</span>
</div>
</div>
</div>
</div>
<div class="col-12 col-sm-6">
<div class="inner">
<h3 class="h6">Started</h3>
<hr class="m-0" />
<p class="m-0" id="history-start-time">N/A</p>
</div>
</div>
<div class="col-12 col-sm-6">
<div class="inner">
<h3 class="h6">Ended</h3>
<hr class="m-0" />
<p class="m-0" id="history-end-time">N/A</p>
</div>
</div>
<div class="col-12">
<div class="inner">
<h3 class="h6">Notes</h3>
<hr class="m-0" />
<textarea class="form-control" id="history-reason" readonly placeholder="No notes given"></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="./lib/bootstrap-5.3.3-dist/js/bootstrap.bundle.min.js"></script>
<script src="./lib/tickago/tickago.min.js"></script>
<script src="./src/main.js" type="module"></script>
</body>
</html>