Skip to content

Commit

Permalink
fix hover box
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemalqueza committed Mar 31, 2024
1 parent 0830668 commit 2d1ec13
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion script.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
document.addEventListener("DOMContentLoaded", function() {
var overlays = document.querySelectorAll('.overlay');
var overlays = document.querySelectorAll('.box');
overlays.forEach(function(overlay) {
overlay.addEventListener('mouseenter', function() {
overlay.querySelector('p').style.display = 'block';
Expand Down
17 changes: 12 additions & 5 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,16 @@ header .nav-links {
justify-content: center;
align-items: center;
flex-wrap: wrap;
margin: 40px 0;
margin: 40px auto;
max-width: calc(200px * 10 + 20px * 10);
}
.container .card {
position: relative;
width: 200px;
height: 280px;
background: rgba(255, 172, 63, 0.212);
margin: 20px;
box-shadow: 0 15px 35px rgba(155, 50, 1, 0.493);
box-shadow: 0 15px 35px rgba(155, 50, 1, 0.317);
display: flex;
justify-content: center;
align-items: center;
Expand Down Expand Up @@ -315,9 +316,15 @@ section h2 {
opacity: 0;
}

.overlay:hover p,
.overlay:hover a {
opacity: 1; /* Mostrar el texto y el enlace al hacer hover */
.box:hover p,
.box:hover a {
opacity: 1;
}

.box p,
.box a {
opacity: 0;
transition: opacity 0.5s ease;
}

.overlay a:hover {
Expand Down

0 comments on commit 2d1ec13

Please sign in to comment.