Skip to content

Commit

Permalink
add root orbit aligment
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Muda committed Mar 17, 2023
1 parent 24eaf15 commit 202f71d
Show file tree
Hide file tree
Showing 7 changed files with 997 additions and 113 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,22 @@

### Radial Grid

- OK rows: rings OR orbit
- OK rows: rings OR orbits
- columns: sectors relates to angles. quadrants... cordinal points...
- angles & distances: definir independientemte (a32; d453)?
- OK initial angle: importantes para saber desde donde empieza
- OK diameter: importante para estabelcer tamano del arco 90° o 360° x ej.
- OK arc: importante para estabelcer tamano del arco 90° o 360° x ej.
- OK Reverse angle...
- OK orbit alignment> lower upper
- OK Stationary- geostationary/gyroscope: comportamiento de lo selementos
- responsiveness: crear dos versiones? media query & rem units? ...
- alignment: ubicacion del elementos izq, centro, der; arriba medio, abajo
- distribucion: ver tipo flex-bos
- responsiveness: crear dos versiones? media query & vh vw units? ...
- dentro de los items ver alignment: ubicacion del elementos izq, centro, der; arriba medio, abajo
- OK draw rings and sectors
- Armar defaults
- Abstraer variables de color, backgrpund etc
- separar grid, de otras cosas
- armar progress en svg
-

## ELEMENTS
- shapes
Expand Down
1,018 changes: 940 additions & 78 deletions css/index.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/index.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/index.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/index.min.css.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div class="item s">!</div>
</div>
<div class="ring-3 items-3 ccw">
<div class="item m box">one</div>
<div class="item m box lower">one</div>
<div class="item m">
<div class="label pos-135">
<hr class="label__connector">
Expand All @@ -40,14 +40,14 @@

</div>

<div class="item m">
<div class="item m upper">
<div class="ring-2 items-4 offset-45 arc-90">
<div class="item xs ">U</div>
<div class="item xs lower">L</div>
<div class="item xs upper">L</div>
<div class="item xs stationary" >N</div>
<div class="item xs">
<div class="ring-3 items-3">
<div class="item xxs lower"></div>
<div class="item xxs upper"></div>
<div class="item xxs"></div>
<div class="item xxs upper"></div>
</div>
Expand Down
63 changes: 40 additions & 23 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
".upper",
".lower";

$min: 1;
$max: 6;
$min-rings: 1;
$max-rings: 6;

$minItems: 1;
$maxItems: 24;
$min-items: 1;
$max-items: 24;

$sectors: "offset-45" 45,
"offset-90" 90,
Expand Down Expand Up @@ -47,6 +47,7 @@
align-content: center;
justify-content: center;
}


/* Initial Reset */
* {
Expand All @@ -66,7 +67,7 @@
--item-number: 1;
--radius-padding: 8px;

@for $i from $min through $max {
@for $i from $min-rings through $max-rings {
--ring-#{$i}-factor: #{$i};
}

Expand Down Expand Up @@ -101,8 +102,9 @@
@include alignment;
}
.item.line {
width: 600px;
height: 1px;
transform-origin: 0 0;
width: calc(var(--radius) * var(--ring-3-factor));
border-radius: 0%;
border: none;
border-top: 1px dashed rgba(155, 155, 155, 0.5);
}
Expand Down Expand Up @@ -141,13 +143,14 @@
}

.core {
width: 1px;
width: 1px;
height: 1px;
display: grid;
border-radius: 50%;
border: 1px dashed rgba(155, 155, 155, 0.5);
border: 1px solid rgb(255, 5, 5);
grid-area: 1/1/1/1;
@include alignment;
align-items: center;
align-content: center;
}

div[class^="ring"] {
Expand Down Expand Up @@ -238,20 +241,20 @@
}
}

@for $i from $min through $max {
@for $i from $min-rings through $max-rings {
.z-container>.ring-#{$i} {
width: calc(var(--radius) * 2 * var(--ring-#{$i}-factor));
height: calc(var(--radius) * 2 * var(--ring-#{$i}-factor));
}
}

@for $i from $minItems through $maxItems {
@for $i from $min-items through $max-items {
.item:nth-child(#{$i}) {
--item-number:#{$i};
}
}

@for $i from $min through $max {
@for $i from $min-rings through $max-rings {

@each $sector,
$angle in $sectors {
Expand All @@ -275,27 +278,41 @@
--direction: -1;
}

@for $i from $minItems through $maxItems {
@for $i from $min-items through $max-items {
.items-#{$i}>.item {
--angle: calc((var(--offset-angle) + var(--arc)) / #{$i} * var(--direction));
}
}

@for $i from $min through $max {
@each $class in $align {
.z-container>.ring-#{$i}> .item#{$class} {
transform: rotate(calc(var(--angle) * var(--item-number) * 1deg)) translate(calc(var(--radius) * #{$i}), 0) rotate(calc(var(--angle) * var(--item-number) * 1deg * -1));
}
@for $i from $min-rings through $max-rings {
@each $size,
$var in $sizes {
@each $class in $align {
$math: "";

.z-container>.ring-#{$i}> .item.stationary#{$class} {
transform: rotate(calc(var(--angle) * var(--item-number) * 1deg)) translate(calc(var(--radius) * #{$i}), 0);
}
@if $class ==".upper" {
$math: "+ (calc(#{$var} / 2))";
}

@if $class ==".lower" {
$math: "- (calc(#{$var} / 2))";
}

.z-container>.ring-#{$i}> .item.#{$size}#{$class} {
transform: rotate(calc(var(--angle) * var(--item-number) * 1deg)) translate(calc(var(--radius) * #{$i} #{$math}), 0) rotate(calc(var(--angle) * var(--item-number) * 1deg * -1));
}

.z-container>.ring-#{$i}> .item.stationary.#{$size}#{$class} {
transform: rotate(calc(var(--angle) * var(--item-number) * 1deg)) translate(calc(var(--radius) * #{$i} #{$math}), 0);
}
}
}

}
.core >.item {
transform: rotate(calc(var(--angle) * var(--item-number) * 1deg))
}
@for $i from $min through $max {
@for $i from $min-rings through $max-rings {

@each $size,
$var in $sizes {
Expand Down

0 comments on commit 202f71d

Please sign in to comment.