피그마를 이용한 디자인 작업을 모바일 코딩으로 작업하는 튜토리얼 영상입니다. 기존에 많이 사용하던 float을 사용하지 않고 display:flex를 사용하여 구조화하였습니다.
Code Youtube
Code Reference
소스는 여기서 다운 받을 수 있습니다. 바로가기
완성된 예제는 여기서 확인 할 수 있습니다. 바로가기
피그마 공유 링크입니다. 바로가기
제플린 web 공유 링크입니다. 바로가기
제플린 app 공유 링크입니다. 바로가기
Code example
sample01
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>New parallax01</title>
<link href="https://fonts.googleapis.com/css?family=Lato:100,300,700,900&display=swap" rel="stylesheet">
<style>
*, *::after, *::before {box-sizing: border-box;}
* {margin: 0; padding: 0;}
body {
background-color: #111;
color : #000;
font-family: 'Lato';
}
.wrap h1 {
font-size: 135px;
padding: 5%;
color : #dc6e25;
text-transform: uppercase;
font-weight: 700;
}
.wrap h1 em {
display: block;
padding-left: 330px;
font-weight: 100;
}
.contents {
width: 100%;
margin: 20% 0 30%;
}
.content-item {
width: 1000px;
/* margin: 0 auto; */
margin: 10% 0 25%;
position: relative;
}
.content-item:nth-child(even){
margin-left: auto;
}
.content-item-title {
text-align: right;
font-weight: 300;
text-transform: capitalize;
color: #999;
padding-bottom: 10px;
font-size: 24px;
}
.content-item:nth-child(even) .content-item-title {
text-align: left;
}
.content-item-num {
font-size: 350px;
opacity: 0.04;
line-height: 1;
font-weight: 100;
color: #fff;
position: absolute;
right: -100px;
top: -200px;
}
.content-item:nth-child(even) .content-item-num {
right: auto; left: -100px;
}
.content-item-imgWrap {
position: relative;
overflow: hidden;
width: 100%;
padding-bottom: 57%;
z-index: 10;
}
.content-item-img {
height: 550px;
position: absolute;
top: -30px;
width: 100%;
background-size: cover;
background-position: 50% 0;
}
.content-item-desc {
font-size: 80px;
line-height: 1.2;
font-weight: 600;
text-transform: uppercase;
color: #fff;
text-align: right;
word-break: keep-all;
margin-top: -200px;
margin-right: -80px;
position: relative;
z-index: 20;
}
.content-item:nth-child(even) .content-item-desc {
text-align: left;
margin-right: 0;
margin-left: -100px;
}
#section1 .content-item-img {background-image: url(http://flairgale.cafe24.com/para/images/so09.jpg);}
#section2 .content-item-img {background-image: url(http://flairgale.cafe24.com/para/images/so02.jpg);}
#section3 .content-item-img {background-image: url(http://flairgale.cafe24.com/para/images/so03.jpg);}
#section4 .content-item-img {background-image: url(http://flairgale.cafe24.com/para/images/so04.jpg);}
#section5 .content-item-img {background-image: url(http://flairgale.cafe24.com/para/images/so05.jpg);}
#section6 .content-item-img {background-image: url(http://flairgale.cafe24.com/para/images/so06.jpg);}
#section7 .content-item-img {background-image: url(http://flairgale.cafe24.com/para/images/so07.jpg);}
#section8 .content-item-img {background-image: url(http://flairgale.cafe24.com/para/images/so08.jpg);}
#section9 .content-item-img {background-image: url(http://flairgale.cafe24.com/para/images/so01.jpg);}
</style>
</head>
<body>
<div class="wrap">
<h1>Parallax<em>Scrolling</em></h1>
<div class="contents">
<section id="section1" class="content-item">
<span class="content-item-num">01</span>
<h2 class="content-item-title">Basic Coding</h2>
<div class="content-item-imgWrap">
<div class="content-item-img"></div>
</div>
<p class="content-item-desc">높은 목표를 세우고, 스스로 채직찔한다.</p>
</section>
<section id="section2" class="content-item">
<span class="content-item-num">02</span>
<h2 class="content-item-title">advice</h2>
<div class="content-item-imgWrap">
<div class="content-item-img"></div>
</div>
<p class="content-item-desc">결과도 중요하지만, 과정을 더 중요하게 생각한다.</p>
</section>
<section id="section3" class="content-item">
<span class="content-item-num">03</span>
<h2 class="content-item-title">advice</h2>
<div class="content-item-imgWrap">
<div class="content-item-img"></div>
</div>
<p class="content-item-desc">매 순간에 최선을 다하고, 끊임없이 변화한다.</p>
</section>
<section id="section4" class="content-item">
<span class="content-item-num">04</span>
<h2 class="content-item-title">advice</h2>
<div class="content-item-imgWrap">
<div class="content-item-img"></div>
</div>
<p class="content-item-desc">모든지 기본을 중요하게 생각한다.</p>
</section>
<section id="section5" class="content-item">
<span class="content-item-num">05</span>
<h2 class="content-item-title">advice</h2>
<div class="content-item-imgWrap">
<div class="content-item-img"></div>
</div>
<p class="content-item-desc">천 마디의 말보다 하나의 행동이 더 값지다.</p>
</section>
<section id="section6" class="content-item">
<span class="content-item-num">06</span>
<h2 class="content-item-title">advice</h2>
<div class="content-item-imgWrap">
<div class="content-item-img"></div>
</div>
<p class="content-item-desc">조그만 성공에 만족하지 않으며, 방심을 경계한다.</p>
</section>
<section id="section7" class="content-item">
<span class="content-item-num">07</span>
<h2 class="content-item-title">advice</h2>
<div class="content-item-imgWrap">
<div class="content-item-img"></div>
</div>
<p class="content-item-desc">내 스타일을 다른 사람에게 강요하지 않는다.</p>
</section>
<section id="section8" class="content-item">
<span class="content-item-num">08</span>
<h2 class="content-item-title">advice</h2>
<div class="content-item-imgWrap">
<div class="content-item-img"></div>
</div>
<p class="content-item-desc">나 자신의 이익을 위해 다른 사람을 이용하지 않는다.</p>
</section>
<section id="section9" class="content-item">
<span class="content-item-num">09</span>
<h2 class="content-item-title">advice</h2>
<div class="content-item-imgWrap">
<div class="content-item-img"></div>
</div>
<p class="content-item-desc">나보다 다른 사람의 의견도 존중한다.</p>
</section>
</div>
</div>
</body>
</html>