Version 2.1.5

This commit is contained in:
Eduardo Gomez 2023-05-28 14:28:50 +02:00
parent 988dbf1c62
commit 570b33af9c
11 changed files with 57 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -87,5 +87,5 @@
"desktop": "assets/screenshot-desktop.jpg", "desktop": "assets/screenshot-desktop.jpg",
"mobile": "assets/screenshot-mobile.jpg" "mobile": "assets/screenshot-mobile.jpg"
}, },
"version": "2.1.3" "version": "2.1.5"
} }

View File

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

View File

@ -2,7 +2,7 @@ version: "3"
services: services:
ghost: ghost:
image: ghost:5.33.8 image: ghost:5.49.0
container_name: ghost container_name: ghost
volumes: volumes:
- ./..:/var/lib/ghost/content/themes/liebling:Z - ./..:/var/lib/ghost/content/themes/liebling:Z

View File

@ -18,6 +18,7 @@ $(() => {
const $body = $('body'); const $body = $('body');
const $header = $('.js-header'); const $header = $('.js-header');
const $announcementBar = $('#announcement-bar-root');
const $openMenu = $('.js-open-menu'); const $openMenu = $('.js-open-menu');
const $closeMenu = $('.js-close-menu'); const $closeMenu = $('.js-close-menu');
const $menu = $('.js-menu'); const $menu = $('.js-menu');
@ -264,6 +265,28 @@ $(() => {
headroom.init(); headroom.init();
} }
if ($announcementBar.length > 0) {
$announcementBar.detach().prependTo($header);
$header.addClass('with-announcement-bar');
setTimeout(() => {
$body.css('padding-top', $announcementBar.height());
$header.removeAttr('data-animate');
}, 500);
const barObserver = new MutationObserver((e) => {
if (e[0].removedNodes.length) {
$body.css('padding-top', 0);
}
})
barObserver.observe($announcementBar[0], { childList: true });
} else {
setTimeout(() => {
$header.removeAttr('data-animate');
}, 500);
}
if ($recentSlider.length > 0) { if ($recentSlider.length > 0) {
const recentSwiper = new Swiper('.js-recent-slider', { const recentSwiper = new Swiper('.js-recent-slider', {
modules: [FreeMode, A11y], modules: [FreeMode, A11y],

View File

@ -29,6 +29,7 @@
@import "components/header/recent-article"; @import "components/header/recent-article";
@import "components/header/tags"; @import "components/header/tags";
@import "components/header/toggle-darkmode"; @import "components/header/toggle-darkmode";
@import "components/header/announcement-bar";
@import "components/hero/hero"; @import "components/hero/hero";
@import "components/hero/avatar"; @import "components/hero/avatar";
@import "components/hero/title"; @import "components/hero/title";

View File

@ -13,6 +13,7 @@ body {
background-color: var(--background-color); background-color: var(--background-color);
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
@include transition(padding-top linear 0.2s);
&.share-menu-displayed { &.share-menu-displayed {
padding-bottom: 45px; padding-bottom: 45px;

View File

@ -0,0 +1,11 @@
div.gh-announcement-bar {
line-height: 1.3;
font-size: 1rem;
padding: 16px 48px;
min-height: auto;
z-index: auto;
@include respond-to("medium") {
font-size: 1.125rem;
}
}

View File

@ -4,14 +4,26 @@
left: 0; left: 0;
width: 100%; width: 100%;
z-index: 4; z-index: 4;
background-color: var(--background-color);
will-change: transform; will-change: transform;
background-color: var(--background-color);
@include transition(transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1)); @include transition(transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1));
@include respond-to('medium') { @include respond-to('medium') {
padding: 15px 0; padding: 15px 0;
} }
&.with-announcement-bar {
@include respond-to('medium') {
padding: 0;
}
.m-menu {
@include respond-to('medium') {
padding: 15px 0;
}
}
}
&.mobile-menu-opened { &.mobile-menu-opened {
height: 100%; height: 100%;

View File

@ -1,6 +1,6 @@
.m-logo { .m-logo {
display: inline-block; display: inline-block;
height: 25px; height: 32px;
img { img {
width: auto; width: auto;
@ -18,7 +18,6 @@
} }
&.in-mobile-topbar { &.in-mobile-topbar {
height: 20px;
margin: 0 $mobile-space; margin: 0 $mobile-space;
} }
} }