Issue
Here is my HTML and CSS:
.choosebybrand {
position: relative;
display: flex;
width: 100%;
height: auto;
justify-content: space-around;
flex-wrap: wrap;
background: linear-gradient(to bottom, #ffffff, whitesmoke);
margin-bottom: 0px;
text-align: center;
padding: 70px;
}
.choosebybrand img {
box-shadow: 0px 5px 20px 1px rgba(0, 0, 0, 1);
margin: 15px;
border-radius: 20px;
}
.choosebybrandtext h1 {
margin-top: 100px;
left: 50%;
text-align: center;
color: rgb(255, 0, 68);
font-size: 40px;
font-style: italic;
}
.choosebybrand h3 {
margin-top: 20px;
font-size: 20px;
font-family: 'Pacifico', 'cursive';
color: rgba(0, 0, 0, 0.2);
text-decoration: none;
}
.apple:hover h3,
.motorola:hover h3,
.lg:hover h3,
.samsung:hover h3,
.huawei:hover h3 {
cursor: pointer;
color: rgb(255, 0, 68);
transition: 1s;
}
a:hover {
text-decoration: none;
}
.icons a {
margin: 10px;
}
.progress-bar {
animation: pr 5s infinite;
background-color: red;
}
@keyframes pr {
0% {
width: 0;
color: red;
}
10% {
background-color: blue;
}
20% {
background-color: black;
}
30% {
background-color: yellow;
}
40% {
background-color: tomato;
}
50% {
width: 100%;
background-color: violet;
}
60% {
background-color: rgb(184, 145, 145);
}
70% {
background-color: white;
}
80% {
background-color: rgb(0, 255, 234);
}
100% {
width: 0;
background-color: red;
}
}
<div class="choosebybrandtext">
<h1>Choose by Brand</h1>
</div>
<div style="margin-top: 50px" data-aos="fade-in" class="choosebybrand">
<div class="samsung">
<a href="samsung.html">
<div class="frontimage">
<img src="images/samsung.png" height="232px" width="115px" alt="">
</div>
<h3>Samsung</h3>
</a>
</div>
<div class="apple">
<a href="apple.html">
<div class="frontimage">
<img src="images/apple.png" height="232px" width="115px" alt="">
</div>
<H3>Apple</H3>
</a>
</div>
<div class="lg">
<a href="lg.html">
<div class="frontimage">
<img src="images/LG.png" height="232px" width="115px" alt="">
</div>
<h3>Lg</h3>
</a>
</div>
<div class="motorola">
<a href="motorola.html">
<div class="frontimage">
<img src="images/Motorola.png" height="232px" width="115px" alt="">
</div>
<h3>Motorola</h3>
</a>
</div>
<div class="huawei">
<a href="huawei.html">
<div class="frontimage">
<img src="images/huawei.png" height="232px" width="115px" alt="">
</div>
<h3>Huawei</h3>
</a>
</div>
</div>
<div class="progress">
<div class="progress-bar"></div>
</div>
Solution
const element = document.querySelector(".element")
const progressBar = document.querySelector(".progress-bar")
element.addEventListener("mouseover", function() {
progressBar.style.animation = "pr 5s infinite"
})
Answered By - Bleron Mexhuani
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.