<h1>parallaxEffect02</h1>
<p>패럴랙스 이펙트 - 사이트 메뉴</p>
</header>
<!-- //header -->
<nav id="parallax__dot">
<ul>
<li class="active"><a href="#section1"><span>메뉴1</span></a></li>
<li><a href="#section2"><span>메뉴2</span></a></li>
<li><a href="#section3"><span>메뉴3</span></a></li>
<li><a href="#section4"><span>메뉴4</span></a></li>
<li><a href="#section5"><span>메뉴5</span></a></li>
<li><a href="#section6"><span>메뉴6</span></a></li>
<li><a href="#section7"><span>메뉴7</span></a></li>
<li><a href="#section8"><span>메뉴8</span></a></li>
<li><a href="#section9"><span>메뉴9</span></a></li>
</ul>
</nav>
<!--//parallax nav -->
<main id="parallax__cont">
<div id="contents">
<section id="section1" class="content__item">
<span class="content__item__num">01</span>
<h2 class="content__item__title">section1</h2>
<figure class="content__item__imgWrap">
<div class="content__item__img"></div>
</figure>
<p class="content__item__desc">결과도 중요하지만, 과정을 더 중요하게 생각한다.</p>
</section>
<!-- section01 -->
<section id="section2" class="content__item">
<span class="content__item__num">02</span>
<h2 class="content__item__title">section2</h2>
<figure class="content__item__imgWrap">
<div class="content__item__img"></div>
</figure>
<p class="content__item__desc"> 직업에서 행복을 찾아라. 아니면 행복이 무엇인지 절대 모를 것이다</p>
</section>
<!-- section02 -->
<section id="section3" class="content__item">
<span class="content__item__num">03</span>
<h2 class="content__item__title">section3</h2>
<figure class="content__item__imgWrap">
<div class="content__item__img"></div>
</figure>
<p class="content__item__desc">피할수 없으면 즐겨라 그리고 행동해라</p>
</section>
<!-- section03 -->
<section id="section4" class="content__item">
<span class="content__item__num">04</span>
<h2 class="content__item__title">section4</h2>
<figure class="content__item__imgWrap">
<div class="content__item__img"></div>
</figure>
<p class="content__item__desc">실패는 잊어라 그러나 그것이 준 교훈은 절대 잊으면 안된다.</p>
</section>
<!-- section04 -->
<section id="section5" class="content__item">
<span class="content__item__num">05</span>
<h2 class="content__item__title">section5</h2>
<figure class="content__item__imgWrap">
<div class="content__item__img"></div>
</figure>
<p class="content__item__desc">당신이 할수 있다고 믿든 할수 없다고 믿든 믿는 대로 될것이다.</p>
</section>
<!-- section05 -->
<section id="section6" class="content__item">
<span class="content__item__num">06</span>
<h2 class="content__item__title">section6</h2>
<figure class="content__item__imgWrap">
<div class="content__item__img"></div>
</figure>
<p class="content__item__desc">눈물과 더불어 빵을 먹어 보지 않은 자는 인생의 참다운 맛을 모른다. </p>
</section>
<!-- section06 -->
<section id="section7" class="content__item">
<span class="content__item__num">07</span>
<h2 class="content__item__title">section7</h2>
<figure class="content__item__imgWrap">
<div class="content__item__img"></div>
</figure>
<p class="content__item__desc">좋은 성과를 얻으려면 한 걸음 한 걸음이 힘차고 충실하지 않으면 안 된다.</p>
</section>
<!-- section07 -->
<section id="section8" class="content__item">
<span class="content__item__num">08</span>
<h2 class="content__item__title">section8</h2>
<figure class="content__item__imgWrap">
<div class="content__item__img"></div>
</figure>
<p class="content__item__desc">산다는것 그것은 치열한 전투이다.</p>
</section>
<!-- section08 -->
<section id="section9" class="content__item">
<span class="content__item__num">09</span>
<h2 class="content__item__title">section9</h2>
<figure class="content__item__imgWrap">
<div class="content__item__img"></div>
</figure>
<p class="content__item__desc">세상은 과정보다 결과를 중요시한다.</p>
</section>
<!-- section09 -->
</div>
</main>
<!-- //main -->
<aside id="parallax__info">
<div class="scroll">scrollTop:<span>0</span>px</div>
</aside>
<!-- parallax__info -->
<footer id="footer">
<div class="modal__wrap">
<div class="modal__btn">소스 보기</div>
<div class="modal__cont">
<div class="modal__box">
<div class="title">
<span class="dot" aria-label="true"></span>
<div class="tabs">
<div class="active">
<span class="favicon" aria-label="true">
<svg width="16" height="16" viewBox="0 0 18 18" fill="none" aria-hidden="true"
focusable="false">
<circle cx="9" cy="9" r="9" fill="#fff"></circle>
<path
d="M18 9C18 13.9706 15.4688 3.09375 9 10.125C2.53125 17.1562 0 13.9706 0 9C0 4.02944 4.02944 0 9 0C13.9706 0 18 4.02944 18 9Z"
fill="orange"></path>
<path
d="M18 9C18 13.9706 14.9062 0.84375 8.29688 6.1875C1.6875 11.5312 0 13.9706 0 9C0 4.02944 4.02944 0 9 0C13.9706 0 18 4.02944 18 9Z"
fill="yellow"></path>
</svg>
</span>
<em>Javascript</em>
<span class="close">
<svg width="18" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"
focusable="false">
<path d="M12.5 3.5L3.5 12.5" stroke="currentColor" stroke-width="1.5"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M12.5 12.5L3.5 3.5" stroke="currentColor" stroke-width="1.5"
stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
</span>
</div>
<div>
<span class="favicon" aria-label="true">
<svg width="16" height="16" viewBox="0 0 18 18" fill="none" aria-hidden="true"
focusable="false">
<circle cx="9" cy="9" r="9" fill="#fff"></circle>
<path
d="M18 9C18 13.9706 15.4688 3.09375 9 10.125C2.53125 17.1562 0 13.9706 0 9C0 4.02944 4.02944 0 9 0C13.9706 0 18 4.02944 18 9Z"
fill="orange"></path>
<path
d="M18 9C18 13.9706 14.9062 0.84375 8.29688 6.1875C1.6875 11.5312 0 13.9706 0 9C0 4.02944 4.02944 0 9 0C13.9706 0 18 4.02944 18 9Z"
fill="yellow"></path>
</svg>
</span>
<em>HTML</em>
<span class="close">
<svg width="18" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"
focusable="false">
<path d="M12.5 3.5L3.5 12.5" stroke="currentColor" stroke-width="1.5"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M12.5 12.5L3.5 3.5" stroke="currentColor" stroke-width="1.5"
stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
</span>
</div>
<div>
<span class="favicon" aria-label="true">
<svg width="16" height="16" viewBox="0 0 18 18" fill="none" aria-hidden="true"
focusable="false">
<circle cx="9" cy="9" r="9" fill="#fff"></circle>
<path
d="M18 9C18 13.9706 15.4688 3.09375 9 10.125C2.53125 17.1562 0 13.9706 0 9C0 4.02944 4.02944 0 9 0C13.9706 0 18 4.02944 18 9Z"
fill="orange"></path>
<path
d="M18 9C18 13.9706 14.9062 0.84375 8.29688 6.1875C1.6875 11.5312 0 13.9706 0 9C0 4.02944 4.02944 0 9 0C13.9706 0 18 4.02944 18 9Z"
fill="yellow"></path>
</svg>
</span>
<em>CSS</em>
<span class="close">
<svg width="18" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"
focusable="false">
<path d="M12.5 3.5L3.5 12.5" stroke="currentColor" stroke-width="1.5"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M12.5 12.5L3.5 3.5" stroke="currentColor" stroke-width="1.5"
stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
</span>
</div>
</div>
<span class="plus" aria-label="true">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"
focusable="false">
<path d="M2.5 8H13.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
stroke-linejoin="round"></path>
<path d="M8 2.5V13.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
stroke-linejoin="round"></path>
</svg>
</span>
</div>
<div class="cont">
<div class="active">
<pre><code class="language-js">
</code></pre>
</div>
<div>
<pre><code class="language-html">
</code></pre>
</div>
<div>
<pre><code class="language-css">/* reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "NexonLv1Gothic";
}
body {
background-color: #222;
color: #fff;
font-family: "NexonLv1Gothic";
font-weight: 300;
}
img {
width: 100%;
vertical-align: top;
}
a {
color: #fff;
text-decoration: none;
}
li {
list-style: none;
}
/* layout */
#header {
z-index: 2000;
}
#main {
z-index: 1000;
position: relative;
width: 100%;
height: 100vh;
}
#footer {
z-index: 3000;
position: relative;
}
/* header */
#header {
color: #fff;
padding: 20px;
position: absolute;
left: 0;
top: 0;
}
#header h1 {
display: inline-block;
font-weight: 300;
margin-bottom: 10px;
border-bottom: 1px dashed #fff;
}
#header p {
margin-bottom: 10px;
}
#header li {
display: inline-block;
}
#header li a {
border: 1px dashed #fff;
border-radius: 30%;
display: inline-block;
width: 30px;
height: 30px;
text-align: center;
line-height: 30px;
font-size: 14px;
}
#header li.active a {
background-color: #fff;
color: #1f224a;
}
/* footer */
#footer .source {
position: absolute;
right: 20px;
bottom: 20px;
border: 1px solid #fff;
border-radius: 40px;
padding: 10px 30px;
font-size: 14px;
}
/* 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: #fff;
border: 1px solid #fff;
border-radius: 50px;
display: inline-block;
padding: 10px 20px;
position: absolute;
right: 20px;
bottom: 20px;
cursor: pointer;
transition: all 0.3s;
}
.modal__btn:hover {
background-color: #fff;
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%;
}
/* scroll */
.modal__box ::-webkit-scrollbar-track {
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 10px;
background-color: #f5f5f5;
}
.modal__box ::-webkit-scrollbar {
width: 10px;
background-color: #f5f5f5;
height: 10px;
}
.modal__box ::-webkit-scrollbar-thumb {
border-radius: 10px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, 1);
background-color: #282936;
}
.modal__box ::-webkit-scrollbar-thumb:hover {
background-color: #0f1891a7;
}
.modal__close {
position: absolute;
right: 20px;
top: 20px;
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%;
}
}
</code></pre>
</div>
</div>
</div>
<div class="modal__close">
<svg width="18" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false">
<path d="M12.5 3.5L3.5 12.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
stroke-linejoin="round"></path>
<path d="M12.5 12.5L3.5 3.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
stroke-linejoin="round"></path>
</svg>
</div>
</div>
</div>
</footer>
#parallax__nav {
position: fixed;
right: 20px;
top: 20px;
z-index: 2000;
background-color: rgba(0, 0, 0, 0.4);
padding: 20px 30px;
border-radius: 50px;
}
#parallax__nav li {
display: inline;
margin: 0 5px;
}
#parallax__nav li a {
display: inline-block;
height: 30px;
padding: 5px 30px;
text-align: center;
line-height: 30px;
}
#parallax__nav li.active a {
background: #fff;
color: #000;
border-radius: 20px;
box-sizing: content-box;
}
#parallax__cont {
max-width: 1600px;
width: 98%;
margin: 0 auto;
/* background-color: rgba(255, 255, 255, 0.3); */
}
.content__item {
width: 1000px;
max-width: 70vw;
margin: 30vw auto;
/* background-color: rgba(255, 255, 255, 0.3); */
text-align: left;
margin-right: 0;
position: relative;
padding-top: 7vw;
}
.content__item:nth-child(even) {
margin-left: 0;
text-align: right;
}
.content__item:nth-child(even) .content__item__num {
left: auto;
right: -5vw;
}
.content__item__num {
font-size: 35vw;
font-family: 'Lato';
font-weight: 100;
position: absolute;
left: -5vw;
top: -16vw;
opacity: 0.07;
z-index: -2;
}
.content__item__title {
font-weight: 400;
text-transform: capitalize;
}
.content__item__imgWrap {
position: relative;
width: 100%;
padding-bottom: 56.25%;
background: #000;
overflow: hidden;
z-index: -1;
}
.content__item__img {
position: absolute;
background-image: url(../assets/img/effect_bg_14@2x.jpg);
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
width: 110%;
height: 110%;
left: -5%;
top: -5%;
filter: saturate(0%);
transition: all 1s;
}
.content__item:nth-child(1) .content__item__img {
background-image: url(https://github.com/thdtjdgml415/coding2/blob/main/javascript/assets/img/effect_bg_17.jpg?raw=true);
}
.content__item:nth-child(2) .content__item__img {
background-image: url(../assets/img/effect_bg_16@2x.jpg);
}
.content__item:nth-child(3) .content__item__img {
background-image: url(https://github.com/thdtjdgml415/coding2/blob/main/javascript/assets/img/effect_bg_11.jpg?raw=true);
}
.content__item:nth-child(4) .content__item__img {
background-image: url(https://github.com/thdtjdgml415/coding2/blob/main/javascript/assets/img/effect_bg_12@2x.jpg?raw=true);
}
.content__item:nth-child(5) .content__item__img {
background-image: url(../assets/img/effect_bg_19@2x.jpg);
}
.content__item:nth-child(6) .content__item__img {
background-image: url(../assets/img/effect_bg_11@2x.jpg);
}
.content__item:nth-child(7) .content__item__img {
background-image: url(../assets/img/effect_bg_13@2x.jpg);
}
.content__item:nth-child(8) .content__item__img {
background-image: url(../assets/img/effect_bg_12@2x.jpg);
}
.content__item:nth-child(9) .content__item__img {
background-image: url(../assets/img/effect_bg_14@2x.jpg);
}
.content__item__desc {
font-size: 3vw;
line-height: 1.4;
margin-top: -5vw;
margin-left: -4vw;
word-break: keep-all;
}
.content__item:nth-child(even) .content__item__desc {
margin-left: auto;
margin-right: -4vw;
}
#parallax__info {
position: fixed;
left: 20px;
bottom: 20px;
z-index: 2000;
background: rgba(0, 0, 0, 0.4);
color: #fff;
padding: 20px;
border-radius: 10px;
}
#parallax__info li,
.scrollTop {
line-height: 1.4;
}
@media (max-width: 800px) {
#parallax__cont {
margin-top: 70vw;
}
#parallax__nav {
padding: 10px;
right: auto;
left: 10px;
top: 50%;
transform: translateY(-50%);
border-radius: 5px;
background-color: rgba(0, 0, 0, 0.8);
}
#parallax__nav li {
display: block;
margin: 5px;
}
#parallax__nav li a {
font-size: 14px;
padding: 5px;
border-radius: 5px;
line-height: 1;
}
#parallax__nav li.active a {
border-radius: 5px;
}
#parallax__info {
left: 10px;
bottom: 10px;
}
.content__item {
height: 100vh;
}
}
#parallax__dot {
position: fixed;
right: 20px;
top: 50%;
transform: translateY(-50%);
z-index: 10000;
padding: 20px 10px;
border-radius: 30px;
background: rgba(0,0,0,0.4);
}
#parallax__dot span {
display: none;
}
#parallax__dot li {
position: relative;
width: 20px;
height: 20px;
border-radius: 50%;
margin: 12px 8px;
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0);
transition: box-shadow .1s ease;
}
#parallax__dot li a {
background: #fff;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
border-radius: 50%;
transition: transform .1s ease;
}
#parallax__dot li.active {
box-shadow: 0 0 0 2px rgba(255, 255, 255, 1);
}
#parallax__dot li.active a {
transform: scale(0.4);
}
/* reset */
* {
margin: 0;
padding: 0;
font-family: "NexonLv1Gothic";
}
body {
background-color: #222;
color: #fff;
font-family: "NexonLv1Gothic";
font-weight: 300;
}
img {
width: 100%;
vertical-align: top;
}
a {
color: #fff;
text-decoration: none;
}
li {
list-style: none;
}
/* layout */
#header {
z-index: 2000;
}
#main {
z-index: 1000;
position: relative;
width: 100%;
height: 100vh;
}
#footer {
z-index: 3000;
position: relative;
}
/* header */
#header {
color: #fff;
padding: 20px;
position: absolute;
left: 0;
top: 0;
}
#header h1 {
display: inline-block;
font-weight: 300;
margin-bottom: 10px;
border-bottom: 1px dashed #fff;
}
#header p {
margin-bottom: 10px;
}
#header li {
display: inline-block;
}
#header li a {
border: 1px dashed #fff;
border-radius: 30%;
display: inline-block;
width: 30px;
height: 30px;
text-align: center;
line-height: 30px;
font-size: 14px;
}
#header li.active a {
background-color: #fff;
color: #1f224a;
}
/* footer */
#footer .source {
position: absolute;
right: 20px;
bottom: 20px;
border: 1px solid #fff;
border-radius: 40px;
padding: 10px 30px;
font-size: 14px;
}
/* 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: #fff;
border: 1px solid #fff;
border-radius: 50px;
display: inline-block;
padding: 10px 20px;
position: absolute;
right: 20px;
bottom: 20px;
cursor: pointer;
transition: all 0.3s;
}
.modal__btn:hover {
background-color: #fff;
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%;
}
/* scroll */
.modal__box ::scrollbar-track {
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 10px;
background-color: #f5f5f5;
}
.modal__box ::scrollbar {
width: 10px;
background-color: #f5f5f5;
height: 10px;
}
.modal__box ::scrollbar-thumb {
border-radius: 10px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, 1);
background-color: #282936;
}
.modal__box ::scrollbar-thumb:hover {
background-color: #0f1891a7;
}
.modal__close {
position: absolute;
right: 20px;
top: 20px;
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%;
}
}
document.querySelectorAll("#parallax__dot a").forEach(el => {
el.addEventListener("click", e => {
e.preventDefault();
console.log(e)
document.querySelector(el.getAttribute("href")).scrollIntoView({behavior: "smooth"});
})
});
window.addEventListener("scroll", () =>{
let scrollTop = window.pageYOffset || window.scrollY || document.documentElement.scrollTop; //한번에 처리
document.querySelector("#parallax__info span").innerText = Math.round(scrollTop);
document.querySelectorAll(".content__item").forEach((e, i) => {
if(scrollTop >= e.offsetTop - window.innerHeight/2){
document.querySelectorAll(`#parallax__dot li`).forEach(li => {
li.classList.remove(`active`);
})
document.querySelector(`#parallax__dot li:nth-child(${i + 1})`).classList.add("active")
}
})
})
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.