css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


Save Automatically?

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div class="container">
  <h1 id="title">Awesome! SirAbhinavJain!</h1>
              @import url(https://fonts.googleapis.com/css?family=Pacifico);

body {
  /* credits to https://sirabhinavjain.wordpress.com */
  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAAAiCAAAAADD1SApAAAA5UlEQVR4AYXUMW6EQBAF0TpSS4T//vda2dO0GgiKwDuItwRl7ef6v5L+qNSc+5EL+jZpkTZJm3LBkBxRx2TI5YLzriQ5j//O9+0hLmgz4hoz71BB56kRc552KtjFpvqjnQtWsdHJbueCVWx9Z7dzwSpWQ2q3c8GudMN6tHPBo1hV/9ntXLCK7SsZ44Jd7CXqGBdMsQ+ZdipYldYvf7dzwfwHWqRNDXXBa2Eq9dkgFfgGucA3yAW+QS7wDXKBb5ALfINc4BvkAt8gF/gGucA3yAW+QS7wDXKBb5ALfINc4BvkAt8gFz+Bp+mo8f2VxAAAAABJRU5ErkJggg==');
  padding: 0;
  margin: 0;

.container {
  box-shadow: inset 0px 0px 225px 40px rgba(0, 0, 0, 0.75);
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  position: absolute;

  margin: auto;
  transform: translateX(-50%) translateY(-50%);
  font-family: 'Pacifico', cursive;
	color: white;
  /*one hardcoded shadow to let the thumbnail look prettier*/
  text-shadow: 1px 1px #2cefff, 2px 2px #2cefff, 3px 3px #2cefff, 4px 4px #ff2c86, 5px 5px #ff2c86, 6px 6px #ff2c86;
var shadowLayers = 25;

//generate css value for text-shadow property
function calcTextShadow(xOffset, xSide, yOffset, ySide, shadowLayers) {
  var cssString = "";
  for (var i = 1; i <= shadowLayers; i++) {
    var color = (i > shadowLayers / 2) ? "#2cefff" : "#ff2c86";
    cssString += xSide * xOffset * i + "px " + ySide * yOffset * i + "px " + color + ","
  return cssString;

document.addEventListener('mousemove', function(event) {
  var title = document.getElementById('title');

  //detect whether the cursor is on the left or righthandside of the browser window
  //!! Math.sign(0) will throw an exception
  var xSide = Math.sign((window.innerWidth / 2) - event.clientX);
  var ySide = Math.sign((window.innerHeight / 2) - event.clientY);

  //distance from center to mouse in percentage to window border
  var xOffset = Math.abs(((window.innerWidth / 2) - event.clientX) / (window.innerWidth / 2));
  var yOffset = Math.abs(((window.innerHeight / 2) - event.clientY) / (window.innerHeight / 2));

  title.style.textShadow = calcTextShadow(xOffset, xSide, yOffset, ySide, shadowLayers);
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................