-
Notifications
You must be signed in to change notification settings - Fork 94
/
index.less
53 lines (45 loc) · 963 Bytes
/
index.less
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
@size:40px;
@top: 70px;
@left: 40px;
@h: sqrt(pow(@top, 2) + pow(@left, 2)) - @size;
@ty: (@h - @size)/2 + @top/2;
.node {
box-sizing: border-box;
position: absolute;
border: 1px solid #999;
text-align: center;
width: @size;
height: @size;
top: @top;
border-radius: @size/2;
&:after {
font-size: @size/2;
font-family: Arial;
line-height: @size;
color: #555;
content: attr(data-name);
}
.node:before {
content: ' ';
display: block;
position: absolute;
width: 1px;
height: @h;
background-color: #999;
left: 0px;
top: 0px;
}
.node:last-child {
left: @left;
&:before {
transform: translate(@size/2 - @left/2 - 2px, -@ty - 2px) rotate(atan(@top/@left)- pi()/2);
}
}
.node:first-child {
left: -@left;
&:before {
transform: translate(@left/2 + @size/2, -@ty) rotate(pi()/2 - atan(@top/@left));
}
}
}
.R { left: 200px; top: 100px}