Skip to content

Commit 77b962e

Browse files
committed
chore: remove modes support
1 parent b600ef4 commit 77b962e

File tree

7 files changed

+41
-24
lines changed

7 files changed

+41
-24
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ Available online at [https://kungfux.github.io/binarytimer/](https://kungfux.git
1818
## Available parameters
1919

2020
- `time=10` - countdown from time in seconds
21-
- `mode=minimalist` - hide all controls showing countdown timer only

src/App.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import routes from "./routes";
44
import TimerSetup from "./pages/TimerSetup.page";
55
import TimerCountdown from "./pages/TimerCountdown.page";
66
import Footer from "./components/Footer.component";
7-
import { MuteProvider } from "./contexts/Mute.context";
87
import { MuteButton } from "./components/MuteButton.component";
8+
import { MuteProvider } from "./contexts/Mute.context";
99

1010
function App() {
1111
const location = useLocation();
1212
const queryParams = new URLSearchParams(location.search);
1313
const timeParam = queryParams.get("time");
14-
const isMinimalistMode = queryParams.get("mode") === "minimalist";
1514

1615
return (
1716
<MuteProvider>
@@ -25,7 +24,7 @@ function App() {
2524
element={timeParam ? <TimerCountdown /> : <TimerSetup />}
2625
/>
2726
</Routes>
28-
{isMinimalistMode ? <div /> : <Footer />}
27+
<Footer />
2928
</div>
3029
</MuteProvider>
3130
);

src/BitCounter.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ class BitCounter {
4646

4747
public toString(): string {
4848
const time = this.getTime();
49+
50+
if (time === 0) {
51+
return "Time's up!";
52+
}
53+
4954
const hours = Math.floor(time / 3600);
5055
const minutes = Math.floor((time % 3600) / 60);
5156
const seconds = time % 60;

src/components/Footer.component.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
const Footer = () => {
22
return (
3-
<footer className="text-gray-400 py-4 flex justify-center text-s dark:text-grey-600">
3+
<footer className="py-4 flex justify-center text-gray-400 dark:text-grey-600">
44
<p className="my-4">
5-
<span className="uppercase">12-bit binary timer</span>
6-
<span className="px-2">😎</span>
7-
<span>kungfux &copy; {new Date().getFullYear()}</span>
5+
<span className="uppercase">
6+
<a href="https://github.com/kungfux/binarytimer">
7+
12-bit binary timer
8+
</a>
9+
</span>
10+
<span className="px-2">by</span>
11+
<span>
12+
<a href="https://kungfux.github.io/">kungfux</a> &copy;{" "}
13+
{new Date().getFullYear()}
14+
</span>
815
</p>
916
</footer>
1017
);

src/components/IconButton.component.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
.button {
1919
font-weight: 500;
20-
margin: 1rem;
20+
margin: 1rem .5rem;
2121
}
2222

2323
.button:last-child {

src/index.css

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,20 @@ body {
1616
font-family: 'Montserrat', sans-serif;
1717
}
1818

19+
a {
20+
text-decoration: none;
21+
color: #3498dbcc;
22+
23+
&:hover {
24+
text-decoration: underline;
25+
color: #3498db;
26+
}
27+
}
28+
1929
@media (prefers-color-scheme: light) {
2030
:root {
21-
color: #213547;
22-
background-color: #ffffff;
31+
color: #242424;
32+
background-color: rgba(255, 255, 255, 0.87);
2333
}
2434
}
2535

src/pages/TimerCountdown.page.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ function TimerCountdown() {
1414
const { isMuted } = useMuteContext();
1515
const queryParams = new URLSearchParams(location.search);
1616
const timeParam = queryParams.get("time");
17-
const isMinimalistMode = queryParams.get("mode") === "minimalist";
1817

1918
const bitCounter = useMemo(() => new BitCounter(), []);
2019

@@ -135,20 +134,18 @@ function TimerCountdown() {
135134
))}
136135
</div>
137136
<p className="my-4">{bitCounter.toString()}</p>
138-
{!isMinimalistMode && stopButton}
137+
{stopButton}
139138
</div>
140-
{!isMinimalistMode && (
141-
<div
142-
className={`mt-8 rounded-2xl ${
143-
timeLeft <= 0 ? "pointer-events-none opacity-50" : ""
144-
}`}
145-
>
146-
<p className="mb-4">Add time:</p>
147-
<div className="flex flex-row justify-center align-center flex-wrap">
148-
{addTimeButtons}
149-
</div>
139+
<div
140+
className={`mt-8 rounded-2xl ${
141+
timeLeft <= 0 ? "pointer-events-none opacity-50" : ""
142+
}`}
143+
>
144+
<p className="mb-4">Add time:</p>
145+
<div className="flex flex-row justify-center align-center flex-wrap">
146+
{addTimeButtons}
150147
</div>
151-
)}
148+
</div>
152149
</div>
153150
</>
154151
);

0 commit comments

Comments
 (0)