Skip to content

Commit

Permalink
Merge pull request #195 from nunocoracao/194-background-homepage-need…
Browse files Browse the repository at this point in the history
…s-a-max-width

updates to the homepage background setup
  • Loading branch information
nunocoracao authored Nov 6, 2022
2 parents 642db32 + 8f588f5 commit 9848ca7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
6 changes: 5 additions & 1 deletion assets/css/compiled/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,10 @@ select {
max-width: 65ch;
}

.max-w-\[1600px\] {
max-width: 1600px;
}

.max-w-3xl {
max-width: 48rem;
}
Expand Down Expand Up @@ -3065,7 +3069,7 @@ body:has(#menu-controller:checked) {
}

.thumbnail_card {
height: 300px;
height: 250px;
background-repeat:no-repeat;
background-size:cover;
background-position:center;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ body:has(#menu-controller:checked) {
}

.thumbnail_card {
height: 300px;
height: 250px;
background-repeat:no-repeat;
background-size:cover;
background-position:center;
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/assets/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ window.addEventListener("DOMContentLoaded", (event) => {
});

var list_config = [
"CardViewProse",
"CardViewScreenWidth",
"CardViewProse",
"NormalView"
]

Expand Down
2 changes: 1 addition & 1 deletion exampleSite/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mainSections = ["docs"]
layout = "custom" # valid options: page, profile, hero, card, background, custom
homepageImage = "/img/iceland.jpg" # used in: hero, and card
showRecent = false
showRecentItems = 9
showRecentItems = 10
showMoreLink = true
showMoreLinkDest = "docs"
cardView = true
Expand Down
8 changes: 5 additions & 3 deletions exampleSite/layouts/partials/recent-articles-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h2 class="mt-8 text-2xl font-extrabold mb-10">{{ i18n "shortcode.recent_article
</span>
</div>

<div id="CardViewProse" class="">
<div id="CardViewProse" class="hidden h-full">
<section class="w-full">
<div class="flex flex-wrap">
{{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in"
Expand All @@ -28,8 +28,9 @@ <h2 class="mt-8 text-2xl font-extrabold mb-10">{{ i18n "shortcode.recent_article
</div>
</section>
</div>
<div id="CardViewScreenWidth" class="hidden h-full">
<section class="relative w-screen" style="left: calc(-50vw + 50%);">

<div id="CardViewScreenWidth" class="">
<section class="relative w-screen max-w-[1600px]" style="left: calc(max(-50vw,-800px) + 50%);">
<div class="flex flex-wrap pl-8 pr-8">
{{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in"
.Site.Params.mainSections)).Pages }}
Expand All @@ -40,6 +41,7 @@ <h2 class="mt-8 text-2xl font-extrabold mb-10">{{ i18n "shortcode.recent_article
</div>
</section>
</div>

<div id="NormalView" class="hidden h-full">
<section class="space-y-10 w-full">
{{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in"
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/recent-articles.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h2 class="mt-8 text-2xl font-extrabold mb-10">{{ i18n "shortcode.recent_article

{{ if .Site.Params.homepage.cardView | default false }}
{{ if .Site.Params.homepage.cardViewScreenWidth | default false }}
<section class="relative w-screen" style="left: calc(-50vw + 50%);">
<section class="relative w-screen max-w-[1600px]" style="left: calc(max(-50vw,-800px) + 50%);">
<div class="flex flex-wrap pl-8 pr-8">
{{ else }}
<section class="w-full">
Expand Down

0 comments on commit 9848ca7

Please sign in to comment.