Skip to content

Commit

Permalink
deliver different images depending on a media request
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkfabisch committed Jan 8, 2016
1 parent 76dea97 commit b688df9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
3 changes: 3 additions & 0 deletions _layouts/post.html
Expand Up @@ -12,6 +12,9 @@
<div class="post-image-image" style="background-image: url({% if page.image %}{{ page.image }}{% endif %})">
Article Image
</div>
<div class="post-image-image2" style="background-image: url({% if page.image2 %}{{ page.image2 }}{% endif %})">
Article Image
</div>
<div class="post-meta">
<h1 class="post-title">{{ page.title }}</h1>
<div class="cf post-meta-text">
Expand Down
1 change: 1 addition & 0 deletions _posts/2014-11-30-mediator_features.markdown
Expand Up @@ -5,6 +5,7 @@ date: 2014-11-30 14:34:25
categories: mediator feature
tags: featured
image: /assets/article_images/2014-11-30-mediator_features/night-track.JPG
image2: /assets/article_images/2014-11-30-mediator_features/night-track-mobile.JPG
---
#Mediator Formats and CSS features

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 26 additions & 10 deletions css/main.sass
Expand Up @@ -240,16 +240,32 @@ body
right: 0
bottom: 0
overflow: hidden
.post-image-image
background-size: cover
position: absolute
top: 0
left: 0
right: 0
bottom: 0
text-indent: -9999px
padding-top: 33%
z-index: 1
@media(min-width: 700px)
.post-image-image
background-size: cover
position: absolute
top: 0
left: 0
right: 0
bottom: 0
text-indent: -9999px
padding-top: 33%
z-index: 1
.post-image-image2
display: none
@media(max-width: 700px)
.post-image-image
display: none
.post-image-image2
background-size: cover
position: absolute
top: 0
left: 0
right: 0
bottom: 0
text-indent: -9999px
padding-top: 33%
z-index: 1
.post-meta
position: absolute
bottom: $rs*5
Expand Down

0 comments on commit b688df9

Please sign in to comment.