Skip to content

Commit 7d4a7ca

Browse files
authored
Merge pull request #133 from Hittitech/main
sticker animation using html/css
2 parents 2f11769 + ff1c7ec commit 7d4a7ca

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

sticker animation/index.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<div id="container">
2+
3+
<!--Element for spinner made with HTML + CSS-->
4+
<div id="html-spinner"></div>
5+
<link rel="stylesheet" href="style.css">
6+
<p id="html-para">Spinner created with only HTML and CSS</p>
7+
8+
<!--Element for custom SVG spinner-->
9+
<svg id="svg-spinner" xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">
10+
<circle cx="24" cy="4" r="4" fill="#fff"/>
11+
<circle cx="12.19" cy="7.86" r="3.7" fill="#fffbf2"/>
12+
<circle cx="5.02" cy="17.68" r="3.4" fill="#fef7e4"/>
13+
<circle cx="5.02" cy="30.32" r="3.1" fill="#fef3d7"/>
14+
<circle cx="12.19" cy="40.14" r="2.8" fill="#feefc9"/>
15+
<circle cx="24" cy="44" r="2.5" fill="#feebbc"/>
16+
<circle cx="35.81" cy="40.14" r="2.2" fill="#fde7af"/>
17+
<circle cx="42.98" cy="30.32" r="1.9" fill="#fde3a1"/>
18+
<circle cx="42.98" cy="17.68" r="1.6" fill="#fddf94"/>
19+
<circle cx="35.81" cy="7.86" r="1.3" fill="#fcdb86"/>
20+
</svg>
21+
<p id="svg-para">Spinner created with custom SVG and CSS Animation</p>
22+
</div>
23+
</div>

sticker animation/style.css

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#html-spinner{
2+
width:40px;
3+
height:40px;
4+
border:4px solid #fcd779;
5+
border-top:4px solid white;
6+
border-radius:50%;
7+
}
8+
9+
#html-spinner, #svg-spinner{
10+
-webkit-transition-property: -webkit-transform;
11+
-webkit-transition-duration: 1.2s;
12+
-webkit-animation-name: rotate;
13+
-webkit-animation-iteration-count: infinite;
14+
-webkit-animation-timing-function: linear;
15+
16+
-moz-transition-property: -moz-transform;
17+
-moz-animation-name: rotate;
18+
-moz-animation-duration: 1.2s;
19+
-moz-animation-iteration-count: infinite;
20+
-moz-animation-timing-function: linear;
21+
22+
transition-property: transform;
23+
animation-name: rotate;
24+
animation-duration: 1.2s;
25+
animation-iteration-count: infinite;
26+
animation-timing-function: linear;
27+
}
28+
29+
@-webkit-keyframes rotate {
30+
from {-webkit-transform: rotate(0deg);}
31+
to {-webkit-transform: rotate(360deg);}
32+
}
33+
34+
@-moz-keyframes rotate {
35+
from {-moz-transform: rotate(0deg);}
36+
to {-moz-transform: rotate(360deg);}
37+
}
38+
39+
@keyframes rotate {
40+
from {transform: rotate(0deg);}
41+
to {transform: rotate(360deg);}
42+
}
43+
44+
45+
/* Rest of page style*/
46+
body{
47+
background:#FABC20;
48+
font-family: 'Open Sans', sans-serif;
49+
-webkit-font-smoothing: antialiased;
50+
color:#393D3D;
51+
}
52+
53+
#container{
54+
width:90%;
55+
max-width:700px;
56+
margin:1em auto;
57+
position:relative;
58+
}
59+
60+
/* spinner positioning */
61+
62+
#html-spinner, #svg-spinner{
63+
position:absolute;
64+
top:80px;
65+
margin-left:-24px;
66+
}
67+
68+
#html-spinner{
69+
left:25%;
70+
}
71+
72+
#svg-spinner{
73+
left:75%;
74+
}
75+
76+
#html-para, #svg-para{
77+
position:absolute;
78+
top:100px;
79+
width:40%;
80+
padding:5%;
81+
text-align:center;
82+
}
83+
84+
#svg-para{
85+
left:50%;
86+
}

0 commit comments

Comments
 (0)