๋ฐ์ํ
SVG ํ ์คํธ ์ ๋๋ฉ์ด์
์ด๋ฒ ํฌ์คํ ์์๋ ํ ์คํธ๊ฐ ์์ํ ๊ทธ๋ ค์ง๋ ํจ๊ณผ์ SVG ์ ๋๋ฉ์ด์ ์ ๋ง๋ค์ด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค. <svg> ํ๊ทธ๊ฐ ์ฌ์ฉ๋ ๋ฐฉ๋ฒ์ ๋๋ค.
HTML ์์ค
<svg viewBox="0 0 1320 300">
<text x="50%" y="50%" dy="40px" text-anchor="middle">์ฝ๋ฉ๊ณต์ฑ
</text>
</svg>
CSS ์์ค
@font-face {
font-family: 'Jalnan';
font-weight: normal;
font-style: normal;
src: url('https://cdn.jsdelivr.net/gh/webfontworld/goodchoice/Jalnan.eot');
src: url('https://cdn.jsdelivr.net/gh/webfontworld/goodchoice/Jalnan.eot?#iefix') format('embedded-opentype'),
url('https://cdn.jsdelivr.net/gh/webfontworld/goodchoice/Jalnan.woff2') format('woff2'),
url('https://cdn.jsdelivr.net/gh/webfontworld/goodchoice/Jalnan.woff') format('woff'),
url('https://cdn.jsdelivr.net/gh/webfontworld/goodchoice/Jalnan.ttf') format("truetype");
font-display: swap;
}
body {
background-color: #FFEBEE;
}
svg {
font-family: 'Jalnan';
font-size: 140px;
position: absolute;
width: 100%;
height: 100%;
text-transform: uppercase;
animation: stroke 5s infinite alternate;
fill: rgba(72,138,204,1);
}
@keyframes stroke {
0% {
stroke-dashoffset: 25%;
stroke-dasharray: 0 50%;
fill: rgba(72,138,204,0);
stroke: rgba(54,95,160,1);
stroke-width: 2;
}
70% {
fill: rgba(72,138,204,0);
stroke: rgba(54,95,160,1);
}
80% {
fill: rgba(72,138,204,0);
stroke: rgba(54,95,160,1);
}
100% {
stroke-dashoffset: -25%;
stroke-dasharray: 50% 0;
fill: rgba(72,138,204,1);
stroke: rgba(54,95,160,0);
stroke-width: 0;
}
}
์ฝ๋ํ ๊ฒฐ๊ณผ
๋ฐ์ํ
'CSS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[CSS] SCSS๋ก ์จ์ด๋ธ ์ ๋๋ฉ์ด์ ๋ง๋ค๊ธฐ๐ (8) | 2022.09.19 |
---|---|
[CSS] ๊ฑท๋ ํธ๋ฐ ์ ๋๋ฉ์ด์ ๋ง๋ค๊ธฐ๐ (8) | 2022.09.08 |
[CSS] SVG๋? - ๋ํยท์ ๋๋ฉ์ด์ ๋ง๋ค๊ธฐ (8) | 2022.09.07 |
[CSS] ์ ๋๋ฉ์ด์ ์ข ๋ฅ์ ์ฌ์ฉ ๋ฐฉ๋ฒ ์ด์ ๋ฆฌ (7) | 2022.09.07 |
[CSS] ๊ณต์ด ์ ์ ์์ด ํ๋ ์ ๋๋ฉ์ด์ ๋ง๋ค๊ธฐ (2) | 2022.09.02 |
๋๊ธ