I basically need to create this design in the image. I know it can be achieved with CSS but I'm not sure how to. I've trying Googling it but I can only find elaborate "sun" designs such as this one, which is too much for me to break down for my current understanding.
https://codepen.io/zmmbreeze/pen/guLfC
I've created the center piece like this (using sass):
&__count {
width: 12rem;
height: 12rem;
color: $lightPurple;
border: $border;
font-size: 4rem;
font-weight: 500;
border-radius: 100%;
@include centerContent;
}
How can I add the "rays"?
This is what I've tried to extract:
.count-down {
position: relative;
margin: auto;
@include centerContent;
&__count {
width: 12rem;
height: 12rem;
color: $lightPurple;
border: $border;
font-size: 4rem;
font-weight: 500;
border-radius: 100%;
@include centerContent;
}
&__go {
width: 15rem;
height: 15rem;
color: white;
border: 1px solid white;
font-size: 4rem;
font-weight: 500;
border-radius: 100%;
@include centerContent;
}
}
.sun-light b,
.sun-light s {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 12%; /* 100*30/100=18.75 */
background: #fed65b;
}
.sun-light s {
top: auto;
bottom: 0;
}
.sun-light:nth-child(10n + 2) {
-webkit-transform: rotate(18deg);
-moz-transform: rotate(18deg);
-o-transform: rotate(18deg);
-ie-transform: rotate(18deg);
transform: rotate(18deg);
}
.sun-light:nth-child(10n + 3) {
-webkit-transform: rotate(36deg);
-moz-transform: rotate(36deg);
-o-transform: rotate(36deg);
-ie-transform: rotate(36deg);
transform: rotate(36deg);
}
.sun-light:nth-child(10n + 4) {
-webkit-transform: rotate(54deg);
-moz-transform: rotate(54deg);
-o-transform: rotate(54deg);
-ie-transform: rotate(54deg);
transform: rotate(54deg);
}
.sun-light:nth-child(10n + 5) {
-webkit-transform: rotate(72deg);
-moz-transform: rotate(72deg);
-o-transform: rotate(72deg);
-ie-transform: rotate(72deg);
transform: rotate(72deg);
}
.sun-light:nth-child(10n + 6) {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-o-transform: rotate(90deg);
-ie-transform: rotate(90deg);
transform: rotate(90deg);
}
.sun-light:nth-child(10n + 7) {
-webkit-transform: rotate(108deg);
-moz-transform: rotate(108deg);
-o-transform: rotate(108deg);
-ie-transform: rotate(108deg);
transform: rotate(108deg);
}
.sun-light:nth-child(10n + 8) {
-webkit-transform: rotate(126deg);
-moz-transform: rotate(126deg);
-o-transform: rotate(126deg);
-ie-transform: rotate(126deg);
transform: rotate(126deg);
}
.sun-light:nth-child(10n + 9) {
-webkit-transform: rotate(144deg);
-moz-transform: rotate(144deg);
-o-transform: rotate(144deg);
-ie-transform: rotate(144deg);
transform: rotate(144deg);
}
.sun-light:nth-child(10n + 10) {
-webkit-transform: rotate(162deg);
-moz-transform: rotate(162deg);
-o-transform: rotate(162deg);
-ie-transform: rotate(162deg);
transform: rotate(162deg);
}
And this is my component (React.js):
<div className="count-down">
{timeToStart > 1 ? (
<div className="count-down__count">{Math.floor(timeToStart)}</div>
) : (
<div className="count-down__go">Go!</div>
)}
<div class="sun-light">
<b></b>
<s></s>
</div>
<div class="sun-light">
<b></b>
<s></s>
</div>
<div class="sun-light">
<b></b>
<s></s>
</div>
<div class="sun-light">
<b></b>
<s></s>
</div>
<div class="sun-light">
<b></b>
<s></s>
</div>
<div class="sun-light">
<b></b>
<s></s>
</div>
<div class="sun-light">
<b></b>
<s></s>
</div>
<div class="sun-light">
<b></b>
<s></s>
</div>
<div class="sun-light">
<b></b>
<s></s>
</div>
<div class="sun-light">
<b></b>
<s></s>
</div>
<div class="sun-light">
<b></b>
<s></s>
</div>
<div class="sun-light">
<b></b>
<s></s>
</div>
</div>
But I get this result for some reason:





