Simple Animated Dialog
이 포스팅에서는 CSS3를 이용한 애니메이션 레이어 팝업에 대해 둘러봅니다.
참고로 SCSS를 컴파일한 CSS임을 알려드립니다.
Source
IE9이하에서는 동작하지 않을 수 있습니다.
See the Pen 심플 애니 레이어팝업 by jaeheekim (@jaehee) on CodePen.
SCSS Type
css
$bg-color: #f1f1f1;
$text-color: #333333;
$highlight-color: #E74C3C;
* {
box-sizing: border-box;
}
body {
background: $bg-color;
color: $text-color;
font-family: 'Cairo', sans-serif;
font-size: 16px;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.dialog__trigger, .dialog__action {
border: 3px solid $text-color;
background: $bg-color;
padding: 15px 20px;
font-size: 1.1rem;
text-transform: uppercase;
//letter-spacing: 1px;
display: block;
transition: all 150ms ease-out;
transform: translateY(0px);
&:hover {
transform: translateY(-5px);
transition: all 100ms ease-in;
box-shadow: 0 5px 10px rgba($text-color,0.4);
}
&:focus {
outline: 0;
}
&:active {
transform: translateY(-3px);
}
}
.dialog {
background: $bg-color;
width: 70%;
position: absolute;
left: calc(50% - 35%);
top: 0;
padding: 30px;
box-shadow: 0 10px 30px rgba($text-color,0.4);
border: 3px solid $text-color;
visibility: hidden;
opacity: 0;
transition: all 180ms ease-in;
@media (max-width: 600px) {
width: 90%;
left: calc(50% - 45%);
}
&.dialog--active {
top: 10%;
visibility: visible;
opacity: 1;
transition: all 250ms ease-out;
}
.dialog__close {
font-size: 2rem;
line-height: 2rem;
position: absolute;
right: 15px;
top: 15px;
cursor: pointer;
padding: 15px;
transition: color 150ms ease;
&:hover {
color: $highlight-color;
}
}
.dialog__title {
font-size: 2rem;
font-family: 'Slabo 27px', serif;
font-weight: 100;
margin: 0;
padding: 0 0 15px 0;
border-bottom: 2px solid $text-color;
}
.dialog__content {
font-size: 1.1rem;
line-height: 2rem;
}
.dialog__action {
margin: 0;
font-size: 1rem;
}
}
Related links
Jaehee's WebClub
[A PEN By Tristan White]
'Code Lab' 카테고리의 다른 글
Layer Pop-up (레이어 팝업) (20) | 2016.09.29 |
---|---|
일반 팝업 (0) | 2016.09.29 |
thumbnail list banner #2(플러그인 타입) (0) | 2016.09.13 |
thumbnail list banner #1 (ver1. 함수형 타입) (0) | 2016.09.12 |
Accordion Menu Plug-in Type (1) | 2016.09.08 |