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>

Chủ Nhật, 8 tháng 7, 2018

CSS Hiệu Ứng Thầy Trò Tây Du Ký Thỉnh Kinh
XEM BÀI VIÊT
TOÀN MÀN HÌNH


Demo

Chèn CSS dưới vào:
* {
  padding: 0;
  margin: 0;
  list-style: none;
 }
 html,body {
  height: 100%;
 }
 .main {
  height: 100%;
  width: 100%;
  -webkit-background-size: cover;
  background-size: cover;
  overflow: hidden;
  position: relative;
 }
 .main ul {
  height: 100%;
  width: 3920px;
  position: absolute;
  top: 0;
  left: 0;
  animation: dong 50s linear infinite;
 }
 @keyframes dong {
  0% {
   left: 0;
  }
  100% {
   left: 1920px;
  }
 }
 .main ul li {
  height: 100%;
  width: 100%;
  background: url(https://3.bp.blogspot.com/-BnxY-vUVNh0/W0IUOKmRfNI/AAAAAAAAB5U/StJqZg2Sf0QHF4YYVmgQIVGljFngVVyZQCLcBGAs/s1600/2.jpg);
  float: left;
  margin-left: -2000px;
 }
 .wk {
  z-index: 999;
  width: 200px;
  height: 180px;
  background: url(https://4.bp.blogspot.com/-MA3-MbowsV0/W0IUOZGnNtI/AAAAAAAAB5c/jPDCp9En5acgz6RxrN7IKV_SwZTt0RcwACLcBGAs/s1600/west_01_3ca39fe.png) 0 0 no-repeat;
  /*margin: 400px auto;*/
  position: absolute;
  top: 55%;
  left: 20%;
  animation: wkzou 1s steps(8) infinite;
 }
 @keyframes wkzou {
  to {
   background-position: -1600px 0;
  }
 }
 .bj {
  z-index: 999;
  width: 200px;
  height: 180px;
  background: url(https://4.bp.blogspot.com/-qE0WLZXGiT0/W0IUOVmt8kI/AAAAAAAAB5Y/xSKEKhf3DFsN5ULaF6-m3r9_ibT_O9k9ACLcBGAs/s1600/west_02_47bad19.png) 0 0 no-repeat;
  /*margin: 400px auto;*/
  position: absolute;
  top: 55%;
  left: 35%;
  animation: bjzou 1s steps(8) infinite;
 }
 @keyframes bjzou {
  to {
   background-position: -1600px 0;
  }
 }
 .ts {
  z-index: 999;
  width: 170px;
  height: 240px;
  background: url(https://4.bp.blogspot.com/-8Mpf1w1hOYA/W0IUOlkT6PI/AAAAAAAAB5g/NoczSASgOBIbIR__w38a2Ch_TfDsAmHMwCLcBGAs/s1600/west_03_f962447.png) 0 0 no-repeat;
  /*margin: 400px auto;*/
  position: absolute;
  top: 50%;
  left: 50%;
  animation: tszou 1s steps(8) infinite;
 }
 @keyframes tszou {
  to {
   background-position: -1360px 0;
  }
 }
 .ss {
  z-index: 999;
  width: 210px;
  height: 200px;
  background: url(https://2.bp.blogspot.com/-MXtptJ7dpJU/W0IVNbSy5yI/AAAAAAAAB50/RCIJE1ubQkYzmGiBCaxJu_0bcgirXz3fwCLcBGAs/s3200/west_04_6516d80.png) 0 0 no-repeat;
  /*margin: 400px auto;*/
  position: absolute;
  top: 57%;
  left: 62%;
  animation: sszou 1s steps(8) infinite;
 }
 @keyframes sszou {
  to {
   background-position: -1680px 0;
  }
 }


Tiếp đó là đoạn code hiển thị:
<div class="wk"></div>
<div class="bj"></div>
<div class="ts"></div>
<div class="ss"></div>
<div class="main">
    <ul>
        <li></li>
        <li></li>
    </ul>
</div>

Thứ Bảy, 30 tháng 6, 2018

Tổng hợp 8 CSS Hiệu ứng Loading
XEM BÀI VIÊT
TOÀN MÀN HÌNH


Demo


Đầu tiên chèn đoạn mã dưới vào nơi hiển thị hiệu ứng loading:

<div class="cell">
  <div class="wrapper">
    <div class="spinner spinner1"></div>
  </div>
</div>
<div class="cell">
  <div class="wrapper">
    <div class="spinner spinner2"></div>
  </div>
</div>
<div class="cell">
  <div class="wrapper">
    <div class="spinner spinner3"></div>
  </div>
</div>
<div class="cell">
  <div class="wrapper">
    <div class="spinner spinner4"></div>
  </div>
</div>
<div class="cell">
  <div class="wrapper">
    <div class="spinner spinner5"></div>
  </div>
</div>
<div class="cell">
  <div class="wrapper">
    <div class="spinner spinner6"></div>
  </div>
</div>
<div class="cell">
  <div class="wrapper">
    <div class="spinner spinner7"></div>
  </div>
</div>
<div class="cell">
  <div class="wrapper">
    <div class="spinner spinner8"></div>
  </div>
</div>

Cuối cùng là chèn đoạn css bên dưới vào là hoàn tất:
@import url("https://fonts.googleapis.com/css?family=Source+Serif+Pro");
*, *::before, *::after {
  box-sizing: border-box;
}

.cell {
  width: 25%;
}
.cell .wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  height: 10rem;
  margin: 1rem 1rem 0;
  padding-top: 2.2rem;
  background: rgba(255, 255, 255, 0.2);
}
.cell .wrapper::after {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 0.2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.25);
  /* Increment the section counter */
  counter-increment: spinnerCount;
  /* Display the counter on pseudo-elements */
  content: counter(spinnerCount);
}

.spinner {
  width: 4rem;
  height: 4rem;
}
.spinner.spinner1 {
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  -webkit-animation: rotation .8s ease infinite;
          animation: rotation .8s ease infinite;
}
.spinner.spinner2 {
  border: 3px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.5);
  border-bottom-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  -webkit-animation: rotation .8s ease infinite;
          animation: rotation .8s ease infinite;
}
.spinner.spinner3 {
  border-top: 3px solid rgba(0, 0, 0, 0.5);
  border-right: 3px solid transparent;
  border-radius: 50%;
  -webkit-animation: rotation .8s linear infinite;
          animation: rotation .8s linear infinite;
}
.spinner.spinner4 {
  background: rgba(0, 0, 0, 0.5);
  -webkit-animation: flip 1.2s ease infinite;
          animation: flip 1.2s ease infinite;
}
.spinner.spinner5 {
  margin-top: 2rem;
  overflow: hidden;
  position: relative;
  height: .5rem;
  background: rgba(255, 255, 255, 0.25);
}
.spinner.spinner5::before {
  content: '';
  position: absolute;
  left: -130%;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  -webkit-animation: progress 4s linear infinite;
          animation: progress 4s linear infinite;
}
.spinner.spinner6 {
  position: absolute;
  top: 45%;
  left: 50%;
  background: #fff;
  border-radius: 50%;
  -webkit-animation: pulse 1s ease-in-out infinite;
          animation: pulse 1s ease-in-out infinite;
  -webkit-transform: translate(-50%, -50%) scale(0);
          transform: translate(-50%, -50%) scale(0);
}
.spinner.spinner7 {
  position: relative;
}
.spinner.spinner7::before, .spinner.spinner7::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  -webkit-transform: translate(-50%, -50%) scale(0);
          transform: translate(-50%, -50%) scale(0);
}
.spinner.spinner7::before {
  background: #fff;
  -webkit-animation: pulse2 2s ease-in-out infinite;
          animation: pulse2 2s ease-in-out infinite;
}
.spinner.spinner7::after {
  background: #fff;
  -webkit-animation: pulse2 2s 1s ease-in-out infinite;
          animation: pulse2 2s 1s ease-in-out infinite;
}
.spinner.spinner8 {
  position: relative;
  -webkit-perspective: 200px;
          perspective: 200px;
}
.spinner.spinner8::before {
  display: block;
  content: '';
  width: 50%;
  height: 50%;
  background: rgba(0, 0, 0, 0.5);
  -webkit-animation: 2s flipWalker ease infinite;
          animation: 2s flipWalker ease infinite;
}

@-webkit-keyframes rotation {
  from {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
  to {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}

@keyframes rotation {
  from {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
  to {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}
@-webkit-keyframes flip {
  0% {
    -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
            transform: perspective(120px) rotateX(0deg) rotateY(0deg);
  }
  50% {
    -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(0deg);
            transform: perspective(120px) rotateX(-180deg) rotateY(0deg);
  }
  100% {
    -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-180deg);
            transform: perspective(120px) rotateX(-180deg) rotateY(-180deg);
  }
}
@keyframes flip {
  0% {
    -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
            transform: perspective(120px) rotateX(0deg) rotateY(0deg);
  }
  50% {
    -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(0deg);
            transform: perspective(120px) rotateX(-180deg) rotateY(0deg);
  }
  100% {
    -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-180deg);
            transform: perspective(120px) rotateX(-180deg) rotateY(-180deg);
  }
}
@-webkit-keyframes progress {
  0% {
    left: -130%;
    background: rgba(0, 0, 0, 0.5);
  }
  50% {
    left: 130%;
    background: rgba(0, 0, 0, 0.5);
  }
  51% {
    background: rgba(255, 255, 255, 0.5);
  }
  100% {
    background: rgba(255, 255, 255, 0.5);
  }
}
@keyframes progress {
  0% {
    left: -130%;
    background: rgba(0, 0, 0, 0.5);
  }
  50% {
    left: 130%;
    background: rgba(0, 0, 0, 0.5);
  }
  51% {
    background: rgba(255, 255, 255, 0.5);
  }
  100% {
    background: rgba(255, 255, 255, 0.5);
  }
}
@-webkit-keyframes pulse {
  0% {
    -webkit-transform: translate(-50%, -50%) scale(0);
            transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    -webkit-transform: translate(-50%, -50%) scale(1);
            transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}
@keyframes pulse {
  0% {
    -webkit-transform: translate(-50%, -50%) scale(0);
            transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    -webkit-transform: translate(-50%, -50%) scale(1);
            transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}
@-webkit-keyframes pulse2 {
  0%, 100% {
    -webkit-transform: translate(-50%, -50%) scale(0);
            transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  50% {
    -webkit-transform: translate(-50%, -50%) scale(1);
            transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}
@keyframes pulse2 {
  0%, 100% {
    -webkit-transform: translate(-50%, -50%) scale(0);
            transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  50% {
    -webkit-transform: translate(-50%, -50%) scale(1);
            transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}
@-webkit-keyframes flipWalker {
  0% {
    -webkit-transform: translate(0, 0) rotateX(0) rotateY(0);
            transform: translate(0, 0) rotateX(0) rotateY(0);
  }
  25% {
    -webkit-transform: translate(100%, 0) rotateX(0) rotateY(180deg);
            transform: translate(100%, 0) rotateX(0) rotateY(180deg);
  }
  50% {
    -webkit-transform: translate(100%, 100%) rotateX(-180deg) rotateY(180deg);
            transform: translate(100%, 100%) rotateX(-180deg) rotateY(180deg);
  }
  75% {
    -webkit-transform: translate(0, 100%) rotateX(-180deg) rotateY(360deg);
            transform: translate(0, 100%) rotateX(-180deg) rotateY(360deg);
  }
  100% {
    -webkit-transform: translate(0, 0) rotateX(0) rotateY(360deg);
            transform: translate(0, 0) rotateX(0) rotateY(360deg);
  }
}
@keyframes flipWalker {
  0% {
    -webkit-transform: translate(0, 0) rotateX(0) rotateY(0);
            transform: translate(0, 0) rotateX(0) rotateY(0);
  }
  25% {
    -webkit-transform: translate(100%, 0) rotateX(0) rotateY(180deg);
            transform: translate(100%, 0) rotateX(0) rotateY(180deg);
  }
  50% {
    -webkit-transform: translate(100%, 100%) rotateX(-180deg) rotateY(180deg);
            transform: translate(100%, 100%) rotateX(-180deg) rotateY(180deg);
  }
  75% {
    -webkit-transform: translate(0, 100%) rotateX(-180deg) rotateY(360deg);
            transform: translate(0, 100%) rotateX(-180deg) rotateY(360deg);
  }
  100% {
    -webkit-transform: translate(0, 0) rotateX(0) rotateY(360deg);
            transform: translate(0, 0) rotateX(0) rotateY(360deg);
  }
}

Chủ Nhật, 27 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ứ Bảy, 26 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ứ Sáu, 25 tháng 5, 2018

Nâng cấp Blogger Layout, Default Widget và Skin lên phiên bản mới
XEM BÀI VIÊT
TOÀN MÀN HÌNH
Vừa qua Google có tung ra gói theme blogger mới khá đẹp mắt với chức năng tùy chỉnh cao hơn. Tuy nhiên với hầu hết các template blogger cũ bạn phải tiến hành cập nhật thủ công. Bài viết này sẽ hướng dẫn các bạn cách nâng cấp Blogger Layout, Default Widget và Skin lên phiên bản mới để được hỗ trợ CSS Script và Webkit mới nhất


Giao diện cũ

Giao diện mới

Với giao diện widget mới này bạn có thể dễ dàng ẩn đi 1 widget nào đó bằng 1 cú click chuột, điều đó khá phức tạp khi muốn ẩn/xóa widget với giao diện cũ



Một số lợi ích khi nâng cấp
  • Bố cục ổn định hơn và thêm chức năng mới
  • Tất cả widget mới nhất sẽ tương thích với cập nhật
  • Bạn có thể dễ dàng tuỳ chỉnh chủ đề blogger mà không bị bỡ ngỡ với giao diện mới
  • Cách bố trí blogger mới và thiết kế widget mặc định trông bắt mắt hơn.
Trước tiên bạn hãy backup lại template để tránh lỗi đáng tiếc xảy ra nhè. Để nâng cấp bạn tiến hành làm như sau

1. Nâng cấp bố cục lên Version 3

Như thường lệ bạn đăng nhập trang quản trị vào phần chỉnh sửa HTML

Thêm thuộc tính b:layoutsVersion='3' vào trong thẻ mở<html
Sau khi thêm sẽ được kết quả gần giống như sau

<html b:version='2' class='v2' b:layoutsVersion='3' expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>

2. Nâng cấp widget lên Version 2

Tương tự như phần 1, bạn tiếp tục thêm thuộc tính b:defaultwidgetversion='2' vào trong thẻ mở<html
Sau khi thêm sẽ được kết quả như sau

<html b:version='2' class='v2' b:layoutsVersion='3' b:defaultwidgetversion='2' expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>

Bạn không cần quá quan tâm đến vị trí đặt thuộc tính, chỉ cần lưu mẫu lại và f5 trang thì blogger sẽ tự đặt nó đúng vị trí nó thuộc về.

Tiếp theo bạn dán toàn bộ đoạn code sau vào sau thẻ đóng ]]></b:skin> hoặc </b:template-skin>

<b:defaultmarkups>
      <b:defaultmarkup type='Common'>
        <b:includable id='responsiveImage' var='settings'>
          <b:comment>Add in the high-res thumb for youtube images.</b:comment>
          <b:if cond='not data:settings.image.isYoutube'>
            <b:include data='settings' name='super.responsiveImage'/>
          <b:else/>
            <b:with value='resizeImage(data:post.featuredImage.youtubeMaxResDefaultUrl, 1152, &quot;4:3&quot;)' var='highRes'>
              <b:include data='{                                  image: data:settings.image,                                  imageSizes: [320,490],                                  sourceSizes: &quot;(max-width: 640px) 100vw, (max-width: 1024px) 576px, 490px&quot;,                                  enhancedSourceset: data:highRes                                }' name='super.responsiveImage'/>
            </b:with>
          </b:if>
        </b:includable>
      </b:defaultmarkup>
      <b:defaultmarkup type='BlogSearch'>
        <b:includable id='searchSubmit'>
          <b:if cond='data:widget.sectionId == &quot;search_top&quot;'>
            <label>
              <input type='submit'/>
              <b:include data='{ iconClass: &quot;touch-icon search-icon&quot; }' name='searchIcon'/>
            </label>
          <b:else/>
            <b:include name='super.searchSubmit'/>
          </b:if>
        </b:includable>
      </b:defaultmarkup>
      <b:defaultmarkup type='AdSense,Blog'>
        <b:includable id='defaultAdUnit'>
          <!-- Clear out style (need non-empty string) -->
          <b:with value='&quot;/* Done in css. */&quot;' var='style'>
            <b:include name='super.defaultAdUnit'/>
          </b:with>
        </b:includable>
      </b:defaultmarkup>
      <b:defaultmarkup type='Blog,FeaturedPost,PopularPosts'>
        <b:includable id='sharingButtonContent'>
          <b:message name='messages.share'/>
        </b:includable>
        <b:includable id='postLabels'>
          <b:include cond='data:view.isSingleItem and data:widget.type == &quot;Blog&quot;' name='super.postLabels'/>
        </b:includable>
        <b:includable id='headerByline'>
          <b:if cond='data:view.isSingleItem and data:widget.type == &quot;Blog&quot;'>
            <b:include name='super.headerByline'/>
          <b:else/>
            <b:include data='{ items: [&quot;author&quot;, &quot;timestamp&quot;] }' name='headerBylineOverride'/>
          </b:if>
        </b:includable>
        <b:includable id='footerBylines'>
          <b:if cond='data:view.isSingleItem and data:widget.type == &quot;Blog&quot;'>
            <b:include name='super.footerBylines'/>
          <b:else/>
            <b:include data='{ items: [[&quot;share&quot;, &quot;comments&quot;]] }' name='footerBylinesOverride'/>
          </b:if>
        </b:includable>
        <b:includable id='emailPostIcon'>
          <!-- Replace icon with text -->
          <span class='byline'>
            <a class='flat-button' expr:href='data:post.emailPostUrl'><data:messages.emailPost/></a>
          </span>
        </b:includable>
      </b:defaultmarkup>
      <b:defaultmarkup type='Blog'>
        <b:includable id='main'>
          <b:if cond='not data:posts.any'>
            <div class='no-posts'>
              <b:eval expr='data:view.isSearch ? data:messages.noResultsFound : data:messages.theresNothingHere'/>
            </div>
          </b:if>

          <!-- Display title on homepage -->
          <b:if cond='data:posts.any and data:view.isHomepage'>
            <h3 class='title'><data:messages.latestPosts/></h3>
          </b:if>
          <!-- Filter out the featured post, but only on the homepage. -->
          <b:with value='(data:widgets.FeaturedPost filter w =&gt; w.sectionId == &quot;page_body&quot;) map (w =&gt; w.postId)' var='featuredPostIds'>
            <b:with value='data:view.isHomepage ? data:posts filter (post =&gt; post.id not in data:featuredPostIds) : data:posts' var='posts'>
              <b:include name='super.main'/>
            </b:with>
          </b:with>
        </b:includable>
        <b:includable id='commentFormIframeSrc' var='post'>
          <b:with value='data:template.isAlternateRendering ? (&quot;&amp;skinvariant=&quot; + data:template.variant) : &quot;&quot;' var='variantParam'>
            <a expr:href='data:post.commentFormIframeSrc + &quot;&amp;skin=soho&quot; + data:variantParam' id='comment-editor-src'/>
          </b:with>
        </b:includable>
        <b:includable id='commentForm' var='post'>
          <b:with value='&quot;90px&quot;' var='cmtIframeInitialHeight'>
            <b:include data='post' name='super.commentForm'/>
          </b:with>
        </b:includable>
        <b:includable id='threadedCommentForm' var='post'>
          <b:with value='&quot;90px&quot;' var='cmtIframeInitialHeight'>
            <b:include data='post' name='super.threadedCommentForm'/>
          </b:with>
        </b:includable>
        <b:includable id='postCommentsAndAd' var='post'>
          <!-- Always render inline ad inside container -->
          <div class='post-outer-container'>
            <div class='post-outer'>
              <b:include data='post' name='post'/>
            </div>
            <b:include cond='data:view.isSingleItem' data='post' name='commentPicker'/>
            <b:include cond='data:post.includeAd and data:post.adNumber lt (data:view.isHomepage ? 2 : 3)' data='post' name='inlineAd'/>
          </div>
        </b:includable>
        <b:includable id='post' var='post'>
          <b:if cond='data:view.isSingleItem'>
            <div class='post-sidebar'>
              <b:if cond='data:widgets.Blog.first.allBylineItems.share and data:post.shareUrl'>
                <div class='post-sidebar-item post-share-buttons'>
                  <b:with value='data:widget.instanceId + &quot;-&quot; + (data:regionName ?: &quot;byline&quot;) + &quot;-&quot; + data:post.id' var='sharingId'>
                    <b:include data='{                                                              sharingId: data:sharingId,                                                              originalUrl: data:post.url,                                                              shareUrl: data:post.shareUrl,                                                              platforms: data:blog.sharing.platforms,                                                            }' name='sharingButtons'/>
                  </b:with>
                </div>
              </b:if>
              <b:if cond='data:widgets.Blog.first.allBylineItems.labels and data:post.labels'>
                <div class='post-sidebar-item post-sidebar-labels'>
                  <div><data:messages.labels/></div>
                  <ul>
                    <b:loop index='i' values='data:post.labels' var='label'>
                      <li><a expr:href='data:label.url' rel='tag'><data:label.name/></a></li>
                    </b:loop>
                  </ul>
                </div>
              </b:if>
            </div>
          </b:if>
          <div class='post'>
            <b:class cond='data:view.isMultipleItems and data:post.featuredImage' name='has-featured-image'/>
            <b:class cond='data:view.isMultipleItems and not data:post.featuredImage' name='no-featured-image'/>
            <b:include data='post' name='postMeta'/>
            <b:if cond='data:view.isSingleItem'>
              <b:include name='headerByline'/>
              <b:include data='post' name='postTitle'/>
              <div class='post-body-container'>
                <b:include data='post' name='postBody'/>
              </div>
            <b:else/>
              <b:if cond='data:post.featuredImage'>
                <div class='snippet-thumbnail'>
                  <a b:whitespace='remove' expr:href='data:post.url'>
                    <b:comment>Max width is 576, so max size @ 2x is 1152.</b:comment>
                    <b:include data='{                                        image: data:post.featuredImage,                                        imageSizes: [320,490,576,1152],                                        sourceSizes: &quot;(max-width: 576px) 100vw, (max-width: 1024px) 576px, 490px&quot;                                      }' name='responsiveImage'/>
                  </a>
                  <b:include name='headerByline'/>
                </div>
              <b:else/>
                <b:include name='headerByline'/>
              </b:if>
              <b:include data='post' name='postTitle'/>
            </b:if>
            <b:include data='post' name='postFooter'/>
          </div>
        </b:includable>
        <b:includable id='feedLinks'>
          <!-- Don't render -->
        </b:includable>
      </b:defaultmarkup>
      <b:defaultmarkup type='BlogArchive'>
        <b:includable id='main' var='this'>
          <details class='collapsible extendable'>
            <b:attr cond='data:view.isArchive' name='open' value='open'/>
            <b:with value='true' var='renderAsDetails'>
            <b:with value='data:messages.archive' var='defaultTitle'>
              <b:include name='super.main'/>
            </b:with>
            </b:with>
          </details>
        </b:includable>
        <b:includable id='flat'>
          <b:include data='{                               buttonClass: &quot;flat-button&quot;,                               items: data:this.data,                               itemSet: &quot;data&quot;,                               itemsMarkup: &quot;super.flat&quot;                             }' name='extendableItems'/>
        </b:includable>
        <b:includable id='hierarchy'>
          <b:include data='{                               buttonClass: &quot;flat-button&quot;,                               limit: 1,                               items: data:this.data,                               itemSet: &quot;data&quot;,                               itemsMarkup: &quot;super.hierarchy&quot;                             }' name='extendableItems'/>
        </b:includable>
      </b:defaultmarkup>
      <b:defaultmarkup type='FeaturedPost'>
        <b:includable id='main'>
          <b:with value='data:messages.featured' var='defaultTitle'>
            <b:include name='super.main'/>
          </b:with>
        </b:includable>
        <b:includable id='snippetedPostContent'>
          <b:with value='data:postDisplay.showFeaturedImage and data:post.featuredImage' var='hasImage'>
            <div class='post-content'>
              <b:class cond='data:hasImage' name='has-featured-image'/>
              <b:class cond='not data:hasImage' name='no-featured-image'/>

              <!-- Change the order and add a snippet container -->
              <b:include cond='data:hasImage' data='post' name='snippetedPostThumbnail'/>
              <div class='post-text-container'>
                <b:include name='headerByline'/>
                <b:include cond='data:this.postDisplay.showTitle' name='snippetedPostTitle'/>
                <b:with value='&quot;featured-post&quot;' var='snippetPrefix'>
                  <b:include cond='data:this.postDisplay.showSnippet' data='post' name='postSnippet'/>
                </b:with>
                <div class='post-footer'>
                  <b:include name='footerBylines'/>
                  <!-- TODO(sarnesjo): Use the postJumpLink call (in case it's been customized). -->
                  <a class='jump-link flat-button' expr:href='data:post.url'><data:messages.readMore/></a>
                </div>
              </div>
            </div>
          </b:with>
        </b:includable>
        <b:includable id='snippetedPostByline' var='post'>
          <b:include name='headerByline'/>
        </b:includable>
        <b:includable id='snippetedPostThumbnail'>
          <b:include data='{image: data:featuredImage, maxSize: 954, selector: &quot;.hero-thumb&quot;}' name='responsiveImageStyle'/>
          <a class='thumb-link' expr:href='data:post.url'><div class='thumb hero-thumb'/></a>
        </b:includable>
      </b:defaultmarkup>
      <b:defaultmarkup type='Header'>
        <b:includable id='image'>
          <b:include name='super.image'/>
          <!-- If we are replacing the title, force it to render anyway, and it'll be hidden in CSS. -->
          <b:include cond='data:this.imagePlacement == &quot;REPLACE&quot;' name='title'/>
        </b:includable>
        <b:includable id='title'>
          <div>
            <b:class cond='data:this.imagePlacement == &quot;REPLACE&quot;' name='replaced'/>
            <b:include name='super.title'/>
          </div>
        </b:includable>
      </b:defaultmarkup>
      <b:defaultmarkup type='Label'>
        <b:includable id='main' var='this'>
          <details class='collapsible extendable'>
            <b:attr cond='data:view.isLabelSearch' name='open' value='open'/>
            <b:with value='true' var='renderAsDetails'>
            <b:with value='data:messages.labels' var='defaultTitle'>
              <b:include name='super.main'/>
            </b:with>
            </b:with>
          </details>
        </b:includable>
        <b:includable id='list'>
          <b:include data='{                               buttonClass: &quot;flat-button&quot;,                               items: data:this.labels,                               itemSet: &quot;labels&quot;,                               itemsMarkup: &quot;super.list&quot;                             }' name='extendableItems'/>
        </b:includable>
        <b:includable id='cloud'>
          <b:include data='{                               buttonClass: &quot;flat-button&quot;,                               items: data:this.labels,                               itemSet: &quot;labels&quot;,                               itemsMarkup: &quot;super.cloud&quot;                             }' name='extendableItems'/>
        </b:includable>
      </b:defaultmarkup>
      <b:defaultmarkup type='PageList'>
        <b:includable id='content'>
          <div class='widget-content'>
            <b:if cond='data:widget.sectionId == &quot;page_list_top&quot;'>
              <b:include name='overflowablePageList'/>
            <b:else/>
              <b:include name='pageList'/>
            </b:if>
          </div>
        </b:includable>
        <b:includable id='overflowButton'>
          <a><data:messages.moreEllipsis/></a>
        </b:includable>
      </b:defaultmarkup>
      <b:defaultmarkup type='PopularPosts'>
        <b:includable id='main'>
          <!-- Default the title to 'Popular posts'. -->
          <b:with value='data:messages.popularPosts' var='defaultTitle'>
            <b:include name='super.main'/>
          </b:with>
        </b:includable>
        <b:includable id='snippetedPostContent'>
          <div class='post'>
            <b:class cond='data:post.featuredImage' name='has-featured-image'/>
            <b:class cond='not data:post.featuredImage' name='no-featured-image'/>
            <b:if cond='data:post.featuredImage'>
              <div class='snippet-thumbnail'>
                <a b:whitespace='remove' expr:href='data:post.url'>
                  <b:include data='{                                      image: data:post.featuredImage,                                      imageSizes: [330,660,1320],                                      sourceSizes: &quot;(max-width: 660px) 100vw, 660px&quot;                                    }' name='responsiveImage'/>
                </a>
                <b:include name='headerByline'/>
              </div>
            <b:else/>
              <b:include name='headerByline'/>
            </b:if>
            <b:include cond='data:this.postDisplay.showTitle' name='snippetedPostTitle'/>
            <div class='post-footer'>
              <b:include name='footerBylines'/>
            </div>
          </div>
        </b:includable>
      </b:defaultmarkup>
      <b:defaultmarkup type='Profile'>
        <b:includable id='main' var='this'>
          <!-- Remove widget title -->
          <b:include name='content'/>
        </b:includable>
        <b:includable id='teamProfileLink'>
          <!-- Remove background image, add "Visit profile" message -->
          <a class='profile-link g-profile' expr:href='data:userUrl'>
            <b:include name='profileImage'/>
            <div class='profile-name-wrapper'>
              <div class='profile-name'><data:display-name/></div>
              <div class='visit-profile'><data:messages.visitProfile/></div>
            </div>
          </a>
        </b:includable>
        <b:includable id='userProfileLink'>
          <!-- Remove background image -->
          <a class='profile-link g-profile' expr:href='data:userUrl' rel='author'>
            <data:displayname/>
          </a>
        </b:includable>
        <b:includable id='viewProfileLink'>
          <!-- Change message to "Visit profile" -->
          <a class='profile-link' expr:href='data:userUrl' rel='author'>
            <data:messages.visitProfile/>
          </a>
        </b:includable>
        <b:includable id='defaultProfileImage'>
          <div class='default-avatar-wrapper'>
            <b:include data='{ iconClass: &quot;avatar-icon&quot; }' name='defaultAvatarIcon'/>
          </div>
        </b:includable>
      </b:defaultmarkup>
    </b:defaultmarkups>

3. Nâng cấp b:skin

Thay thế <b:skin><![CDATA[/* thành <b:skin version='1.0.0'><![CDATA[/*

Cuối cùng lưu mẫu lại để xem thay đổi

4. Fix lỗi

Bạn không nên nâng cấp giao diện của Popular Posts vì cấu trúc khác nhau có thể làm vỡ bố cục của trang web, khi đã nâng cấp thành công bạn hãy thay thế đoạn code Popular Posts mới bằng code Popular Posts cũ đã backup từ trước

Khi thêm 1 widget mới có thể bị lỗi tiêu đề thẻ h2. Bạn hãy tìm đến đoạn code của widget đó và thay thế <b:includable id='main'>...</b:includable> thành

<b:includable id='main'>
    <!-- only display title if it's non-empty -->
    <b:if cond='data:title != &quot;&quot;'>
        <h2 class='title'><data:title/></h2>
    </b:if>
    <div class='widget-content'>
        <data:content/>
    </div>
    <b:include name='quickedit' />
</b:includable>

Thì widget sẽ được áp dụng đúng css

Good Luck