Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding fan Animation himanshu-sheetlani #2575

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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/himanshu-sheetlani/Fan Animation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
115 changes: 115 additions & 0 deletions Art/himanshu-sheetlani/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>himanshu-sheetlani</title>
<link rel="stylesheet" href="./style.css">
<link rel="shortcut icon" href="https://rebrand.ly/13idvhf" type="image/x-icon">
</head>
<body>
<div class="fan">
<div class="circle">
<img src="https://rebrand.ly/13idvhf" alt="fan">
</div>
</div>
<div class="btn">
<a class="btn1 b" onclick="on()">ON</a>
<a class="btn2 b" onclick="s1()">1</a>
<a class="btn3 b" onclick="s2()">2</a>
<a class="btn4 b" onclick="s3()">3</a>
</div>

<!-- script to change styling -->
<script>
let img= document.querySelector(".circle img")
let btn1= document.querySelector(".btn1")
let btn2= document.querySelector(".btn2")
let btn3= document.querySelector(".btn3")
let btn4= document.querySelector(".btn4")
btn1.style.backgroundColor="red"
function on(){

console.log("function called")
if(btn1.style.backgroundColor=="red"){
console.log("text is on")
btn1.innerText="OFF"
btn1.style.backgroundColor="green";
img.style.animationDuration="2s"
btn1.style.fontSize="20px"
btn2.style.backgroundColor="rgb(82, 82, 82)"
btn3.style.backgroundColor="grey"
btn4.style.backgroundColor="grey"
btn2.style.color="white"
btn3.style.color="black"
btn4.style.color="black"
btn2.style.boxShadow="0 0"
btn3.style.boxShadow="inset white 0px 6px 9px 0px"
btn4.style.boxShadow="inset white 0px 6px 9px 0px"
}else{
btn1.style.backgroundColor="red";
btn1.innerText="ON"
img.style.animationDuration="0s"
btn1.style.fontSize="25px"
btn2.style.backgroundColor="grey"
btn3.style.backgroundColor="grey"
btn4.style.backgroundColor="grey"
btn2.style.color="black"
btn3.style.color="black"
btn4.style.color="black"
btn2.style.boxShadow="inset white 0px 6px 9px 0px"
btn3.style.boxShadow="inset white 0px 6px 9px 0px"
btn4.style.boxShadow="inset white 0px 6px 9px 0px"
}
}
function s1(){
if(btn1.style.backgroundColor=="green"){
img.style.animationDuration="2s"
btn2.style.backgroundColor="rgb(82, 82, 82)"
btn3.style.backgroundColor="grey"
btn4.style.backgroundColor="grey"
btn2.style.color="white"
btn3.style.color="black"
btn4.style.color="black"
btn2.style.boxShadow="0 0"
btn3.style.boxShadow="inset white 0px 6px 9px 0px"
btn4.style.boxShadow="inset white 0px 6px 9px 0px"
}else{
alert("Press ON Button First")
}
}
function s2(){
if(btn1.style.backgroundColor=="green"){
img.style.animationDuration="1s"
btn3.style.backgroundColor="rgb(82, 82, 82)"
btn2.style.backgroundColor="grey"
btn4.style.backgroundColor="grey"
btn3.style.color="white"
btn2.style.color="black"
btn4.style.color="black"
btn3.style.boxShadow="0 0"
btn2.style.boxShadow="inset white 0px 6px 9px 0px"
btn4.style.boxShadow="inset white 0px 6px 9px 0px"
}else{
alert("Press ON Button First")
}
}
function s3(){
if(btn1.style.backgroundColor=="green"){
img.style.animationDuration=".5s"
btn4.style.backgroundColor="rgb(82, 82, 82)"
btn3.style.backgroundColor="grey"
btn2.style.backgroundColor="grey"
btn4.style.color="white"
btn3.style.color="black"
btn2.style.color="black"
btn4.style.boxShadow="0 0"
btn3.style.boxShadow="inset white 0px 6px 9px 0px"
btn2.style.boxShadow="inset white 0px 6px 9px 0px"
}else{
alert("Press ON Button First")
}
}
</script>
</body>
</html>
78 changes: 78 additions & 0 deletions Art/himanshu-sheetlani/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
body{
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
width: 100vw;
font-size: 25px;
font-family: Arial, Helvetica, sans-serif;
}

.circle{
width: 300px;
height: 300px;
border: 5px double black;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}

.circle img{
height: 250px;
width: 250px;
animation: spin infinite linear;
animation-duration: 0s;
rotate: 360deg;
}

.btn{
margin: 100px;
width: 30vw;
display: flex;
flex-direction: row;
justify-content: space-around;

}

.b{
height: 50px;
width: 50px;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
background: grey;
border: 1px solid black;
cursor: pointer;
box-shadow: inset white 0px 6px 9px 0px;
}

.b:hover{
background: rgb(82, 82, 82);
border: 1px solid black;
box-shadow: 0 0 0;
color: #fff;
}

.btn1{
background-color: red;
color: #fff;
}

.btn1:hover{
background-color: red;
box-shadow: 0 0 0;
}

@keyframes spin{
0%{
rotate: 360deg;
}
100%{
rotate: 0deg;
}
}
7 changes: 7 additions & 0 deletions include.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
let cards = [
{
artName: 'Fan Animation',
pageLink: './Art/himanshu-sheetlani/index.html',
imageLink: './Art/himanshu-sheetlani/Fan Animation.gif',
author: 'Himanshu Sheetlani',
githubLink: 'https://github.com/himanshu-sheetlani'
},
{
artName: 'Balls Animation',
pageLink: './Art/vikasverma67/Animation1/index.html',
Expand Down