Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
JEETAHIRWAR committed Apr 11, 2024
1 parent 6d3d90c commit a8dfaa0
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 6 deletions.
20 changes: 20 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,26 @@ window.addEventListener('DOMContentLoaded', () => {

secondCon.appendChild(imagesBox);

// const imagesBox = document.querySelector('.imagesBox');
const num = document.createElement('span');
num.classList.add('number');
// num.textContent = `0${item.id}`;
if (item.id < 10) {
num.textContent = `0${item.id}`;
} else {
num.textContent = item.id;
}
imagesBox.appendChild(num);

imagesBox.addEventListener('mouseenter', () => {
num.style.visibility = 'visible';
});

imagesBox.addEventListener('mouseleave', () => {
num.style.visibility = 'hidden';
});


imagesBox.addEventListener('click', () => {
const container1 = document.getElementById('container1');
container1.style.backgroundImage = `url(${item.image})`;
Expand Down
42 changes: 36 additions & 6 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ html {
font-variation-settings:
"XROT" 0,
"YROT" 0;

/* cursor: url(myBall.cur), auto; */
}

main {
Expand Down Expand Up @@ -130,7 +132,9 @@ main {
.imagesBox {
min-width: 35%;
height: 100%;
display: flex;
/* display: flex; */
display: inline-block;
position: relative;
justify-content: center;
align-items: center;
border-radius: 10px;
Expand All @@ -144,10 +148,34 @@ main {
margin-left: 0px;
}

.imagesBox:hover {
/* .imagesBox:hover {
cursor: pointer;
} */


.number {
position: absolute;
top: 5px;
left: 5px;
background-color: rgba(0, 0, 0, 0.2);
/* color: white; */
color: #E1F0DA;
/* padding: 5px 6px; */
width: 177px;
height: 227px;
border-radius: 10px;
visibility: hidden;
font-size: 6rem;
font-family: "Libre Baskerville", serif;
font-weight: 900;
opacity: 0.7;
}

/* .imagesBox:hover .number {
visibility: visible;
z-index: 1;
} */


.scroll-left {
position: absolute;
Expand All @@ -163,17 +191,17 @@ main {
background-color: #BC7FCD;
}

.fa-circle-arrow-left {
/* .fa-circle-arrow-left {
margin-top: 2px;
}
} */


.con3 {
position: absolute;
width: 35%;
height: 20px;
bottom: 20px;
right: 240px;
bottom: 4%;
right: 17%;
display: flex;
flex-direction: column;
justify-content: center;
Expand Down Expand Up @@ -201,6 +229,8 @@ main {
/* color: #BC7FCD; */
color: crimson;
margin-right: 5px;
margin-left: 5px;
/* font-size: 24px; */
}

#container2 {
Expand Down

0 comments on commit a8dfaa0

Please sign in to comment.