Skip to content

Commit

Permalink
remove redundancy
Browse files Browse the repository at this point in the history
  • Loading branch information
JGantts committed Mar 7, 2024
1 parent 6363ebe commit f0a5b73
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 40 deletions.
15 changes: 11 additions & 4 deletions src/Curtain/Curtain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,25 +148,32 @@ async function initializeCurtain() {
doneAnimatingCurtain = false
let countToAddSmoothed = widthInLargePixels*PIXELATED_LARGE_BOX_SIZE/SMOOTHED_BOX_SIZE
let curve = {
pos: { low: -300, high: 0 },
velo: { low: 0, high: 5 },
acc: { low: 5, high: 10 },
jolt: { low: -5, high: 5 },
}
let gaussianSumsPosition: number[] = gaussians(
countToAddSmoothed,
() => {return Math.random()*90 + 10},
rainbow.curve.pos.low, rainbow.curve.pos.high
curve.pos.low, curve.pos.high
)
let gaussianSumsVelocity: number[] = gaussians(
countToAddSmoothed,
() => {return Math.random()*90 + 10},
rainbow.curve.velo.low*(1/10), rainbow.curve.velo.high*(1/10)
curve.velo.low*(1/10), curve.velo.high*(1/10)
)
let gaussianSumsAcceleration: number[] = gaussians(
countToAddSmoothed,
() => {return Math.random()*90 + 10},
rainbow.curve.acc.low*(1/1000), rainbow.curve.acc.high*(1/1000)
curve.acc.low*(1/1000), curve.acc.high*(1/1000)
)
let gaussianSumsJolt: number[] = gaussians(
countToAddSmoothed,
() => {return Math.random()*90 + 10},
rainbow.curve.jolt.low*(1/1000000), rainbow.curve.jolt.high*(1/1000000)
curve.jolt.low*(1/1000000), curve.jolt.high*(1/1000000)
)
gaussianObjects = []
Expand Down
6 changes: 0 additions & 6 deletions src/Curtain/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ type Rainbow = {
name: String,
stops: { stop: number, color: Color}[],
dir: RainbowDirection
curve: {
pos: Range
velo: Range,
acc: Range,
jolt: Range,
}
}

enum BackgroundState {
Expand Down
30 changes: 0 additions & 30 deletions src/components/Background.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@ const colorsCycle: Rainbow[] = [
{ stop: 0.6, color: hslToComponents(blue.blue10) },
{ stop: 1, color: hslToComponents(grass.grass10) },
],
curve: {
pos: { low: -300, high: 0 },
velo: { low: 0, high: 5 },
acc: { low: 5, high: 10 },
jolt: { low: -5, high: 5 },
},
},
{
name: "orange",
Expand All @@ -108,12 +102,6 @@ const colorsCycle: Rainbow[] = [
{ stop: 0.6, color: hslToComponents(red.red10) },
{ stop: 1, color: hslToComponents(ruby.ruby11) },
],
curve: {
pos: { low: -300, high: 0 },
velo: { low: 0, high: 5 },
acc: { low: 5, high: 10 },
jolt: { low: -5, high: 5 },
},
},
{
name: "purple",
Expand All @@ -125,12 +113,6 @@ const colorsCycle: Rainbow[] = [
{ stop: 0.6, color: hslToComponents(pink.pink10) },
{ stop: 1, color: hslToComponents(plum.plum12) },
],
curve: {
pos: { low: -300, high: 0 },
velo: { low: 0, high: 5 },
acc: { low: 5, high: 10 },
jolt: { low: -5, high: 5 },
},
},
{
name: "mint",
Expand All @@ -141,12 +123,6 @@ const colorsCycle: Rainbow[] = [
{ stop: 0.55, color: hslToComponents(lime.lime10) },
{ stop: 1, color: hslToComponents(green.green10) },
],
curve: {
pos: { low: -300, high: 0 },
velo: { low: 0, high: 5 },
acc: { low: 5, high: 10 },
jolt: { low: -5, high: 5 },
},
},
{
name: "green-red",
Expand All @@ -155,12 +131,6 @@ const colorsCycle: Rainbow[] = [
{ stop: 0, color: hslToComponents(green.green8) },
{ stop: 1, color: hslToComponents(crimson.crimson10) },
],
curve: {
pos: { low: -300, high: 0 },
velo: { low: 0, high: 5 },
acc: { low: 5, high: 10 },
jolt: { low: -5, high: 5 },
},
},
/*{
dir: RainbowDirection.Regular,
Expand Down

0 comments on commit f0a5b73

Please sign in to comment.