-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #670 from Swaim-Sahay/Advanced-Dancing-Animation-t…
…utorial Advanced dancing animation tutorial
- Loading branch information
Showing
2 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
125 changes: 125 additions & 0 deletions
125
Advanced Dancing Animation-tutorial/Advanced Dancing Animation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Advanced Dancing Animation</title> | ||
<style> | ||
/* Keyframes for the dance animation */ | ||
@keyframes dance-move { | ||
0%, 100% { | ||
transform: rotate(0deg) translateY(0); | ||
} | ||
25% { | ||
transform: rotate(-10deg) translateY(-10px); | ||
} | ||
50% { | ||
transform: rotate(0deg) translateY(0); | ||
} | ||
75% { | ||
transform: rotate(10deg) translateY(-10px); | ||
} | ||
} | ||
|
||
@keyframes arm-move { | ||
0%, 100% { | ||
transform: rotate(0deg); | ||
} | ||
50% { | ||
transform: rotate(20deg); | ||
} | ||
} | ||
|
||
@keyframes leg-move { | ||
0%, 100% { | ||
transform: rotate(0deg); | ||
} | ||
50% { | ||
transform: rotate(-20deg); | ||
} | ||
} | ||
|
||
/* Container for the character */ | ||
.character { | ||
position: relative; | ||
width: 100px; | ||
height: 200px; | ||
margin: 100px auto; | ||
animation: dance-move 1s infinite; | ||
} | ||
|
||
/* Head of the character */ | ||
.head { | ||
width: 60px; | ||
height: 60px; | ||
background-color: #FFD700; | ||
border-radius: 50%; | ||
position: absolute; | ||
top: 0; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
} | ||
|
||
/* Body of the character */ | ||
.body { | ||
width: 30px; | ||
height: 80px; | ||
background-color: #4CAF50; | ||
position: absolute; | ||
top: 60px; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
} | ||
|
||
/* Arms of the character */ | ||
.arm { | ||
width: 20px; | ||
height: 60px; | ||
background-color: #4CAF50; | ||
position: absolute; | ||
top: 60px; | ||
transform-origin: top; | ||
animation: arm-move 1s infinite; | ||
} | ||
|
||
.arm-left { | ||
left: 0; | ||
} | ||
|
||
.arm-right { | ||
right: 0; | ||
} | ||
|
||
/* Legs of the character */ | ||
.leg { | ||
width: 20px; | ||
height: 80px; | ||
background-color: #4CAF50; | ||
position: absolute; | ||
top: 140px; | ||
transform-origin: top; | ||
animation: leg-move 1s infinite; | ||
} | ||
|
||
.leg-left { | ||
left: 20px; | ||
} | ||
|
||
.leg-right { | ||
right: 20px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<div class="character"> | ||
<div class="head"></div> | ||
<div class="body"></div> | ||
<div class="arm arm-left"></div> | ||
<div class="arm arm-right"></div> | ||
<div class="leg leg-left"></div> | ||
<div class="leg leg-right"></div> | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
this is advanced dancing animation tutorial. |