-
Notifications
You must be signed in to change notification settings - Fork 0
/
svg_com_g.html
52 lines (45 loc) · 1.45 KB
/
svg_com_g.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
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Transformações</title>
<style>
svg {
border: 2px dashed grey;
}
</style>
</head>
<body>
<h2>Translação</h2>
<svg width="200" heigth="120" fill="rgba(255, 0, 50, 0.2)" stroke="red">
<path d="M 10 40 l 40 10 l -5 50 Z" />
<g transform="translate(30, 20)">
<path d="M 10 40 l 40 10 l -5 50 Z" />
</g>
</svg>
<h2>Rotação</h2>
<svg width="200" heigth="120" fill="rgba(255, 0, 50, 0.2)" stroke="red">
<path d="M 10 40 l 40 10 l -5 50 Z" />
<g transform="rotate(-30)">
<path d="M 10 40 l 40 10 l -5 50 Z" />
</g>
</svg>
<h2>Escala</h2>
<svg width="200" heigth="120" fill="rgba(255, 0, 50, 0.2)" stroke="red">
<path d="M 10 40 l 40 10 l -5 50 Z" />
<g transform="scale(1.5)">
<path d="M 10 40 l 40 10 l -5 50 Z" />
</g>
</svg>
<h2>Várias transformações</h2>
<svg width="200" heigth="120" fill="rgba(255, 0, 50, 0.2)" stroke="red">
<path d="M 10 40 l 40 10 l -5 50 Z" />
<g transform="translate(10, 5) rotate(-10) scale(1.5)">
<path d="M 10 40 l 40 10 l -5 50 Z" />
</g>
</svg>
</body>
</html>