Persistent Light Source Transform

Developer
Size
2,785 Kb
Views
28,336

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 Previews

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); }
}
Persistent Light Source Transform - Script Codes
Persistent Light Source Transform - Script Codes
Home Page Home
Developer Chris Burnell
Username chrisburnell
Uploaded September 16, 2022
Rating 3
Size 2,785 Kb
Views 28,336
Do you need developer help for Persistent Light Source Transform?

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!

Chris Burnell (chrisburnell) Script Codes
Create amazing SEO content with AI!

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!