Skip to content

Commit

Permalink
Merge pull request #670 from Swaim-Sahay/Advanced-Dancing-Animation-t…
Browse files Browse the repository at this point in the history
…utorial

Advanced dancing animation tutorial
  • Loading branch information
aayush105 authored Oct 25, 2024
2 parents 20a7f87 + b23c7a1 commit fe15981
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 0 deletions.
125 changes: 125 additions & 0 deletions Advanced Dancing Animation-tutorial/Advanced Dancing Animation.html
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>
1 change: 1 addition & 0 deletions Advanced Dancing Animation-tutorial/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
this is advanced dancing animation tutorial.

0 comments on commit fe15981

Please sign in to comment.