Skip to content

Commit

Permalink
Add bloom
Browse files Browse the repository at this point in the history
  • Loading branch information
l-jost committed Sep 25, 2023
1 parent 747cae1 commit cad87c9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
16 changes: 14 additions & 2 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ header {
background-size: cover;
background-position: bottom;
color: #fff;
padding: 100px;
padding: 130px;
text-align: center;
}

Expand Down Expand Up @@ -51,4 +51,16 @@ footer {

.show {
opacity: 1;
}
}

.cursor {
position: absolute;
width: 70%;
height: 70%;
opacity: 0.05;
border-radius: 100%;
background: radial-gradient(circle, #fff, transparent 50%);
pointer-events: none;
transform: translate(-50%, -50%);
transition: width 0.15s, height 0.15s, opacity 0.15s;
}
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ <h3>Luca Jost</h3>
</section>
</header>
<main class="container-fluid">
<div class="cursor"></div>
<!-- First Project -->
<section class="hidden">
<div class="row justify-content-center">
Expand Down
18 changes: 18 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,21 @@ const observer = new IntersectionObserver(entries => {

const hiddenElements = document.querySelectorAll('.hidden')
hiddenElements.forEach(element => observer.observe(element))

document.addEventListener('mousemove', (e) => {
// Update the cursor position to follow the mouse
cursor.style.left = e.pageX + 'px'
cursor.style.top = e.pageY + 'px'
})

document.addEventListener('mouseenter', () => {
// Show the cursor when it enters the document
cursor.style.opacity = 0.05
})

document.addEventListener('mouseleave', () => {
// Hide the cursor when it leaves the document
cursor.style.opacity = 0
})

const cursor = document.querySelector('.cursor')

0 comments on commit cad87c9

Please sign in to comment.