Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Add bloom #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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')
Loading