Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="container">
<div class="grid">
<span id="text">LOOKS BETTER ON <a id="link" href="https://rishabhpatni.com"target="_blank">MY WEBSITE</a></span>
</div>
</div>

              
            
!

CSS

              
                * {
  box-sizing: inherit;
}

html {
  box-sizing: border-box;
}

body {
  background-image: repeating-radial-gradient( circle at 0 0, transparent 0, #141414 32px ), repeating-linear-gradient( #00000055, #000000 );;

 font-family: 'Rubik', sans-serif;
  margin: 0;
  min-height: 100vh;
    display: grid;
  place-items: center;
}

#text {
  z-index: 10;
  margin: 20px;
  font-weight: regular;
  color: white;
  position: absolute;
  font-size: 1rem;
  text-align: bottom;
}

#link {
   color: white;
}

 .grid{
  margin-left: auto;
  margin-right: auto;
  max-width: inherit;
  width: 100%;

}

 .container{
  background-image: radial-gradient(at 300px 300px, rgba(120,123,221,.5) 0, #000000 70%);
  text-shadow: 0px 1px 2px rgba(0.8,0.8,0.8,1.6);

}
              
            
!

JS

              
                var canvas = document.createElement('canvas');
var clone = document.createElement('canvas');
var sempliceCover = document.querySelector('.container');
sempliceCover.appendChild(canvas);
sempliceCover.appendChild(clone);

var cloneCtx = clone.getContext('2d');
var ctx = canvas.getContext('2d');
   
var ww = window.innerWidth;
var wh = window.innerHeight;
  
canvas.width = ww;
canvas.height= wh;
var partCount = 100;
var particles = [];

var gradient = document.querySelector(".container");
function onMouseMove(event) {
gradient.style.backgroundImage = 'radial-gradient(at ' + event.clientX + 'px ' + event.clientY + 'px, rgba(120,123,221,.5) 0, #000000 70%)';}
document.addEventListener("mousemove", onMouseMove);
  
function particle(){
  this.color = 'rgba(255,255,255,'+ Math.random()+')';
  console.log(this.color);
  this.x = randomInt(0,ww);
  this.y = randomInt(0,wh);
  this.direction = {
    "x": -1 + Math.random() * 2,
    "y": -1 + Math.random() * 2
  };
  this.vx = 0.3 * Math.random();
  this.vy = 0.3 * Math.random();
  this.radius = randomInt(2,3);
  this.float = function(){
    this.x += this.vx * this.direction.x;
    this.y += this.vy * this.direction.y;
  };
  this.changeDirection = function (axis) {
    this.direction[axis] *= -1;
  };
  this.boundaryCheck = function () {
            if (this.x >= ww) {
                this.x = ww;
                this.changeDirection("x");
            } else if (this.x <= 0) {
                this.x = 0;
                this.changeDirection("x");
            }
            if (this.y >= wh) {
                this.y = wh;
                this.changeDirection("y");
            } else if (this.y <= 0) {
                this.y = 0;
                this.changeDirection("y");
            }
        };
  this.draw = function () {
    ctx.beginPath();
    ctx.fillStyle = this.color;
    ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);
    ctx.fill();
  };
}
function clearCanvas() {
 cloneCtx.clearRect(0, 0, ww, wh);
 ctx.clearRect(0, 0, ww, wh);
}
function createParticles(){
  for (i=0;i<partCount;i++){
    var p = new particle();
    particles.push(p);
  }
}
function drawParticles() {
   for (i=0;i<particles.length;i++) {
     p = particles[i];
     p.draw();
   }
}
function updateParticles() {
        for (var i = particles.length - 1; i >= 0; i--) {
            p = particles[i];
            p.float();
            p.boundaryCheck();
        }
}
createParticles();
drawParticles();
function animateParticles() {
        clearCanvas();
        drawParticles();
        updateParticles();
        cloneCtx.drawImage(canvas, 0, 0);
        requestAnimationFrame(animateParticles);
    }
requestAnimationFrame(animateParticles);
cloneCtx.drawImage(canvas, 0, 0);

$(window).on('resize',function(){
  ww = $(window).width();
  wh = $(window).height();
  canvas.width = ww;
  canvas.height= wh;
  clearCanvas();
  particles = [];
  createParticles();
  drawParticles();
});
function randomInt(min,max)
{
    return Math.floor(Math.random()*(max-min+1)+min);
}
function velocityInt(min,max)
{
    return Math.random()*(max-min+1)+min;
}
              
            
!
999px

Console