townsquare/css/circle.scss

63 lines
1.7 KiB
SCSS
Raw Normal View History

2020-03-31 14:56:59 +00:00
@mixin on-circle($item-count) {
$angle: (360 / $item-count);
$rot: 0;
@for $i from 1 through $item-count {
&:nth-child(#{$i}) {
transform: rotate($rot * 1deg);
2020-04-01 10:34:02 +00:00
@if $i - 1 <= $item-count / 2 {
z-index: $item-count - $i + 1;
} @else {
z-index: $i - 1;
}
2020-03-31 14:56:59 +00:00
> * {
transform: rotate($rot * -1deg);
}
}
$rot: $rot + $angle;
}
}
.circle {
padding: 0;
width: 100%;
height: 100%;
list-style: none;
overflow: hidden;
position: relative;
margin: 0;
box-sizing: border-box;
li {
position: absolute;
top: 0;
left: 50%;
height: 50%;
transform-origin: 0 100%;
text-align: center;
> * {
margin-left: -100px;
width: 200px;
}
}
}
2020-04-01 10:34:02 +00:00
.circle.size-5 li { @include on-circle($item-count: 5); }
.circle.size-6 li { @include on-circle($item-count: 6); }
.circle.size-7 li { @include on-circle($item-count: 7); }
.circle.size-8 li { @include on-circle($item-count: 8); }
.circle.size-9 li { @include on-circle($item-count: 9); }
.circle.size-10 li { @include on-circle($item-count: 10); }
.circle.size-11 li { @include on-circle($item-count: 11); }
.circle.size-12 li { @include on-circle($item-count: 12); }
.circle.size-13 li { @include on-circle($item-count: 13); }
.circle.size-14 li { @include on-circle($item-count: 14); }
.circle.size-15 li { @include on-circle($item-count: 15); }
.circle.size-16 li { @include on-circle($item-count: 16); }
.circle.size-17 li { @include on-circle($item-count: 17); }
.circle.size-18 li { @include on-circle($item-count: 18); }
.circle.size-19 li { @include on-circle($item-count: 19); }
.circle.size-20 li { @include on-circle($item-count: 20); }