Greetings everyone! This is my debut post on this platform, and I'm in urgent need of assistance as I am relatively new to the world of programming.
I've been trying tirelessly to implement a hover effect on these cards, but for some reason, it just won't cooperate. I experimented with adding the hover effect to various classes without success. It seemed to be functioning well until certain modifications were made to the Bootstrap responsive elements (col-md, col-lg, etc).
Below is the Svelte component code for your perusal:
<h1 class="text-center text-light my-5 animate__animated animate__fadeInDown">
Projects
</h1>
<div class="container mt-5">
<div class="row justify-content-center align-items-center">
<div class="col-lg-3 col-md-4 col-sm-6 mb-4">
<div
class="card bg-black text-light border-opacity-25 border-light animate__animated animate__fadeInLeft"
>
<!-- svelte-ignore a11y-img-redundant-alt -->
<img
class="card-img-top object-fit-fill"
width="150"
height="150"
src="/img/justme.webp"
alt="Card image"
/>
<div class="card-body">
<strong
class="card-text d-flex justify-content-center align-items-center"
>This Portfolio</strong
>
<hr />
<div
class="container d-flex justify-content-between align-content-center my-2"
>
<img src="/img/svelte.svg" height="40" alt="Svelte" />
<img src="/img/javascript.svg" height="40" alt="JavaScript" />
<img src="/img/bootstrap.svg" height="40" alt="Bootstrap" />
</div>
</div>
</div>
</div>
<!-- Add more cards here with the same structure -->
<div class="col-lg-3 col-md-4 col-sm-6 mb-4">
<div
class="card bg-black text-light border-opacity-25 border-light animate__animated animate__fadeInLeft"
>
<!-- svelte-ignore a11y-img-redundant-alt -->
<img
class="card-img-top object-fit-fill"
width="150"
height="150"
src="/img/countries.webp"
alt="Card image"
/>
<div class="card-body">
<strong
class="card-text d-flex justify-content-center align-items-center"
>Countries App</strong
>
<hr />
<div
class="container d-flex justify-content-between align-content-center my-2"
>
<img src="/img/angular.svg" height="40" alt="Angular" />
<img src="/img/typescript.svg" height="40" alt="TypeScript" />
<img src="/img/bootstrap.svg" height="40" alt="Bootstrap" />
</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-4 col-sm-6 mb-4">
<a href="">
<div
class="card bg-black text-light border-opacity-25 border-light animate__animated animate__fadeInRight"
>
<!-- svelte-ignore a11y-img-redundant-alt -->
<img
class="card-img-top object-fit-cover"
width="150"
height="150"
src="/img/giphy.webp"
alt="Card image"
/>
<div class="card-body">
<strong
class="card-text d-flex justify-content-center align-items-center"
>GIFs App</strong
>
<hr />
<div
class="container d-flex justify-content-between align-content-center my-2"
>
<img src="/img/angular.svg" height="40" alt="Angular" />
<img src="/img/typescript.svg" height="40" alt="TypeScript" />
<img src="/img/bootstrap.svg" height="40" alt="Bootstrap" />
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-3 col-md-4 col-sm-6 mb-4" id="carta">
<div
class="card bg-black text-light border-opacity-25 border-light animate__animated animate__fadeInRight"
>
<!-- svelte-ignore a11y-img-redundant-alt -->
<img
class="card-img-top object-fit-cover"
width="150"
height="150"
src="/img/twitterdb.webp"
alt="Card image"
/>
<div class="card-body">
<strong
class="card-text d-flex justify-content-center align-items-center"
>Twitter Database</strong
>
<hr />
<div
class="container d-flex justify-content-center align-content-center my-2"
>
<img src="/img/mysql.svg" height="40" alt="MySQL" />
</div>
</div>
</div>
</div>
<!-- Add more cards here with the same structure -->
</div>
</div>
<style>
.card {
height: auto;
max-width: 280px;
min-width: 160;
overflow: hidden;
border-radius: 15px;
background-image: linear-gradient(
135deg,
rgb(255, 255, 255, 15%),
rgb(21, 25, 31, 0%)
);
transition: transform 0.2s ease, filter 0.2s ease;
}
.card:hover {
filter: drop-shadow(0 0 0px rgb(255, 255, 255, 100%));
transform: scale(1.05);
}
@media (max-width: 767px) {
.row {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
.col-sm-6 {
flex-basis: 50%;
}
}
</style>
Your insights and guidance on why the hover effect seems to have stopped working would be immensely appreciated.
Thank you in advance, and please pardon any language errors as English is not my native tongue (I'm from Spain).
Despite my efforts to include the hover effect in almost all divs, nothing seems to yield positive results.