Skip to content

Commit

Permalink
labels fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchox5 committed Oct 19, 2023
1 parent c9c80bf commit 4a5694a
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 9 deletions.
30 changes: 26 additions & 4 deletions examples/generic.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</div>
</div>

<div class="o-orbit o-limit-90">
<div class="o-orbit o-limit-270">

<div class="o-orbiter o-md ">
<div class="o-orbit ">
Expand All @@ -60,16 +60,38 @@

</div>
<div class="o-orbiter o-md">
<div class="o-label o-offset-45">
<div class="o-content">Tactic sat intel <br> 45</div>
</div>
</div>
<div class="o-orbiter o-md">
<div class="o-label o-offset-90">
<div class="o-content">Tactic sat intel <br> 90</div>
</div>
</div>
<div class="o-orbiter o-md ">
<div class="o-orbiter o-md">
<div class="o-label o-offset-135">
<div class="o-content">Tactic sat intel <br> 135</div>
</div>
</div>
<div class="o-orbiter o-md">
<div class="o-label o-offset-180">
<div class="o-content">Tactic sat intel <br> 180</div>
</div>
</div>
<div class="o-orbiter o-md">
<div class="o-label o-offset-45">
<div class="o-content">Tactic sat intel <br> trino</div>
<div class="o-label o-offset-225">
<div class="o-content">Tactic sat intel <br> 225</div>
</div>
</div>
<div class="o-orbiter o-md">
<div class="o-label o-offset-270">
<div class="o-content">Tactic sat intel <br> 270</div>
</div>
</div>
<div class="o-orbiter o-md">
<div class="o-label o-offset-315">
<div class="o-content">Tactic sat intel <br> 315</div>
</div>
</div>
</div>
Expand Down
39 changes: 36 additions & 3 deletions src/components/_label-base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
display: block;
border: 1px solid;
border-radius: 50%;
background-color: inherit;
width: 4px;
height: 4px;
--o-x-coords: calc(var(--o-size) / 1.8);
Expand All @@ -31,12 +32,44 @@
/* Set size variable for each orbiter */
@each $pos, $angle in $offsets {
.o-label#{$pos} {
--o-label-angle: calc(#{$angle} * 1deg);

@if $pos == '.o-offset-180' {
--o-label-box: -5px;
} @else {
--o-len: 100%;
--o-label-dir: 1;
--o-label-angle: calc(#{$angle} * 1deg);
} @else if $pos == '.o-offset-45' {
--o-label-box: 5px;
}
--o-len: 0%;
--o-label-dir: 1;
--o-label-angle: calc(#{$angle} * 1deg);
} @else if $pos == '.o-offset-90' {
--o-label-box: 5px;
--o-len: 0%;
--o-label-dir: -58;
--o-label-angle: 91deg;
} @else if $pos == '.o-offset-135' {
--o-label-box: 5px;
--o-len: 100%;
--o-label-dir: -1;
--o-label-angle: calc(#{$angle} * 1deg);
} @else if $pos == '.o-offset-225' {
--o-label-box: 5px;
--o-len: 100%;
--o-label-dir: 2;
--o-label-angle: calc(#{$angle} * 1deg);
} @else if $pos == '.o-offset-270' {
--o-label-box: 5px;
--o-len: 100%;
--o-label-dir: -125;
--o-label-angle: 271deg;
} @else if $pos == '.o-offset-315' {
--o-label-box: 5px;
--o-len: 0%;
--o-label-dir: -3;
--o-label-angle: calc(#{$angle} * 1deg);
}

}
}

Expand Down
5 changes: 3 additions & 2 deletions src/utilities/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
z-index: 10;
}


//sector o-cont.o-content
.o-sector > .o-content {
display: grid;
Expand Down Expand Up @@ -54,7 +55,7 @@
min-width: 100px;
height:auto;
--o-label-box: 5px;
transform: translate(calc(var(--o-connector-width) - 5px), var(--o-label-box))
rotate(calc(var(--o-label-angle) * -1));
rotate: (calc(var(--o-label-angle) * -1));
transform: translate(calc(var(--o-connector-width) * cos(var(--o-label-angle)) - var(--o-len)), calc(cos(var(--o-label-angle)) * var(--o-connector-width) * var(--o-label-dir)));
}

0 comments on commit 4a5694a

Please sign in to comment.