Skip to content

Commit 0cc821a

Browse files
committed
Update home.html
1 parent bde4073 commit 0cc821a

1 file changed

Lines changed: 29 additions & 46 deletions

File tree

_layouts/home.html

Lines changed: 29 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@
3232
</div>
3333
</div>
3434

35-
<!-- Upcoming Seminar + News Strip -->
35+
<!-- Upcoming Seminar + News Strip (70/20 split, inline countdown) -->
3636
<div class="strip strip-grey animate__animated animate__fadeInUp">
3737
<div class="container py-6">
38-
<div class="row justify-content-center gx-5">
38+
<div class="d-flex justify-content-between flex-wrap">
3939

40-
<!-- Event Card -->
41-
<section class="col-12 col-lg-6">
40+
<!-- 70% Event Column -->
41+
<div class="event-wrapper" style="flex:7; min-width:300px;">
4242
<div class="event-card p-4 bg-white rounded shadow-sm position-relative" style="top:-30px;">
4343
{% assign seminar = site.data.news.upcoming_seminar %}
4444
<h2 class="mb-1"><strong>{{ seminar.title }}</strong></h2>
4545
<p class="text-secondary mb-4">{{ seminar.subtitle }}</p>
4646

47-
<!-- Countdown -->
47+
<!-- Inline Countdown -->
4848
<div class="event-countdown mb-4 animate__animated animate__pulse animate__infinite">
49-
<div id="countdown" class="d-flex justify-content-center align-items-center"></div>
49+
<div id="countdown"></div>
5050
</div>
5151

5252
<!-- Details -->
@@ -72,16 +72,15 @@ <h4>Speakers</h4>
7272

7373
<!-- Action -->
7474
<div class="text-end mt-4">
75-
<a href="{{ seminar.registration_link }}"
76-
class="btn btn-primary">
75+
<a href="{{ seminar.registration_link }}" class="btn btn-primary">
7776
Join the Seminar
7877
</a>
7978
</div>
8079
</div>
81-
</section>
80+
</div>
8281

83-
<!-- News Card -->
84-
<aside class="col-12 col-md-5 col-lg-3">
82+
<!-- 20% News Column -->
83+
<div class="news-wrapper" style="flex:2; min-width:200px;">
8584
<div class="news-card p-4 bg-white rounded shadow-sm position-relative" style="top:-30px;">
8685
<h3 class="mb-3"><strong>Latest News</strong></h3>
8786
<ul class="list-unstyled mb-0">
@@ -96,7 +95,7 @@ <h3 class="mb-3"><strong>Latest News</strong></h3>
9695
{% endfor %}
9796
</ul>
9897
</div>
99-
</aside>
98+
</div>
10099

101100
</div>
102101
</div>
@@ -160,57 +159,41 @@ <h2 class="feature-title">{{ feature.title }}</h2>
160159
{% endif %}
161160

162161
<style>
163-
.event-countdown #countdown {
164-
display: flex;
165-
justify-content: center;
166-
font-size: 2.5rem;
167-
gap: 0.5rem;
168-
}
169-
.event-countdown #countdown .unit {
170-
text-align: center;
171-
}
172-
.event-countdown #countdown .unit small {
173-
display: block;
174-
font-size: 0.6rem;
175-
color: #666;
176-
}
177-
.event-countdown #countdown .sep {
178-
font-size: 2.5rem;
179-
line-height: 1;
162+
#countdown {
163+
font-size: 2rem;
180164
color: #333;
165+
text-align: center;
166+
white-space: nowrap;
181167
}
168+
#countdown span { margin: 0 0.25rem; }
182169
</style>
183-
184-
<!-- Countdown Script -->
185170
<script>
186-
document.addEventListener("DOMContentLoaded", function() {
171+
document.addEventListener("DOMContentLoaded", () => {
187172
const target = new Date("{{ seminar.date | date: "%Y-%m-%dT%H:%M:%S" }}Z");
188173
const el = document.getElementById("countdown");
189174

190-
function render() {
175+
const pad = n => String(n).padStart(2, '0');
176+
function update() {
191177
const now = new Date();
192178
let diff = target - now;
193179
if (diff <= 0) {
194-
el.innerHTML = "<strong>We're live now!</strong>";
180+
el.textContent = "We're live now!";
195181
clearInterval(timer);
196182
return;
197183
}
198-
const days = Math.floor(diff / 86400000); diff %= 86400000;
184+
const days = Math.floor(diff / 86400000); diff %= 86400000;
199185
const hours = Math.floor(diff / 3600000); diff %= 3600000;
200-
const mins = Math.floor(diff / 60000); diff %= 60000;
201-
const secs = Math.floor(diff / 1000);
186+
const mins = Math.floor(diff / 60000); diff %= 60000;
187+
const secs = Math.floor(diff / 1000);
202188

203189
el.innerHTML =
204-
`<div class="unit">${days}<small>Days</small></div>` +
205-
`<div class="sep">:</div>` +
206-
`<div class="unit">${hours}<small>Hrs</small></div>` +
207-
`<div class="sep">:</div>` +
208-
`<div class="unit">${mins}<small>Min</small></div>` +
209-
`<div class="sep">:</div>` +
210-
`<div class="unit">${secs}<small>Sec</small></div>`;
190+
`<span>${pad(days)} day</span>, ` +
191+
`<span>${pad(hours)} hours</span>, ` +
192+
`<span>${pad(mins)} mint</span>, ` +
193+
`<span>${pad(secs)} secs</span>`;
211194
}
212195

213-
render();
214-
const timer = setInterval(render, 1000);
196+
update();
197+
const timer = setInterval(update, 1000);
215198
});
216199
</script>

0 commit comments

Comments
 (0)