finally figured out flexbox [ci skip]

This commit is contained in:
danielgrippi 2012-02-15 21:59:29 -08:00
parent 1c4a689af7
commit c36c6e9569
3 changed files with 62 additions and 23 deletions

View file

@ -1,4 +1,4 @@
<div class="multi-photo"> <div class="multi-photo backdrop">
<h3> <h3>
{{text}} {{text}}
</h3> </h3>

View file

@ -1,7 +1,9 @@
{{#each photos}} {{#each photos}}
<div class="status photo-backdrop" style="background-image: url({{sizes.large}})"> <div class="status photo-backdrop" style="background-image: url({{sizes.large}})">
<div class="darken">
<h1> <h1>
{{../text}} {{../text}}
</h1> </h1>
</div> </div>
</div>
{{/each}} {{/each}}

View file

@ -2,22 +2,51 @@
/* mixins */ /* mixins */
@mixin pushdown() { @mixin center() {
/* temp hack... should use box model here */ display: -webkit-box;
padding-top: 10%; -webkit-box-orient: horizontal;
-webkit-box-pack: center;
-webkit-box-align: center;
display: -moz-box;
-moz-box-orient: horizontal;
-moz-box-pack: center;
-moz-box-align: center;
display: box;
box-orient: horizontal;
box-pack: center;
box-align: center;
}
@mixin box-shadow($left, $top, $blur, $color) {
-webkit-box-shadow: $left $top $blur $color;
-moz-box-shadow: $left $top $blur $color;
box-shadow: $left $top $blur $color;
}
@mixin background-cover() {
background: no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
} }
/* styles */ /* styles */
.multi-photo { .multi-photo {
.img-bounding-box { .img-bounding-box {
display: inline-block; @include center();
margin-left: 10px; margin-left: 10px;
height: 500px; height: 500px;
width: 300px; width: 400px;
} }
img { img {
@include box-shadow(0, 3px, 15px, #999);
max-width: 100%; max-width: 100%;
max-height: 100%; max-height: 100%;
} }
@ -28,29 +57,39 @@
} }
.status { .status {
@include pushdown();
text-align: center;
h1 { h1 {
font-weight: bold; font-weight: bold;
font-size: 60px; font-size: 40px;
} }
&.photo-backdrop {
h1 {
font-size: 100px;
}
}
}
.darken {
@include center();
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-color: rgba(0,0,0,0.3);
} }
.backdrop, .backdrop,
.photo-backdrop { .photo-backdrop {
@include center();
@include background-cover();
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
background: no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
@ -63,8 +102,6 @@
} }
.rich-media { .rich-media {
@include pushdown();
text-align: center; text-align: center;
background-color: #333; background-color: #333;
@ -74,7 +111,7 @@
} }
iframe { iframe {
box-shadow: 0 3px 15px #000; @include box-shadow(0, 3px, 15px, #000);
width: 857px; width: 857px;
height: 480px; height: 480px;