BOX SHADOW MADNESS!
How do I make an box shadow madness!?
Test of box shadow properties, and viability as a spriting engine.... What is a box shadow madness!? How do you make a box shadow madness!? This script and codes were developed by Jeff Daze on 18 January 2023, Wednesday.
BOX SHADOW MADNESS! - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>BOX SHADOW MADNESS!</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <button id="runner">Run it!</button><button id="stopper">Stop it!</button>
<div class="box subflare"></div> <script src="js/index.js"></script>
</body>
</html>
BOX SHADOW MADNESS! - Script Codes CSS Codes
/* how many outlines can we get? can use: border, bg with padding, outline, and the infinite monster of box-shadow! box-shadow: [horizontal offset] [vertical offset] [blur] [spread]; another test! will a second class allow us to add another pseudo element? let's see! pseudo element inserts for most browsers: document.styleSheets[0].insertRule('a:hover { color: green; }', 0); IE just has to be different! document.styleSheets[0].addRule('a:hover', 'color: green', 0);
*/
body{ background:#000;
}
.box{ width:10px; height:10px; margin:150px; border-radius:50%; /* box-shadow: 1px 1px 0 0 rgba(255,0,0,1), 2px 2px 0 0 rgba(255,0,0,1), 3px 3px 0 0 rgba(255,0,0,1), 4px 4px 0 0 rgba(255,0,0,1), 5px 5px 0 0 rgba(255,0,0,1); */
}
.box:before{ content: ""; position:relative; display:block; background:rgba(255,255,255,0.9); top:5px; left:4px; width:1px; height:5px; border-radius:50%; box-shadow: 0px 0px 16px 7px rgba(255,255,255,0.9);
}
.box:after{ content:""; position:relative; display:block; top:2px; left:-200px; width:500px; height:2px; border-radius:50%; border-top:1px solid rgba(255,255,255,0.1); background:rgba(255,255,255,0.3); box-shadow: 0px 0px 10px 3px rgba(255,255,255,0.4);
}
BOX SHADOW MADNESS! - Script Codes JS Codes
//vars...
//timer control...
var running;
//bind clicks to buttons...
$("#runner").addEventListener('click', function() { strt();
}, false);
$("#stopper").addEventListener('click', function() { stp();
}, false);
var render = function(){ var el = $(".box"); //lets test pseudoselector... //$(".box::after").style.background = "#eaeaea"; //generate the line... //use this to trim the comma off the last entry: // // var trimmed = string.substr(0, string.length-1); // //make a line some number of pixels long... var lineLength = randRange(10, 500); //buffer for the box shadow css... var cssString=""; //build our string! for(var i=0;i<=lineLength;i++){ cssString += shadowLine(i, i, randRange(1, 5), (i+1) / randRange(1, 200), randRange(0, 255), randRange(0, 255), randRange(0, 255), Math.random()-0.825); //cssString += shadowLine(i, i, 0, 0, 10, 0, 255, 1); //if it's the last one, chop off the comma char... if(i==lineLength){ cssString = cssString.substr(0, cssString.length-1); } } var shadow = "1px 1px 0 0 rgba(0,0,255,1),\ 2px 2px 0 0 rgba(0,0,255,1),\ 3px 3px 0 0 rgba(0,0,255,1),\ 4px 4px 0 0 rgba(0,0,255,1),\ 5px 5px 0 0 rgba(0,0,255,1)"; el.style.boxShadow = cssString;
};
var shadowLine = function(x, y, blur, spread, r, g, b, a){ return x+"px "+y+"px "+blur+"px "+spread+"px rgba("+r+","+g+","+b+","+a+"),";
};
//utility functions...
function strt(){ running = setInterval("render()", 100);
}
function stp(){ clearInterval(running);
}
//random number...
function randRange(min, max){ return Math.floor(Math.random() * (max - min + 1)) + min;
}
//TAKE THAT jQuery!!
function $(selector){ return document.querySelector(selector);
}

Developer | Jeff Daze |
Username | jeffdaze |
Uploaded | January 18, 2023 |
Rating | 3 |
Size | 2,888 Kb |
Views | 6,069 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Tilemap Edge CSS | 2,159 Kb |
Code snippets for a Puyo clone | 2,363 Kb |
A Pen by Jeff Daze | 2,191 Kb |
Finite Scroll Example | 3,082 Kb |
Desktop Notifications | 1,975 Kb |
Angular Drag Example | 2,497 Kb |
Speed Reading | 6,553 Kb |
Winter Scene | 2,739 Kb |
Quick torus demo three.js | 1,894 Kb |
Attempt to implement diamond square algorithm | 2,110 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
CSS Flip Animation | Bbodine1 | 2,525 Kb |
Lazy Load for Background Images | The_ruther4d | 2,977 Kb |
Out of the blue | Giaco | 2,537 Kb |
Example SVGZ Data URI | Joeyhoer | 2,981 Kb |
Mobile Sub Menu Concept | Berdejitendra | 2,790 Kb |
E-mail Template | SoloMDFK | 4,871 Kb |
Portfolio Page | KaylaMT | 1,983 Kb |
Awesome textarea | Ayoungh | 1,977 Kb |
Flexbox Test | Icutpeople | 2,486 Kb |
Brent Burns Tribute Page | Nevada48 | 2,569 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!