Skip to content

Commit b8e07ec

Browse files
committed
minor changes to page layout
1 parent 306688c commit b8e07ec

File tree

3 files changed

+55
-45
lines changed

3 files changed

+55
-45
lines changed

public/main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ function updateTimer(minutes, seconds, timerElement, totalDuration) {
2020
const remainingTime = minutes * 60 + seconds;
2121
const remainingPercentage = (remainingTime / totalDuration) * 100;
2222
if (remainingPercentage <= 20) {
23-
document.getElementById('pri-container').classList.add('warning');
23+
document.querySelector('main').classList.add('warning');
2424
} else {
25-
document.getElementById('pri-container').classList.remove('warning');
25+
document.querySelector('main').classList.remove('warning');
2626
}
2727
}
2828

public/styles.css

+41-30
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,47 @@
1+
/* Debug Start
2+
* { outline: 1px solid red; }
3+
@media (min-width: 100vw) {
4+
* {
5+
background-color: rgba(255, 0, 0, 0.1);
6+
}
7+
}
8+
Debug End */
9+
110
body {
211
font-family: Arial, sans-serif;
12+
background-color: #f0f0f0;
13+
margin: 0;
14+
padding: 0;
15+
overflow-x: hidden; /* Prevents horizontal scrolling */
16+
}
17+
main {
318
display: flex;
419
flex-direction: column;
5-
justify-content: center;
620
align-items: center;
7-
height: 100vh;
8-
margin: 0;
9-
background-color: #f0f0f0;
10-
}
11-
#time-container {
12-
text-align: center;
13-
margin-bottom: 20px;
14-
}
15-
#pri-container {
21+
justify-content: center;
1622
text-align: center;
17-
min-width: 25%;
23+
width: 25%;
24+
max-width: 100vw;
1825
background-color: #ffffff;
1926
border-radius: 10px;
27+
margin: 5% auto 0;
2028
padding: 2rem;
2129
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
2230
transition: background-color 0.3s ease;
2331
}
32+
footer {
33+
display: flex;
34+
justify-content: center;
35+
align-items: center;
36+
text-align: center;
37+
margin: 0 auto;
38+
padding: 5px;
39+
width: 100%
40+
}
41+
#time-container {
42+
text-align: center;
43+
margin-bottom: 20px;
44+
}
2445
.timer-item.warning {
2546
background-color: #ffff99; /* Light yellow for warning state */
2647
}
@@ -48,6 +69,7 @@ h2 {
4869
}
4970
footer a {
5071
text-decoration: none;
72+
margin: 0 10px
5173
}
5274
.next-button:hover {
5375
background-color: #218838;
@@ -56,39 +78,28 @@ footer a {
5678
background-color: #6c757d;
5779
cursor: not-allowed;
5880
}
59-
footer {
60-
position: fixed;
61-
bottom: 10px;
62-
right: 10px;
63-
display: flex;
64-
gap: 10px;
65-
align-items: center;
66-
}
6781

6882
/* Mobile-specific styles */
6983
@media (max-width: 600px) {
70-
body {
71-
padding: 1rem;
72-
}
73-
#pri-container {
84+
main {
7485
width: 100%;
86+
margin: 0 auto;
87+
box-shadow: none;
7588
}
7689
#next-item {
77-
width: 100%;
90+
width: 90%;
7891
padding: 1rem;
7992
}
8093
}
81-
8294
/* Tablet-specific styles */
8395
@media (min-width: 601px) and (max-width: 1024px) {
84-
body {
85-
padding: 2rem;
86-
}
87-
#pri-container {
96+
main {
8897
width: 75%;
98+
margin: 0 auto;
99+
box-shadow: none;
89100
}
90101
#next-item {
91102
width: 70%;
92103
padding: 1rem;
93104
}
94-
}
105+
}

views/timer.ejs

+12-13
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@
77
<link rel="stylesheet" href="/styles.css">
88
</head>
99
<body>
10-
<div id="pri-container">
11-
<div id="time-container"></div>
12-
<button id="next-item" class="next-button">Next Item</button>
13-
</div>
14-
<script src="/main.js"></script>
15-
<script>
16-
const agendaItems = <%- JSON.stringify(agendaItems) %>;
17-
const timeItems = <%- JSON.stringify(timeItems) %>;
18-
let currentItemIndex = 0;
19-
let currentInterval;
20-
21-
showNextItem();
22-
</script>
10+
<main>
11+
<div id="time-container"></div>
12+
<button id="next-item" class="next-button">Next Item</button>
13+
</main>
14+
<script src="/main.js"></script>
15+
<script>
16+
const agendaItems = <%- JSON.stringify(agendaItems) %>;
17+
const timeItems = <%- JSON.stringify(timeItems) %>;
18+
let currentItemIndex = 0;
19+
let currentInterval;
20+
showNextItem();
21+
</script>
2322
<footer>
2423
<a href="#">Link 1</a>
2524
<a href="#">Link 2</a>

0 commit comments

Comments
 (0)