-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle_circle.css
More file actions
95 lines (82 loc) · 2.62 KB
/
Copy pathstyle_circle.css
File metadata and controls
95 lines (82 loc) · 2.62 KB
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
@import "compass/css3";
// gradient variable
$topColor : hsl(80, 32%, 47%);
$bottomColor : hsl(203, 47%, 18%);
// bullet-proof gradients
@mixin gradient( $top-gradient, $bottom-gradient) {
background: #cedce7; /* Old browsers */
background: -moz-linear-gradient(0deg, $top-gradient 0%, $bottom-gradient 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,$top-gradient), color-stop(100%,$bottom-gradient)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(0deg, $top-gradient 0%, $bottom-gradient 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(0deg, $top-gradient 0%, $bottom-gradient 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(0deg, $top-gradient 0%, $bottom-gradient 100%); /* IE10+ */
background: linear-gradient(90deg, $top-gradient 0%, $bottom-gradient 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#849e51', endColorstr='#193445',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
}
// easy browser prefixes
@mixin prefix($property, $value) {
-webkit-#{$property}: $value;
-moz-#{$property}: $value;
-ms-#{$property}: $value;
-o-#{$property}: $value;
#{$property}: $value;
}
// fade-in animation (should make a mixin)
@-moz-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
@-webkit-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
// the number of points should match the number of elements in your markup
$totalPoints: 6;
// build the circle
@for $i from 1 through $totalPoints {
// circle radius
$radius: 130;
// center x coordinate
$cx: 140;
// center y coordinate
$cy: 100;
// animation delay because Sass interpolation weirdness
$delay: ($i * 300) + ms;
// set x and y coordinate of each circle
$x: floor($cx + $radius * cos( 2 * pi() * ($i / $totalPoints)));
$y: floor($cy + $radius * sin( 2 * pi() * ($i / $totalPoints)));
// prettiness
li:nth-child( #{$i} ) {
@include prefix(transform, translate( $x + px, $y + px));
@include prefix(animation, fadein 1s $delay 1 normal forwards );
@include prefix(transition, opacity 1s);
}
}
body {
@include gradient($topColor, $bottomColor);
}
div {
text-align: center;
width: 20em;
margin: 4em auto;
}
ul {
position: relative;
padding: 0;
margin: 0;
width: 100%;
list-style-type: none;
li {
@include prefix(border-radius, 40px );
position: absolute;
display: block;
opacity: 0;
width: 2em;
height: 2em;
background: #FFF;
}
}