Skip to content

Commit 17a0c8e

Browse files
committed
Updated preview pictures to be positioned and sized better
1 parent 84644ce commit 17a0c8e

File tree

4 files changed

+71
-13
lines changed

4 files changed

+71
-13
lines changed

_scss/_components.scss

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,26 @@
8989
&__link {
9090
display: block;
9191
//padding: 2em 1em;
92-
padding: 2em calc(2em + 3.5em) 2em 1em;
92+
padding: 2em calc(2em + 6.5em) 2em 1em;
9393
position: relative;
9494

9595
@media (min-width: $mq-md) {
9696
//padding: 3em 8em;
97-
padding: 3em calc(3em + 3.5em) 3em 8em;
97+
padding: 3em calc(3em + 5em) 3em 2em;
98+
}
99+
100+
@media (min-width: $mq-lg) {
101+
padding: 3em calc(3em + 8em) 3em 3em;
102+
}
103+
104+
@media (min-width: $mq-xl) {
105+
padding: 3em calc(3em + 8em) 3em 5em;
98106
}
99107

100108
@media (min-width: $mq-xxl) {
101109
padding-left: 10em;
102110
//padding-right: 10em;
103-
padding-right: 13.5em;
111+
padding-right: 14em;
104112
}
105113
}
106114

_scss/main.scss

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,34 @@
2727
font-size: 0.7em;
2828
}
2929

30-
.post-image{
31-
height: 5em;
32-
width: 5em;
30+
.post-image-wrapper{
31+
height: 7em;
32+
width: 7em;
3333
border-radius: 50%;
3434
position: absolute;
3535
right: 1em;
3636
top: 50%;
3737
transform: translateY(-50%);
38+
overflow: hidden;
39+
40+
@media(min-width: $mq-md){
41+
right: 2em;
42+
}
43+
@media(min-width: $mq-lg){
44+
right: 3em;
45+
}
46+
@media(min-width: $mq-xl){
47+
right: 5em;
48+
}
49+
}
50+
51+
.post-image{
52+
width: initial;
53+
max-width: initial;
54+
55+
height: inherit;
56+
min-width: 100%;
57+
position: absolute;
58+
top: 50%;
59+
transform: translateY(-50%);
3860
}

css/main.css

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,21 @@ section {
246246
animation: fade-in 1s both; }
247247
.preview__link {
248248
display: block;
249-
padding: 2em calc(2em + 3.5em) 2em 1em;
249+
padding: 2em calc(2em + 6.5em) 2em 1em;
250250
position: relative; }
251251
@media (min-width: 54em) {
252252
.preview__link {
253-
padding: 3em calc(3em + 3.5em) 3em 8em; } }
253+
padding: 3em calc(3em + 5em) 3em 2em; } }
254+
@media (min-width: 64em) {
255+
.preview__link {
256+
padding: 3em calc(3em + 8em) 3em 3em; } }
257+
@media (min-width: 76.5em) {
258+
.preview__link {
259+
padding: 3em calc(3em + 8em) 3em 5em; } }
254260
@media (min-width: 114em) {
255261
.preview__link {
256262
padding-left: 10em;
257-
padding-right: 13.5em; } }
263+
padding-right: 14em; } }
258264
.preview__date {
259265
font-family: "Space Mono", monospace;
260266
color: #0a0a0a; }
@@ -932,12 +938,32 @@ section {
932938
margin-left: .5em;
933939
font-size: 0.7em; }
934940

935-
.post-image {
936-
height: 5em;
937-
width: 5em;
941+
.post-image-wrapper {
942+
height: 7em;
943+
width: 7em;
938944
border-radius: 50%;
939945
position: absolute;
940946
right: 1em;
941947
top: 50%;
948+
-webkit-transform: translateY(-50%);
949+
transform: translateY(-50%);
950+
overflow: hidden; }
951+
@media (min-width: 54em) {
952+
.post-image-wrapper {
953+
right: 2em; } }
954+
@media (min-width: 64em) {
955+
.post-image-wrapper {
956+
right: 3em; } }
957+
@media (min-width: 76.5em) {
958+
.post-image-wrapper {
959+
right: 5em; } }
960+
961+
.post-image {
962+
width: initial;
963+
max-width: initial;
964+
height: inherit;
965+
min-width: 100%;
966+
position: absolute;
967+
top: 50%;
942968
-webkit-transform: translateY(-50%);
943969
transform: translateY(-50%); }

index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ <h1>{{ site.title }}</h1>
4040
<a class="preview__link" href="{{ post.url | prepend: site.baseurl }}" itemprop="url">
4141
<span class="preview__date" itemprop="datePublished" datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%b %-d, %Y" }}</span>
4242
<h2 class="preview__header" itemprop="name">{{ post.title }}</h2>
43-
<img class="post-image" src="{{post.image}}">
43+
<div class="post-image-wrapper">
44+
<img class="post-image" src="{{post.image}}">
45+
</div>
4446
<!--<p class="preview__excerpt" itemprop="description">{{ post.content | strip_html | truncatewords: 30 }}</p>-->
4547
<!--<span class="preview__more">Read More</span>-->
4648
</a>

0 commit comments

Comments
 (0)