I'm

Developer, Designer, Photographer

GET IN TOUCH

  • Buk-gu, Busan, Republic of Korea
  • ungdoli0916@naver.com
  • Kakao ID : Ungdoli
Your message has been sent. Thank you!
(즐거웅코드) svg로 삼각형 그리기

· 즐거'웅' 코드 (Source)/HTML & CSS & JAVASCRIPT
2021. 6. 5. 13:04

반응형

[즐거'웅'코드] 목차

  1. 예제 소스
  2. 구현 예시
예제 소스
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<svg x="0" y="0" width="100%" height="100%" viewBox="0 0 100 100" preserveAspectRatio="none">
    <polygon id="triangle" fill="none" stroke="#000000" stroke-opacity="1" stroke-width="1" points="50, 0 0, 100 100, 100"/>
</svg>
 
<style>
    #triangle{
        stroke-dasharray: 4000;
        animation: drawing 30s ease-out forwards;
    }
 
    @keyframes drawing {
        to {
            stroke-dashoffset: 0;
        }
        from {
            stroke-dashoffset: 4000;
        }
    }
</style>
구현 예시
반응형