Skip to content

Commit

Permalink
o-arx tree-shake code
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchox5 committed Jan 15, 2025
1 parent 7188159 commit eefb5de
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/js/orbit-arc.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ template.innerHTML = `
fill: var(--o-fill);
stroke: var(--o-stroke);
stroke-width: var(--o-stroke-width);
transition: all 0.3s;
stroke-linejoin: round;
}
text {
fill: var(--o-color);
}
#orbitShape {
transition: all 0.3s;
stroke-linejoin: round;
}
#orbitPath {
fill: transparent;
stroke: none;
Expand Down Expand Up @@ -103,9 +101,6 @@ export class OrbitArc extends HTMLElement {
getAttributes() {
let rawAngle, arcAngle, orbitNumber, size, innerOuter
const strokeWidth = parseFloat(getComputedStyle(this).getPropertyValue('--o-stroke-width'))
const fill = getComputedStyle(this).getPropertyValue('--o-fill')
const stroke = getComputedStyle(this).getPropertyValue('--o-stroke')

const orbitRadius = parseFloat(getComputedStyle(this).getPropertyValue('r') || 0)
const shape = this.getAttribute('shape') || 'none'
const flip = this.hasAttribute('flip') || this.classList.contains('flip')
Expand Down Expand Up @@ -141,7 +136,7 @@ export class OrbitArc extends HTMLElement {
const arcHeight = orbitRadius / orbitNumber * size - strokeWidth + 0.3 // 0.3 tries to fix bug when render arcs
const arcHeightPercentage = ((arcHeight / 2 ) * 100) / orbitRadius / 2
const gap = parseFloat(getComputedStyle(this).getPropertyValue('--o-gap'))

if (this.classList.contains('outer-orbit')) {
innerOuter = arcHeightPercentage
} else if (this.classList.contains('quarter-outer-orbit')) {
Expand Down Expand Up @@ -172,9 +167,7 @@ export class OrbitArc extends HTMLElement {
innerOuter,
orbitNumber,
size,
strokeWidth,
stroke,
fill
strokeWidth
}
}

Expand Down

0 comments on commit eefb5de

Please sign in to comment.