:root {
--htmlColor : #223547;
--cssColor : #472222;
--javascriptColor : #224736;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'NexonLv1Gothic';
color: var(--htmlColor);
}
*, *:before, *:after {
box-sizing:border-box;
}
a {
color: var(--htmlColor);
text-decoration: none;
}
li {
list-style: none;
}
/* scroll */
::-webkit-scrollbar-track
{
box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
background-color: #F5F5F5;
}
::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
height: 10px;
}
::-webkit-scrollbar-thumb
{
border-radius: 10px;
box-shadow: inset 0 0 6px rgba(0,0,0,.3);
background-color: #282936;
}
::-webkit-scrollbar-thumb:hover {
background-color: #0f1891a7;
}
/* header */
#header {
display: flex;
justify-content: space-between;
}
#header nav {
margin: 10px;
}
#header nav li {
position: relative;
display: inline;
}
#header nav li a {
width: 30px;
height: 30px;
border: 1px solid var(--htmlColor);
border-radius: 50%;
display: inline-block;
text-align: center;
line-height: 30px;
font-family: 'NexonLv1Gothic';
}
#header nav li.active a {
background-color: var(--htmlColor);
color: #fff;
}
#header nav li .sub {
position: absolute;
left: 0;
top: 35px;
width: 400px;
}
#header nav li .sub li a {
width: auto;
background-color: transparent;
color: var(--htmlColor);
border: 0;
text-align: left;
line-height: 1.2;
}
#header nav li .sub li.active a {
text-decoration: underline;
}
/* main */
#main {
margin: 50px 10px;
}
.search__wrap {
max-width: 1400px;
margin: 0 auto;
border: 3px solid var(--htmlColor);
border-radius: 20px;
background-color: #f1f3f6;
padding: 30px;
text-align: center;
}
.search__wrap > span {
font-size: 20px;
margin-bottom: 20px;
display: inline-block;
}
.search__wrap > h1 {
font-family: 'Tmon';
color: var(--htmlColor);
font-size: 6vw;
margin-bottom: 10px;
}
.search__box {
margin-bottom: 20px;
}
.search__box label {
position: absolute;
clip: rect(0 0 0 0);
width: 1px;
height: 1px;
margin: -1px;
overflow: hidden;
}
.search__box input {
border: 2px solid var(--htmlColor);
padding: 15px 40px;
width: 70%;
border-radius: 50px;
font-size: 20px;
}
.search__list li {
text-align: left;
line-height: 1.7;
}
.search__list li.hide {
display: none;
}
.search__list li.show {
display: block;
}
.search__info {
text-align: right;
margin-bottom: 30px;
padding-bottom: 10px;
border-bottom: 2px dashed var(--htmlColor);
}
.search__info {
text-align: center;
margin-bottom: 10px;
}
/* keyword box */
.search__info .keyword {
text-align: center;
margin-bottom: 10px;
}
.search__info .keyword span {
border: 2px solid var(--htmlColor);
border-radius: 50px;
padding: 10px;
display: inline-block;
margin-bottom: 4px;
}
.search__info .keyword span:hover {
background-color: var(--htmlColor);
cursor: pointer;
color: #fff;
}
@media (max-width: 600px){
.search__wrap {
padding: 20px;
}
.search__wrap > span {
font-size: 16px;
margin-bottom: 10px;
}
.search__wrap > h1 {
font-size: 44px;
}
.search__box input {
font-size: 16px;
padding: 12px 30px;
}
}
/* modal__wrap */
.modal__wrap {}
.modal__cont {
width: 100%;
height: 100vh;
background-color: rgba(255, 255, 255, 0.3);
position: fixed;
left: 0;
top: 0;
overflow-x: hidden;
display: flex;
align-items: center;
justify-content: center;
transform: scale(0);
}
.modal__btn {
color: #000;
border: 1px solid rgb(177, 12, 12);
border-radius: 50px;
display: inline-block;
padding: 10px 20px;
position: absolute;
right: 0px;
top: 20px;
cursor: pointer;
transition: all 0.3s;
}
.modal__btn:hover {
background-color: rgb(0, 255, 42);
color: #3B3D63;
}
.modal__box {
width: 70%;
height: 70vh;
margin: 0 auto;
background-color: #fff;
background-color: #fff;
border-radius: 0.5rem;
box-shadow: 0 10px 20px -5px hsl(180deg 2% 10%);
transform: scale(0);
}
.modal__box .title {
padding-inline: 1rem;
background-color: #000007;
display: flex;
align-items: center;
color: #fff;
height: 50px;
border-top-left-radius: 0.5rem;
border-top-right-radius: 0.5rem;
}
.modal__box .title .dot {
width: 15px;
height: 15px;
background-color: #fbff00;
display: inline-block;
border-radius: 50%;
position: relative;
margin-left: 2rem;
}
.modal__box .title .dot::before {
content: '';
position: absolute;
left: 25px;
top: 0;
width: 15px;
height: 15px;
background-color: #22ff00;
border-radius: 50%;
}
.modal__box .title .dot::after {
content: '';
position: absolute;
right: 25px;
top: 0;
width: 15px;
height: 15px;
background-color: rgb(255, 0, 0);
border-radius: 50%;
}
.modal__box .title .plus {
background: #282936;
padding: 0.5rem 0.5rem 0.3rem 0.5rem;
border-radius: 0.5rem;
color: #7A7D9D;
}
.modal__box .title .tabs {
display: flex;
margin-left: 50px;
}
.modal__box .title .tabs > div {
color: #7A7D9D;
background-color: #1f224a;
padding: 0.35rem 0.8rem 0.25rem 0.8rem;
margin-right: 0.5rem;
display: flex;
align-items: center;
border-radius: 0.4rem;
text-transform: uppercase;
cursor: grab;
}
.modal__box .title .tabs > div.active {
background-color: #fff;
}
.modal__box .title .tabs > div em {
font-style: normal;
}
.modal__box .title .tabs > div .favicon {
margin-right: 0.4rem;
margin-top: 0.2rem;
}
.modal__box .title .tabs > div .close {
margin-left: 4rem;
}
.title .plus {
border: 1px solid #000;
padding: 0.4rem;
border-radius: 10px;
background-color: #1f224a;
color: #fff;
}
.modal__box .cont {
background-color: #282936;
height: 100%;
box-sizing: border-box;
border-bottom-left-radius: 0.5rem;
border-bottom-right-radius: 0.5rem;
overflow-y: auto;
}
.modal__box .cont > div{
display: none;
}
.modal__box .cont > div.active {
display: block;
height: 100%;
}
.modal__close {
position: absolute;
right: 100px;
top: 40px;
background-color: #1f224a;
padding: 1rem 1rem 0.8rem 1rem;
border-radius: 5px;
box-shadow: 0 3px 5px -5px hsl(180deg 2% 10%);
cursor: pointer;
transition: all 0.3s;
opacity: 0;
}
.modal__close:hover{
background-color: #13142d7d;
}
.modal__close svg{
color: #fff;
}
/* 모달 애니메이션 */
.modal__cont.show { /*전체 배경*/
animation: foldOut 1s ease forwards;
}
.modal__cont.show .modal__box { /*스크립트 배경*/
animation: zoomOut 0.5s 1s ease forwards; /*초를 두개써서딜레이를 줄 수 있다*/
}
.modal__cont.show .modal__close { /* 닫기버튼*/
animation: closeOut 0.6s 1.5s ease forwards;
}
.modal__cont.show.hide {
animation: foldIn 0.3s 0.3s ease backwards;
}
.modal__cont.show.hide .modal__box{
animation: zoomIn 0.5s 1s ease backwards;
}
.modal__cont.show.hide .modal__close { /* 닫기버튼*/
animation: closeIn 0.3s 0.6s ease backwards;
opacity: 1;
}
@keyframes foldOut {
0% {transform: scaleX(0) scaleY(0.001);}
50% {transform: scaleX(1) scaleY(0.001);}
100% {transform: scaleX(1) scaleY(1);}
}
@keyframes closeOut {
0% {opacity: 0;}
100% {opacity: 1;}
}
@keyframes foldIn {
0% {transform: scaleX(1) scaleY(1);}
50% {transform: scaleX(1) scaleY(0.001);}
100% {transform: scaleX(0) scaleY(0.001);}
}
@keyframes zoomOut {
0% {transform: scale(0);}
100% {transform: scale(1);}
}
@keyframes zoomIn {
100% {transform: scale(1);}
0% {transform: scale(0);}
}
@media (max-width: 1100px){
#header {
width: 100%;
}
.modal__box{
width: 96%;
}
.modal__box .title {
overflow: hidden;
}
.modal__box .title .dot {
display: none;
}
.modal__box .title .tabs {
margin-left: 0;
}
.modal__box .title .tabs > div .close {
display: none;
}
}
@media (max-width: 600px){
#header {
text-align: center;
}
#header h1{
line-height: 1.4;
}
.modal__box{
width: 96%;
}
}
/* footer */
#footer {
text-align: center;
}
#footer a {
color: #000;
font-family: 'NexonLv1Gothic';
padding-bottom: 50px;
}
#footer a:hover {
text-decoration: underline;
}
<main id="main">
<div class="search__wrap">
<span>charAt()를 이용하여 검색하기</span>
<h1>CSS 속성 검색하기</h1>
<div class="search__info">
<div class="keyword">
<span>a</span>
<span>b</span>
<span>c</span>
<span>d</span>
<span>e</span>
<span>f</span>
<span>g</span>
<span>h</span>
<span>i</span>
<span>j</span>
<span>k</span>
<span>l</span>
<span>m</span>
<span>n</span>
<span>o</span>
<span>p</span>
<span>q</span>
<span>r</span>
<span>s</span>
<span>t</span>
<span>u</span>
<span>v</span>
<span>w</span>
<span>x</span>
<span>y</span>
<span>z</span>
</div>
<div>전체 속성 갯수 : <span class="num"></span></div>
<div>목록 속성 갯수 : <span class="subnum"></span></div>
</div>
<div class="search__list">
<div class="css">
<ul>
<li><strong>accent-color</strong> : 특정 요소에 색상을 지정할 때 사용됩니다.</li>
<li><strong>align-content</strong> : 콘텐츠 아이템의 상하관계 정렬 상태를 설정합니다.</li>
<li><strong>align-items</strong> : 콘텐츠 아이템의 내부 상하관계 정렬 상태를 설정합니다.</li>
<li><strong>align-self</strong> : 개별적인 콘텐츠 아이템의 정렬 상태를 설정합니다.</li>
<li><strong>all</strong> : 요소의 속성을 초기화 또는 상속을 설정합니다.</li>
<li><strong>animation</strong> : 애니메이션과 관련된 속성을 일괄적으로 설정합니다.</li>
<li><strong>animation-delay</strong> : 애니메이션 지연 시간을 설정합니다.</li>
<li><strong>animation-direction</strong> : 애니메이션 움직임 방향을 설정합니다.</li>
</ul>
</div>
</div>
</div>
</main>