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,336 |
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 |
Student Charter Demo for City University | 5,837 Kb |
The power of transform for centering | 3,747 Kb |
Psychedelic Slice | 2,681 Kb |
Simple CSS Checkbox | 2,797 Kb |
Modal Container without JS | 3,272 Kb |
Simple CSS Checkbox | 3,244 Kb |
Globule Bleu Jobs Page Anchor Rollover Effect | 2,533 Kb |
Message Types | 2,987 Kb |
Flyknife Comics | 2,934 Kb |
New Brandings | 5,617 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 |
A Pen by Oliver Schafeld | Schafeld | 1,720 Kb |
Prototype Responsive Homepage | Heyitsolivia | 7,677 Kb |
Perspective Origin Demo | Agelber | 3,614 Kb |
Css3 slide | Nakome | 3,190 Kb |
Flat UI - Checkbox FIX | ARS | 2,663 Kb |
Simple animated hover effect | Pobee-norris | 3,044 Kb |
Add This API | ThatGuySam | 2,848 Kb |
Text Looping Transition | Agelber | 5,619 Kb |
A Pen by Paul Sullivan | Pwsm50 | 2,349 Kb |
Highbrow Basic HTML Lesson 7 | Kimlarocca | 1,662 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!