Yin-Yang CSS Image Animation

Developer
Size
3,255 Kb
Views
38,456

How do I make an yin-yang css image animation?

Read the blog post http://zachsaucier.com/blog/blog/2014/06/20/the-creative-process/A CSS version based on these gifs https://24.media.tumblr.com/0a0a8f7afd396c73e3ac876fae047889/tumblr_n73sr9y6TP1relaado1_400.gif https://38.media.tumblr.com/569d680e7d50c3a9c197ab233f8e34a8/tumblr_n73pcoi2iH1relaado1_400.gif https://24.media.tumblr.com/f04bde43e138a3f9a345b2554c780d9e/tumblr_n73qa5iVsO1relaado1_400.gif https://31.media.tumblr.com/2e635a83096a4bf9dad3a011a127abf9/tumblr_n73sazxyaO1relaado1_400.gif. What is a yin-yang css image animation? How do you make a yin-yang css image animation? This script and codes were developed by Zach Saucier on 20 August 2022, Saturday.

Yin-Yang CSS Image Animation Previews

Yin-Yang CSS Image Animation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Yin-Yang CSS Image 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! */ body { background:#34495e; }
.container { width:300px; height:300px; position:relative; margin:50px auto; overflow:hidden; /* Removing this is interesting */ animation:rotate 5s linear infinite; border:1px solid black;
}
.circle { border-radius:50%; }
.one:after, .two:after { animation:rotate 2.5s linear infinite reverse; }
/* You can replace the images with anything, including gifs! */
.one:after { background-image: url(http://img2.timeinc.net/people/i/2013/pets/news/130304/kitten-3-600.jpg); }
.two:after { background-image: url(http://www.wallpapersdb.org/wallpapers/cats/cute_cat_praying_1920x1200.jpg); }
.main { width:100%; height:50%;
}
.main.two { top:50%; }
.one { transform:rotate(0deg); }
.two { transform:rotate(180deg); }
.main, .big, .small { position:absolute; overflow:hidden; }
.main:after, .big:after, .small:after { content:''; position:absolute; top:0; left:0; width:300px; height:300px; background-size:100% 100%;
}
.big { width:50%; height:50%; top:25%; left:50%;
}
.big.two { left:0; }
.big:after { top: -50%; left: -100%; }
.small { width:25%; height:25%; top:37.5%; left:12.5%;
}
.small.two { left:62.5%; }
.small:after { top: -150%; left: -50%; }
@keyframes rotate { to { transform:rotate(360deg); }
}
h2 { max-width:400px; margin:150px auto; color:darkgrey; text-align:center;
}
a { color:white;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="container circle"> <div class="main one"></div> <div class="main two"></div> <div class="big circle one"></div> <div class="big circle two"></div> <div class="small circle one"></div> <div class="small circle two"></div>
</div>
<h2>If you liked it, check out the <a href="http://zachsaucier.com/blog/blog/2014/06/20/the-creative-process/">accompanying blog post</a></h2> <script src="js/index.js"></script>
</body>
</html>

Yin-Yang CSS Image Animation - Script Codes CSS Codes

body { background:#34495e; }
.container { width:300px; height:300px; position:relative; margin:50px auto; overflow:hidden; /* Removing this is interesting */ animation:rotate 5s linear infinite; border:1px solid black;
}
.circle { border-radius:50%; }
.one:after, .two:after { animation:rotate 2.5s linear infinite reverse; }
/* You can replace the images with anything, including gifs! */
.one:after { background-image: url(http://img2.timeinc.net/people/i/2013/pets/news/130304/kitten-3-600.jpg); }
.two:after { background-image: url(http://www.wallpapersdb.org/wallpapers/cats/cute_cat_praying_1920x1200.jpg); }
.main { width:100%; height:50%;
}
.main.two { top:50%; }
.one { transform:rotate(0deg); }
.two { transform:rotate(180deg); }
.main, .big, .small { position:absolute; overflow:hidden; }
.main:after, .big:after, .small:after { content:''; position:absolute; top:0; left:0; width:300px; height:300px; background-size:100% 100%;
}
.big { width:50%; height:50%; top:25%; left:50%;
}
.big.two { left:0; }
.big:after { top: -50%; left: -100%; }
.small { width:25%; height:25%; top:37.5%; left:12.5%;
}
.small.two { left:62.5%; }
.small:after { top: -150%; left: -50%; }
@keyframes rotate { to { transform:rotate(360deg); }
}
h2 { max-width:400px; margin:150px auto; color:darkgrey; text-align:center;
}
a { color:white;
}

Yin-Yang CSS Image Animation - Script Codes JS Codes

// For more check out zachsaucier.com
Yin-Yang CSS Image Animation - Script Codes
Yin-Yang CSS Image Animation - Script Codes
Home Page Home
Developer Zach Saucier
Username Zeaklous
Uploaded August 20, 2022
Rating 4.5
Size 3,255 Kb
Views 38,456
Do you need developer help for Yin-Yang CSS Image 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!