Skip to content

Commit 46b0672

Browse files
author
Mark Durrant
committed
Merge pull request #89 from pebblecode/pt/enhanced-post-media
Enhanced blog post media
2 parents 12cc5d5 + 509c739 commit 46b0672

10 files changed

+51
-24
lines changed

Diff for: _includes/image.html

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<figure class="media-container">
2+
<img class="media image" src="{{ include.url }}" alt="{{ include.caption }}">
3+
<figcaption class="media-caption">{{ include.caption }}</figcaption>
4+
</figure>

Diff for: _includes/youtube.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<figure class="media-container">
2+
<div class="media video">
3+
<iframe width="532" height="400" src="https://www.youtube.com/embed/{{ include.id }}" frameborder="0" allowfullscreen></iframe>
4+
</div>
5+
<figcaption class="media-caption">{{ include.caption }}</figcaption>
6+
</figure>

Diff for: _posts/2016-04-06-february-lightning-talks.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ In February's lightning talks, Clo tells us about bias and why diversity is impo
1212

1313
Clo delves into the ways that our personal backgrounds influence our view of the world, and explains why it's important to consider all viewpoints.
1414

15-
<div class="video"><iframe width="532" height="400" src="//www.youtube.com/embed/QmAl2cg3C5U" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>
15+
{% include youtube.html id="QmAl2cg3C5U" %}
1616

1717
---
1818

1919
## Styling in Javascript by Mike James
2020

2121
Mike talks us through a modular, component-based approach to CSS and development, and why new technologies like post-css and react lend themselves so well.
2222

23-
<div class="video"><iframe width="532" height="400" src="//www.youtube.com/embed/DYC9kNPrOwE" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>
23+
{% include youtube.html id="DYC9kNPrOwE" %}

Diff for: _posts/2016-05-17-screen-saver.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ Here’s our setup:
1919

2020
Propsboard hooks into our Slack channels, enabling anyone to give ‘Props’ to slack messages worthy of praise or sharing.
2121

22-
![Screen Saver](/img/posts/2016-05-17-screen-saver/screen.gif)
22+
{% include image.html url="/img/posts/2016-05-17-screen-saver/screen.gif" caption="Our Propsboard dashboard in action" %}
2323

2424
All in all, it’s a great, cheap way to turn screens into useful digital signs, that the whole team can interact with and use to share what’s going on across the office.

Diff for: _sass/components/_clients.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//===============================================================================
2-
// CLIENTS GRID
2+
// CLIENTS
33
//===============================================================================
44
.client-container {
55
padding-bottom: 20px;

Diff for: _sass/components/_cta-container.scss renamed to _sass/components/_cta.scss

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//===============================================================================
2+
// CALL-TO-ACTION
3+
//===============================================================================
14
.cta-container {
25
padding: 65px 20px 30px;
36
background-color: lighten($ink, 50);

Diff for: _sass/components/_media.scss

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//===============================================================================
2+
// MEDIA
3+
//===============================================================================
4+
.media-container {
5+
padding: 10px 0 0;
6+
}
7+
8+
.media {
9+
position: relative;
10+
margin-left: -30px;
11+
12+
&.video {
13+
padding-bottom: 56.25%; /* 16:9 */
14+
height: 0;
15+
}
16+
17+
iframe {
18+
position: absolute;
19+
top: 0;
20+
left: 0;
21+
width: 100%;
22+
height: 100%;
23+
}
24+
}
25+
26+
.media-caption {
27+
padding: 5px 0;
28+
font-size: $epsilon;
29+
color: lighten($ink, 20);
30+
text-align: center;
31+
}

Diff for: _sass/pages/_page-base.scss

+1-15
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,9 @@
7373
margin-top: 10px;
7474
margin-right: 5px;
7575
}
76+
}
7677

77-
.video {
78-
position: relative;
79-
padding-bottom: 56.25%; /* 16:9 */
80-
padding-top: 25px;
81-
margin-bottom: 30px;
82-
height: 0;
83-
}
8478

85-
.video iframe {
86-
position: absolute;
87-
top: 0;
88-
left: 0;
89-
width: 100%;
90-
height: 100%;
91-
}
92-
}
9379

9480
// Meta
9581
.meta-title {

Diff for: _sass/pages/_post.scss

-4
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,11 @@
196196
&:before {
197197
top: 15px;
198198
transform: rotate(-2deg) scale(1.2);
199-
-ms-transform: rotate(-2deg) scale(1.2);
200-
-webkit-transform: rotate(-2deg) scale(1.2);
201199
}
202200

203201
&:after {
204202
top: -30px;
205203
transform: rotate(-1.4deg) scale(1.2);
206-
-ms-transform: rotate(-1.4deg) scale(1.2);
207-
-webkit-transform: rotate(-1.4deg) scale(1.2);
208204
}
209205

210206
.hero-inner {

Diff for: css/main.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
@import "components/_clients";
2222
@import "components/_share";
2323
@import "components/_related";
24-
@import "components/_cta-container";
24+
@import "components/_cta";
25+
@import "components/_media";
2526

2627
// PAGE TEMPLATES
2728
@import "pages/_page-base";

0 commit comments

Comments
 (0)