Skip to content

Commit 1b28ab7

Browse files
committed
add ellipse feat
1 parent dc105e8 commit 1b28ab7

23 files changed

+135
-197
lines changed

assets/css/orbit-base.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/orbit-base.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/orbit.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/orbit.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/orbit-base.css

+34-55
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Ej: .custom {
6363
--o-orbit-size-4: calc(var(--o-radius) * 4 * 2);
6464
--o-orbit-size-5: calc(var(--o-radius) * 5 * 2);
6565
--o-orbit-size-6: calc(var(--o-radius) * 6 * 2);
66+
--o-ellipse-rate: 1;
6667
/* Shape sizes */
6768
--o-xxs: 8px;
6869
--o-xs: 24px;
@@ -123,7 +124,7 @@ Ej: .custom {
123124
place-items: center;
124125
box-sizing: content-box;
125126
width: var(--o-diameter);
126-
height: var(--o-diameter);
127+
height: calc(var(--o-diameter) / var(--o-ellipse-rate));
127128
z-index: var(--o-z-index);
128129
}
129130

@@ -174,26 +175,11 @@ Ej: .custom {
174175
width: var(--o-size);
175176
height: var(--o-size);
176177
border-radius: 50%;
177-
transform: rotate(var(--o-rotate)) translate(var(--o-x-coords), 0) rotate(var(--o-rotate-invert));
178+
transform: translate(calc(var(--o-x-coords) * cos(var(--o-rotate))), calc(var(--o-x-coords) / var(--o-ellipse-rate) * sin(var(--o-rotate))));
178179
}
179180

180181
.o-orbiter.o-stationary {
181-
transform: rotate(var(--o-rotate)) translate(var(--o-x-coords), 0);
182-
}
183-
184-
.o-orbiter > .o-content {
185-
padding: 5px;
186-
width: inherit;
187-
height: inherit;
188-
display: grid;
189-
border-radius: inherit;
190-
grid-area: 1/1/1/1;
191-
align-items: center;
192-
justify-items: center;
193-
align-content: center;
194-
justify-content: center;
195-
overflow: hidden;
196-
z-index: 10;
182+
transform: translate(calc(var(--o-x-coords) * cos(var(--o-rotate))), calc(var(--o-x-coords) / var(--o-ellipse-rate) * sin(var(--o-rotate)))) rotate(var(--o-rotate));
197183
}
198184

199185
/* ========== Shapes ========= */
@@ -203,7 +189,7 @@ Ej: .custom {
203189
radial grid, so if you have a boexed orbit its child elements still will be placed
204190
using radial grid.
205191
*/
206-
.o-circle {
192+
.o-orbiter.o-circle {
207193
border-radius: 50% !important; /* Default shape */
208194
}
209195

@@ -216,20 +202,20 @@ Ej: .custom {
216202
border-top: 1px dashed var(--o-dark);
217203
}
218204

219-
.o-box {
205+
.o-orbiter.o-box {
220206
border-radius: 0% !important;
221207
}
222208

223-
.o-rounded {
209+
.o-orbiter.o-rounded {
224210
border-radius: 25% !important;
225211
}
226212

227213
/* TODO: add blob variants */
228-
.o-blob {
214+
.o-orbiter.o-blob {
229215
border-radius: 30% 70% 70% 30%/30% 30% 70% 70% !important;
230216
}
231217

232-
.o-transparent {
218+
.o-orbiter.o-transparent {
233219
border: none !important;
234220
background-color: var(--o-transparent) !important;
235221
}
@@ -352,41 +338,19 @@ Ej: .custom {
352338
justify-content: center;
353339
rotate: -90deg;
354340
width: calc(var(--o-diameter));
355-
height: calc(var(--o-diameter));
341+
height: calc(var(--o-diameter) / var(--o-ellipse-rate));
356342
}
357343

358344
.o-svg > .o-svg-markers {
359345
--o-svg-markers: 12;
360346
--o-marker-width: 1px;
361-
--o-circumference: calc(var(--o-r) * var(--o-π) * 2);
347+
--o-circumference: calc(var(--o-r) * var(--o-π) * 2 / var(--o-ellipse-rate));
362348
--o-dash: calc(var(--o-circumference) / var(--o-svg-markers) - var(--o-marker-width));
363349
--o-r: calc(var(--o-diameter) / 2);
364350
cx: var(--o-r);
365-
cy: var(--o-r);
366-
r: var(--o-r);
367-
stroke-width: calc(var(--o-radius) * 2);
368-
stroke-dasharray: var(--o-marker-width) var(--o-dash);
369-
}
370-
371-
.o-svg > .o-svg-progress {
372-
--o-r: calc(var(--o-diameter) / 2);
373-
cx: var(--o-r);
374-
cy: var(--o-r);
375-
r: calc(var(--o-r));
376-
stroke-width: var(--o-stroke);
377-
stroke-dasharray: calc(var(--o-r) * var(--o-π) * 2);
378-
stroke-dashoffset: calc((100 - var(--o-val)) / 100 * var(--o-r) * var(--o-π) * 2);
379-
}
380-
381-
.o-svg > .o-svg-markers {
382-
--o-svg-markers: 12;
383-
--o-marker-width: 1px;
384-
--o-circumference: calc(var(--o-r) * var(--o-π) * 2);
385-
--o-dash: calc(var(--o-circumference) / var(--o-svg-markers) - var(--o-marker-width));
386-
--o-r: calc(var(--o-diameter) / 2);
387-
cx: var(--o-r);
388-
cy: var(--o-r);
389-
r: var(--o-r);
351+
cy: calc(var(--o-r) / var(--o-ellipse-rate));
352+
rx: var(--o-r);
353+
ry: calc(var(--o-r) / var(--o-ellipse-rate));
390354
stroke-width: calc(var(--o-radius) * 2);
391355
stroke-dasharray: var(--o-marker-width) var(--o-dash);
392356
}
@@ -395,11 +359,12 @@ Ej: .custom {
395359
.o-svg > .o-svg-progress {
396360
--o-r: calc(var(--o-diameter) / 2);
397361
cx: var(--o-r);
398-
cy: var(--o-r);
399-
r: calc(var(--o-r));
362+
cy: calc(var(--o-r) / var(--o-ellipse-rate));
363+
rx: var(--o-r);
364+
ry: calc(var(--o-r) / var(--o-ellipse-rate));
400365
stroke-width: var(--o-stroke);
401-
stroke-dasharray: calc(var(--o-r) * var(--o-π) * 2);
402-
stroke-dashoffset: calc((100 - var(--o-val)) / 100 * var(--o-r) * var(--o-π) * 2);
366+
stroke-dasharray: calc(var(--o-r) * var(--o-π) * 2 / var(--o-ellipse-rate));
367+
stroke-dashoffset: calc((100 - var(--o-val)) / 100 * var(--o-r) * var(--o-π) * 2 / var(--o-ellipse-rate));
403368
}
404369

405370
/* progress */
@@ -411,7 +376,6 @@ Ej: .custom {
411376
place-items: center;
412377
width: 100%;
413378
height: 100%;
414-
aspect-ratio: 1;
415379
}
416380

417381
.o-progress + .o-orbiter {
@@ -2843,6 +2807,21 @@ Ej: .custom {
28432807
--o-diameter: calc(var(--o-size) * 6);
28442808
}
28452809

2810+
.o-content {
2811+
padding: 5px;
2812+
width: inherit;
2813+
height: inherit;
2814+
display: grid;
2815+
border-radius: inherit;
2816+
grid-area: 1/1/1/1;
2817+
align-items: center;
2818+
justify-items: center;
2819+
align-content: center;
2820+
justify-content: center;
2821+
overflow: hidden;
2822+
z-index: 10;
2823+
}
2824+
28462825
/* Media Query for Mobile Devices */
28472826
@media (max-width: 480px) {
28482827
.o-container {

dist/css/orbit-base.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/orbit-base.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)