Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Art/riya010107-tree/icon.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions Art/riya010107-tree/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="styles.css" />
<title>Tree Animation</title>
</head>
<body>
<div class="tree"></div>
</body>
</html>

4 changes: 4 additions & 0 deletions Art/riya010107-tree/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"artName": "tree",
"githubHandle": "Riya010107"
}
41 changes: 41 additions & 0 deletions Art/riya010107-tree/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: rgb(240, 240, 240);
}

/* Tree image setup */
.tree {
width: 200px;
height: 250px;
background-image: url("tree.png");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
animation-name: sway-tree;
animation-duration: 4s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
transform-origin: bottom center; /* makes the sway look natural */
}

/* Tree sway animation */
@keyframes sway-tree {
0% {
transform: rotate(0deg);
}
25% {
transform: rotate(3deg);
}
50% {
transform: rotate(0deg);
}
75% {
transform: rotate(-3deg);
}
100% {
transform: rotate(0deg);
}
}