Change transformation-origin mid animation

Developer
Size
2,138 Kb
Views
32,384

How do I make an change transformation-origin mid animation?

An example of switching the transformation origin mid animation. What is a change transformation-origin mid animation? How do you make a change transformation-origin mid animation? This script and codes were developed by Zach Saucier on 20 August 2022, Saturday.

Change transformation-origin mid animation Previews

Change transformation-origin mid animation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Change transformation-origin mid animation</title> <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! */ div { width:200px; height:200px; background:rgba(0,0,255,.5); animation:flipAround 8s infinite; transform-origin:right;
}
@keyframes flipAround { 25% { transform-origin:right; animation-mode:forwards; transform:rotateY(-180deg); } 25.001% { transform-origin:bottom; transform:translateX(200px); } 50% { transform-origin:bottom; transform:translateX(200px) rotateX(-180deg); } 50.001% { transform-origin:left; transform:translateX(200px) translateY(200px); } 75% { transform-origin:left; transform-origin:left; transform:translateX(200px) translateY(200px) rotateY(180deg); } 75.001% { transform-origin:top; transform:translateY(200px); } 100% { transform-origin:top; transform-origin:top; transform:translateY(200px) rotateX(180deg); }
}
body { background:rgb(20,20,20); } </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div></div> <script src="js/index.js"></script>
</body>
</html>

Change transformation-origin mid animation - Script Codes CSS Codes

div { width:200px; height:200px; background:rgba(0,0,255,.5); animation:flipAround 8s infinite; transform-origin:right;
}
@keyframes flipAround { 25% { transform-origin:right; animation-mode:forwards; transform:rotateY(-180deg); } 25.001% { transform-origin:bottom; transform:translateX(200px); } 50% { transform-origin:bottom; transform:translateX(200px) rotateX(-180deg); } 50.001% { transform-origin:left; transform:translateX(200px) translateY(200px); } 75% { transform-origin:left; transform-origin:left; transform:translateX(200px) translateY(200px) rotateY(180deg); } 75.001% { transform-origin:top; transform:translateY(200px); } 100% { transform-origin:top; transform-origin:top; transform:translateY(200px) rotateX(180deg); }
}
body { background:rgb(20,20,20); }

Change transformation-origin mid animation - Script Codes JS Codes

// For more check out zachsaucier.com
Change transformation-origin mid animation - Script Codes
Change transformation-origin mid animation - Script Codes
Home Page Home
Developer Zach Saucier
Username Zeaklous
Uploaded August 20, 2022
Rating 3.5
Size 2,138 Kb
Views 32,384
Do you need developer help for Change transformation-origin mid animation?

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!

Zach Saucier (Zeaklous) Script Codes
Create amazing art & images 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!