Skip to content

Commit

Permalink
Remove light
Browse files Browse the repository at this point in the history
  • Loading branch information
midudev committed Feb 28, 2024
1 parent 92bcdce commit bcb11c1
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/components/SmokeBackground.astro
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@
const THEME = {
dark: {
background: 0x666666,
light: 0xffffff,
opacity: 1,
opacity: 0.1,
},
light: {
background: 0xeeeeee,
light: 0xffffff,
opacity: 0.1,
},
} as const
Expand Down Expand Up @@ -54,16 +52,10 @@
})
renderer.setSize(w, h)
// color de fondo
renderer.setClearColor(currentTheme.background, 1)
scene.background = new THREE.Color(currentTheme.background)

$bkg?.appendChild(renderer.domElement)

// añadir una luz directional
const light = new THREE.DirectionalLight(currentTheme.light, 0.5)
// posicion de la luz
light.position.set(-1, 3, 1)
scene.add(light)

const smokeParticles: THREE.Mesh[] = []

const loader = new THREE.TextureLoader()
Expand Down Expand Up @@ -142,8 +134,7 @@
window.addEventListener("theme-changed", () => {
const themePreference = window.getThemePreference()
currentTheme = THEME[themePreference]
light.color.setHex(currentTheme.light)
renderer.setClearColor(currentTheme.background, 1)
scene.background = new THREE.Color(currentTheme.background)

smokeParticles.forEach((particle) => {
const smokeMaterial = particle.material as THREE.MeshLambertMaterial
Expand Down

0 comments on commit bcb11c1

Please sign in to comment.