回答編集履歴
1
scss追加。
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
キレイな渦はなかなか難しい。ご参考になれば。
|
2
2
|
|
3
|
-
|
3
|
+
![渦1](c136b86fcd397a0bd6d9c8e0548d605e.png)
|
4
4
|
|
5
5
|
```html
|
6
6
|
|
@@ -40,8 +40,84 @@
|
|
40
40
|
|
41
41
|
box-shadow: $bs;
|
42
42
|
|
43
|
+
position: absolute;
|
44
|
+
|
43
|
-
t
|
45
|
+
top: 50%; left: 50%;
|
44
46
|
|
45
47
|
}
|
46
48
|
|
47
49
|
```
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
いろいろと調べて、ちょっと格好良くなりました。
|
54
|
+
|
55
|
+
![渦2](0ed085d2cef3ed2c1ddaf78d10ed3942.png)
|
56
|
+
|
57
|
+
```scss
|
58
|
+
|
59
|
+
body {
|
60
|
+
|
61
|
+
background: #000;
|
62
|
+
|
63
|
+
}
|
64
|
+
|
65
|
+
$n: 10;
|
66
|
+
|
67
|
+
$p: 32;
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
$d: 2px;
|
72
|
+
|
73
|
+
$c: 0.2;
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
$bs: ();
|
78
|
+
|
79
|
+
@for $i from 0 to $n {
|
80
|
+
|
81
|
+
$b: $i * 2 * pi() / $n;
|
82
|
+
|
83
|
+
$x: 0;
|
84
|
+
|
85
|
+
@for $j from 1 through $p {
|
86
|
+
|
87
|
+
$g: $j * 2 * pi() / $p;
|
88
|
+
|
89
|
+
$s: 7.5 * ($c * $p - $j) * ($j - (1 + $c / 4) * $p) / pow((.5 + $c) * $p, 2);
|
90
|
+
|
91
|
+
@if $j < $c * $p { $s: 0; }
|
92
|
+
|
93
|
+
$x: $x + 1.65 * ($s + 1) * $d;
|
94
|
+
|
95
|
+
$y: $x * sin($g) / 5;
|
96
|
+
|
97
|
+
$x1: $x * sin($b + $g);
|
98
|
+
|
99
|
+
$y1: $x * cos($b + $g);
|
100
|
+
|
101
|
+
$bs: $bs, $x1 $y1 0 $s * $d #fff !global;
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
.swirl {
|
108
|
+
|
109
|
+
width: $d;
|
110
|
+
|
111
|
+
height: $d;
|
112
|
+
|
113
|
+
border-radius: 100%;
|
114
|
+
|
115
|
+
box-shadow: $bs;
|
116
|
+
|
117
|
+
position: absolute;
|
118
|
+
|
119
|
+
top: 50%; left: 50%;
|
120
|
+
|
121
|
+
}
|
122
|
+
|
123
|
+
```
|