Skip to content

Commit 3a75ec3

Browse files
committed
update
1 parent 338b81a commit 3a75ec3

4 files changed

Lines changed: 55 additions & 128 deletions

File tree

assets/js/script.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
// Preloader js
55
$(window).on('load', function () {
66
$('.preloader').fadeOut(100);
7-
var calendarContainer = document.getElementById('calendar-container');
8-
if(calendarContainer){
9-
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
10-
const html = `<iframe src="https://calendar.google.com/calendar/embed?src=c_62694f414055ac569e5cb12dafbb0890ca22f3640b177a4b10b53171fbc9bdd4%40group.calendar.google.com&ctz=${timezone}" style="border:0; width:100%; min-height:500px;margin:0px;" frameborder="0" scrolling="no"></iframe>`
11-
calendarContainer.innerHTML = html;
12-
}
137
});
148

159
// Accordions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

layouts/partials/header.html

Lines changed: 3 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -60,132 +60,13 @@
6060
</ul>
6161
</div>
6262
<div class="col3">
63-
{{ if eq .Name "About" }}
64-
<ul class="menu">
65-
<li class="menu-title">Featured Information</li>
66-
</ul>
67-
<div class="featured-articles">
68-
{{ range where site.Data.featured_articles.about "visible" true }}
69-
<div class="article-card">
70-
<a href="{{ .link }}" class="article-link">
71-
<div class="article-image">
72-
<img src="{{ .image }}" alt="{{ .title }}">
73-
</div>
74-
<div class="article-content">
75-
<h4>{{ .title }}</h4>
76-
<p>{{ .description }}</p>
77-
</div>
78-
</a>
79-
</div>
80-
{{ end }}
81-
{{ else if eq .Name "Activities" }}
82-
<ul class="menu">
83-
<li class="menu-title">Featured Information</li>
84-
</ul>
85-
<div class="featured-articles">
86-
{{ range where site.Data.featured_articles.activities "visible" true }}
87-
<div class="article-card">
88-
<a href="{{ .link }}" class="article-link">
89-
<div class="article-image">
90-
<img src="{{ .image }}" alt="{{ .title }}">
91-
</div>
92-
<div class="article-content">
93-
<h4>{{ .title }}</h4>
94-
<p>{{ .description }}</p>
95-
</div>
96-
</a>
97-
</div>
98-
{{ end }}
99-
{{ else if eq .Name "Learning" }}
100-
<ul class="menu">
101-
<li class="menu-title">Featured Articles</li>
102-
</ul>
103-
<div class="featured-articles">
104-
{{ range where site.Data.featured_articles.learning "visible" true }}
105-
<div class="article-card">
106-
<a href="{{ .link }}" class="article-link">
107-
<div class="article-image">
108-
<img src="{{ .image }}" alt="{{ .title }}">
109-
</div>
110-
<div class="article-content">
111-
<h4>{{ .title }}</h4>
112-
<p>{{ .description }}</p>
113-
</div>
114-
</a>
115-
</div>
116-
{{ end }}
117-
{{ else if eq .Name "Community" }}
118-
<ul class="menu">
119-
<li class="menu-title">Featured Activity</li>
120-
</ul>
121-
<div class="featured-articles">
122-
{{ $pages := where site.Pages "Type" "in" "redirects" }}
123-
{{ $pages = where $pages "Section" "events" }}
124-
{{ range first 1 ($pages.ByDate.Reverse) }}
125-
<div class="article-card">
126-
<a href="{{ .Params.redirect }}" class="article-link" target="_blank">
127-
<div class="article-image">
128-
<img src="{{ .Params.image }}" alt="{{ .Title }}">
129-
</div>
130-
<div class="article-content">
131-
<h4>{{ .Title }} will be held on {{ .Date.Format "January 2, 2006" }}</h4>
132-
</div>
133-
</a>
134-
</div>
135-
{{ end }}
136-
{{ range where site.Data.featured_articles.community "visible" true }}
137-
<div class="article-card">
138-
<a href="{{ .link }}" class="article-link">
139-
<div class="article-image">
140-
<img src="{{ .image }}" alt="{{ .title }}">
141-
</div>
142-
<div class="article-content">
143-
<h4>{{ .title }}</h4>
144-
</div>
145-
</a>
146-
</div>
147-
{{ end }}
148-
{{ else if eq .Name "Blog & News" }}
149-
<ul class="menu">
150-
<li class="menu-title">Featured Articles</li>
151-
</ul>
152-
<div class="featured-articles">
153-
{{ range where site.Data.featured_articles.blog "visible" true }}
154-
<div class="article-card">
155-
<a href="{{ .link }}" class="article-link">
156-
<div class="article-image">
157-
<img src="{{ .image }}" alt="{{ .title }}">
158-
</div>
159-
<div class="article-content">
160-
<h4>{{ .title }}</h4>
161-
</div>
162-
</a>
163-
</div>
164-
{{ end }}
165-
</div>
166-
{{ end }}
167-
</div>
168-
</div>
169-
</div>
170-
</li>
171-
{{ else }}
172-
{{ if eq .Name "Schedule" }}
173-
<li class="menu-item-has-children">
174-
<a href="#" style="border-bottom: 0px solid #e0e0e0;"><span>{{ .Name }}</span></a>
175-
<div class="sub-menu" style="padding:0px;margin:0px;">
176-
<div style="width:100%;margin:0px;padding:0px;" id="calendar-container">
177-
<div id="calendar-loading" style="text-align:center;padding:40px;color:#666;">
178-
<i class="ti-reload" style="animation: spin 2s linear infinite;display:block;font-size:24px;margin-bottom:10px;"></i>
179-
<span>Loading...</span>
63+
{{ partial "featured-articles.html" . }}
18064
</div>
18165
</div>
18266
</div>
18367
</li>
184-
{{else}}
185-
<li class="menu-item">
186-
<a href="{{ .URL | absURL }}" {{ with .Pre }} target="{{ . }}" {{ end }}><span>{{ .Name }}</span></a>
187-
</li>
188-
{{ end }}
68+
{{ else }}
69+
{{ partial "menu.html" . }}
18970
{{ end }}
19071
{{ end }}
19172
</ul>

layouts/partials/menu.html

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{{ if eq .Name "Schedule" }}
2+
<li class="menu-item-has-children">
3+
<a href="#" style="border-bottom: 0px solid #e0e0e0;"><span>{{ .Name }}</span></a>
4+
<div class="sub-menu" style="padding:0px;margin:0px;">
5+
<div style="width:100%;margin:0px;padding:0px;" id="calendar-container">
6+
<div id="calendar-loading" style="text-align:center;padding:40px;color:#666;">
7+
<i class="ti-reload" style="animation: spin 2s linear infinite;display:block;font-size:24px;margin-bottom:10px;"></i>
8+
<span>Loading...</span>
9+
</div>
10+
</div>
11+
</div>
12+
</li>
13+
14+
<script>
15+
document.addEventListener('DOMContentLoaded', function () {
16+
var calendarContainer = document.getElementById('calendar-container');
17+
if(calendarContainer){
18+
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
19+
const html = `<iframe src="https://calendar.google.com/calendar/embed?src=c_62694f414055ac569e5cb12dafbb0890ca22f3640b177a4b10b53171fbc9bdd4%40group.calendar.google.com&ctz=${timezone}" style="border:0; width:100%; min-height:500px;margin:0px;" frameborder="0" scrolling="no"></iframe>`
20+
calendarContainer.innerHTML = html;
21+
}
22+
23+
const observer = new MutationObserver((mutations) => {
24+
mutations.forEach((mutation) => {
25+
if (mutation.addedNodes.length > 0) {
26+
const loadingElement = document.getElementById('calendar-loading');
27+
if (loadingElement) {
28+
loadingElement.style.transition = 'opacity 0.5s ease-out';
29+
loadingElement.style.opacity = '1';
30+
31+
setTimeout(() => {
32+
loadingElement.style.opacity = '0';
33+
setTimeout(() => {
34+
loadingElement.style.display = 'none';
35+
}, 500);
36+
}, 2000);
37+
}
38+
}
39+
});
40+
});
41+
42+
if (calendarContainer) {
43+
observer.observe(calendarContainer, { childList: true, subtree: true });
44+
}
45+
});
46+
</script>
47+
{{else}}
48+
<li class="menu-item">
49+
<a href="{{ .URL | absURL }}" {{ with .Pre }} target="{{ . }}" {{ end }}><span>{{ .Name }}</span></a>
50+
</li>
51+
{{ end }}

0 commit comments

Comments
 (0)