์ฌ์ดํธ ๋ง๋ค๊ธฐ : ์ด๋ฏธ์ง ์ ํ 03
์ด๋ฒ ํฌ์คํ ์์๋ Figma์์ ๋ง๋ ์ด๋ฏธ์ง ์ ํ ์น์ ์ HTML๊ณผ CSS ์ฝ๋๋ก ์ฎ๊ธฐ๋ ์์ ์ ํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค.
Figma
๋จผ์ ๋ง๋ค๊ณ ์ ํ๋ ์น ์ฌ์ดํธ์ ๋ชจ์์ Figma๋ผ๋ ํ๋ก๊ทธ๋จ์ ์ด์ฉํ์ฌ ์๋์ ๊ฐ์ด ๋ง๋ค์ด์ฃผ๋๋ก ํ์.
์ด๋ฒ์ ๋ง๋ค ์น ์ฌ์ดํธ์ ์ ํ์ ํฐ ๋ฉ์ธ ์ด๋ฏธ์ง ํ ์ฅ๊ณผ ๊ทธ ์์ ์์ ์ฌ์ด์ฆ์ ์ด๋ฏธ์ง 4์ฅ์ด ๋ฐฐ์น๋ ๊ตฌ์กฐ์ด๋ฉฐ,
๋ง์ฐ์ค๋ฅผ ์ฌ๋ ค ๋์ผ๋ฉด(hover) ์ ๋ชฉ๊ณผ ์ค๋ช
์ด ๋ค์ด์๋ ๊ฒ์์ ๋ธ๋ฌ ์ฒ๋ฆฌ๋ ๋ฐ์ค๊ฐ ์์ฐ์ค๋ฝ๊ฒ ์ฌ๋ผ์ค๋ ํจ๊ณผ๊น์ง ๋ฐ์์์ผ๋ณด๋๋ก ํ๊ฒ ๋ค.
HTML ์์ค
์น ํ์ค ์ค์๋ฅผ ์ํด ์๋งจํฑ ํ๊ทธ๋ฅผ ์ ๊ทน ์ฌ์ฉํ๋๋ก ํ์. ์์ธํ ์ค๋ช ์ ์๋ ์์ ์ฝ๋์ ์ฃผ์์ฒ๋ฆฌ ๋ด์ฉ์ ์ฐธ์กฐํ ๊ฒ.
<body>
<section id="imageType03" class="image__wrap gmarket section">
<h1>๊ท์ฌ์ด ํฌ๋กํคํฐ๋ฅผ ๋ณด๊ณ ๊ฐ์ธ์๐ป</h1>
<p>
์ฐ๋ฆฌ์ค์ ์์ง ์บ๋ฆญํฐ ํฌ๋กํคํฐ๋ฅผ ๋ณด๋ฉฐ ํ๋งํฉ์๋ค. ๊ท์ฌ์ด ๊ณ ์์ด ์น๊ตฌ ํฌ๋กํคํฐ๋ฅผ ์ค์ปท ๋ณด๊ณ ๊ฐ์ธ์!
</p>
<div class="image__inner container-fluid">
<article class="image">
<div class="image__desc">
<h3>ํฌ๋กํคํฐ ๊ฐ์กฑ๋ค</h3>
<p>๊ฐ์กฑ๋ค๊ณผ ํจ๊ป ๋์ด๋์ฐ์ ๋๋ฌ์จ ํคํฐ์์ ๐ป</p>
</div>
<div class="image__sns">
<!-- ir ํจ๊ณผ : ์คํฌ๋ฆฐ ๋ฆฌ๋๊ธฐ์๋ ์ฝํ์ง๋ง ๊ฒ์ผ๋ก๋ ์ ๋ณด์ด๊ฒ ํ๋ ์์
-->
<a href="#" class="link"><span class="ir">๊ณต์ ํ๊ธฐ</span></a>
<a href="#" class="link"><span class="ir">Twitter</span></a>
<a href="#" class="link"><span class="ir">Instagram</span></a>
<a href="#" class="link"><span class="ir">YouTube</span></a>
<a href="#" class="link"><span class="ir">Facebook</span></a>
</div>
</article>
<article class="image">
<figure class="image__box">
<img src="img/imageType03_bg02.jpg" alt="์ด์์๋ ํฌ๋กํคํฐ">
</figure>
<div class="image__desc">
<h3>์ด์์๋ ํฌ๋กํคํฐ</h3>
<p>ํฌ๋กํคํฐ๋ ํ์ค ์์ ์ด๊ณ ์์ด์.</p>
</div>
<div class="image__sns">
<a href="#" class="link"><span class="ir">๊ณต์ ํ๊ธฐ</span></a>
<a href="#" class="link"><span class="ir">Twitter</span></a>
<a href="#" class="link"><span class="ir">Instagram</span></a>
<a href="#" class="link"><span class="ir">YouTube</span></a>
<a href="#" class="link"><span class="ir">Facebook</span></a>
</div>
</article>
<article class="image">
<figure class="image__box">
<img src="img/imageType03_bg03.jpg" alt="ํฌ๋กํคํฐ ํ๋์นด">
</figure>
<div class="image__desc">
<h3>ํฌ๋กํคํฐ ํ๋์นด</h3>
<p>์ฌ๋ฌ๋ถ์ ์๋์ฐจ๋ ์ด๋ ๊ฒ ๊พธ๋ฉฐ๋ด์.</p>
</div>
<div class="image__sns">
<a href="#" class="link"><span class="ir">๊ณต์ ํ๊ธฐ</span></a>
<a href="#" class="link"><span class="ir">Twitter</span></a>
<a href="#" class="link"><span class="ir">Instagram</span></a>
<a href="#" class="link"><span class="ir">YouTube</span></a>
<a href="#" class="link"><span class="ir">Facebook</span></a>
</div>
</article>
<article class="image">
<figure class="image__box">
<img src="img/imageType03_bg04.jpg" alt="ํฌ๋กํคํฐ ๋ค์จ์ฌ์ธ">
</figure>
<div class="image__desc">
<h3>ํฌ๋กํคํฐ ๋ค์จ์ฌ์ธ</h3>
<p>๊ฐ์ฑ์ ์ธ ํฌ๋กํคํฐ ๋ค์จ์ฌ์ธ์
๋๋ค.</p>
</div>
<div class="image__sns">
<a href="#" class="link"><span class="ir">๊ณต์ ํ๊ธฐ</span></a>
<a href="#" class="link"><span class="ir">Twitter</span></a>
<a href="#" class="link"><span class="ir">Instagram</span></a>
<a href="#" class="link"><span class="ir">YouTube</span></a>
<a href="#" class="link"><span class="ir">Facebook</span></a>
</div>
</article>
<article class="image">
<figure class="image__box">
<img src="img/imageType03_bg05.jpg" alt="์ฐ๋ฆฌ์ค ์ฃผ์ํ์ฌ">
</figure>
<div class="image__desc">
<h3>์ฐ๋ฆฌ์ค ์ฃผ์ํ์ฌ</h3>
<p>www.sanrio.co.jp</p>
</div>
<div class="image__sns">
<a href="#" class="link"><span class="ir">๊ณต์ ํ๊ธฐ</span></a>
<a href="#" class="link"><span class="ir">Twitter</span></a>
<a href="#" class="link"><span class="ir">Instagram</span></a>
<a href="#" class="link"><span class="ir">YouTube</span></a>
<a href="#" class="link"><span class="ir">Facebook</span></a>
</div>
</article>
</div>
</section>
</body>
CSS ์์ค
reset์์ margin๊ฐ๊ณผ padding๊ฐ์ 0์ผ๋ก ์ด๊ธฐํ ์ํค๋ ์์
๋ถํฐ ์์ํ๋ค.
๋ํ, ์ ๋๋ฉ์ด์
ํจ๊ณผ๋ฅผ ์ฃผ๊ธฐ ์ํด transition ์์ฑ๊ณผ :hover ์์ฑ์ ์ ๊ทน ํ์ฉํ๋ค.
์ด๋ฒ์๋ SNS ๊ณต์ ์์ด์ฝ 5๊ฐ๋ฅผ ํ์ํ๊ธฐ ์ํด ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ ํจ๊ณผ๊น์ง ์ฌ์ฉ๋์๋ค.
์์ธํ ์ค๋ช
์ ์๋ ์์ ์ฝ๋์ ์ฃผ์์ฒ๋ฆฌ๋ ๋ด์ฉ์ ์ฐธ์กฐํ ๊ฒ.
/* fonts */
@import url('https://webfontworld.github.io/gmarket/GmarketSans.css');
.gmarket {
font-family: 'GmarketSans';
font-weight: 400;
}
/* reset */
* {
margin: 0;
padding: 0;
}
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
a {
text-decoration: none;
color: #000;
}
img {
width: 100%; /* ์ด๋ฏธ์ง ํ์ด๋์จ ๊ฑฐ ์ง์ด๋ฃ๊ธฐ */
vertical-align: top; /* ์ด๋ฏธ์ง ์ฌ์ด์ฆ ๋น๊ณต๊ฐ์์ด ๋ง์ถฐ์ฃผ๊ธฐ */
}
/* common */
.container {
width: 1160px;
padding: 0 20px;
margin: 0 auto;
min-width: 1160px; /* ๋ฐ์ํ ํ ๋ ์์ ์ค ๊ฒ */
}
.container-fluid {
width: 100%;
padding: 0 100px;
box-sizing: border-box; /* ์คํฌ๋กค๋ฐ ์๊ธฐ๋๊ฑฐ ๋ฐฉ์ง */
}
.section {
padding: 120px 0;
}
.section > h1 {
font-size: 50px;
line-height: 1;
text-align: center;
margin-bottom: 20px;
}
.section > p {
font-size: 22px;
font-weight: 300;
text-align: center;
margin-bottom: 70px;
color: #666;
}
/* ir ํจ๊ณผ (์ด๋ฏธ์ง ๋์ฒด ํจ๊ณผ == alt) */
/* ํ๋ฉด์์์๋ ์๋์ค๊ฒ ํจ๊ณผ ๋์์ ์คํฌ๋ฆฐ๋ฆฌ๋๊ธฐ์๋ ์ฝํ๊ฒ ํ๋ ์์
*/
.ir {
display: block;
overflow: hidden;
font-size: 0;
line-height: 0;
text-indent: -9999px;
}
/* imageType */
/* Flex ๋์ Grid๋ฅผ ์ฌ์ฉํ์๋ค. */
.image__inner {
display: grid;
grid-template-areas:
"box1 box1 box2 box3"
"box1 box1 box4 box5";
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-template-rows: 1fr 1fr;
grid-gap: 20px;
}
.image {
position: relative;
overflow: hidden;
}
.image__inner .image {}
.image__inner .image:nth-child(1) {
grid-area: box1;
background: url(img/imageType03_bg01.jpg);
background-size: cover;
}
.image__inner .image:nth-child(2) {
grid-area: box2;
}
.image__inner .image:nth-child(3) {
grid-area: box3;
}
.image__inner .image:nth-child(4) {
grid-area: box4;
}
.image__inner .image:nth-child(5) {
grid-area: box5;
}
.image__box {}
.image__desc {
position: absolute;
left: 0;
bottom: -100%;
width: 100%;
backdrop-filter: blur(10px);
background: rgba(0, 0, 0, 0.5);
padding: 16px;
box-sizing: border-box;
color: #fff;
transition: all 0.4s ease;
}
.image:hover .image__desc {
bottom: 0;
}
.image__desc h3 {
font-size: 20px;
}
.image__desc p {
font-size: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 300;
}
.image__sns {
position: absolute;
right: -100px;
top: 10px;
transition: all 0.4s ease;
}
.image__sns a {
width: 36px;
height: 36px;
background: #fff;
border-radius: 50%;
display: block;
margin-bottom: 5px;
background: url(img/image_bg03_icon.svg);
}
/* ์ด๋ฏธ์ง ์คํ๋ผ์ดํธ */
/* ์์ด์ฝ 5๊ฐ๋ฅผ ์ด์ด ๋ง๋ ํ๋ ์์ SVG๋ก ์ถ์ถํ์ฌ ๊ทธ ์ขํ๊ฐ์ ์๋์ ๊ฐ์ด
์ฎ๊ฒจ๊ฐ๋ฉฐ ์์ด์ฝ ํ๋์ฉ ๋ณด์ด๋๋ก ํ๋ ๊ธฐ๋ฒ */
.image__sns a:nth-child(1) {
}
.image__sns a:nth-child(2) {
background-position: -50px 0;
}
.image__sns a:nth-child(3) {
background-position: -100px 0;
}
.image__sns a:nth-child(4) {
background-position: -150px 0;
}
.image__sns a:nth-child(5) {
background-position: -200px 0;
}
.image:hover .image__sns {
right: 10px;
}
์ต์ข ๊ฒฐ๊ณผ
'Site' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[์ฌ์ดํธ ๋ง๋ค๊ธฐ] ํ ์คํธ ์ ํ 02 (3) | 2022.09.01 |
---|---|
[์ฌ์ดํธ ๋ง๋ค๊ธฐ] ํ ์คํธ ์ ํ 01 (3) | 2022.08.30 |
[์ฌ์ดํธ ๋ง๋ค๊ธฐ] ์ด๋ฏธ์ง ์ ํ 02 - Transition & Hover ํ์ฉํ๊ธฐ (2) | 2022.08.17 |
[์ฌ์ดํธ ๋ง๋ค๊ธฐ] ์ด๋ฏธ์ง ์ ํ 01 - ์ด๋ฏธ์ง ์์ ์ค๋ช , ๋ฒํผ ๋ฃ๊ธฐ (2) | 2022.08.17 |
[์ฌ์ดํธ ๋ง๋ค๊ธฐ] ์นด๋ ์ ํ ์น์ ๋ง๋ค๊ธฐ ์ฌํํธ (10) | 2022.08.10 |
๋๊ธ