Minor things

This commit is contained in:
Sodbileg Gansukh 2023-07-10 15:09:26 +08:00
parent c5a1fce9d9
commit 6d7e0ec42d
5 changed files with 130 additions and 48 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

@ -134,7 +134,6 @@ a:hover {
} }
.gh-outer { .gh-outer {
position: relative;
padding: 0 max(4vmin, 20px); padding: 0 max(4vmin, 20px);
} }
@ -620,6 +619,22 @@ Search LOGO Login Subscribe
/* 6. Header */ /* 6. Header */
.gh-header {
position: relative;
}
.gh-header-image {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.gh-header-inner {
position: relative;
}
/* 6.1. Magazine layout */ /* 6.1. Magazine layout */
.gh-header.is-magazine .gh-header-inner { .gh-header.is-magazine .gh-header-inner {
@ -667,8 +682,32 @@ Search LOGO Login Subscribe
display: none; display: none;
} }
/* 6.3. Classic layout */
.gh-header.is-classic {
display: flex;
min-height: 480px;
}
.gh-header.is-classic .gh-header-inner {
display: flex;
flex-direction: column;
align-items: center;
gap: 32px;
margin: auto;
max-width: 720px;
}
.gh-header.is-classic.has-image .gh-header-inner {
color: #fff;
}
/* 7. Featured posts */ /* 7. Featured posts */
.gh-featured {
margin-top: 64px;
}
.gh-featured-feed { .gh-featured-feed {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
@ -692,6 +731,10 @@ Search LOGO Login Subscribe
/* 8. Container */ /* 8. Container */
.gh-container {
margin-top: 64px;
}
.gh-container-inner { .gh-container-inner {
display: grid; display: grid;
grid-template-columns: repeat(16, 1fr); grid-template-columns: repeat(16, 1fr);
@ -729,6 +772,7 @@ Search LOGO Login Subscribe
.gh-container.is-list .gh-card-link { .gh-container.is-list .gh-card-link {
display: flex; display: flex;
align-items: flex-start;
gap: 24px; gap: 24px;
} }
@ -750,13 +794,30 @@ Search LOGO Login Subscribe
display: none; display: none;
} }
/* 10. Footer */ /* 10. Sidebar */
.gh-about {
position: sticky;
top: 40px;
display: flex;
flex-direction: column;
align-items: center;
padding: 48px 24px;
background-color: var(--color-lighter-gray);
}
.gh-about-icon {
width: 80px;
height: 80px;
}
/* 11. Footer */
.gh-footer { .gh-footer {
margin-top: 80px; margin-top: 80px;
} }
/* 10.1. Footer bar */ /* 11.1. Footer bar */
.gh-footer-bar { .gh-footer-bar {
display: grid; display: grid;
@ -775,7 +836,7 @@ Search LOGO Login Subscribe
text-align: right; text-align: right;
} }
/* 10.2. Footer signup */ /* 11.2. Footer signup */
.gh-footer-signup { .gh-footer-signup {
display: flex; display: flex;

View File

@ -108,11 +108,17 @@
"Magazine", "Magazine",
"Highlight", "Highlight",
"Landing", "Landing",
"Search" "Search",
"Off"
], ],
"default": "Magazine", "default": "Magazine",
"group": "homepage" "group": "homepage"
}, },
"use_publication_cover_as_background": {
"type": "boolean",
"default": false,
"group": "homepage"
},
"show_featured": { "show_featured": {
"type": "boolean", "type": "boolean",
"default": true, "default": true,

View File

@ -1,46 +1,61 @@
<section class="gh-header is-{{#match headerStyle "Magazine"}}magazine{{else match headerStyle "Highlight"}}highlight{{else}}classic{{/match}} gh-outer"> {{#match headerStyle "!=" "Off"}}
<div class="gh-header-inner gh-inner"> <section class="gh-header is-{{#match headerStyle "Magazine"}}magazine{{else match headerStyle "Highlight"}}highlight{{else}}classic{{/match}}{{#if @custom.use_publication_cover_as_background}} has-image{{/if}} gh-outer">
{{!-- Magazine layout --}} {{!-- Background image --}}
{{#match headerStyle "Magazine"}} {{#if @custom.use_publication_cover_as_background}}
{{#foreach posts limit="7"}} {{#match headerStyle "!=" "Magazine"}}
{{#match @number 2}} {{#match headerStyle "!=" "Highlight"}}
<div class="gh-header-left"> {{#if @site.cover_image}}
{{/match}} <img class="gh-header-image" src="{{@site.cover_image}}" alt="{{@site.title}}">
{{#match @number 5}} {{/if}}
<div class="gh-header-right"> {{/match}}
{{/match}} {{/match}}
{{> "loop"}} {{/if}}
{{#match @number 4}}
</div>
{{/match}}
{{#match @number 7}}
</div>
{{/match}}
{{/foreach}}
{{/match}}
{{!-- Highlight layout --}} <div class="gh-header-inner gh-inner">
{{#match headerStyle "Highlight"}}
{{#foreach posts limit="4"}}
{{> "loop"}}
{{/foreach}}
{{/match}}
{{!-- Landing layout --}} {{!-- Magazine layout --}}
{{#match headerStyle "Landing"}} {{#match headerStyle "Magazine"}}
<h1>Founded by Australian journalist Claire Lehmann, Quillette publishes high quality long reads on diverse topics, daily.</h1> {{#foreach posts limit="7"}}
<form> {{#match @number 2}}
<input type="email"> <div class="gh-header-left">
<button type="submit">Subscribe</button> {{/match}}
</form> {{#match @number 5}}
{{/match}} <div class="gh-header-right">
{{/match}}
{{> "loop"}}
{{#match @number 4}}
</div>
{{/match}}
{{#match @number 7}}
</div>
{{/match}}
{{/foreach}}
{{/match}}
{{!-- Search layout --}} {{!-- Highlight layout --}}
{{#match headerStyle "Search"}} {{#match headerStyle "Highlight"}}
<h1>Founded by Australian journalist Claire Lehmann, Quillette publishes high quality long reads on diverse topics, daily.</h1> {{#foreach posts limit="4"}}
<div>Search</div> {{> "loop"}}
{{/match}} {{/foreach}}
{{/match}}
</div> {{!-- Landing layout --}}
</section> {{#match headerStyle "Landing"}}
<h1>Founded by Australian journalist Claire Lehmann, Quillette publishes high quality long reads on diverse topics, daily.</h1>
<form>
<input type="email" placeholder="jamie@example.com">
<button class="gh-button" type="submit">Subscribe</button>
</form>
{{/match}}
{{!-- Search layout --}}
{{#match headerStyle "Search"}}
<h1>Founded by Australian journalist Claire Lehmann, Quillette publishes high quality long reads on diverse topics, daily.</h1>
<button data-ghost-search>{{> "icons/search"}}Search</button>
{{/match}}
</div>
</section>
{{/match}}