This commit is contained in:
Vrifox 2020-11-12 09:12:55 +01:00
parent 7b777115c8
commit cc98aeaa05
3 changed files with 149 additions and 152 deletions

View file

@ -43,7 +43,7 @@ h4 {
} }
hr { hr {
color: $bg60; color: $bg60;
margin: 50px 20px; margin: 60px 0;
} }
.container { .container {

View file

@ -50,12 +50,12 @@
main { main {
margin: 60px 0 0 0; margin: 60px 0 0 0;
} .latest {
.section.latest {
color: $white-dark; color: $white-dark;
display: block;
font-size: 1.5em; font-size: 1.5em;
text-align: center;
margin: -7px;
a { a {
color: $white; color: $white;
font-weight: bold; font-weight: bold;
@ -65,20 +65,18 @@ main {
text-decoration: none; text-decoration: none;
} }
} }
} }
.section.projects .inner {
.section.articles {
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 1rem; grid-gap: 1rem;
margin: 20px 0; grid-template-columns: repeat(4, 1fr);
margin: 40px 0;
a { a {
color: $white-light; color: $white-light;
text-decoration: none; text-decoration: none;
} }
article { article {
background: $bg60; background: $bg60;
border: 1px solid $bg60;
border-radius: 5px; border-radius: 5px;
color: $white; color: $white;
display: flex; display: flex;
@ -89,88 +87,89 @@ main {
&:hover { &:hover {
background: $bg70; background: $bg70;
} }
img {
background: $bg80;
border-radius: 5px 5px 0px 0px;
margin: -20px -20px 15px -20px;
max-height: 250px;
max-width: calc(100% + 40px);
object-fit: cover;
order: -1;
}
h1 { h1 {
color: $white;
font-size: 18px; font-size: 18px;
font-weight: 400; font-weight: 400;
margin: 0 0 10px 0;
}
.meta {
color: $white-dark;
font-size: 14px;
margin: 0; margin: 0;
text-align: center;
} }
.author { p.meta {
color: $white-dark; color: $white-dark;
font-style: italic; font-size: 15px;
margin: 0;
text-align: center;
span.status {
/*&::before {
content: '·';
margin-right: 9px;
}*/
} }
} }
} }
}
.section.projects { .section.articles {
margin: 0 auto;
.inner {
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 1rem; grid-gap: 1rem;
grid-template-columns: repeat(3, 1fr); margin: 40px 0;
margin: 20px 0;
a { a {
color: $white-light; color: $white-light;
text-decoration: none; text-decoration: none;
} }
article { article {
background: $bg60; background: $bg60;
border: 1px solid $bg60;
border-radius: 5px; border-radius: 5px;
color: $white-light; color: $white;
display: flex; display: flex;
flex-flow: column; flex-flow: column;
height: max-content; height: 100%;
padding: 20px; padding: 20px;
transition: background .2s; transition: background .2s;
&:hover { &:hover {
background: $bg70; background: $bg70;
p.description {
max-height: none;
} }
img {
background: $bg80;
border-radius: 5px 5px 0px 0px;
margin: -20px -20px 10px -20px;
max-height: 170px;
max-width: calc(100% + 40px);
object-fit: cover;
order: -1;
} }
h1 { h1 {
font-size: 20px; font-size: 18px;
font-weight: 400; font-weight: 400;
margin: 0; margin: 0 0 10px 0;
min-height: 65px;
text-align: center;
color: $white;
} }
.meta { p.description {
color: $white-dark; color: $white-dark;
font-size: 15px; margin: 20px 0;
margin: 0; flex: 1;
} }
.status { p.meta {
color: $white-dark; color: $white-dark;
&::before { font-size: 14px;
content: '·'; margin: 0;
margin-right: 9px; text-align: center;
span.author {
font-style: italic;
}
}
} }
} }
} }
} }
@media (max-width: 900px) { @media (max-width: 900px) {
.section.articles { main {
.section.projects.inner {
grid-template-columns: repeat(2, 1fr);
}
.section.articles.inner {
grid-template-columns: repeat(1, 1fr); grid-template-columns: repeat(1, 1fr);
} }
.section.projects {
grid-template-columns: repeat(2, 1fr);
} }
} }
@media (max-width: 600px) { @media (max-width: 600px) {
@ -195,7 +194,9 @@ main {
} }
} }
} }
.section.projects { main {
.section.projects.inner {
grid-template-columns: repeat(1, 1fr); grid-template-columns: repeat(1, 1fr);
} }
}
} }

View file

@ -28,44 +28,40 @@
</section> </section>
<main> <main>
<div class="container"> <div class="container">
<span class="section latest"> <section class="section projects">
latest <span class="latest">
<a href="{{ "/blog" | relURL }}">posts</a> latest <a href="{{ "/projects" | relURL }}">projects</a>
</span> </span>
<section class="section articles"> <div class="section projects inner">
{{ range first 2 (where .Site.RegularPages "Type" "post") }} {{ range first 4 (where .Site.RegularPages "Type" "project") }}
<a href="{{ .Permalink }}"> <a href="{{ .Permalink }}">
<article> <article>
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
<p class="meta">{{ with .Params.activetime }}<span class="date">{{ . }}</span>{{ end }}<br />{{ with .Params.status }}<span class="status">{{ . }}</span>{{ end }}</p>
</article>
</a>
{{ end }}
</div>
</section>
<hr>
<section class="section articles">
<span class="latest">
latest <a href="{{ "/blog" | relURL }}">posts</a>
</span>
<div class="section articles inner">
{{ range first 4 (where .Site.RegularPages "Type" "post") }}
<a href="{{ .Permalink }}">
<article>
<h1>{{ .Title }}</h1>
{{ with .Description }}<p class="description">{{ . }}</p>{{ end }}
<p class="meta" title="{{ .Date.Format "2 Jan 2006, 15:04 MST" }}"> <p class="meta" title="{{ .Date.Format "2 Jan 2006, 15:04 MST" }}">
<span class="date">{{ .Date.Format "2 January 2006" }}</span> <span class="date">{{ .Date.Format "2 January 2006" }}</span>
<span class="author">{{ with .Params.author }}by {{ end }}{{ .Params.author }}</span> <span class="author">{{ with .Params.author }}by {{ end }}{{ .Params.author }}</span>
</p> </p>
{{ with .Description }}
<p>{{ . }}</p>
{{ end }}
{{ with .Params.featured_image }}
<img src="{{ . | relURL }}" alt="">
{{ end }}
</article>
</a>
{{ end }}
</section>
<span class="section latest">
latest
<a href="{{ "/projects" | relURL }}">projects</a>
</span>
<section class="section projects">
{{ range first 3 (where .Site.RegularPages "Type" "project") }}
<a href="{{ .Permalink }}">
<article>
<h1>{{ .Title }}</h1>
<p class="meta">{{ with .Params.activetime }}<span class="date">{{ . }}</span>{{ end }} {{ with .Params.status }}<span class="status">{{ . }}</span>{{ end }}</p>
{{ with .Description }}<p>{{ . }}</p>{{ end }}
<img {{ with .Params.featured_image }}src="{{ . | relURL }}"{{ end }} alt="">
</article> </article>
</a> </a>
{{ end }} {{ end }}
</div>
</section> </section>
</div> </div>
</main> </main>