Css animation transform
Author: M | 2025-04-24
CSS Matrix animation issue. 1. CSS transform and rotate with animation. 3. CSS Animation and Transform. 1. Strange animation with transition on transform matrix. 1. CSS CSS Animation and Transform. 4. Rotate animation and translate? 1. Translate and scale animation issue. 3. CSS3 Transform Translate to the left. 1. CSS animation - transform issue. 3. How to combine transforms in CSS? 1. Transform Animations. 1. CSS: Using transform translate instead of bottom.
CSS: Animation Using CSS Transforms - CSS
Beginners Guide to CSS Animations--> CSS animations are a powerful way to add interactivity and visual interest to your websites. With CSS animations, you can create effects such as fading elements in and out, moving elements around the page, changing the appearance of elements over time, and even simulate complex physics-based effects.To create a CSS animation, you need to do two things:Define the animation keyframes. Keyframes are the different stages of the animation. For each keyframe, you specify the CSS properties that you want to animate and the values of those properties.Apply the animation to an HTML element. Once you have defined your animation keyframes, you can apply the animation to an HTML element using the animation property.Defining animation keyframesAnimation keyframes are defined using the @keyframes at-rule. The @keyframes at-rule takes the name of your animation as its argument. Inside the @keyframes at-rule, you define one or more keyframes.Each keyframe is defined by a percentage value and a set of CSS properties. The percentage value specifies when the keyframe should occur in the animation. The CSS properties specify the values that the element should have at that point in the animation.For example, the following code defines a simple animation that bounces an element up and down:CSS@keyframes bounce { 0% { transform: translateY(0); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0); }}This animation has three keyframes:The first keyframe occurs at 0% of the animation. At this point, the element's transform: translateY() property is set to 0, which keeps the element in its original position.The second keyframe occurs at 50% of the animation. At this point, the element's transform: translateY() property is set to -10px, which moves the element 10 pixels down.The third keyframe occurs at 100% of the animation. At this point, the element's transform: translateY() property is set back to 0, which moves the element back to its original position.Applying animations to HTML elementsOnce you have defined your animation keyframes, you can apply the animation to an HTML element using the animation property. The animation property takes the name of your animation as its value.For example, the following code applies the bounce animation to the .box element:CSS.box:hover { animation: bounce 1s linear;}This code tells the browser to animate the .box element using the bounce animation over a period of 1 second. The linear timing function specifies that the animation should play at a constant speed. You can see the result of this animation below.Animation ResultHover over me to view animation.Animation propertiesIn addition to the animation property, there are a number of other CSS properties that you can use to control your animations. These properties include:animation-duration: Specifies the duration of the animation in seconds.animation-timing-function: Specifies the speed curve of CSS Loading Animations ShowcaseA modern collection of pure CSS loading animations featuring neon-inspired design effects. This project demonstrates various animation techniques using CSS3, including 3D transforms, keyframe animations, and modern visual effects.Live DemoAbout The ProjectCSS Animation Showcase is an open-source project dedicated to demonstrating the power and creativity of pure CSS animations. By focusing on a cyberpunk-inspired aesthetic, we create engaging loading animations that are both visually stunning and performant.GoalsShowcase creative possibilities with pure CSS animationsProvide learning resources for CSS animation techniquesDemonstrate performance-optimized animation practicesFoster a collaborative community around CSS animationPromote accessibility in web animationsCommunity StandardsOpen Source: All code is freely available and open for contributionBeginner Friendly: Well-documented code with clear examplesQuality Focused: Emphasis on performance and best practicesInclusive: Welcoming environment for all skill levelsAI Enhanced: Leveraging AI for consistent, high-quality animationsDesign FeaturesModern neon color schemeGlassmorphism effectsResponsive designInteractive hover statesPure CSS implementationNo external dependenciesAnimationsSee the complete list of animations and their features in the Animations List.UsageClone the repository:git clone index.html in a modern web browser.That's it! No build process or dependencies required.Browser SupportThe animations are designed to work in modern browsers that support:CSS Custom Properties (CSS Variables)CSS Transform and Transform-styleCSS Keyframe AnimationsCSS Filters and Backdrop-filterRecommended browsers:Chrome (latest)Firefox (latest)Safari (latest)Edge (latest)CustomizationColorsThe project uses CSS custom properties for easy color customization. Modify the variables in styles.css::root { --bg-color: #0a0a0a; --card-bg: rgba(255, 255, 255, 0.03); --neon-pink: #ff2d75; --neon-blue: #0ff; --neon-purple: #b300ff;}Animation SpeedEach animation's duration can be adjusted by modifying the animation-duration property in their respective CSS classes.Issues and SupportReporting IssuesIf you find a bug or have a suggestion:First, check if the issue already exists in our Issues pageIf not, create a new issue with:Clear description of the problemSteps to reproduceExpected vs actual behaviorBrowser and OS informationScreenshots if applicableSecurityFor security concerns, please review our Security Policy before submitting a report.ContributingTo contribute to this project,CSS: Animation Using CSS Transforms
Right side. Its animation sequence is notably more intricate compared to the other two shapes.Shape 3 - Initial State/* Shape 3 */.shape-3 { left: 100px; animation: shape-3-movement;}Shape 3’s animation name is set to shape-3-movement and positioned at left: 100px.Shape 3 - Transform Height to 200px/* Shape 3 Animation */@keyframes shape-3-movement { from { background: var(--gradient); } 10% { height: 150px; } 20% { height: 200px; left: 100px; }}Similar to Shape 2, you assign the CSS custom property (variable), var(--gradient) as Shape 3’s background property value. At the 10% waypoint, the height is increased to 150px. The height is further increased to 200px at 20% while staying at left: 100px.Shape 3 - Move to Middle Area@keyframes shape-3-movement { 50% { height: 200px; left: 205px; }}Shape 3 will move to the middle area of the container by the 50% mark while keeping its height at 200px.Shape 3 - Move to Left Area@keyframes shape-3-movement { 90% { height: 100px; } to { height: 100px; left: 310px; background: var(--gradient); }}With height: 100px, Shape 3 will shrink its height from 200px down to 100px.Shape 3 - End StateShape 3’s final state will be left: 310px, the left area of the container, and will revert to a circle shape while retaining its gradient background.Multi-Element TransformIn this final section, let’s break down how multiple shapes transform in tandem.Shape 2 and Shape 3 - Height TransformationShape 2 and Shape 3’s height properties are transformed simultaneously. Shape 2 has a max height of 150px, while shape 3 has a height of 200px.Shape 2 and Shape 3 - Crossing at Middle AreaIn the middle area, Shape 2 starts to shrink, and a slight blur effect is applied to make it look like it’s receding in the background while Shape 3 is passing it.Shape 3 and Shape 2 - End StateShape 2 and Shape 3 return to circles at their end state. Shape 3 retains its gradient background, while Shape 2 goes back to its default background color.All Shapes - Shape 3 with GradientAll shapes in their end state.You can see and play with the complete code on Pyxofy’s CodePen page. See the Pen CSS Animation - Rotate and Transform Elements by Pyxofy (@pyxofy) on CodePen.ConclusionIn this article, you learned how to combine multiple CSS properties to rotate and transform elements.First, you used the CSS custom properties (variables) to assign a radial-gradient() to the shape’s background. Next, you utilized the height, blur(), and rotate to transform the circle into an elongated shape.You learned how to use the left property in tandem with the animation and @keyframes at-rule to simulate a rotation-like animation sequence.Share your masterpiece with us on LinkedIn, Threads, Mastodon, X (Twitter) @pyxofy, or Facebook.We hope you liked this article.. CSS Matrix animation issue. 1. CSS transform and rotate with animation. 3. CSS Animation and Transform. 1. Strange animation with transition on transform matrix. 1. CSSAnimation Using CSS Transforms CSS
IntroductionTransforming and rotating are simple but fun animations. This article explores creating an animation sequence that rotates and transforms multiple elements.CSS Properties you’ll learn in this article:rotateradial-gradient()blur()heightborder-radiusCustom properties (variables)PreviewYou will learn how to rotate and transform multiple elements in this article. You’ll start by creating three simple circle shapes and then apply transform and rotate animations to them.Rotate and Transform - PreviewPrerequisitesEssential CSS and HTML knowledge will help you understand the concepts and techniques introduced in this article. Jump over to this article if you require an HTML and CSS primer.We assume that you have set up tools to manipulate CSS. If you haven’t, this article will show you how to set them up.Please read this article if you’re unfamiliar with CSS animation and the @keyframes at-rule property.HTML Structure container is the outermost enclosure. It enables the content to be centered and draws a light gray border. The rest of the divs represent each animation sequence.Keep the HTML structure as is for the animation to display correctly.Body and Container Div CSSCSS code for the body and container div./* Body and Container Settings *//* Center shapes */body { margin: 0; padding: 0; height: 100vh; display: flex; justify-content: center; align-items: center; flex-wrap: wrap;}/* Set background and border color */.container { width: 500px; height: 500px; border: 5px solid lightgray; background: royalblue; position: relative; margin: 5px; display: flex; justify-content: center; align-items: center; /* Rotate Container */ rotate: 180.02deg; /* rotate: 180deg; */ /* Causes a rendering bug in Firefox 131.0b9 (aarch64) */}Basic Circle ShapeIn this section, you’ll learn about the circle shapes’ shared properties.All Shapes - No Gradient/* Shared Properties */.shape-1,.shape-2,.shape-3 { position: absolute; width: 100px; height: 100px; top: 150px; border-radius: 50px; background: burlywood; animation-duration: 2s; animation-timing-function: ease-in-out; animation-iteration-count: infinite;}The shapes’ position property value is set to absolute.The width and height values are set to 100px.The shape is positioned 150px from the top, has a border-radius of 50px, and its background color is set to burlywood.The animation sequence will last for two seconds, 2s, with a timing function of ease-in-out and will loop with infinite./* Color Palette */:root { --gradient: radial-gradient(at 5% 80%, seashell, burlywood 70%);}You will use a radial gradient when the shapes are transforming and rotating. The gradient colors will be seashell and burlwood and positioned 5% on the x-axis and 80% on the y-axis.To minimize the amount of code, we will use CSS custom properties (variables) to apply the radial gradient. Please refer to this article for details on creating CSS custom properties (variables).CSS Art – How to Make a Color PaletteUsing stock colors is so 90’s. Learn how to make custom color palettes to express your unique style and personality in this article, step-by-step.PyxofyPyxofy/* Set background and border color */.container Color = ref('blue')script>template> ContextMenuRoot> ContextMenuTrigger>…ContextMenuTrigger> ContextMenuPortal> ContextMenuContent> ContextMenuRadioGroup v-model="color"> ContextMenuRadioItem value="red"> ContextMenuItemIndicator> Icon icon="radix-icons:check" /> ContextMenuItemIndicator> Red ContextMenuRadioItem> ContextMenuRadioItem value="blue"> ContextMenuItemIndicator> Icon icon="radix-icons:check" /> ContextMenuItemIndicator> Blue ContextMenuRadioItem> ContextMenuRadioItem value="green"> ContextMenuItemIndicator> Icon icon="radix-icons:check" /> ContextMenuItemIndicator> Green ContextMenuRadioItem> ContextMenuRadioGroup> ContextMenuContent> ContextMenuPortal> ContextMenuRoot>template>With complex items You can add extra decorative elements in the Item parts, such as images.vuescript setup lang="ts">import { ContextMenuContent, ContextMenuItem, ContextMenuPortal, ContextMenuRoot, ContextMenuTrigger } from 'radix-vue'script>template> ContextMenuRoot> ContextMenuTrigger>…ContextMenuTrigger> ContextMenuPortal> ContextMenuContent> ContextMenuItem> img src="…"> Adolfo Hess ContextMenuItem> ContextMenuItem> img src="…"> Miyah Myles ContextMenuItem> ContextMenuContent> ContextMenuPortal> ContextMenuRoot>template>Constrain the content/sub-content size You may want to constrain the width of the content (or sub-content) so that it matches the trigger (or sub-trigger) width. You may also want to constrain its height to not exceed the viewport.We expose several CSS custom properties such as --radix-context-menu-trigger-width and --radix-context-menu-content-available-height to support this. Use them to constrain the content dimensions.vuescript setup lang="ts">import { ContextMenuContent, ContextMenuItem, ContextMenuPortal, ContextMenuRoot, ContextMenuTrigger } from 'radix-vue'script>template> ContextMenuRoot> ContextMenuTrigger>…ContextMenuTrigger> ContextMenuPortal> ContextMenuContent class="ContextMenuContent"> … ContextMenuContent> ContextMenuPortal> ContextMenuRoot>template>css/* styles.css */.ContextMenuContent { width: var(--radix-context-menu-trigger-width); max-height: var(--radix-context-menu-content-available-height);}Origin-aware animations We expose a CSS custom property --radix-context-menu-content-transform-origin. Use it to animate the content from its computed origin based on side, sideOffset, align, alignOffset and any collisions.vuescript setup lang="ts">import { ContextMenuContent, ContextMenuPortal, ContextMenuRoot, ContextMenuTrigger } from 'radix-vue'script>template> ContextMenuRoot> ContextMenuTrigger>…ContextMenuTrigger> ContextMenuPortal> ContextMenuContent class="ContextMenuContent"> … ContextMenuContent> ContextMenuPortal> ContextMenuRoot>template>css/* styles.css */.ContextMenuContent { transform-origin: var(--radix-context-menu-content-transform-origin); animation: scaleIn 0.5s ease-out;}@keyframes scaleIn { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); }}Collision-aware animations We expose data-side and data-align attributes. Their values will change at runtime to reflect collisions. Use them to create collision and direction-aware animations.vuescript setup lang="ts">import { ContextMenuContent, ContextMenuPortal, ContextMenuRoot, ContextMenuTrigger } from 'radix-vue'script>template> ContextMenuRoot> ContextMenuTrigger>…ContextMenuTrigger> ContextMenuPortal> ContextMenuContent class="ContextMenuContent"> … ContextMenuContent> ContextMenuPortal> ContextMenuRoot>template>css/* styles.css */.ContextMenuContent { animation-duration: 0.6s; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);}.ContextMenuContent[data-side="top"] { animation-name: slideUp;}.ContextMenuContent[data-side="bottom"] { animation-name: slideDown;}@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); }}@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); }}Accessibility Uses roving tabindex to manage focus movement among menu items.Keyboard Interactions KeyDescriptionSpaceActivates the focused item.EnterActivates the focused item.ArrowDownMoves focus to the next item.ArrowUpMoves focus to the previous item.ArrowRightArrowLeft When focus is on ContextMenu.SubTrigger, opens or closes the submenu depending on reading direction. EscCloses the context menu3D Transforms and Animations CSS
Font Awesome icons can be customized even further using your own CSS. We’ve even added CSS Custom Properties to our style toolkit options.Customize with CSS Custom PropertiesOur styling toolkit provides a lot of utility, including size, rotate, stack, and animate icons. Using the CSS custom properties below, we’ve added easy ways to customize aspects of our styling toolkit’s features.CSS Custom PropertyDetailsAccepted Values--faSet the Unicode value for an icon (primary layer)--fa--faSet the Unicode value for an icon (secondary layer)--fa-style-familySet Font Awesome icon family"Font Awesome 6 Free""Font Awesome 6 Pro""Font Awesome 6 Duotone""Font Awesome 6 Brands""Font Awesome 6 Sharp"--fa-styleSet Font Awesome icon styleAny valid Font Awesome style weight--fa-displaySet display of an iconAny valid CSS display value--fa-inverseSet color of an inverted iconAny valid CSS color valueIcons in a List--fa-li-marginSet margin around iconAny valid CSS margin value--fa-li-widthSet width of iconAny valid CSS width valueRotating Icons--fa-rotate-angleSet rotation angle of.fa-rotate-byAny valid CSS transform rotate valueAnimating Icons--fa-animation-delaySet an initial delay for animationAny valid CSS animation-direction value--fa-animation-directionSet direction for animationAny valid CSS animation-direction value--fa-animation-durationSet duration for animationAny valid CSS animation-duration value--fa-animation-iteration-countSet number of iterations for animationAny valid CSS animation-iteration-count value--fa-animation-timingSet how the animation progresses through framesAny valid CSS animation-timing-function value--fa-beat-scaleSet the max value an fa-beat icon will scaleAny valid CSS number value--fa-fade-opacitySet lowest opacity value an fa-fade icon will fade to0 1.0--fa-beat-fade-opacitySet lowest opacity value an fa-beat-fade icon will fade to and from0 1.0--fa-beat-fade-scaleSet max value that an icon will scaleSet the max value an fa-beat-fade icon will scale--fa-flip-xSet an fa-flip icon’s x-coordinate of the vector denoting the axis of rotationAny valid CSS number value between 0 and 1--fa-flip-ySet an fa-flip icon’sy-coordinate of the vector denoting the axis of rotationAny valid CSS number value between 0 and 1--fa-flip-zSet an fa-flip icon’s z-coordinate of the vector denoting the axis of rotationAny valid CSS number value between 0 and 1--fa-flip-angleSet an fa-flip icon’s rotation angle. A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.Any valid CSS angle valueBounce Icons--fa-bounce-reboundSet the amount of rebound an icon has when landing after the jumpAny valid CSS length value--fa-bounce-heightSet the max height an icon will jump to when bouncingAny valid CSS length value--fa-bounce-start-scale-xSet the icon’s horizontal distortion (“squish”) when starting to bounceAny valid CSS number value--fa-bounce-start-scale-ySet the icon’s vertical distortion (“squish”) when starting to bounceAny valid CSS number value--fa-bounce-jump-scale-xSet the icon’s horizontal distortion (“squish”) at the top of the jumpAny valid CSS number value--fa-bounce-jump-scale-ySet the icon’s vertical distortion (“squish”) atAnimating a CSS Transform - Treehouse
Navigation link’s beautiful and different underline animations appear with smooth animation.In those first, second, and third navigation links I have given position absolute and that underline width increases while we hover on them. On the last navigation link, I have given width 100% and scaleX 0 and transform-origin right, and while we do hover I have given transform scaleX 1 and transform-origin right that’s why it moves forward.I believe you have got all the ideas and tactics that I have used on this program [Navigation Menu Hover Animation in HTML and CSS] and you can build this type of animation easily but hose friends who are feeling difficult to make this, you can get all the source code of this hover animations from below.You Might Like This:Before copying the given code of Navigation Menu Hover Animation and Effects you need to create two files: an HTML file and a CSS file. After Creating these two files then you can copy-paste the following codes in your documents. All Navigation Menu Hover Animation | CodingLab Dashboard Portfolio Services Feedback /* Google Fonts Import Link */@import url(' margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif;}body{ height: 100vh; display: flex; align-items: center; justify-content: center; background: #c1f7f5;}.nav-links{ display: flex; align-items: center; background: #fff; padding: 20px 15px; border-radius: 12px; box-shadow: 0 5px 10px rgba(0,0,0,0.2);}.nav-links li{ list-style: none; margin: 0 12px;}.nav-links li a{ position: relative; color: #333; font-size: 20px; font-weight: 500; padding: 6px 0; text-decoration: none;}.nav-links li a:before{ content: ''; position: absolute; bottom: 0; left: 0;. CSS Matrix animation issue. 1. CSS transform and rotate with animation. 3. CSS Animation and Transform. 1. Strange animation with transition on transform matrix. 1. CSS CSS Animation and Transform. 4. Rotate animation and translate? 1. Translate and scale animation issue. 3. CSS3 Transform Translate to the left. 1. CSS animation - transform issue. 3. How to combine transforms in CSS? 1. Transform Animations. 1. CSS: Using transform translate instead of bottom.Animations Transforms - State of CSS
Does not cause other elements to flow around it like the scale() transform function does. That means an element’s scale does not result in the elements around it reflowing in order to make additional (or less) room available based on the scale of that element.Scaling affects child and descendent elementsAnother thing to note is that the scale property scales all of an element’s descendants. For example, let’s say we have text inside the element. Changing the elements scale scales both the element and the text.Transitions and animationsAnd, yes, we can use scale in CSS transitions and animations. For example, we can make any element smoothly transition between scales on, say, hover:We can even get a little more creative when we combine scale with other independent transform properties, like translate:FallbacksWhile browser support is building for the CSS scale property and other independent transform properties, it’s probably worth checking for support when using scale:.box:hover { transform: scale(2); /* Fallback to this */}@supports (scale: 1) { .box:hover { scale: 2; /* Used if support for `scale` is detected */ }}DemoBrowser supportMore informationCSS Transforms Module Level 2 SpecificationMDN Developer Docs Snippet on Nov 3, 2014 Scale on Hover with Transition Article on Feb 21, 2020 Full Page Background Video Styles Article on Feb 7, 2020 Fun Times With CSS Pixel Art Article on Mar 30, 2020 How They Fit Together: Transform, Translate, Rotate, Scale, and Offset Article on Nov 28, 2018 I Heart CSS Article on Jun 30, 2016 Recreating the Twitter Heart Animation (with One Element, No Images, and No JavaScript)Comments
Beginners Guide to CSS Animations--> CSS animations are a powerful way to add interactivity and visual interest to your websites. With CSS animations, you can create effects such as fading elements in and out, moving elements around the page, changing the appearance of elements over time, and even simulate complex physics-based effects.To create a CSS animation, you need to do two things:Define the animation keyframes. Keyframes are the different stages of the animation. For each keyframe, you specify the CSS properties that you want to animate and the values of those properties.Apply the animation to an HTML element. Once you have defined your animation keyframes, you can apply the animation to an HTML element using the animation property.Defining animation keyframesAnimation keyframes are defined using the @keyframes at-rule. The @keyframes at-rule takes the name of your animation as its argument. Inside the @keyframes at-rule, you define one or more keyframes.Each keyframe is defined by a percentage value and a set of CSS properties. The percentage value specifies when the keyframe should occur in the animation. The CSS properties specify the values that the element should have at that point in the animation.For example, the following code defines a simple animation that bounces an element up and down:CSS@keyframes bounce { 0% { transform: translateY(0); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0); }}This animation has three keyframes:The first keyframe occurs at 0% of the animation. At this point, the element's transform: translateY() property is set to 0, which keeps the element in its original position.The second keyframe occurs at 50% of the animation. At this point, the element's transform: translateY() property is set to -10px, which moves the element 10 pixels down.The third keyframe occurs at 100% of the animation. At this point, the element's transform: translateY() property is set back to 0, which moves the element back to its original position.Applying animations to HTML elementsOnce you have defined your animation keyframes, you can apply the animation to an HTML element using the animation property. The animation property takes the name of your animation as its value.For example, the following code applies the bounce animation to the .box element:CSS.box:hover { animation: bounce 1s linear;}This code tells the browser to animate the .box element using the bounce animation over a period of 1 second. The linear timing function specifies that the animation should play at a constant speed. You can see the result of this animation below.Animation ResultHover over me to view animation.Animation propertiesIn addition to the animation property, there are a number of other CSS properties that you can use to control your animations. These properties include:animation-duration: Specifies the duration of the animation in seconds.animation-timing-function: Specifies the speed curve of
2025-04-09CSS Loading Animations ShowcaseA modern collection of pure CSS loading animations featuring neon-inspired design effects. This project demonstrates various animation techniques using CSS3, including 3D transforms, keyframe animations, and modern visual effects.Live DemoAbout The ProjectCSS Animation Showcase is an open-source project dedicated to demonstrating the power and creativity of pure CSS animations. By focusing on a cyberpunk-inspired aesthetic, we create engaging loading animations that are both visually stunning and performant.GoalsShowcase creative possibilities with pure CSS animationsProvide learning resources for CSS animation techniquesDemonstrate performance-optimized animation practicesFoster a collaborative community around CSS animationPromote accessibility in web animationsCommunity StandardsOpen Source: All code is freely available and open for contributionBeginner Friendly: Well-documented code with clear examplesQuality Focused: Emphasis on performance and best practicesInclusive: Welcoming environment for all skill levelsAI Enhanced: Leveraging AI for consistent, high-quality animationsDesign FeaturesModern neon color schemeGlassmorphism effectsResponsive designInteractive hover statesPure CSS implementationNo external dependenciesAnimationsSee the complete list of animations and their features in the Animations List.UsageClone the repository:git clone index.html in a modern web browser.That's it! No build process or dependencies required.Browser SupportThe animations are designed to work in modern browsers that support:CSS Custom Properties (CSS Variables)CSS Transform and Transform-styleCSS Keyframe AnimationsCSS Filters and Backdrop-filterRecommended browsers:Chrome (latest)Firefox (latest)Safari (latest)Edge (latest)CustomizationColorsThe project uses CSS custom properties for easy color customization. Modify the variables in styles.css::root { --bg-color: #0a0a0a; --card-bg: rgba(255, 255, 255, 0.03); --neon-pink: #ff2d75; --neon-blue: #0ff; --neon-purple: #b300ff;}Animation SpeedEach animation's duration can be adjusted by modifying the animation-duration property in their respective CSS classes.Issues and SupportReporting IssuesIf you find a bug or have a suggestion:First, check if the issue already exists in our Issues pageIf not, create a new issue with:Clear description of the problemSteps to reproduceExpected vs actual behaviorBrowser and OS informationScreenshots if applicableSecurityFor security concerns, please review our Security Policy before submitting a report.ContributingTo contribute to this project,
2025-04-07Right side. Its animation sequence is notably more intricate compared to the other two shapes.Shape 3 - Initial State/* Shape 3 */.shape-3 { left: 100px; animation: shape-3-movement;}Shape 3’s animation name is set to shape-3-movement and positioned at left: 100px.Shape 3 - Transform Height to 200px/* Shape 3 Animation */@keyframes shape-3-movement { from { background: var(--gradient); } 10% { height: 150px; } 20% { height: 200px; left: 100px; }}Similar to Shape 2, you assign the CSS custom property (variable), var(--gradient) as Shape 3’s background property value. At the 10% waypoint, the height is increased to 150px. The height is further increased to 200px at 20% while staying at left: 100px.Shape 3 - Move to Middle Area@keyframes shape-3-movement { 50% { height: 200px; left: 205px; }}Shape 3 will move to the middle area of the container by the 50% mark while keeping its height at 200px.Shape 3 - Move to Left Area@keyframes shape-3-movement { 90% { height: 100px; } to { height: 100px; left: 310px; background: var(--gradient); }}With height: 100px, Shape 3 will shrink its height from 200px down to 100px.Shape 3 - End StateShape 3’s final state will be left: 310px, the left area of the container, and will revert to a circle shape while retaining its gradient background.Multi-Element TransformIn this final section, let’s break down how multiple shapes transform in tandem.Shape 2 and Shape 3 - Height TransformationShape 2 and Shape 3’s height properties are transformed simultaneously. Shape 2 has a max height of 150px, while shape 3 has a height of 200px.Shape 2 and Shape 3 - Crossing at Middle AreaIn the middle area, Shape 2 starts to shrink, and a slight blur effect is applied to make it look like it’s receding in the background while Shape 3 is passing it.Shape 3 and Shape 2 - End StateShape 2 and Shape 3 return to circles at their end state. Shape 3 retains its gradient background, while Shape 2 goes back to its default background color.All Shapes - Shape 3 with GradientAll shapes in their end state.You can see and play with the complete code on Pyxofy’s CodePen page. See the Pen CSS Animation - Rotate and Transform Elements by Pyxofy (@pyxofy) on CodePen.ConclusionIn this article, you learned how to combine multiple CSS properties to rotate and transform elements.First, you used the CSS custom properties (variables) to assign a radial-gradient() to the shape’s background. Next, you utilized the height, blur(), and rotate to transform the circle into an elongated shape.You learned how to use the left property in tandem with the animation and @keyframes at-rule to simulate a rotation-like animation sequence.Share your masterpiece with us on LinkedIn, Threads, Mastodon, X (Twitter) @pyxofy, or Facebook.We hope you liked this article.
2025-04-12IntroductionTransforming and rotating are simple but fun animations. This article explores creating an animation sequence that rotates and transforms multiple elements.CSS Properties you’ll learn in this article:rotateradial-gradient()blur()heightborder-radiusCustom properties (variables)PreviewYou will learn how to rotate and transform multiple elements in this article. You’ll start by creating three simple circle shapes and then apply transform and rotate animations to them.Rotate and Transform - PreviewPrerequisitesEssential CSS and HTML knowledge will help you understand the concepts and techniques introduced in this article. Jump over to this article if you require an HTML and CSS primer.We assume that you have set up tools to manipulate CSS. If you haven’t, this article will show you how to set them up.Please read this article if you’re unfamiliar with CSS animation and the @keyframes at-rule property.HTML Structure container is the outermost enclosure. It enables the content to be centered and draws a light gray border. The rest of the divs represent each animation sequence.Keep the HTML structure as is for the animation to display correctly.Body and Container Div CSSCSS code for the body and container div./* Body and Container Settings *//* Center shapes */body { margin: 0; padding: 0; height: 100vh; display: flex; justify-content: center; align-items: center; flex-wrap: wrap;}/* Set background and border color */.container { width: 500px; height: 500px; border: 5px solid lightgray; background: royalblue; position: relative; margin: 5px; display: flex; justify-content: center; align-items: center; /* Rotate Container */ rotate: 180.02deg; /* rotate: 180deg; */ /* Causes a rendering bug in Firefox 131.0b9 (aarch64) */}Basic Circle ShapeIn this section, you’ll learn about the circle shapes’ shared properties.All Shapes - No Gradient/* Shared Properties */.shape-1,.shape-2,.shape-3 { position: absolute; width: 100px; height: 100px; top: 150px; border-radius: 50px; background: burlywood; animation-duration: 2s; animation-timing-function: ease-in-out; animation-iteration-count: infinite;}The shapes’ position property value is set to absolute.The width and height values are set to 100px.The shape is positioned 150px from the top, has a border-radius of 50px, and its background color is set to burlywood.The animation sequence will last for two seconds, 2s, with a timing function of ease-in-out and will loop with infinite./* Color Palette */:root { --gradient: radial-gradient(at 5% 80%, seashell, burlywood 70%);}You will use a radial gradient when the shapes are transforming and rotating. The gradient colors will be seashell and burlwood and positioned 5% on the x-axis and 80% on the y-axis.To minimize the amount of code, we will use CSS custom properties (variables) to apply the radial gradient. Please refer to this article for details on creating CSS custom properties (variables).CSS Art – How to Make a Color PaletteUsing stock colors is so 90’s. Learn how to make custom color palettes to express your unique style and personality in this article, step-by-step.PyxofyPyxofy/* Set background and border color */.container
2025-04-09