비전공자 개발일기

QR Code Scanning 본문

HTML _CSS

QR Code Scanning

HiroDaegu 2022. 8. 22. 00:50
728x90
SMALL

 

<!DOCTYPE html>
<html lang="ko">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>QR CODE SCANNER</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <div class="scan">
    <div class="qrcode"></div>
    <h3>QR Code Scanning...</h3>
    <div class="border"></div>
  </div>
</body>
</html>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #111;
}

.scan {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.scan .qrcode {
  position: relative;
  width: 400px;
  height: 400px;
  background: url(QR_Code01.png);
  background-size: 400px;
}

.scan .qrcode::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: url(QR_Code02.png);
  background-size: 400px;
  animation: animate 4s ease-in-out infinite;
  overflow: hidden;
}

@keyframes animate {
  0%, 100% {
    height: 20px;
  }
  50% {
    height: calc(100% - 20px);
  }
}

.scan .qrcode::after {
  content: '';
  position: absolute;
  inset: 20px;
  width: calc(100% - 40px);
  height: 2px;
  background: #35FD5C;
  filter: drop-shadow(0 0 20px #35FD5C) drop-shadow(0 0 60px #35FD5C);
  animation: animateLine 4s ease-in-out infinite;
}

@keyframes animateLine {
  0% {
    top: 20px;
  }
  50% {
    top: calc(100% - 20px);
  }
} 

.border {
  position: absolute;
  inset: 0;
  background: url(border.png);
  background-size: 400px;
  background-repeat: no-repeat;
}

.scan h3 {
  text-transform: uppercase;
  font-size: 2em;
  margin-top: 20px;
  color: #FFF;
  letter-spacing: 2px;
  filter: drop-shadow(0 0 20px #FFF) drop-shadow(0 0 60px #FFF);
  animation: animateText 0.5s steps(1) infinite;
}

@keyframes animateText {
  0%, 100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}
728x90
LIST

'HTML _CSS' 카테고리의 다른 글

Lamp Animation  (0) 2022.08.27
3D Animated Stairs  (0) 2022.08.23
Responsive Pricing Table  (0) 2022.08.20
Navigation Tabs Menu Design  (0) 2022.08.19
Glowing Ring Animation  (0) 2022.08.17