-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
executable file
·170 lines (138 loc) · 4.93 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<html>
<head>
<!-- Titulo de Web -->
<title>Icons – Animation</title>
<!-- Meta tags -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
<style>
* { margin:0; padding:0; }
p {
font-family:Arial, sans-serif;
font-size:12px;
line-height: 1.5em;
}
p span {
font-family:monospace, sans-serif;
display:block;
}
html { background: #ffffff; padding:20px; }
.container { width:400px; height:400px; position:absolute; top:50%; left:50%; margin-left:-200px; margin-top:-200px; text-align: center; }
#Contrato {
animation: fade 2s ease-in;
}
.page {
animation: float 2s ease-in-out infinite;
}
@keyframes float {
0%,100% {
transform: translateY(0);
}
50% {
transform: translateY(-4px)
}
}
.blue-square {
animation: rotation 2s linear infinite;
transform-origin: 60.279998779296875px 88.98999786376953px;
}
@keyframes rotation {
0% {
transform: rotate(0);
}
100% {
transform: rotate(-90deg);
}
}
.lineas {
stroke-dasharray: 100;
stroke-dashoffset: 100;
animation: dash 1500ms ease-out forwards, float 2s ease-in-out infinite;
}
@keyframes dash {
to {
stroke-dashoffset: 0;
}
}
.signature-1 {
stroke-dasharray: 40;
stroke-dashoffset: 80;
animation: sign 1s linear forwards, float 2s ease-in-out infinite;
}
.signature-2 {
stroke-dasharray: 40;
stroke-dashoffset: 40;
animation: dash 1s linear forwards, float 2s ease-in-out infinite;
}
@keyframes sign {
from {
stroke-dashoffset: 40;
}
to {
stroke-dashoffset: 80;
}
}
.check-blue {
stroke-dasharray: 100;
stroke-dashoffset: 100;
animation: check-box 2000ms cubic-bezier(1, 0.4, 0.5, 1) forwards;
animation-delay: 200ms;
}
.check-green {
stroke-dasharray: 100;
stroke-dashoffset: 100;
animation: check-box 2000ms cubic-bezier(1, 0.4, 0.5, 1) forwards;
animation-delay: 200ms;
}
@keyframes fade {
0% {
opacity: 0;
}
30%,100% {
opacity: 1;
}
}
@keyframes check-box {
from {
stroke-dashoffset: 100;
}
to {
stroke-dashoffset: 200;
}
}
@media only screen and (max-width: 768px) {
svg {
max-width: 70%;
}
}
</style>
</head>
<body>
<div class="container">
<svg id="Contrato" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 213 188">
<rect class="blue-square" fill="#e1f3fc" x="16.36" y="45.07" width="87.84" height="87.84" rx="14" ry="14" transform="translate(80.58 -16.56) rotate(45)" />
<rect class="page" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="#10123a" stroke-width="6px" x="52.66" y="7" width="124.44" height="174" rx="4" ry="4"/>
<line class="lineas line-7" stroke-linecap="round" stroke-linejoin="round" stroke="#10123a" stroke-width="6px" x1="71.14" y1="127.52" x2="110.95" y2="127.52"/>
<line class="lineas line-6" stroke-linecap="round" stroke-linejoin="round" stroke="#10123a" stroke-width="6px" x1="71.14" y1="114.26" x2="158.62" y2="114.26"/>
<line class="lineas line-5" stroke-linecap="round" stroke-linejoin="round" stroke="#10123a" stroke-width="6px" x1="71.14" y1="96.36" x2="99.76" y2="96.36"/>
<line class="lineas line-4" stroke-linecap="round" stroke-linejoin="round" stroke="#10123a" stroke-width="6px" x1="71.14" y1="83.1" x2="158.62" y2="83.1"/>
<line class="lineas line-3" stroke-linecap="round" stroke-linejoin="round" stroke="#10123a" stroke-width="6px" x1="71.14" y1="69.83" x2="158.62" y2="69.83"/>
<line class="lineas line-2" stroke-linecap="round" stroke-linejoin="round" stroke="#10123a" stroke-width="6px" x1="71.14" y1="56.57" x2="150.76" y2="56.57"/>
<line class="lineas line-1" stroke-linecap="round" stroke-linejoin="round" stroke="#10123a" stroke-width="6px" x1="71.14" y1="33.53" x2="93.01" y2="33.53"/>
<path class="signatures signature-1" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="#10123a" stroke-width="6px" d="M103.35,152.32c-3,0-3-4-6-4s-3,4-6,4-3-4-6-4-3,4-6,4"/>
<path class="signatures signature-2" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="#10123a" stroke-width="6px" d="M118.48,148.32c3,0,3,4,6,4s3-4,6-4,3,4,6,4,3-4,6-4"/>
<polyline class="check-blue" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="#10123a" stroke-width="17px" points="202.09 115.92 176.98 143.35 166.06 132.42"/>
<polyline class="check-green" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="6px" stroke="#69ff90" points="202.09 115.92 176.98 143.35 166.06 132.42"/>
</svg>
</div>
</body>
</html>
<p>En SVGS la propiedad transform-origin no toma el valor correcto si es declarada en formato texto.</p>
<p>Para sacar el centro de un SVG podemos usar el siguiente código en la consola:</p>
<p><span>const id = document.getElementById('id');</span>
<span>const rect = id.getBBox();</span>
<span>const x = rect.x + rect.width / 2;</span>
<span>const y = rect.y + rect.height / 2;</span></p>