Skip to content

Commit 7f47622

Browse files
committedNov 13, 2020
Redesign of story items
1 parent e83d371 commit 7f47622

File tree

3 files changed

+84
-35
lines changed

3 files changed

+84
-35
lines changed
 

‎_includes/story_item.html

+29-23
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,43 @@
11
<div class="grid-item col-xs-12 col-sm-12 col-md-6 col-lg-4">
22
<div class="story-item card margin-15">
3-
<a href="{{ include.story.url }}">
4-
<div class="trim">
5-
<img class="image center-block img-responsive"
6-
src="{{ include.story.image }}"
7-
alt="story image"/>
8-
</div>
9-
</a>
10-
<div class="card-content">
11-
{% if include.story.language != nil %}
12-
<small class="programming-language-tooltip"
13-
>{{ include.story.language.name }}</small>
14-
{% endif %}
15-
<h2 class="title serif">
16-
<a href="{{ include.story.url }}">{{ include.story.title }}</a>
17-
</h2>
3+
<div class="card-header">
184
<div class="info">
19-
<span class="time">
20-
<span class="mdi mdi-clock"></span> {{ include.story.date | date: '%e %b %Y' }}
21-
</span>
22-
<span><i class="mdi mdi-book-open-page-variant"></i> {{ include.story.content | number_of_words | divided_by: 225 | floor }} min</span>
5+
<div class="margin-b-5">
6+
{% if include.story.author %}
7+
<span class="author">{{ include.story.author }}</span>
8+
{% endif %}
9+
<span class="badge date">{{ include.story.date | date: '%e %b, %Y' }}</span>
10+
<span>{{ include.story.content | number_of_words | divided_by: 225 | floor }} min</span>
11+
</div>
2312
{% if include.story.tags %}
2413
<div class="categories">
25-
<span class="mdi mdi-tag"></span>
2614
<small>
2715
{{ include.story.tags | join: ', ' }}
2816
</small>
2917
</div>
3018
{% endif %}
3119
</div>
32-
<p class="sneak-peek serif softcolor">
33-
{{ include.story.excerpt | strip_html }}
34-
</p>
20+
</div>
21+
<div class="move-up">
22+
<a href="{{ include.story.url }}">
23+
<div class="trim">
24+
<img class="image center-block img-responsive"
25+
src="{{ include.story.image }}"
26+
alt="story image"/>
27+
</div>
28+
</a>
29+
<div class="card-content">
30+
{% if include.story.language != nil %}
31+
<small class="programming-language-tooltip"
32+
>{{ include.story.language.name }}</small>
33+
{% endif %}
34+
<h2 class="title serif">
35+
<a href="{{ include.story.url }}">{{ include.story.title }}</a>
36+
</h2>
37+
<p class="sneak-peek serif softcolor">
38+
{{ include.story.excerpt | strip_html }}
39+
</p>
40+
</div>
3541
</div>
3642
</div>
3743
</div>

‎_sass/_helpers.scss

+8
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@
4747
margin: 20px;
4848
}
4949

50+
.margin-b-5 {
51+
margin-bottom: 5px;
52+
}
53+
54+
.margin-b-10 {
55+
margin-bottom: 10px;
56+
}
57+
5058
.margin-tb-5 {
5159
margin-top: 5px;
5260
margin-bottom: 5px;

‎_sass/_story-items.scss

+47-12
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,18 @@
6363
.image {
6464
width: 100%;
6565
height: auto;
66+
67+
@include prefix(filter, none, webkit moz ms);
68+
69+
@include prefix(transition, (all .45s ease-out), moz ms o);
6670
}
6771

6872
&:hover .image {
73+
width: 105%;
6974

75+
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
76+
filter: gray; /* IE 6-9 */
77+
@include prefix(filter, grayscale(100%), webkit moz ms o);
7078
}
7179

7280
/* this class makes sure the story image doesn't get to big */
@@ -82,6 +90,12 @@
8290
color: #868686;
8391
}
8492

93+
.badge {
94+
padding: 5px 10px;
95+
background-color: $primary-color;
96+
color: #ffffff;
97+
}
98+
8599
/***************
86100
* Cards
87101
***************/
@@ -100,21 +114,48 @@
100114
margin: 0;
101115
}
102116

117+
.info {
118+
text-align: center;
119+
margin: 0 auto;
120+
color: #727272;
121+
opacity: 0;
122+
123+
transform: translateY(20px);
124+
125+
@include prefix(transition, (all 0.3s ease-out), webkit moz o);
126+
127+
padding-bottom: 15px;
128+
129+
.date {
130+
text-transform: uppercase;
131+
margin: 0 5px;
132+
}
133+
}
134+
135+
&:hover .info {
136+
opacity: 1;
137+
transform: translateY(0px);
138+
}
139+
140+
.move-up {
141+
transform: translateY(-30px);
142+
@include prefix(transition, (all 0.3s ease-out), webkit moz o);
143+
}
144+
145+
&:hover .move-up {
146+
transform: translateY(0px);
147+
}
148+
103149
.card-content {
104150
$left: 5%;
105151
$border-color: #ad9977;
106152

107153
position: relative;
108154
background-color: white;
109-
top: -3vh;
110-
margin-left: $left;
111-
margin-right: 2%;
112-
padding: 25px 16px 15px 25px;
155+
padding: 25px 15px 10px 20px;
113156

114157
border-top: 2px solid $border-color;
115158

116-
@include prefix(box-shadow, (0 0 4px rgba(0,0,0,0.3)), webkit moz o);
117-
118159
.title {
119160
width: 100%;
120161
margin-bottom: 15px;
@@ -134,10 +175,6 @@
134175
margin: 10px 0 13px 0;
135176
}
136177

137-
.info {
138-
color: #727272;
139-
}
140-
141178
.programming-language-tooltip {
142179
background-color: $border-color;
143180
font-size: 15px;
@@ -149,8 +186,6 @@
149186

150187
top: -20px;
151188
right: 15px;
152-
153-
@include prefix(box-shadow, (0 1px 4px 0 rgba(0, 0, 0, 0.2)), webkit moz);
154189
}
155190

156191
}

0 commit comments

Comments
 (0)
Please sign in to comment.