Thứ Bảy, 4 tháng 8, 2018

Code Trang 404 Hiệu Ứng Đẹp
XEM BÀI VIÊT
TOÀN MÀN HÌNH


Demo

CSS:

@import url("https://fonts.googleapis.com/css?family=Lato|Russo+One");

.container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
overflow: hidden;
}

.container-star {
background-image: linear-gradient(to bottom, #292256 0%, #8446cf 70%, #a871d6 100%);
}
.container-star:after {
background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 40%, rgba(15, 10, 38, 0.2) 100%);
content: "";
width: 100%;
height: 100%;
position: absolute;
top: 0;
}

.star-1 {
position: absolute;
border-radius: 50%;
background-color: #ffffff;
-webkit-animation: twinkle 5s infinite ease-in-out;
animation: twinkle 5s infinite ease-in-out;
}
.star-1:after {
height: 100%;
width: 100%;
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
content: "";
position: absolute;
background-color: #fff;
border-radius: 50%;
}
.star-1:before {
background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0) 100%);
position: absolute;
border-radius: 50%;
content: "";
top: -20%;
left: -50%;
}

.star-1:nth-of-type(1) {
top: 78vh;
left: 44vw;
width: 9px;
height: 3px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-1:nth-of-type(1):before {
width: 18px;
height: 18px;
top: -250%;
}

.star-1:nth-of-type(2) {
top: 94vh;
left: 67vw;
width: 6px;
height: 2px;
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
.star-1:nth-of-type(2):before {
width: 12px;
height: 12px;
top: -250%;
}

.star-1:nth-of-type(3) {
top: 41vh;
left: 66vw;
width: 6px;
height: 2px;
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.star-1:nth-of-type(3):before {
width: 12px;
height: 12px;
top: -250%;
}

.star-1:nth-of-type(4) {
top: 72vh;
left: 77vw;
width: 9px;
height: 3px;
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
.star-1:nth-of-type(4):before {
width: 18px;
height: 18px;
top: -250%;
}

.star-1:nth-of-type(5) {
top: 14vh;
left: 68vw;
width: 9px;
height: 3px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-1:nth-of-type(5):before {
width: 18px;
height: 18px;
top: -250%;
}

.star-1:nth-of-type(6) {
top: 26vh;
left: 79vw;
width: 6px;
height: 2px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-1:nth-of-type(6):before {
width: 12px;
height: 12px;
top: -250%;
}

.star-1:nth-of-type(7) {
top: 28vh;
left: 84vw;
width: 9px;
height: 3px;
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.star-1:nth-of-type(7):before {
width: 18px;
height: 18px;
top: -250%;
}

.star-1:nth-of-type(8) {
top: 42vh;
left: 28vw;
width: 4px;
height: 1.3333333333px;
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
.star-1:nth-of-type(8):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-1:nth-of-type(9) {
top: 7vh;
left: 99vw;
width: 7px;
height: 2.3333333333px;
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.star-1:nth-of-type(9):before {
width: 14px;
height: 14px;
top: -250%;
}

.star-1:nth-of-type(10) {
top: 97vh;
left: 76vw;
width: 4px;
height: 1.3333333333px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-1:nth-of-type(10):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-1:nth-of-type(11) {
top: 76vh;
left: 89vw;
width: 9px;
height: 3px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-1:nth-of-type(11):before {
width: 18px;
height: 18px;
top: -250%;
}

.star-1:nth-of-type(12) {
top: 16vh;
left: 92vw;
width: 8px;
height: 2.6666666667px;
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.star-1:nth-of-type(12):before {
width: 16px;
height: 16px;
top: -250%;
}

.star-1:nth-of-type(13) {
top: 78vh;
left: 33vw;
width: 6px;
height: 2px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-1:nth-of-type(13):before {
width: 12px;
height: 12px;
top: -250%;
}

.star-1:nth-of-type(14) {
top: 12vh;
left: 67vw;
width: 7px;
height: 2.3333333333px;
-webkit-animation-delay: 5s;
animation-delay: 5s;
}
.star-1:nth-of-type(14):before {
width: 14px;
height: 14px;
top: -250%;
}

.star-1:nth-of-type(15) {
top: 64vh;
left: 51vw;
width: 4px;
height: 1.3333333333px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-1:nth-of-type(15):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-1:nth-of-type(16) {
top: 71vh;
left: 95vw;
width: 4px;
height: 1.3333333333px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-1:nth-of-type(16):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-1:nth-of-type(17) {
top: 56vh;
left: 31vw;
width: 7px;
height: 2.3333333333px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-1:nth-of-type(17):before {
width: 14px;
height: 14px;
top: -250%;
}

.star-1:nth-of-type(18) {
top: 33vh;
left: 80vw;
width: 6px;
height: 2px;
-webkit-animation-delay: 5s;
animation-delay: 5s;
}
.star-1:nth-of-type(18):before {
width: 12px;
height: 12px;
top: -250%;
}

.star-1:nth-of-type(19) {
top: 30vh;
left: 14vw;
width: 8px;
height: 2.6666666667px;
-webkit-animation-delay: 5s;
animation-delay: 5s;
}
.star-1:nth-of-type(19):before {
width: 16px;
height: 16px;
top: -250%;
}

.star-1:nth-of-type(20) {
top: 53vh;
left: 43vw;
width: 6px;
height: 2px;
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
.star-1:nth-of-type(20):before {
width: 12px;
height: 12px;
top: -250%;
}

.star-1:nth-of-type(21) {
top: 32vh;
left: 9vw;
width: 7px;
height: 2.3333333333px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-1:nth-of-type(21):before {
width: 14px;
height: 14px;
top: -250%;
}

.star-1:nth-of-type(22) {
top: 97vh;
left: 9vw;
width: 5px;
height: 1.6666666667px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-1:nth-of-type(22):before {
width: 10px;
height: 10px;
top: -250%;
}

.star-1:nth-of-type(23) {
top: 62vh;
left: 6vw;
width: 5px;
height: 1.6666666667px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-1:nth-of-type(23):before {
width: 10px;
height: 10px;
top: -250%;
}

.star-1:nth-of-type(24) {
top: 57vh;
left: 13vw;
width: 9px;
height: 3px;
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
.star-1:nth-of-type(24):before {
width: 18px;
height: 18px;
top: -250%;
}

.star-1:nth-of-type(25) {
top: 52vh;
left: 60vw;
width: 4px;
height: 1.3333333333px;
-webkit-animation-delay: 5s;
animation-delay: 5s;
}
.star-1:nth-of-type(25):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-1:nth-of-type(26) {
top: 5vh;
left: 84vw;
width: 5px;
height: 1.6666666667px;
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.star-1:nth-of-type(26):before {
width: 10px;
height: 10px;
top: -250%;
}

.star-1:nth-of-type(27) {
top: 26vh;
left: 23vw;
width: 8px;
height: 2.6666666667px;
-webkit-animation-delay: 5s;
animation-delay: 5s;
}
.star-1:nth-of-type(27):before {
width: 16px;
height: 16px;
top: -250%;
}

.star-1:nth-of-type(28) {
top: 34vh;
left: 3vw;
width: 4px;
height: 1.3333333333px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-1:nth-of-type(28):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-1:nth-of-type(29) {
top: 40vh;
left: 58vw;
width: 6px;
height: 2px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-1:nth-of-type(29):before {
width: 12px;
height: 12px;
top: -250%;
}

.star-1:nth-of-type(30) {
top: 17vh;
left: 55vw;
width: 5px;
height: 1.6666666667px;
-webkit-animation-delay: 5s;
animation-delay: 5s;
}
.star-1:nth-of-type(30):before {
width: 10px;
height: 10px;
top: -250%;
}

.star-2 {
position: absolute;
border-radius: 50%;
background-color: #ffffff;
-webkit-animation: twinkle 5s infinite ease-in-out;
animation: twinkle 5s infinite ease-in-out;
}

.star-2:nth-of-type(31) {
top: 70vh;
left: 96vw;
width: 2px;
height: 2px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-2:nth-of-type(31):before {
width: 4px;
height: 4px;
top: -250%;
}

.star-2:nth-of-type(32) {
top: 88vh;
left: 57vw;
width: 3px;
height: 3px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-2:nth-of-type(32):before {
width: 6px;
height: 6px;
top: -250%;
}

.star-2:nth-of-type(33) {
top: 59vh;
left: 48vw;
width: 3px;
height: 3px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-2:nth-of-type(33):before {
width: 6px;
height: 6px;
top: -250%;
}

.star-2:nth-of-type(34) {
top: 2vh;
left: 83vw;
width: 2px;
height: 2px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-2:nth-of-type(34):before {
width: 4px;
height: 4px;
top: -250%;
}

.star-2:nth-of-type(35) {
top: 8vh;
left: 75vw;
width: 4px;
height: 4px;
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
.star-2:nth-of-type(35):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-2:nth-of-type(36) {
top: 78vh;
left: 8vw;
width: 3px;
height: 3px;
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.star-2:nth-of-type(36):before {
width: 6px;
height: 6px;
top: -250%;
}

.star-2:nth-of-type(37) {
top: 72vh;
left: 98vw;
width: 2px;
height: 2px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-2:nth-of-type(37):before {
width: 4px;
height: 4px;
top: -250%;
}

.star-2:nth-of-type(38) {
top: 34vh;
left: 41vw;
width: 3px;
height: 3px;
-webkit-animation-delay: 5s;
animation-delay: 5s;
}
.star-2:nth-of-type(38):before {
width: 6px;
height: 6px;
top: -250%;
}

.star-2:nth-of-type(39) {
top: 13vh;
left: 5vw;
width: 4px;
height: 4px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-2:nth-of-type(39):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-2:nth-of-type(40) {
top: 5vh;
left: 86vw;
width: 2px;
height: 2px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-2:nth-of-type(40):before {
width: 4px;
height: 4px;
top: -250%;
}

.star-2:nth-of-type(41) {
top: 7vh;
left: 62vw;
width: 3px;
height: 3px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-2:nth-of-type(41):before {
width: 6px;
height: 6px;
top: -250%;
}

.star-2:nth-of-type(42) {
top: 36vh;
left: 44vw;
width: 2px;
height: 2px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-2:nth-of-type(42):before {
width: 4px;
height: 4px;
top: -250%;
}

.star-2:nth-of-type(43) {
top: 74vh;
left: 47vw;
width: 3px;
height: 3px;
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.star-2:nth-of-type(43):before {
width: 6px;
height: 6px;
top: -250%;
}

.star-2:nth-of-type(44) {
top: 72vh;
left: 86vw;
width: 2px;
height: 2px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-2:nth-of-type(44):before {
width: 4px;
height: 4px;
top: -250%;
}

.star-2:nth-of-type(45) {
top: 26vh;
left: 40vw;
width: 4px;
height: 4px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-2:nth-of-type(45):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-2:nth-of-type(46) {
top: 41vh;
left: 39vw;
width: 3px;
height: 3px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-2:nth-of-type(46):before {
width: 6px;
height: 6px;
top: -250%;
}

.star-2:nth-of-type(47) {
top: 16vh;
left: 36vw;
width: 4px;
height: 4px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-2:nth-of-type(47):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-2:nth-of-type(48) {
top: 96vh;
left: 37vw;
width: 4px;
height: 4px;
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
.star-2:nth-of-type(48):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-2:nth-of-type(49) {
top: 18vh;
left: 8vw;
width: 4px;
height: 4px;
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.star-2:nth-of-type(49):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-2:nth-of-type(50) {
top: 56vh;
left: 31vw;
width: 4px;
height: 4px;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.star-2:nth-of-type(50):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-2:nth-of-type(51) {
top: 24vh;
left: 69vw;
width: 3px;
height: 3px;
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
.star-2:nth-of-type(51):before {
width: 6px;
height: 6px;
top: -250%;
}

.star-2:nth-of-type(52) {
top: 52vh;
left: 17vw;
width: 3px;
height: 3px;
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
.star-2:nth-of-type(52):before {
width: 6px;
height: 6px;
top: -250%;
}

.star-2:nth-of-type(53) {
top: 35vh;
left: 59vw;
width: 2px;
height: 2px;
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
.star-2:nth-of-type(53):before {
width: 4px;
height: 4px;
top: -250%;
}

.star-2:nth-of-type(54) {
top: 46vh;
left: 73vw;
width: 4px;
height: 4px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-2:nth-of-type(54):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-2:nth-of-type(55) {
top: 38vh;
left: 35vw;
width: 4px;
height: 4px;
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.star-2:nth-of-type(55):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-2:nth-of-type(56) {
top: 34vh;
left: 66vw;
width: 3px;
height: 3px;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.star-2:nth-of-type(56):before {
width: 6px;
height: 6px;
top: -250%;
}

.star-2:nth-of-type(57) {
top: 80vh;
left: 76vw;
width: 3px;
height: 3px;
-webkit-animation-delay: 5s;
animation-delay: 5s;
}
.star-2:nth-of-type(57):before {
width: 6px;
height: 6px;
top: -250%;
}

.star-2:nth-of-type(58) {
top: 45vh;
left: 49vw;
width: 2px;
height: 2px;
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
.star-2:nth-of-type(58):before {
width: 4px;
height: 4px;
top: -250%;
}

.star-2:nth-of-type(59) {
top: 8vh;
left: 4vw;
width: 4px;
height: 4px;
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.star-2:nth-of-type(59):before {
width: 8px;
height: 8px;
top: -250%;
}

.star-2:nth-of-type(60) {
top: 71vh;
left: 93vw;
width: 2px;
height: 2px;
-webkit-animation-delay: 3s;
animation-delay: 3s;
}
.star-2:nth-of-type(60):before {
width: 4px;
height: 4px;
top: -250%;
}

.container-title {
width: 600px;
height: 450px;
left: 50%;
top: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
position: absolute;
color: white;
line-height: 1;
font-weight: 700;
text-align: center;
justify-content: center;
align-items: center;
flex-direction: column;
display: flex;
}

.title > * {
display: inline-block;
font-size: 200px;
}

.number {
text-shadow: 20px 20px 20px rgba(0, 0, 0, 0.2);
padding: 0 0.2em;
font-family: 'Russo One', sans-serif;
}

.subtitle {
font-size: 25px;
margin-top: 1.5em;
font-family: "Lato", sans-serif;
text-shadow: 4px 4px 4px rgba(0, 0, 0, 0.2);
}

button {
font-size: 22px;
margin-top: 1.5em;
padding: 0.5em 1em;
letter-spacing: 1px;
font-family: "Lato", sans-serif;
color: white;
background-color: transparent;
border: 0;
cursor: pointer;
z-index: 999;
border: 2px solid white;
border-radius: 5px;
text-shadow: 4px 4px 4px rgba(0, 0, 0, 0.2);
transition: opacity 0.2s ease;
}
button:hover {
opacity: 0.7;
}
button:focus {
outline: 0;
}

.moon {
position: relative;
border-radius: 50%;
width: 160px;
height: 160px;
z-index: 2;
background-color: #fff;
box-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff, 0 0 40px #fff, 0 0 70px #fff, 0 0 80px #fff, 0 0 100px #ff1177;
-webkit-animation: rotate 5s ease-in-out infinite;
animation: rotate 5s ease-in-out infinite;
}
.moon .face {
top: 60%;
left: 47%;
position: absolute;
}
.moon .face .mouth {
border-top-left-radius: 50%;
border-bottom-right-radius: 50%;
border-top-right-radius: 50%;
background-color: #5c3191;
width: 25px;
height: 25px;
position: absolute;
-webkit-animation: snore 5s ease-in-out infinite;
animation: snore 5s ease-in-out infinite;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
box-shadow: inset -4px -4px 4px rgba(0, 0, 0, 0.3);
}
.moon .face .eyes {
position: absolute;
top: -30px;
left: -30px;
}
.moon .face .eyes .eye-left,
.moon .face .eyes .eye-right {
border: 4px solid #5c3191;
width: 30px;
height: 15px;
border-bottom-left-radius: 100px;
border-bottom-right-radius: 100px;
border-top: 0;
position: absolute;
}
.moon .face .eyes .eye-left:before, .moon .face .eyes .eye-left:after,
.moon .face .eyes .eye-right:before,
.moon .face .eyes .eye-right:after {
content: "";
position: absolute;
border-radius: 50%;
width: 4px;
height: 4px;
background-color: #5c3191;
top: -2px;
left: -4px;
}
.moon .face .eyes .eye-left:after,
.moon .face .eyes .eye-right:after {
left: auto;
right: -4px;
}
.moon .face .eyes .eye-right {
left: 50px;
}

.container-bird {
-webkit-perspective: 2000px;
perspective: 2000px;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}

.bird {
position: absolute;
z-index: 1000;
left: 50%;
top: 50%;
height: 40px;
width: 50px;
-webkit-transform: translate3d(-100vw, 0, 0) rotateY(90deg);
transform: translate3d(-100vw, 0, 0) rotateY(90deg);
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
}

.bird-container {
left: 0;
top: 0;
width: 100%;
height: 100%;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transform: translate3d(50px, 30px, -300px);
transform: translate3d(50px, 30px, -300px);
}

.wing {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
border-radius: 3px;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transform-origin: center bottom;
transform-origin: center bottom;
z-index: 300;
}

.wing-left {
background: linear-gradient(to bottom, #a58dc4 0%, #7979a8 100%);
-webkit-transform: translate3d(0, 0, 0) rotateX(-30deg);
transform: translate3d(0, 0, 0) rotateX(-30deg);
-webkit-animation: wingLeft 1.3s cubic-bezier(0.45, 0, 0.5, 0.95) infinite;
animation: wingLeft 1.3s cubic-bezier(0.45, 0, 0.5, 0.95) infinite;
}

.wing-right {
background: linear-gradient(to bottom, #d9d3e2 0%, #b8a5d1 100%);
-webkit-transform: translate3d(0, 0, 0) rotateX(-30deg);
transform: translate3d(0, 0, 0) rotateX(-30deg);
-webkit-animation: wingRight 1.3s cubic-bezier(0.45, 0, 0.5, 0.95) infinite;
animation: wingRight 1.3s cubic-bezier(0.45, 0, 0.5, 0.95) infinite;
}

.wing-right-top,
.wing-left-top {
border-right: 25px solid transparent;
border-left: 25px solid transparent;
top: -20px;
width: 100%;
position: absolute;
-webkit-transform-origin: 100% 100%;
transform-origin: 100% 100%;
}

.wing-right-top {
border-bottom: 20px solid #b8a5d1;
-webkit-transform: translate3d(0, 0, 0) rotateX(60deg);
transform: translate3d(0, 0, 0) rotateX(60deg);
-webkit-animation: wingRightTop 1.3s cubic-bezier(0.45, 0, 0.5, 0.95) infinite;
animation: wingRightTop 1.3s cubic-bezier(0.45, 0, 0.5, 0.95) infinite;
}

.wing-left-top {
border-bottom: 20px solid #7979a8;
-webkit-transform: translate3d(0, 0, 0) rotateX(-60deg);
transform: translate3d(0, 0, 0) rotateX(-60deg);
-webkit-animation: wingLeftTop 1.3s cubic-bezier(0.45, 0, 0.5, 0.95) infinite;
animation: wingLeftTop 1.3s cubic-bezier(0.45, 0, 0.5, 0.95) infinite;
}

.bird-anim:nth-child(1) {
-webkit-animation: bird1 30s linear infinite forwards;
animation: bird1 30s linear infinite forwards;
}

.bird-anim:nth-child(2) {
-webkit-animation: bird2 30s linear infinite forwards;
animation: bird2 30s linear infinite forwards;
-webkit-animation-delay: 3s;
animation-delay: 3s;
z-index: -1;
}

.bird-anim:nth-child(3) {
-webkit-animation: bird3 30s linear infinite forwards;
animation: bird3 30s linear infinite forwards;
-webkit-animation-delay: 5s;
animation-delay: 5s;
}

.bird-anim:nth-child(4) {
-webkit-animation: bird4 30s linear infinite forwards;
animation: bird4 30s linear infinite forwards;
-webkit-animation-delay: 7s;
animation-delay: 7s;
}

.bird-anim:nth-child(5) {
-webkit-animation: bird5 30s linear infinite forwards;
animation: bird5 30s linear infinite forwards;
-webkit-animation-delay: 14s;
animation-delay: 14s;
}

.bird-anim:nth-child(6) {
-webkit-animation: bird6 30s linear infinite forwards;
animation: bird6 30s linear infinite forwards;
-webkit-animation-delay: 10s;
animation-delay: 10s;
z-index: -1;
}

@-webkit-keyframes rotate {
0%, 100% {
-webkit-transform: rotate(-8deg);
transform: rotate(-8deg);
}
50% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
}

@keyframes rotate {
0%, 100% {
-webkit-transform: rotate(-8deg);
transform: rotate(-8deg);
}
50% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
}
@-webkit-keyframes snore {
0%, 100% {
-webkit-transform: scale(1) rotate(30deg);
transform: scale(1) rotate(30deg);
}
50% {
-webkit-transform: scale(0.5) rotate(30deg);
transform: scale(0.5) rotate(30deg);
border-bottom-left-radius: 50%;
}
}
@keyframes snore {
0%, 100% {
-webkit-transform: scale(1) rotate(30deg);
transform: scale(1) rotate(30deg);
}
50% {
-webkit-transform: scale(0.5) rotate(30deg);
transform: scale(0.5) rotate(30deg);
border-bottom-left-radius: 50%;
}
}
@-webkit-keyframes twinkle {
0%, 100% {
opacity: 0.7;
}
50% {
opacity: 0.3;
}
}
@keyframes twinkle {
0%, 100% {
opacity: 0.7;
}
50% {
opacity: 0.3;
}
}
@-webkit-keyframes wingLeft {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0) rotateX(-50deg);
transform: translate3d(0, 0, 0) rotateX(-50deg);
}
50% {
-webkit-transform: translate3d(0, -20px, 0) rotateX(-130deg);
transform: translate3d(0, -20px, 0) rotateX(-130deg);
background: linear-gradient(to bottom, #d9d3e2 0%, #b8a5d1 100%);
}
}
@keyframes wingLeft {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0) rotateX(-50deg);
transform: translate3d(0, 0, 0) rotateX(-50deg);
}
50% {
-webkit-transform: translate3d(0, -20px, 0) rotateX(-130deg);
transform: translate3d(0, -20px, 0) rotateX(-130deg);
background: linear-gradient(to bottom, #d9d3e2 0%, #b8a5d1 100%);
}
}
@-webkit-keyframes wingLeftTop {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0) rotateX(-10deg);
transform: translate3d(0, 0, 0) rotateX(-10deg);
}
50% {
-webkit-transform: translate3d(0px, 0px, 0) rotateX(-40deg);
transform: translate3d(0px, 0px, 0) rotateX(-40deg);
border-bottom: 20px solid #b8a5d1;
}
}
@keyframes wingLeftTop {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0) rotateX(-10deg);
transform: translate3d(0, 0, 0) rotateX(-10deg);
}
50% {
-webkit-transform: translate3d(0px, 0px, 0) rotateX(-40deg);
transform: translate3d(0px, 0px, 0) rotateX(-40deg);
border-bottom: 20px solid #b8a5d1;
}
}
@-webkit-keyframes wingRight {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0) rotateX(50deg);
transform: translate3d(0, 0, 0) rotateX(50deg);
}
50% {
-webkit-transform: translate3d(0, -20px, 0) rotateX(130deg);
transform: translate3d(0, -20px, 0) rotateX(130deg);
background: linear-gradient(to bottom, #a58dc4 0%, #7979a8 100%);
}
}
@keyframes wingRight {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0) rotateX(50deg);
transform: translate3d(0, 0, 0) rotateX(50deg);
}
50% {
-webkit-transform: translate3d(0, -20px, 0) rotateX(130deg);
transform: translate3d(0, -20px, 0) rotateX(130deg);
background: linear-gradient(to bottom, #a58dc4 0%, #7979a8 100%);
}
}
@-webkit-keyframes wingRightTop {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0) rotateX(10deg);
transform: translate3d(0, 0, 0) rotateX(10deg);
}
50% {
-webkit-transform: translate3d(0px, 0px, 0px) rotateX(40deg);
transform: translate3d(0px, 0px, 0px) rotateX(40deg);
border-bottom: 20px solid #7979a8;
}
}
@keyframes wingRightTop {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0) rotateX(10deg);
transform: translate3d(0, 0, 0) rotateX(10deg);
}
50% {
-webkit-transform: translate3d(0px, 0px, 0px) rotateX(40deg);
transform: translate3d(0px, 0px, 0px) rotateX(40deg);
border-bottom: 20px solid #7979a8;
}
}
@-webkit-keyframes bird1 {
0% {
-webkit-transform: translate3d(-120vw, -20px, -1000px) rotateY(-40deg) rotateX(0deg);
transform: translate3d(-120vw, -20px, -1000px) rotateY(-40deg) rotateX(0deg);
}
100% {
-webkit-transform: translate3d(100vw, -40vh, 1000px) rotateY(-40deg) rotateX(0deg);
transform: translate3d(100vw, -40vh, 1000px) rotateY(-40deg) rotateX(0deg);
}
}
@keyframes bird1 {
0% {
-webkit-transform: translate3d(-120vw, -20px, -1000px) rotateY(-40deg) rotateX(0deg);
transform: translate3d(-120vw, -20px, -1000px) rotateY(-40deg) rotateX(0deg);
}
100% {
-webkit-transform: translate3d(100vw, -40vh, 1000px) rotateY(-40deg) rotateX(0deg);
transform: translate3d(100vw, -40vh, 1000px) rotateY(-40deg) rotateX(0deg);
}
}
@-webkit-keyframes bird2 {
0%,
15% {
-webkit-transform: translate3d(100vw, -300px, -1000px) rotateY(10deg) rotateX(0deg);
transform: translate3d(100vw, -300px, -1000px) rotateY(10deg) rotateX(0deg);
}
100% {
-webkit-transform: translate3d(-100vw, -20px, -1000px) rotateY(10deg) rotateX(0deg);
transform: translate3d(-100vw, -20px, -1000px) rotateY(10deg) rotateX(0deg);
}
}
@keyframes bird2 {
0%,
15% {
-webkit-transform: translate3d(100vw, -300px, -1000px) rotateY(10deg) rotateX(0deg);
transform: translate3d(100vw, -300px, -1000px) rotateY(10deg) rotateX(0deg);
}
100% {
-webkit-transform: translate3d(-100vw, -20px, -1000px) rotateY(10deg) rotateX(0deg);
transform: translate3d(-100vw, -20px, -1000px) rotateY(10deg) rotateX(0deg);
}
}
@-webkit-keyframes bird3 {
0% {
-webkit-transform: translate3d(100vw, -50vh, 100px) rotateY(-5deg) rotateX(-20deg);
transform: translate3d(100vw, -50vh, 100px) rotateY(-5deg) rotateX(-20deg);
}
100% {
-webkit-transform: translate3d(-100vw, -10vh, 100px) rotateY(-5deg) rotateX(-20deg);
transform: translate3d(-100vw, -10vh, 100px) rotateY(-5deg) rotateX(-20deg);
}
}
@keyframes bird3 {
0% {
-webkit-transform: translate3d(100vw, -50vh, 100px) rotateY(-5deg) rotateX(-20deg);
transform: translate3d(100vw, -50vh, 100px) rotateY(-5deg) rotateX(-20deg);
}
100% {
-webkit-transform: translate3d(-100vw, -10vh, 100px) rotateY(-5deg) rotateX(-20deg);
transform: translate3d(-100vw, -10vh, 100px) rotateY(-5deg) rotateX(-20deg);
}
}
@-webkit-keyframes bird4 {
0% {
-webkit-transform: translate3d(100vw, 30vh, 200px) rotateY(-5deg) rotateX(10deg);
transform: translate3d(100vw, 30vh, 200px) rotateY(-5deg) rotateX(10deg);
}
100% {
-webkit-transform: translate3d(-100vw, -30vh, 200px) rotateY(-5deg) rotateX(10deg);
transform: translate3d(-100vw, -30vh, 200px) rotateY(-5deg) rotateX(10deg);
}
}
@keyframes bird4 {
0% {
-webkit-transform: translate3d(100vw, 30vh, 200px) rotateY(-5deg) rotateX(10deg);
transform: translate3d(100vw, 30vh, 200px) rotateY(-5deg) rotateX(10deg);
}
100% {
-webkit-transform: translate3d(-100vw, -30vh, 200px) rotateY(-5deg) rotateX(10deg);
transform: translate3d(-100vw, -30vh, 200px) rotateY(-5deg) rotateX(10deg);
}
}
@-webkit-keyframes bird5 {
0%,
5% {
-webkit-transform: translate3d(100vw, 30vh, 400px) rotateY(-15deg) rotateX(-10deg);
transform: translate3d(100vw, 30vh, 400px) rotateY(-15deg) rotateX(-10deg);
}
100% {
-webkit-transform: translate3d(-100vw, 10vh, 400px) rotateY(-15deg) rotateX(-10deg);
transform: translate3d(-100vw, 10vh, 400px) rotateY(-15deg) rotateX(-10deg);
}
}
@keyframes bird5 {
0%,
5% {
-webkit-transform: translate3d(100vw, 30vh, 400px) rotateY(-15deg) rotateX(-10deg);
transform: translate3d(100vw, 30vh, 400px) rotateY(-15deg) rotateX(-10deg);
}
100% {
-webkit-transform: translate3d(-100vw, 10vh, 400px) rotateY(-15deg) rotateX(-10deg);
transform: translate3d(-100vw, 10vh, 400px) rotateY(-15deg) rotateX(-10deg);
}
}
@-webkit-keyframes bird6 {
0%, 10% {
-webkit-transform: translate3d(-100vw, 20vh, -500px) rotateY(15deg) rotateX(10deg);
transform: translate3d(-100vw, 20vh, -500px) rotateY(15deg) rotateX(10deg);
}
100% {
-webkit-transform: translate3d(100vw, 40vh, -800px) rotateY(5deg) rotateX(10deg);
transform: translate3d(100vw, 40vh, -800px) rotateY(5deg) rotateX(10deg);
}
}
@keyframes bird6 {
0%, 10% {
-webkit-transform: translate3d(-100vw, 20vh, -500px) rotateY(15deg) rotateX(10deg);
transform: translate3d(-100vw, 20vh, -500px) rotateY(15deg) rotateX(10deg);
}
100% {
-webkit-transform: translate3d(100vw, 40vh, -800px) rotateY(5deg) rotateX(10deg);
transform: translate3d(100vw, 40vh, -800px) rotateY(5deg) rotateX(10deg);
}
}
@media screen and (max-width: 580px) {
.container-404 {
width: 100%;
}

.number {
font-size: 100px;
}

.subtitle {
font-size: 20px;
padding: 0 1em;
}

.moon {
width: 100px;
height: 100px;
}

.face {
-webkit-transform: scale(0.7);
transform: scale(0.7);
}
}

Code Trang 404:
<div class="container container-star">
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-1"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
  <div class="star-2"></div>
</div>
<div class="container container-bird">
  <div class="bird bird-anim">
    <div class="bird-container">
      <div class="wing wing-left">
        <div class="wing-left-top"></div>
      </div>
      <div class="wing wing-right">
        <div class="wing-right-top"></div>
      </div>
    </div>
  </div>
  <div class="bird bird-anim">
    <div class="bird-container">
      <div class="wing wing-left">
        <div class="wing-left-top"></div>
      </div>
      <div class="wing wing-right">
        <div class="wing-right-top"></div>
      </div>
    </div>
  </div>
  <div class="bird bird-anim">
    <div class="bird-container">
      <div class="wing wing-left">
        <div class="wing-left-top"></div>
      </div>
      <div class="wing wing-right">
        <div class="wing-right-top"></div>
      </div>
    </div>
  </div>
  <div class="bird bird-anim">
    <div class="bird-container">
      <div class="wing wing-left">
        <div class="wing-left-top"></div>
      </div>
      <div class="wing wing-right">
        <div class="wing-right-top"></div>
      </div>
    </div>
  </div>
  <div class="bird bird-anim">
    <div class="bird-container">
      <div class="wing wing-left">
        <div class="wing-left-top"></div>
      </div>
      <div class="wing wing-right">
        <div class="wing-right-top"></div>
      </div>
    </div>
  </div>
  <div class="bird bird-anim">
    <div class="bird-container">
      <div class="wing wing-left">
        <div class="wing-left-top"></div>
      </div>
      <div class="wing wing-right">
        <div class="wing-right-top"></div>
      </div>
    </div>
  </div>
  <div class="container-title">
    <div class="title">
      <div class="number">4</div>
      <div class="moon">
        <div class="face">
          <div class="mouth"></div>
          <div class="eyes">
            <div class="eye-left"></div>
            <div class="eye-right"></div>
          </div>
        </div>
      </div>
      <div class="number">4</div>
    </div>
    <div class="subtitle">Page Not Found</div>
    <button>Trang Chủ</button>
  </div>
</div>

Thứ Bảy, 26 tháng 5, 2018

CSS Simple bảng giá tác thiết kế
XEM BÀI VIÊT
TOÀN MÀN HÌNH


Demo


Đầu tiền các bạn chèn đoạn css dưới vào:

<link href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"></link>
<style>
.demo{
padding: 2em 0;
}
:root{
--pricingTable-yellow: #faac01;
--pricingTable-purple: #be4f91;
--pricingTable-blue: #0192af;
}
.demo{ background: #dedddb; }
.pricingTable{
padding-bottom: 10px;
background: #fff;
border-bottom: 15px solid var(--pricingTable-yellow);
text-align: center;
overflow: hidden;
position: relative;
}
.pricingTable:before{
content: "";
width: 100%;
height: 350px;
background: var(--pricingTable-yellow);
position: absolute;
top: -150px;
left: 0;
transform: skewY(-20deg);
}
.pricingTable .pricingTable-header{
padding: 20px 20px 60px;
text-align: left;
position: relative;
}
.pricingTable .title{
font-size: 30px;
font-weight: 600;
color: #fff;
text-transform: uppercase;
margin: 0;
}
.pricingTable .sub-title{
display: block;
font-size: 16px;
color: #fff;
text-transform: uppercase;
}
.pricingTable .year{
width: 80px;
height: 55px;
background: #fff;
padding: 7px 0;
font-size: 15px;
font-weight: 600;
font-style: italic;
color: var(--pricingTable-yellow);
text-align: center;
position: absolute;
top: 30px;
right: 20px;
z-index: 1;
}
.pricingTable .year:before,
.pricingTable .year:after{
content: "";
width: 57px;
height: 57px;
background: #fff;
position: absolute;
top: -28px;
left: 50%;
z-index: -1;
transform: translateX(-50%) scaleY(0.5) rotate(45deg);
}
.pricingTable .year:after{
top: auto;
bottom: -28px;
}
.pricingTable .price-value{
display: inline-block;
width: 170px;
height: 110px;
padding: 15px;
border: 2px solid var(--pricingTable-yellow);
border-top: none;
border-bottom: none;
position: relative;
}
.pricingTable .price-value:before,
.pricingTable .price-value:after{
content: "";
width: 121px;
height: 121px;
border: 3px solid var(--pricingTable-yellow);
border-right: none;
border-bottom: none;
position: absolute;
top: -60px;
left: 50%;
transform: translateX(-50%) scaleY(0.5) rotate(45deg);
}
.pricingTable .price-value:after{
border-top: none;
border-left: none;
border-bottom: 3px solid var(--pricingTable-yellow);
border-right: 3px solid var(--pricingTable-yellow);
top: auto;
bottom: -60px;
}
.pricingTable .value{
width: 100%;
height: 100%;
background: #fff;
border: 2px solid var(--pricingTable-yellow);
border-top: none;
border-bottom: none;
color: var(--pricingTable-yellow);
z-index: 1;
position: relative;
}
.pricingTable .value:before,
.pricingTable .value:after{
content: "";
width: 97px;
height: 97px;
background: #fff;
border: 3px solid var(--pricingTable-yellow);
border-bottom: none;
border-right: none;
position: absolute;
top: -48px;
left: 50%;
z-index: -1;
transform: translateX(-50%) scaleY(0.5) rotate(45deg);
}
.pricingTable .value:after{
border-right: 3px solid var(--pricingTable-yellow);
border-bottom: 3px solid var(--pricingTable-yellow);
border-top: none;
border-left: none;
top: auto;
bottom: -48px;
}
.pricingTable .currency{
display: inline-block;
font-size: 30px;
margin-top: 7px;
vertical-align: top;
}
.pricingTable .amount{
display: inline-block;
font-size: 40px;
font-weight: 600;
line-height: 65px;
}
.pricingTable .amount span{
display: inline-block;
font-size: 30px;
font-weight: normal;
vertical-align: top;
margin-top: -7px;
}
.pricingTable .month{
display: block;
font-size: 16px;
line-height: 0;
}
.pricingTable .pricing-content{
padding: 50px 0 0 80px;
margin-bottom: 20px;
list-style: none;
text-align: left;
transition: all 0.3s ease 0s;
}
.pricingTable .pricing-content li{
padding: 7px 0;
font-size: 16px;
color: #808080;
position: relative;
}
.pricingTable .pricing-content li:before,
.pricingTable .pricing-content li.disable:before{
content: "\f00c";
font-family: fontawesome;
width: 25px;
height: 25px;
line-height: 25px;
border-radius: 50%;
background: #98c458;
text-align: center;
color: #fff;
position: absolute;
left: -50px;
}
.pricingTable .pricing-content li.disable:before{
content: "\f00d";
background: #fe6c6c;
}
.pricingTable .pricingTable-signup{
display: inline-block;
width: 60%;
height: 50px;
line-height: 50px;
font-size: 22px;
font-weight: 700;
color: var(--pricingTable-yellow);
text-transform: uppercase;
border: 2px solid var(--pricingTable-yellow);
margin: 0 auto 10px;
position: relative;
transition: all 0.3s ease 0s;
}
.pricingTable .pricingTable-signup:hover{
background: var(--pricingTable-yellow);
color: #fff;
}
.pricingTable.purple{ border-bottom-color: var(--pricingTable-purple); }
.pricingTable.purple:before{ background: var(--pricingTable-purple); }
.pricingTable.purple .year{ color: var(--pricingTable-purple); }
.pricingTable.purple .price-value{
border-left-color: var(--pricingTable-purple);
border-right-color: var(--pricingTable-purple);
}
.pricingTable.purple .price-value:before{
border-left-color: var(--pricingTable-purple);
border-top-color: var(--pricingTable-purple);
}
.pricingTable.purple .price-value:after{
border-right-color: var(--pricingTable-purple);
border-bottom-color: var(--pricingTable-purple);
}
.pricingTable.purple .value{
border-left-color: var(--pricingTable-purple);
border-right-color: var(--pricingTable-purple);
color: var(--pricingTable-purple);
}
.pricingTable.purple .value:before{
border-left-color: var(--pricingTable-purple);
border-top-color: var(--pricingTable-purple);
}
.pricingTable.purple .value:after{
border-right-color: var(--pricingTable-purple);
border-bottom-color: var(--pricingTable-purple);
}
.pricingTable.purple .pricingTable-signup{
color: var(--pricingTable-purple);
border-color: var(--pricingTable-purple);
}
.pricingTable.purple .pricingTable-signup:hover{
color: #fff;
background: var(--pricingTable-purple);
}
.pricingTable.blue{ border-bottom-color: var(--pricingTable-blue); }
.pricingTable.blue:before{ background: var(--pricingTable-blue); }
.pricingTable.blue .year{ color: var(--pricingTable-blue); }
.pricingTable.blue .price-value{
border-left-color: var(--pricingTable-blue);
border-right-color: var(--pricingTable-blue);
}
.pricingTable.blue .price-value:before{
border-left-color: var(--pricingTable-blue);
border-top-color: var(--pricingTable-blue);
}
.pricingTable.blue .price-value:after{
border-right-color: var(--pricingTable-blue);
border-bottom-color: var(--pricingTable-blue);
}
.pricingTable.blue .value{
border-left-color: var(--pricingTable-blue);
border-right-color: var(--pricingTable-blue);
color: var(--pricingTable-blue);
}
.pricingTable.blue .value:before{
border-left-color: var(--pricingTable-blue);
border-top-color: var(--pricingTable-blue);
}
.pricingTable.blue .value:after{
border-right-color: var(--pricingTable-blue);
border-bottom-color: var(--pricingTable-blue);
}
.pricingTable.blue .pricingTable-signup{
color: var(--pricingTable-blue);
border-color: var(--pricingTable-blue);
}
.pricingTable.blue .pricingTable-signup:hover{
color: #fff;
background: var(--pricingTable-blue);
}
@media only screen and (max-width: 990px){
.pricingTable{ margin-bottom: 30px; }
}
@media only screen and (max-width: 767px){
.pricingTable:before{ transform: skewY(-15deg); }
.pricingTable .title{ font-size: 22px; }
}
</style>

Tiếp theo là đoạn mã code hiển thị:

 <div class="demo">
        <div class="container">
            <div class="row">
                <div class="col-md-4 col-sm-6">
                    <div class="pricingTable">
                        <div class="pricingTable-header">
                            <h3 class="title">Standard</h3>
                            <span class="sub-title">Lorem ipsum</span>
                            <span class="year">Pay only <br>$110/year</span>
                        </div>
                        <div class="price-value">
                            <div class="value">
                                <span class="currency">$</span>
                                <span class="amount">10.<span>99</span></span>
                                <span class="month">/month</span>
                            </div>
                        </div>
                        <ul class="pricing-content">
                            <li>50GB Disk Space</li>
                            <li>50 Email Accounts</li>
                            <li>50GB Monthly Bandwidth</li>
                            <li class="disable">10 Subdomains</li>
                            <li class="disable">15 Domains</li>
                        </ul>
                        <a href="#" class="pricingTable-signup">Sign up</a>
                    </div>
                </div>

                <div class="col-md-4 col-sm-6">
                    <div class="pricingTable purple">
                        <div class="pricingTable-header">
                            <h3 class="title">Business</h3>
                            <span class="sub-title">Lorem ipsum</span>
                            <span class="year">Pay only <br>$220/year</span>
                        </div>
                        <div class="price-value">
                            <div class="value">
                                <span class="currency">$</span>
                                <span class="amount">20.<span>99</span></span>
                                <span class="month">/month</span>
                            </div>
                        </div>
                        <ul class="pricing-content">
                            <li>60GB Disk Space</li>
                            <li>60 Email Accounts</li>
                            <li>60GB Monthly Bandwidth</li>
                            <li>15 Subdomains</li>
                            <li class="disable">20 Domains</li>
                        </ul>
                        <a href="#" class="pricingTable-signup">Sign up</a>
                    </div>
                </div>

                <div class="col-md-4 col-sm-6">
                    <div class="pricingTable blue">
                        <div class="pricingTable-header">
                            <h3 class="title">Premium</h3>
                            <span class="sub-title">Lorem ipsum</span>
                            <span class="year">Pay only <br>$330/year</span>
                        </div>
                        <div class="price-value">
                            <div class="value">
                                <span class="currency">$</span>
                                <span class="amount">30.<span>99</span></span>
                                <span class="month">/month</span>
                            </div>
                        </div>
                        <ul class="pricing-content">
                            <li>70GB Disk Space</li>
                            <li>70 Email Accounts</li>
                            <li>70GB Monthly Bandwidth</li>
                            <li>20 Subdomains</li>
                            <li>25 Domains</li>
                        </ul>
                        <a href="#" class="pricingTable-signup">Sign up</a>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>

Thứ Sáu, 25 tháng 5, 2018

Code Slider Post Làm Trang Chủ
XEM BÀI VIÊT
TOÀN MÀN HÌNH


Demo

Đầu tiên chèn đoạn css dưới:

<link href="css/style.css" rel="stylesheet" type="text/css"></link>
<link href="https://fonts.googleapis.com/css?family=Slabo+27px" rel="stylesheet"></link>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"></link>
<style>
body,html {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
display: block;
position: relative;
overflow: hidden;
font-family: 'Slabo 27px', serif;
font-size: 16px;
}

h1,h2,h3,h4,h5,h6 {
padding: 0;
margin: 0;
}
ul,li,p {
margin: 0;
padding: 0;
}
a {
text-decoration: none;
}
.wrapper {
height: 100%;
width: 100%;
display: block;
overflow: hidden;
}
.wrapper .container {
height: 100%;
width: 100%;
display: block;
overflow: hidden;
}

.slideshow {
height: 100%;
width: 100%;
display: block;
overflow: hidden;
}
.slideshow .slideshow-left {
width: 40%;
float: left;
position: relative;
height: 100%;
}
.slideshow .slideshow-left .Lslide {
height: 100%;
display: block;
overflow: hidden;
position: absolute;
bottom: 0px;
top: 0;
left: 0;
right: 0;
}
.slideshow .Lslide-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
}
.slideshow .Lslide-content h2 {
color: #fff;
font-weight: 600;
font-size: 60px;
line-height: 0.8;
}
.slideshow .Lslide-content p {
color: #fff;
padding: 2.5em 0em;
}
.slideshow .Lslide-content .button {
background-color: #fff;
display: inline-block;
border-radius: 25px;
position: relative;
}
.slideshow .Lslide-content .button i {
float: right;
position: absolute;
top: 50%;
right: 2.5em;
color: #000;
font-size: 9px;
transform: translateY(-50%);
-ms-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-webkit-transform: translateY(-50%);
transition: all 0.3s;
}
.slideshow .Lslide-content .button:hover i {
right: 1.7em;
}
.slideshow .Lslide-content .button p {
margin: 0;
padding: 0;
color: #000;
text-align: left;
padding: 0.8em 8em 0.8em 1.5em;
font-size: 12px;
font-weight: 600;
}
.slideshow .slideshow-right {
width: 60%;
float: left;
position: relative;
height: 100%;
}
.slideshow .slideshow-right .Rslide {
height: 100%;
display: block;
overflow: hidden;
position: absolute;
bottom: 0px;
top: 0;
left: 0;
right: 0;
}
.slideshow .slideshow-right .Rslide img {
min-width: 100%;
}
.control {
position: absolute;
left: 40%;
top: 50%;
transform: translateY(-50%);
-ms-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-webkit-transform: translateY(-50%);
}
.control i {
left: 0;
right: 0;
top: 50%;
transform: translateY(-50%);
-ms-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-webkit-transform: translateY(-50%);
text-align: center;
position: absolute;
color: #aaaaaa;
transition: all 0.3s;
-ms-transition: all 0.3s;
-moz-transition: all 0.3s;
-webkit-transition: all 0.3s;
}
.control .control-top {
width: 45px;
height: 50px;
background-color: #fff;
z-index: 5;
position: relative;
border-radius: 0px 4px 4px 0px;
cursor: pointer;
}
.control .control-top:hover i {
color: #333333;
}
.control .control-bottom {
width: 45px;
height: 50px;
background-color: #fff;
z-index: 5;
position: relative;
border-radius: 4px 0px 0px 4px;
left: -45px;
cursor: pointer;
}
.control .control-bottom:hover i {
color: #333333;
}
</style>

Tiếp theo là đoạn code hiển thị:
 <div class="wrapper">
           <div class="container">

               <div class="slideshow">

                    <div class="slideshow-left">

                        <div class="Lslide">
                            <div class="Lslide-content">
                                <h2>Probably not</h2>
                                <p>Be a part of our creation</p>

                                <div class="button">
                                    <a href="#">
                                        <p>More</p>
                                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="Lslide">
                            <div class="Lslide-content">
                                <h2>But not today</h2>
                                <p>Be a part of our creation</p>

                                <div class="button">
                                    <a href="#">
                                        <p>More</p>
                                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="Lslide">
                            <div class="Lslide-content">
                                <h2>Probably not</h2>
                                <p>Be a part of our creation</p>

                                <div class="button">
                                    <a href="#">
                                        <p>More</p>
                                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
                                    </a>
                                </div>
                            </div>
                        </div>   

                    </div>

                    <div class="slideshow-right">

                        <div class="Rslide">
                            <img src="http://www.grandvincent-marion.fr/_codepen/flower-3.jpg" alt="">
                        </div>

                        <div class="Rslide">
                            <img src="http://www.grandvincent-marion.fr/_codepen/flower-5.jpg" alt="">
                        </div>   
                        <div class="Rslide">
                            <img src="http://www.grandvincent-marion.fr/_codepen/flower-1.jpg" alt="">
                        </div>                                             
                    </div>   

                   
                    <div class="control">
                        <div class="oncontrol control-top">
                            <i class="fa fa-arrow-up" aria-hidden="true"></i>
                        </div>
                        <div class="oncontrol control-bottom">
                            <i class="fa fa-arrow-down" aria-hidden="true"></i>
                        </div>                         
                    </div>

               </div>

           </div>
       </div>

Cuối cùng chèn đoạn mã JS dưới đây nữa là xong:
<script>
var Lslide      = document.querySelectorAll('.Lslide'),
    Rslide      = document.querySelectorAll('.Rslide'),
    control     = document.querySelectorAll('.oncontrol'),
    slideHeight = document.querySelector('.wrapper').clientHeight,
    color = ['#fdc97c', '#e5d3d0', '#71b3d6'],
    index = 0;


function init() {
    slideHeight = document.querySelector('.wrapper').clientHeight;
    for (i = 0; i < Lslide.length; i++) {
        Lslide[i].style.backgroundColor = color[i];
        Lslide[i].style.top = -slideHeight * i + "px";
        Rslide[i].style.top = slideHeight * i + "px";
    } 
}
init()
window.addEventListener('resize', function(){
    init()
});

function moveToTop() {

    index++;
    for (el = 0; el < Lslide.length; el++) {
        Lslide[el].style.top = parseInt(Lslide[el].style.top) + slideHeight + "px";
        Rslide[el].style.top = parseInt(Rslide[el].style.top) - slideHeight + "px";
    }

    if (index > Lslide.length-1) {
        index = 0;
        for (el = 0; el < Lslide.length; el++) {
            Lslide[el].style.top = -slideHeight * el + "px";
            Rslide[el].style.top = slideHeight * el + "px";
        }
    }
}

function moveToBottom() {
    index--;
    for (el = 0; el < Lslide.length; el++) {
        Lslide[el].style.top = parseInt(Lslide[el].style.top) - slideHeight + "px";
        Rslide[el].style.top = parseInt(Rslide[el].style.top) + slideHeight + "px";
       
    }
    if (index < 0) {
        index = Rslide.length-1;
        for (el = 0; el < Lslide.length; el++) {
            Lslide[el].style.top = parseInt(Lslide[el].style.top) + slideHeight * Lslide.length + "px";
            Rslide[el].style.top = parseInt(Rslide[el].style.top) - slideHeight * Rslide.length + "px";
        }
    }
}

function transition() {
    for (t = 0; t < Lslide.length; t++) {
        Lslide[t].style.transition = "all 0.8s";
        Rslide[t].style.transition = "all 0.8s";
    }
}
 

for (t = 0; t < control.length; t++) {
    control[t].addEventListener("click", function() {

        if (this.classList.contains('control-top')) {
            moveToTop()
        }
        if (this.classList.contains('control-bottom')) {
            moveToBottom()
        }

        transition()
 
    });
}

var wheeling;
function mousemouve(e) {

    clearTimeout(wheeling);
    e.preventDefault();
    var e = window.event || e;
    var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
   
    wheeling = setTimeout(function() {
        wheeling = undefined;
        if (delta === 1) {
            moveToTop()
        }
        if (delta === -1) {
            moveToBottom()
        }
    }, 100);

    transition()
}

document.addEventListener("mousewheel", mousemouve);
document.addEventListener("DOMMouseScroll", mousemouve);
</script>

Thứ Năm, 16 tháng 2, 2017

Code tác giả ẩn hiện chất
XEM BÀI VIÊT
TOÀN MÀN HÌNH




Chèn Code Dưới vào sau /header:


<link href="http://cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet"/>

<div class="container">
<div class="menu-wrap">
<nav class="menu-top">
<div class="profile"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlQeHPOd0MfDFyH578k2wTQi23d4zKE0nxA_aiRbk17bg1gEk7q476DUINycfLPI7_jNPf9KF4Lb1KauFi13Q_u0KT1pBNAFFQLf009zADLcozsnijf9kF32eYRfDU7KkRJRAo2J3Vx54/s1600/123213.png" alt="Bẽo Hòa Vinh"/><span>Bẽo Hòa Vinh</span></div>
<div class="icon-list">
<a href="#"><i class="fa fa-fw fa-star-o"></i></a>
<a href="#"><i class="fa fa-fw fa-bell-o"></i></a>
<a href="#"><i class="fa fa-fw fa-envelope-o"></i></a>
<a href="#"><i class="fa fa-fw fa-comment-o"></i></a>
</div>
</nav>
<nav class="menu-side">
<a href="#">Recent Stories</a>
<a href="#">Reading List</a>
<a href="#">My Stories</a>
<a href="#">Categories</a>
</nav>
</div>
<button class="menu-button" id="open-button"></button>
<div class="content-wrap">
<div class="content">
<header class="codrops-header">
<h1>Chia Sẻ 78 <span>TÁC GIẢ ẨN HIỆN</span></h1>
<p>
ĐI ĐỂ TRỞ VỀ <br/>
Sáng tác: Tiên Cookie <br/>
<br/>
Verse: <br/>
Tôi đang ở một nơi rất xa, nơi không<br/> có khói bụi thành phố <br/>
Ở một nơi đẹp như mơ <br/>
Trên cao êm êm mây trắng bay lặng nhìn<br/> biển rộng sóng vỗ <br/>
Cuộc đời tôi là những chuyến đi dài <br/>
<br/>
Pre: <br/>
Vượt suối thác, vượt núi dốc, dù chênh<br/> vênh, có xá gì <br/>
Có biết bao thứ tươi đẹp vẫn cứ ở đó<br/> đang chờ tôi <br/>
Người xung quanh ở nơi đây thật dễ mến<br/> dẫu mới gặp <br/>
Ánh mắt lấp lánh hiền hoà chào tôi<br/> chào người bạn mới <br/>
<br/>
Chorus: <br/>
Từng chặng đường dài mà ta qua, giờ<br/> ngồi một mình lại thấy nhớ <br/>
Ngày ngày mặt trời rạng ngời vươn cao<br/> lên từ trên mái nhà <br/>
Từng chặng đường dài mà ta qua đều để<br/> lại kỉ niệm quý giá <br/>
Để lại một điều rằng càng đi xa ta<br/> càng thêm nhớ nhà <br/>
<br/>
Đi thật xa để trở về <br/>
Đi thật xa để trở về <br/>
Có một nơi để trở về <br/>
Đi, Đi để trở về <br/>
<br/>
Verse II: <br/>
Tôi đang ở một nơi rất xa, nơi không<br/> có khói bụi thành phố<br/>
Ở một nơi đẹp như mơ <br/>
Trên cao êm êm mây trắng bay lặng nhìn<br/> biển rộng sóng vỗ <br/>
Cuộc đời tôi là những chuyến đi dài <br/>
<br/>
pre: <br/>
Vượt suối thác, vượt núi dốc, dù chênh<br/> vênh, có xá gì <br/>
Có biết bao thứ tươi đẹp còn đang<br/> trông mong tôi ghé qua <br/>
Người xung quanh ở nơi đây thật dễ mến<br/> dẫu mới gặp <br/>
Ánh mắt lấp lánh hiền hoà chào tôi<br/> chào người bạn mới <br/>
<br/>
Chorus: <br/>
Từng chặng đường dài mà ta qua, giờ<br/> ngồi một mình lại thấy nhớ<br/>
Ngày ngày mặt trời rạng ngời vươn cao<br/> lên từ trên mái nhà <br/>
Từng chặng đường dài mà ta qua đều để<br/> lại kỉ niệm quý giá <br/>
Để lại một điều rằng càng đi xa ta<br/> càng thêm nhớ nhà <br/>
<br/>
Đi thật xa để trở về <br/>
Đi thật xa để trở về <br/>
Có một nơi để trở về <br/>
Đi, Đi để trở về <br/>
<br/>
Brigde:
<br/>
Cuộc đời thật đẹp khi được đi muôn nơi<br/> xa xôi rộng lớn <br/>
Nhưng ta vẫn có nơi để trở về sau mỗi<br/> chuyến đi <br/>
Điều kì diệu là con người ta đi xa hơn<br/> để trưởng thành hơn <br/>
Không quên mang theo bên cạnh hành<br/> trang nỗi nhớ gia đình<br/>
</p>
</header>
</div>
</div><!-- /content-wrap -->
</div><!-- /container -->

<script src="http://demo.htmleaf.com/1410/201410182336/js/main.js"></script>







Chèn CSS dưới vào:



.menu-wrap a {
color: #b8b7ad;
}

.menu-wrap a:hover,
.menu-wrap a:focus {
color: #c94e50;
}

.content-wrap {
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
-webkit-transition: -webkit-transform 0.3s;
transition: transform 0.3s;
}

.content {
position: relative;
background: #b4bad2;
}

/* Overlay */
.content::before {
position: absolute;
top: 0;
left: 0;
z-index: 10;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.3);
content: '';
opacity: 0;
-webkit-transform: translate3d(100%,0,0);
transform: translate3d(100%,0,0);
-webkit-transition: opacity 0.3s, -webkit-transform 0s 0.3s;
transition: opacity 0.3s, transform 0s 0.3s;
}

/* Menu Button */
.menu-button {
position: fixed;
z-index: 1000;
margin: 1em;
padding: 0;
width: 2.5em;
height: 2.25em;
border: none;
text-indent: 2.5em;
font-size: 1.5em;
color: transparent;
background: transparent;
-webkit-transition: -webkit-transform 0.3s;
transition: transform 0.3s;
}

.menu-button::before {
position: absolute;
top: 0.5em;
right: 0.5em;
bottom: 0.5em;
left: 0.5em;
background: linear-gradient(#373a47 20%, transparent 20%, transparent 40%, #373a47 40%, #373a47 60%, transparent 60%, transparent 80%, #373a47 80%);
content: '';
}

.menu-button:hover {
opacity: 0.6;
}
/* Menu */
.menu-wrap {
position: absolute;
font-weight: 700;
opacity: 0;
-webkit-transition: opacity 1s;
transition: opacity 1s;
}

.menu-top {
line-height: 58px;
}

.menu-top .profile {
display: inline-block;
padding: 8px 10px;
line-height: 42px;
}

.menu-top .profile,
.menu-side {
width: 300px;
}

.menu-top .profile img {
float: left;
margin-right: 1em;
width: 43px;
}

.icon-list {
display: inline-block;
font-size: 1.25em;
}

.icon-list a {
margin: 0 1em 0 0;
padding: 0;
}

@media screen and (max-width: 32em) {
.icon-list {
padding-left: 1em;
}
}

.menu-side a {
display: block;
padding: 1.2em;
border-bottom: 1px solid rgba(0,0,0,0.1);
}

.menu-side a:first-child {
border-top: 1px solid rgba(0,0,0,0.1);
}

/* Shown menu */
.show-menu .menu-wrap {
opacity: 1;
}

.show-menu .content-wrap,
.show-menu .menu-button {
-webkit-transform: translate3d(300px,60px,0);
transform: translate3d(300px,60px,0);
}

.show-menu .content::before {
opacity: 1;
-webkit-transition: opacity 0.3s;
transition: opacity 0.3s;
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
/* Header */
.codrops-header {
margin: 0 auto;
padding: 3em 2em;
text-align: center;
height: 100%;
}

.codrops-header h1 {
margin: 0 auto;
font-weight: 800;
font-size: 3.75em;
line-height: 1;
}

.codrops-header h1 span {
display: block;
font-size: 50%;
font-weight: 400;
padding-top: 0.325em;
}

.codrops-links {
text-transform: uppercase;
font-weight: 700;
font-size: 0.69em;
line-height: 2.2;
padding: 1.61em 5em;
}

.codrops-links a {
display: inline-block;
padding: 0 1em;
text-decoration: none;
letter-spacing: 1px;
}

.codrops-icon:before {
margin: 0 4px;
text-transform: none;
font-weight: normal;
font-style: normal;
font-variant: normal;
font-family: 'codropsicons';
line-height: 1;
speak: none;
-webkit-font-smoothing: antialiased;
}

.codrops-icon-drop:before {
content: "\e001";
}

.codrops-icon-prev:before {
content: "\e004";
}

/* Demo Buttons Style */
.codrops-demos {
font-size: 1em;
max-width: 1200px;
margin: 3em auto 5em;
padding: 2em 10em 0;
}

.codrops-demos > a {
display: inline-block;
margin: 0.75em;
padding: 1.35em 1.1em;
width: 15em;
background: #fffce1;
outline: none;
text-decoration: none;
text-transform: uppercase;
letter-spacing: 1px;
font-weight: 800;
border-radius: 20px/50px;
}

.codrops-demos > a.current-demo {
background: #c94e50;
color: #fffce1;
}

/* Related demos */
.related {
margin-top: 5em;
padding: 0 3em 5em;
}

.related p {
font-size: 1.5em;
font-weight: 700;
}

.related > a {
display: inline-block;
text-align: center;
margin: 20px 10px;
padding: 25px;
border-radius: 35px/200px;
background: #fffce1;
max-width: 100%;
}

.related a img {
max-width: 100%;
opacity: 0.8;
border-radius: 20px/100px;
}

.related a:hover img,
.related a:active img {
opacity: 1;
}

.related a h3 {
margin: 0;
padding: 0.5em 0.75em 0.3em;
max-width: 300px;
text-align: left;
}

body #cdawrap {
top: auto;
bottom: 35px;
right: 35px;
background: #b4bad2;
border: 1px solid rgba(131,135,151,0.6);
}

.demo-wave body #cdawrap {
top: 35px;
right: 35px;
bottom: auto;
}

@media screen and (max-width: 40em) {
body {
font-size: 80%;
}
.codrops-header h1 {
font-size: 2.5em;
}
.codrops-demos {
max-width: 900px;
padding: 2em 2em 0;
}
.related > a {
margin: 20px 0;
}
}

@media screen and (max-width: 25em) {

.codrops-icon {
font-size: 250%;
}

.codrops-icon span {
display: none;
}

}








Cuối là chèn JS:



<script type="text/javascript">
/*!
* classie - class helper functions
* from bonzo https://github.com/ded/bonzo
*
* classie.has( elem, 'my-class' ) -> true/false
* classie.add( elem, 'my-new-class' )
* classie.remove( elem, 'my-unwanted-class' )
* classie.toggle( elem, 'my-class' )
*/

/*jshint browser: true, strict: true, undef: true */
/*global define: false */

( function( window ) {

'use strict';

// class helper functions from bonzo https://github.com/ded/bonzo

function classReg( className ) {
return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
}

// classList support for class management
// altho to be fair, the api sucks because it won't accept multiple classes at once
var hasClass, addClass, removeClass;

if ( 'classList' in document.documentElement ) {
hasClass = function( elem, c ) {
return elem.classList.contains( c );
};
addClass = function( elem, c ) {
elem.classList.add( c );
};
removeClass = function( elem, c ) {
elem.classList.remove( c );
};
}
else {
hasClass = function( elem, c ) {
return classReg( c ).test( elem.className );
};
addClass = function( elem, c ) {
if ( !hasClass( elem, c ) ) {
elem.className = elem.className + ' ' + c;
}
};
removeClass = function( elem, c ) {
elem.className = elem.className.replace( classReg( c ), ' ' );
};
}

function toggleClass( elem, c ) {
var fn = hasClass( elem, c ) ? removeClass : addClass;
fn( elem, c );
}

var classie = {
// full names
hasClass: hasClass,
addClass: addClass,
removeClass: removeClass,
toggleClass: toggleClass,
// short names
has: hasClass,
add: addClass,
remove: removeClass,
toggle: toggleClass
};

// transport
if ( typeof define === 'function' && define.amd ) {
// AMD
define( classie );
} else {
// browser global
window.classie = classie;
}

})( window );
</script>


<script type="text/javascript">
/**
* main.js
* http://www.codrops.com
*
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2014, Codrops
* http://www.codrops.com
*/
(function() {

var bodyEl = document.body,
content = document.querySelector( '.content-wrap' ),
openbtn = document.getElementById( 'open-button' ),
closebtn = document.getElementById( 'close-button' ),
isOpen = false;

function init() {
initEvents();
}

function initEvents() {
openbtn.addEventListener( 'click', toggleMenu );
if( closebtn ) {
closebtn.addEventListener( 'click', toggleMenu );
}

// close the menu element if the target it´s not the menu element or one of its descendants..
content.addEventListener( 'click', function(ev) {
var target = ev.target;
if( isOpen && target !== openbtn ) {
toggleMenu();
}
} );
}

function toggleMenu() {
if( isOpen ) {
classie.remove( bodyEl, 'show-menu' );
}
else {
classie.add( bodyEl, 'show-menu' );
}
isOpen = !isOpen;
}

init();

})();
</script>