Skip to content

Commit

Permalink
add animation
Browse files Browse the repository at this point in the history
  • Loading branch information
steelydylan committed Feb 4, 2017
1 parent 2f5d19d commit 66a4923
Show file tree
Hide file tree
Showing 11 changed files with 3,416 additions and 810 deletions.
109 changes: 109 additions & 0 deletions assets/css/modal-video.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
@keyframes modal-video {
from {
opacity: 0;
}

to {
opacity: 1;
}
}

@keyframes modal-video-inner {
from {
transform: translate(0, 100px);
}

to {
transform: translate(0, 0);
}
}

.js-modal-video-close {
display: none;
}

.js-modal-video-open {
display: block;
}

.modal-video {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1000000;
cursor: pointer;
opacity: 1;
animation-duration: .3s;
animation-name: modal-video;
}

.modal-video-body {
max-width: 940px;
width: 100%;
height: 100%;
margin: 0 auto;
display: table;
}

.modal-video-inner {
display: table-cell;
vertical-align: middle;
width: 100%;
height: 100%;
}

.modal-video-movie-wrap {
width: 100%;
height: 0;
position: relative;
padding-bottom: 56.25%;
animation-duration: .3s;
animation-name: modal-video-inner;
}

.modal-video-movie-wrap iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

.modal-video-close-btn {
position: absolute;
z-index: 2;
top: -35px;
right: -35px;
display: inline-block;
width: 35px;
height: 35px;
overflow: hidden;
border: none;
background: transparent;
}

.modal-video-close-btn:before {
transform: rotate(45deg);
}

.modal-video-close-btn:after {
transform: rotate(-45deg);
}

.modal-video-close-btn:before,
.modal-video-close-btn:after {
content: '';
position: absolute;
height: 2px;
width: 100%;
top: 50%;
left: 0;
margin-top: -1px;
background: #fff;
border-radius: 5px;
height: 6px;
margin-top: -6px;
}
109 changes: 109 additions & 0 deletions assets/scss/modal-video.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
@keyframes modal-video {
from {
opacity: 0;
}

to {
opacity: 1;
}
}

@keyframes modal-video-inner {
from {
transform: translate(0, 100px);
}

to {
transform: translate(0, 0);
}
}

.js-modal-video-close {
display: none;
}

.js-modal-video-open {
display: block;
}

.modal-video {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, .5);
z-index: 1000000;
cursor: pointer;
opacity: 1;
animation-duration: .3s;
animation-name: modal-video;
}

.modal-video-body {
max-width: 940px;
width: 100%;
height: 100%;
margin: 0 auto;
display: table;
}

.modal-video-inner {
display: table-cell;
vertical-align: middle;
width: 100%;
height: 100%;
}

.modal-video-movie-wrap {
width: 100%;
height: 0;
position: relative;
padding-bottom: 56.25%;
animation-duration: .3s;
animation-name: modal-video-inner;

& iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}

.modal-video-close-btn {
position: absolute;
z-index: 2;
top: -35px;
right: -35px;
display: inline-block;
width: 35px;
height: 35px;
overflow: hidden;
border: none;
background: transparent;

&:before {
transform: rotate(45deg);
}

&:after {
transform: rotate(-45deg);
}

&:before,
&:after {
content: '';
position: absolute;
height: 2px;
width: 100%;
top: 50%;
left: 0;
margin-top: -1px;
background: #fff;
border-radius: 5px;
height: 6px;
margin-top: -6px;
}
}
1 change: 1 addition & 0 deletions css/modal-video.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 66a4923

Please sign in to comment.