Persistent Light Source Transform
How do I make an persistent light source transform?
The element is transformed at the same rate its box-shadow is animated. This makes for a persistent light source.. What is a persistent light source transform? How do you make a persistent light source transform? This script and codes were developed by Chris Burnell on 16 September 2022, Friday.
Persistent Light Source Transform - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Persistent Light Source Transform</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ html, body { height: 100%; position: relative;
}
body { background: #2EA05B;
}
.square { background: #48B97C; color: mintcream; width: 2.5em; height: 2.5em; margin: -1.25em 0 0 -1.25em; display: block; position: absolute; top: 50%; left: 50%; font-size: 6em; line-height: 2.5em; text-align: center; text-shadow: 1px 1px #2ea05B, 2px 2px #2ea05B, 3px 3px #2ea05B, 4px 4px #2ea05B, 5px 5px #2ea05B, 6px 6px #2ea05B, 7px 7px #2ea05B, 8px 8px #2ea05B, 9px 9px #2ea05B, 10px 10px #2ea05B, 11px 11px #2ea05B, 12px 12px #2ea05B; box-shadow: 0.5em 0.5em 0 rgba(0, 0, 0, 0.2); animation: wiggle 8s infinite linear;
}
@keyframes wiggle { 0% { box-shadow: 0.5em 0.5em 0 rgba(0, 0, 0, 0.2); transform: none; } 25% { left: 20%; text-shadow: 1px -1px #2ea05B, 2px -2px #2ea05B, 3px -3px #2ea05B, 4px -4px #2ea05B, 5px -5px #2ea05B, 6px -6px #2ea05B, 7px -7px #2ea05B, 8px -8px #2ea05B, 9px -9px #2ea05B, 10px -10px #2ea05B, 11px -11px #2ea05B, 12px -12px #2ea05B; box-shadow: 0.5em -0.5em 0 rgba(0, 0, 0, 0.2); transform: rotate3d(0, 0, 1, 90deg); } 50% { text-shadow: -1px -1px #2ea05B, -2px -2px #2ea05B, -3px -3px #2ea05B, -4px -4px #2ea05B, -5px -5px #2ea05B, -6px -6px #2ea05B, -7px -7px #2ea05B, -8px -8px #2ea05B, -9px -9px #2ea05B, -10px -10px #2ea05B, -11px -11px #2ea05B, -12px -12px #2ea05B; box-shadow: -0.5em -0.5em 0 rgba(0, 0, 0, 0.2); transform: rotate3d(0, 0, 1, 180deg); } 75% { left: 75%; text-shadow: -1px 1px #2ea05B, -2px 2px #2ea05B, -3px 3px #2ea05B, -4px 4px #2ea05B, -5px 5px #2ea05B, -6px 6px #2ea05B, -7px 7px #2ea05B, -8px 8px #2ea05B, -9px 9px #2ea05B, -10px 10px #2ea05B, -11px 11px #2ea05B, -12px 12px #2ea05B; box-shadow: -0.5em 0.5em 0 rgba(0, 0, 0, 0.2); transform: rotate3d(0, 0, 1, 270deg); } 100% { text-shadow: 1px 1px #2ea05B, 2px 2px #2ea05B, 3px 3px #2ea05B, 4px 4px #2ea05B, 5px 5px #2ea05B, 6px 6px #2ea05B, 7px 7px #2ea05B, 8px 8px #2ea05B, 9px 9px #2ea05B, 10px 10px #2ea05B, 11px 11px #2ea05B, 12px 12px #2ea05B; box-shadow: 0.5em 0.5em 0 rgba(0, 0, 0, 0.2); transform: rotate3d(0, 0, 1, 360deg); }
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="square">Ag</div>
<!-- The box-shadow is a bit off here. The browser's rounding math isn't great. If you know how to adjust or fix please let me know!
--> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>
Persistent Light Source Transform - Script Codes CSS Codes
html, body { height: 100%; position: relative;
}
body { background: #2EA05B;
}
.square { background: #48B97C; color: mintcream; width: 2.5em; height: 2.5em; margin: -1.25em 0 0 -1.25em; display: block; position: absolute; top: 50%; left: 50%; font-size: 6em; line-height: 2.5em; text-align: center; text-shadow: 1px 1px #2ea05B, 2px 2px #2ea05B, 3px 3px #2ea05B, 4px 4px #2ea05B, 5px 5px #2ea05B, 6px 6px #2ea05B, 7px 7px #2ea05B, 8px 8px #2ea05B, 9px 9px #2ea05B, 10px 10px #2ea05B, 11px 11px #2ea05B, 12px 12px #2ea05B; box-shadow: 0.5em 0.5em 0 rgba(0, 0, 0, 0.2); animation: wiggle 8s infinite linear;
}
@keyframes wiggle { 0% { box-shadow: 0.5em 0.5em 0 rgba(0, 0, 0, 0.2); transform: none; } 25% { left: 20%; text-shadow: 1px -1px #2ea05B, 2px -2px #2ea05B, 3px -3px #2ea05B, 4px -4px #2ea05B, 5px -5px #2ea05B, 6px -6px #2ea05B, 7px -7px #2ea05B, 8px -8px #2ea05B, 9px -9px #2ea05B, 10px -10px #2ea05B, 11px -11px #2ea05B, 12px -12px #2ea05B; box-shadow: 0.5em -0.5em 0 rgba(0, 0, 0, 0.2); transform: rotate3d(0, 0, 1, 90deg); } 50% { text-shadow: -1px -1px #2ea05B, -2px -2px #2ea05B, -3px -3px #2ea05B, -4px -4px #2ea05B, -5px -5px #2ea05B, -6px -6px #2ea05B, -7px -7px #2ea05B, -8px -8px #2ea05B, -9px -9px #2ea05B, -10px -10px #2ea05B, -11px -11px #2ea05B, -12px -12px #2ea05B; box-shadow: -0.5em -0.5em 0 rgba(0, 0, 0, 0.2); transform: rotate3d(0, 0, 1, 180deg); } 75% { left: 75%; text-shadow: -1px 1px #2ea05B, -2px 2px #2ea05B, -3px 3px #2ea05B, -4px 4px #2ea05B, -5px 5px #2ea05B, -6px 6px #2ea05B, -7px 7px #2ea05B, -8px 8px #2ea05B, -9px 9px #2ea05B, -10px 10px #2ea05B, -11px 11px #2ea05B, -12px 12px #2ea05B; box-shadow: -0.5em 0.5em 0 rgba(0, 0, 0, 0.2); transform: rotate3d(0, 0, 1, 270deg); } 100% { text-shadow: 1px 1px #2ea05B, 2px 2px #2ea05B, 3px 3px #2ea05B, 4px 4px #2ea05B, 5px 5px #2ea05B, 6px 6px #2ea05B, 7px 7px #2ea05B, 8px 8px #2ea05B, 9px 9px #2ea05B, 10px 10px #2ea05B, 11px 11px #2ea05B, 12px 12px #2ea05B; box-shadow: 0.5em 0.5em 0 rgba(0, 0, 0, 0.2); transform: rotate3d(0, 0, 1, 360deg); }
}

Developer | Chris Burnell |
Username | chrisburnell |
Uploaded | September 16, 2022 |
Rating | 3 |
Size | 2,785 Kb |
Views | 28,322 |
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 |
Simple CSS Checkbox | 2,797 Kb |
Modal Container without JS | 3,272 Kb |
Message Types | 2,987 Kb |
Category Hover Demo | 3,469 Kb |
New Brandings | 5,617 Kb |
The Importance of Proper Navigational CSS | 3,165 Kb |
Square Illusion | 3,295 Kb |
Flyknife Comics | 2,934 Kb |
Cutaway Indicator | 2,435 Kb |
The power of transform for centering | 3,747 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 |
SVG Circle Progress | JMChristensen | 3,368 Kb |
Matrix | Stathisnikolaidis | 1,922 Kb |
SVG Transform vs CSS Transform | AmeliaBR | 4,175 Kb |
Long Shadow Button | Uixcrazy | 3,550 Kb |
Side Sliding Menu CSS | EduardL | 4,388 Kb |
Fading gradient button | Insprd | 1,713 Kb |
A Pen by Shidhin | Shidhincr | 5,015 Kb |
Personal Website Redesign v2.0 | DevItWithDavid | 5,168 Kb |
PNotify Demo | Adittmar | 1,731 Kb |
CSS Variables | Jdsteinbach | 4,759 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!