Skip to content

Commit 570b33a

Browse files
committed
Version 2.1.5
1 parent 988dbf1 commit 570b33a

File tree

11 files changed

+57
-10
lines changed

11 files changed

+57
-10
lines changed

assets/css/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,5 @@
8787
"desktop": "assets/screenshot-desktop.jpg",
8888
"mobile": "assets/screenshot-mobile.jpg"
8989
},
90-
"version": "2.1.3"
90+
"version": "2.1.5"
9191
}

partials/header.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
This header template is shared across all the pages.
33
--}}
44

5-
<header class="m-header {{#if background}}with-picture{{/if}} js-header">
6-
<div class="m-mobile-topbar" data-animate="fade-down">
5+
<header class="m-header {{#if background}}with-picture{{/if}} js-header" data-animate="fade-down">
6+
<div class="m-mobile-topbar">
77
<button class="m-icon-button in-mobile-topbar js-open-menu" aria-label="{{t "Open menu"}}">
88
<span class="icon-menu" aria-hidden="true"></span>
99
</button>
@@ -28,7 +28,7 @@ This header template is shared across all the pages.
2828
<button class="m-icon-button outlined as-close-menu js-close-menu" aria-label="{{t "Close menu"}}">
2929
<span class="icon-close"></span>
3030
</button>
31-
<div class="m-menu__main" data-animate="fade-down">
31+
<div class="m-menu__main">
3232
<div class="l-wrapper">
3333
<div class="m-nav js-main-nav">
3434
<nav class="m-nav__left js-main-nav-left" role="navigation" aria-label="{{t "Main menu"}}">

src/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "3"
22

33
services:
44
ghost:
5-
image: ghost:5.33.8
5+
image: ghost:5.49.0
66
container_name: ghost
77
volumes:
88
- ./..:/var/lib/ghost/content/themes/liebling:Z

src/js/app.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ $(() => {
1818

1919
const $body = $('body');
2020
const $header = $('.js-header');
21+
const $announcementBar = $('#announcement-bar-root');
2122
const $openMenu = $('.js-open-menu');
2223
const $closeMenu = $('.js-close-menu');
2324
const $menu = $('.js-menu');
@@ -264,6 +265,28 @@ $(() => {
264265
headroom.init();
265266
}
266267

268+
if ($announcementBar.length > 0) {
269+
$announcementBar.detach().prependTo($header);
270+
$header.addClass('with-announcement-bar');
271+
272+
setTimeout(() => {
273+
$body.css('padding-top', $announcementBar.height());
274+
$header.removeAttr('data-animate');
275+
}, 500);
276+
277+
const barObserver = new MutationObserver((e) => {
278+
if (e[0].removedNodes.length) {
279+
$body.css('padding-top', 0);
280+
}
281+
})
282+
283+
barObserver.observe($announcementBar[0], { childList: true });
284+
} else {
285+
setTimeout(() => {
286+
$header.removeAttr('data-animate');
287+
}, 500);
288+
}
289+
267290
if ($recentSlider.length > 0) {
268291
const recentSwiper = new Swiper('.js-recent-slider', {
269292
modules: [FreeMode, A11y],

src/sass/app.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
@import "components/header/recent-article";
3030
@import "components/header/tags";
3131
@import "components/header/toggle-darkmode";
32+
@import "components/header/announcement-bar";
3233
@import "components/hero/hero";
3334
@import "components/hero/avatar";
3435
@import "components/hero/title";

src/sass/common/_global.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ body {
1313
background-color: var(--background-color);
1414
-webkit-font-smoothing: antialiased;
1515
-moz-osx-font-smoothing: grayscale;
16+
@include transition(padding-top linear 0.2s);
1617

1718
&.share-menu-displayed {
1819
padding-bottom: 45px;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
div.gh-announcement-bar {
2+
line-height: 1.3;
3+
font-size: 1rem;
4+
padding: 16px 48px;
5+
min-height: auto;
6+
z-index: auto;
7+
8+
@include respond-to("medium") {
9+
font-size: 1.125rem;
10+
}
11+
}

src/sass/components/header/_header.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,26 @@
44
left: 0;
55
width: 100%;
66
z-index: 4;
7-
background-color: var(--background-color);
87
will-change: transform;
8+
background-color: var(--background-color);
99
@include transition(transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1));
1010

1111
@include respond-to('medium') {
1212
padding: 15px 0;
1313
}
1414

15+
&.with-announcement-bar {
16+
@include respond-to('medium') {
17+
padding: 0;
18+
}
19+
20+
.m-menu {
21+
@include respond-to('medium') {
22+
padding: 15px 0;
23+
}
24+
}
25+
}
26+
1527
&.mobile-menu-opened {
1628
height: 100%;
1729

0 commit comments

Comments
 (0)