¿Conoces algún plugin con temas navideños para mi web?

  • Autor Autor Hojure
  • Fecha de inicio Fecha de inicio
Hojure

Hojure

Gamma
Verificado por Whatsapp
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
Buenas amigos, quisiera saber si saben de algún plugin que pueda modificar mi web con temas navideño!!

En algunas web e visto que cuando entras empieza a caer nieve!!!

Saben de alguno

Saludos gracias!!!
 
¡Hola! Te recomendaría el plugin "Snow, Weather Effect". Este plugin permite que caiga nieve en tu sitio web, además tiene varias opciones de personalización. Otra opción puede ser "Christmas Panda", también te permitirá agregar diversos elementos navideños a tu sitio. ¡Espero que te sea útil!
 
Hola, existen muchos plugins para navidad, una que me recuerde es de Tribulant Snow Storm es un plugin de tormenta de nieve en el sitio web.
 
crea en un html que caiga nieve usando algún script
 
crea en un html que caiga nieve usando algún script
Claro, puedes usar un script de JavaScript. Aquí tienes un código simple:

HTML:
<!DOCTYPE html>
<html>
<body>
<canvas id="snow" style="position:absolute;top:0;left:0"></canvas>
<script>
var canvas = document.getElementById("snow"), ctx = canvas.getContext("2d"),
  snowflakes = [], SnowFlake = function X() {
    this.x = 0;
    this.y = 0;
    this.vy = 0;
    this.vx = 0;
    this.r = 0;

    this.reset();
  };

canvas.style.pointerEvents = "none";

SnowFlake.prototype.reset = function() {
  this.x = Math.random() * canvas.width;
  this.y = Math.random() * canvas.height;
  this.vy = 1 + Math.random() * 3;
  this.vx = 0.5 - Math.random();
  this.r = 1 + Math.random() * 2;
  this.o = 0.5 + Math.random() * 0.5;
}

window.onresize = function() {
  canvas.width = window.innerWidth;
  canvas.height = window.innerHeight;

  while (snowflakes.length < canvas.width / 4) {
    snowflakes.push(new SnowFlake());
  }
}

window.onresize();

window.requestAnimationFrame(function loop() {
  ctx.clearRect(0, 0, canvas.width, canvas.height);

  for (var i = 0; i < snowflakes.length; i++) {
    var sf = snowflakes[i];
    ctx.globalAlpha = sf.o;
    ctx.beginPath();
    ctx.arc(sf.x, sf.y, sf.r, 0, Math.PI * 2);
    ctx.closePath();
    ctx.fill();

    sf.x += sf.vx;
    sf.y += sf.vy;

    if (sf.x > canvas.width || sf.x < 0 || sf.y > canvas.height) {
      sf.reset();
    }
  }

  window.requestAnimationFrame(loop);
});
</script>
</body>
</html>

Este código generará un efecto de caída de nieve en la página.
 
Claro, puedes usar un script de JavaScript. Aquí tienes un código simple:

HTML:
<!DOCTYPE html>
<html>
<body>
<canvas id="snow" style="position:absolute;top:0;left:0"></canvas>
<script>
var canvas = document.getElementById("snow"), ctx = canvas.getContext("2d"),
  snowflakes = [], SnowFlake = function X() {
    this.x = 0;
    this.y = 0;
    this.vy = 0;
    this.vx = 0;
    this.r = 0;

    this.reset();
  };

canvas.style.pointerEvents = "none";

SnowFlake.prototype.reset = function() {
  this.x = Math.random() * canvas.width;
  this.y = Math.random() * canvas.height;
  this.vy = 1 + Math.random() * 3;
  this.vx = 0.5 - Math.random();
  this.r = 1 + Math.random() * 2;
  this.o = 0.5 + Math.random() * 0.5;
}

window.onresize = function() {
  canvas.width = window.innerWidth;
  canvas.height = window.innerHeight;

  while (snowflakes.length < canvas.width / 4) {
    snowflakes.push(new SnowFlake());
  }
}

window.onresize();

window.requestAnimationFrame(function loop() {
  ctx.clearRect(0, 0, canvas.width, canvas.height);

  for (var i = 0; i < snowflakes.length; i++) {
    var sf = snowflakes[i];
    ctx.globalAlpha = sf.o;
    ctx.beginPath();
    ctx.arc(sf.x, sf.y, sf.r, 0, Math.PI * 2);
    ctx.closePath();
    ctx.fill();

    sf.x += sf.vx;
    sf.y += sf.vy;

    if (sf.x > canvas.width || sf.x < 0 || sf.y > canvas.height) {
      sf.reset();
    }
  }

  window.requestAnimationFrame(loop);
});
</script>
</body>
</html>

Este código generará un efecto de caída de nieve en la página.
parece que esta cayendo tierra, ¿como lo modifico para que paresca nieve?
 
parece que esta cayendo tierra, ¿como lo modifico para que paresca nieve?
El color de los copos de nieve depende del color de relleno del contexto del canvas. Para cambiarlo a blanco, debes añadir ctx.fillStyle = 'white'; antes de dibujar el copo de nieve. Aquí está el código modificado:

HTML:
<script>
...
window.requestAnimationFrame(function loop() {
  ctx.clearRect(0, 0, canvas.width, canvas.height);
  
  // Cambia el color de relleno a blanco
  ctx.fillStyle = 'white';

  for (var i = 0; i < snowflakes.length; i++) {
    ...
    ctx.fill();
    ...
  }

  window.requestAnimationFrame(loop);
});
</script>

Esto hará que parezcan copos de nieve cayendo en lugar de tierra. ¡Espero que esto ayude!
 
Atrás
Arriba