Skip to content

Instantly share code, notes, and snippets.

@justinepocock
Created September 8, 2016 10:26
Show Gist options
  • Save justinepocock/2a53217f13c019c19f38d034d1047694 to your computer and use it in GitHub Desktop.
Save justinepocock/2a53217f13c019c19f38d034d1047694 to your computer and use it in GitHub Desktop.
video transition mixin
@mixin feature(){
.file-video {
position: relative;
display: block;
overflow: hidden;
@if $min-height == 0 {
height: auto;
} @elseif {
height: $min-height / 2;
}
.content {
display: block;
background-size: cover;
background-position: center;
transition:
transform 300ms ease 0s;
@if $rotate {
transform: translateZ( 0px );
} @elseif $animated {
transform: translateZ( 10px );
}
img {
width: 100%;
min-height: 200px;
visibility: hidden;
}
}
}
//do the same animation for video
&:hover .file-video {
transform: translate3d( 10px, 0, 0px );
.no-csstransforms3d & { left: 10px; }
.content {
transform: translateZ( 10px );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment