|
19 | 19 | <div class="logo"> |
20 | 20 | <a href='{{ if eq .Site.Language.Lang "en" }}{{ site.BaseURL }}{{ else }}{{ site.BaseURL }}{{ .Site.Language.Lang }}{{end}}' |
21 | 21 | title="{{ site.Title }}" style="border-bottom: 0px solid #e0e0e0;"> |
22 | | - <img width="{{ site.Params.logo_width}}" src="{{ site.Params.logo | absURL }}" alt="{{ site.Title }}"> |
| 22 | + <img src="{{ site.Params.logo | absURL }}" alt="{{ site.Title }}" class="desktop-logo"> |
| 23 | + <img src="{{ site.Params.mobileLogo | default site.Params.logo | absURL }}" alt="{{ site.Title }}" class="mobile-logo"> |
23 | 24 | </a> |
24 | 25 | </div> |
25 | 26 |
|
@@ -209,76 +210,6 @@ <h4>{{ .title }}</h4> |
209 | 210 | </div> |
210 | 211 | </header> |
211 | 212 |
|
212 | | -<style> |
213 | | -@keyframes spin { |
214 | | - from { transform: rotate(0deg); } |
215 | | - to { transform: rotate(360deg); } |
216 | | -} |
217 | | - |
218 | | -@keyframes pulse { |
219 | | - 0% { transform: scale(1); } |
220 | | - 50% { transform: scale(1.5); } |
221 | | - 100% { transform: scale(1); } |
222 | | -} |
223 | | - |
224 | | -.slack-icon-pulse { |
225 | | - display: inline-block; |
226 | | - animation: pulse 1.5s infinite ease-in-out; |
227 | | - vertical-align: middle; |
228 | | -} |
229 | | - |
230 | | -.btn-outline-primary { |
231 | | - box-shadow: none !important; |
232 | | -} |
233 | | - |
234 | | -.btn-outline-primary:hover, |
235 | | -.btn-outline-primary:active, |
236 | | -.btn-outline-primary:focus { |
237 | | - box-shadow: none !important; |
238 | | - outline: none !important; |
239 | | - border: 0 !important; |
240 | | -} |
241 | | - |
242 | | -.btn-outline-primary:hover .slack-icon-pulse { |
243 | | - animation: pulse 0.8s infinite ease-in-out; |
244 | | -} |
245 | | - |
246 | | -.language-selector { |
247 | | - display: inline-block; |
248 | | - margin-right: 10px; |
249 | | -} |
250 | | - |
251 | | -.language-selector select { |
252 | | - padding: 6px 12px; |
253 | | - border: 1px solid #ddd; |
254 | | - border-radius: 4px; |
255 | | - background-color: white; |
256 | | - cursor: pointer; |
257 | | - min-width: 100px; |
258 | | - width: 100px; |
259 | | -} |
260 | | - |
261 | | -.header-cta { |
262 | | - display: flex; |
263 | | - align-items: center; |
264 | | -} |
265 | | - |
266 | | -.header-cta .search-wrapper { |
267 | | - flex-grow: 1; |
268 | | -} |
269 | | - |
270 | | -.header-cta .search-wrapper input { |
271 | | - width: 100%; |
272 | | - min-width: 200px; |
273 | | -} |
274 | | - |
275 | | -.header-cta .search-wrapper input:focus { |
276 | | - border-color: #0aa8a7; |
277 | | - box-shadow: 0 0 0 0.2rem rgba(0, 160, 160, 0.25); |
278 | | - outline: none; |
279 | | -} |
280 | | -</style> |
281 | | - |
282 | 213 | <script> |
283 | 214 | document.addEventListener('DOMContentLoaded', function () { |
284 | 215 | const hamburger = document.querySelector('.hamburger'); |
@@ -325,6 +256,26 @@ <h4>{{ .title }}</h4> |
325 | 256 | menu.classList.toggle('is-active'); |
326 | 257 | }); |
327 | 258 |
|
| 259 | + // Logo switching function for resize events |
| 260 | + const checkLogoDisplay = function() { |
| 261 | + const desktopLogo = document.querySelector('.desktop-logo'); |
| 262 | + const mobileLogo = document.querySelector('.mobile-logo'); |
| 263 | + |
| 264 | + if (window.innerWidth <= 390) { |
| 265 | + if (desktopLogo) desktopLogo.style.display = 'none'; |
| 266 | + if (mobileLogo) mobileLogo.style.display = 'block'; |
| 267 | + } else { |
| 268 | + if (desktopLogo) desktopLogo.style.display = 'block'; |
| 269 | + if (mobileLogo) mobileLogo.style.display = 'none'; |
| 270 | + } |
| 271 | + }; |
| 272 | + |
| 273 | + // Initial check |
| 274 | + checkLogoDisplay(); |
| 275 | + |
| 276 | + // Check on resize |
| 277 | + window.addEventListener('resize', checkLogoDisplay); |
| 278 | + |
328 | 279 | if (isMobile) { |
329 | 280 | subMenuParents.forEach(item => { |
330 | 281 | item.addEventListener('click', function (e) { |
|
0 commit comments