0% found this document useful (0 votes)
17 views6 pages

Animations. Code

The document contains HTML and CSS code for creating rotating flower and circle animations. It includes SVG elements for the flower's petals and CSS animations for spinning effects. The layout is centered on a white background with two layers for each shape, one in the back and one in the front.

Uploaded by

olajesu109
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views6 pages

Animations. Code

The document contains HTML and CSS code for creating rotating flower and circle animations. It includes SVG elements for the flower's petals and CSS animations for spinning effects. The layout is centered on a white background with two layers for each shape, one in the back and one in the front.

Uploaded by

olajesu109
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

<!

DOCTYPE html>

<html>

<head>

<title>Rotating Flower</title>

<link rel="stylesheet" href="[Link]">

</head>

<body>

<!-- Back flower -->

<div class="flower back">

<svg viewBox="0 0 200 200">

<g transform="translate(100,100)">

<!-- 8 gray petals -->

<g class="petal-group">

<path d="M0,-60 Q20,-20 0,0 Q-20,-20 0,-60" fill="lightgray" />

</g>

<use href=".petal-group" transform="rotate(45)" />

<use href=".petal-group" transform="rotate(90)" />

<use href=".petal-group" transform="rotate(135)" />

<use href=".petal-group" transform="rotate(180)" />

<use href=".petal-group" transform="rotate(225)" />

<use href=".petal-group" transform="rotate(270)" />

<use href=".petal-group" transform="rotate(315)" />

</g>

</svg>

</div
<!-- Front flower -->

<div class="flower front">

<svg viewBox="0 0 200 200">

<g transform="translate(100,100)">

<!-- 8 black petals -->

<g class="petal-group">

<path d="M0,-60 Q20,-20 0,0 Q-20,-20 0,-60" fill="black" />

</g>

<use href=".petal-group" transform="rotate(45)" />

<use href=".petal-group" transform="rotate(90)" />

<use href=".petal-group" transform="rotate(135)" />

<use href=".petal-group" transform="rotate(180)" />

<use href=".petal-group" transform="rotate(225)" />

<use href=".petal-group" transform="rotate(270)" />

<use href=".petal-group" transform="rotate(315)" />

</g>

</svg>

</div>

</body>

</html>

body {

background-color: white;

height: 100vh;

margin: 0;
display: flex;

justify-content: center;

align-items: center;

position: relative;

.flower {

position: absolute;

width: 200px;

height: 200px;

.back {

animation: spinBack 8s linear infinite;

.front {

animation: spinFront 8s linear infinite reverse;

@keyframes spinFront {

from { transform: rotate(0deg); }

to { transform: rotate(360deg); }

}
@keyframes spinBack {

from { transform: rotate(0deg); }

to { transform: rotate(360deg); }

<!DOCTYPE html>

<html>

<head>

<title>Simple Rotating Circles</title>

<link rel="stylesheet" href="[Link]">

</head>

<body>

<!-- Back layer -->

<div class="circle back"></div>

<!-- Front layer -->

<div class="circle front"></div>

</body>

</html>

body {

background-color: white;

height: 100vh;

margin: 0;
display: flex;

justify-content: center;

align-items: center;

position: relative;

.circle {

position: absolute;

border-radius: 50%;

.back {

width: 200px;

height: 200px;

background-color: lightgray;

animation: spinBack 5s linear infinite;

.front {

width: 100px;

height: 100px;

background-color: blue;

animation: spinFront 5s linear infinite reverse;

}
@keyframes spinFront {

from { transform: rotate(0deg); }

to { transform: rotate(360deg); }

@keyframes spinBack {

from { transform: rotate(0deg); }

to { transform: rotate(360deg); }

You might also like