Skip to content

Instantly share code, notes, and snippets.

@itrelease
Created October 9, 2015 22:40
Show Gist options
  • Save itrelease/8653d70adc5fc8fa24f2 to your computer and use it in GitHub Desktop.
Save itrelease/8653d70adc5fc8fa24f2 to your computer and use it in GitHub Desktop.
@import '~constants';
.stamp-Video {
position: relative;
background-color: @blackColor;
cursor: pointer;
}
.stamp-Video-box {
color: @lightColor;
overflow: hidden;
}
.stamp-Video-bg,
.stamp-Video-blurredBg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
&:before {
position: absolute;
content: '';
top: 0; right: 0; bottom: 0; left: 0;
background-image: linear-gradient(to top, fade(@blackColor, 40%), fade(@blackColor, 0%));
}
}
.stamp-Video-bg {
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
.stamp-Video-blurredBg {
transition: opacity .2s ease-out;
will-change: opacity;
opacity: 0;
}
// embed
.stamp-Video-embed {
position: relative;
}
.stamp-Video-embed img {
max-width: 100%;
vertical-align: bottom;
opacity: 0;
}
.stamp-Video-embed iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
pointer-events: none;
transform: scale(0.75);
will-change: transform;
transition: opacity .5s ease-out,
transform 1s @bezier;
}
.stamp-Video-duration {
position: absolute;
bottom: 1rem;
margin: 0 .5rem;
left: 0; right: 0;
text-align: center;
font-size: @font-size--xxsmall;
}
// meta: title and author
.stamp-Video-meta {
position: relative;
width: 100%;
padding: @Content-padding--small;
z-index: 1;
text-align: center;
transition: opacity .25s ease-out;
color: @lightColor;
background-color: fade(@blackColor, 50%);
@media @media-sm {
padding: @Content-padding--medium;
}
@media @media-md {
position: absolute;
bottom: 0;
background-color: transparent;
}
}
.stamp-Video-title,
.stamp-Video-author {
max-width: @Content-box--medium;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin: 0 auto;
}
.stamp-Video-title {
margin-bottom: .5rem;
font-weight: bold;
font-size: @font-size--medium;
@media @media-sm {
font-size: @font-size--xlarge;
}
@media @media-lg {
font-size: @font-size--xxlarge;
}
}
.stamp-Video-author {
opacity: .75;
@media @media-sm {
font-size: @font-size--small;
}
}
// states
.stamp-Video--pressedPlay .stamp-Video-blurredBg {
opacity: 1;
}
.stamp-Video--ready {
cursor: default;
}
.stamp-Video--ready .stamp-Video-embed iframe {
transform: scale(1);
opacity: 1;
pointer-events: auto;
}
.stamp-Video--ready .stamp-Video-meta {
@media @media-md {
opacity: 0;
pointer-events: none;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment