"Unable to move past the initial segment due to an ongoing

My portfolio webpage includes a "blob" and "blur" effect inspired by this YouTube video (https://www.youtube.com/watch?v=kySGqoU7X-s&t=46s). However, I am encountering an issue where the effect is only displayed in the first section of the page. Even after adding content to the div, the effect remains confined to one section when scrolling through the page. How can I ensure that the "blob" and "blur" effect persists throughout the entire page?

If anyone has insights into why this behavior is occurring, I would greatly appreciate your input.

Answer №1

It may be more beneficial to utilize the CSS property of position: fixed. When positioned at the far right, the "blob" expands the site, allowing for vertical scrolling: https://i.stack.imgur.com/stpbv.png

const blob = document.getElementById("blob");
const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

// Touch pointer movement
window.onpointermove = event => {
    const { clientX, clientY } = event;

    // Blob animation
    blob.animate({
        left: `${clientX}px`,
        top: `${clientY}px`
    }, { duration: 3000, fill: "forwards" });
};

let interval = null;

// Hover effect on h1 tag
document.querySelector("h1").onmouseover = e => {
    let iterations = 0;
    
    interval = setInterval(() => {
        e.target.innerText =e.target.innerText.split("")
            .map((letter, index) => {
                if(index < iterations) {
                    return e.target.dataset.value[index];
                }
            
                return letters[Math.floor(Math.random() * 26)]
            })
            .join("");

        if(iterations >= e.target.dataset.value.length) {
            clearInterval(iterations);
        }

        iterations += 1 / 4;
    }, 30);
}
body {
    background-color: black;
    height: 100%;
    width: 100%;
    margin: 0rem;

    --scrollbar-width: 0.4rem;
    --light-color: aquamarine;
    --dark-color: mediumpurple;
}

html {
    scroll-behavior: smooth;
}

@keyframes rotate {
    from {
        rotate: 0deg;
    }
    50% {
        scale: 1 1.5;
    }
    to {
        rotate: 360deg;
    }
}

#blob {
    background-color: white;
    height: 34vmax;
    aspect-ratio: 1;
    position: fixed;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    border-radius: 50%;
    background: linear-gradient(to right, aquamarine, mediumpurple);
    animation: rotate 20s infinite;
    opacity: 0.8;
  }

#blur {
    height: 100%;
    width: 100%;
    z-index: 2;
    backdrop-filter: blur(12vmax);
}

h1 {
    font-family: 'Space Mono', monospace;
    font-size: clamp(3rem, 10vw, 10rem);
    color: white;
    padding: 0rem clamp(1rem, 2vw, 3rem);
    border-radius: clamp(0.4rem, 0.75vw, 1rem);
    margin: 0rem;
    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    z-index: 4;
}

h2 {
    font-family: 'Space Mono', monospace;
    font-size: clamp(1rem, 5vw, 5rem);
    color: aquamarine;
    padding: 0rem clamp(1rem, 2vw, 3rem);
    border-radius: clamp(0.4rem, 0.75vw, 1rem);
    margin: 0rem;
    position: absolute;
    left: 50%;
    top: 63%;
    translate: -50% -50%;
    z-index: 4;
}

li, a, button {
    font-family: 'Space Mono', monospace;
    font-weight: 500;
    font-size: 16px;
    color: #ecf0f1;
    text-decoration: none;
}

header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 30px 10%;
    width: 80%;
    top: 0;
    left: 0;
    z-index: 2;
    backdrop-filter: blur(12vmax);
    background-color: transparent;
}

.show {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0);
}

.logo {
    cursor: pointer;
    order: 3;
    margin-left: auto;
    height: 50px;
}

.nav_links {
    list-style: none;
}

.nav_links li {
    display: inline-block;
    padding: 0px 20px;
}

.nav_links li a {
    transition: all 0.3s ease 0s;
    font-family: 'Space Mono', monospace;
}

.nav_links li a:hover {
    color: aquamarine;
}

button {
    margin-left: 20px;
    padding: 9px 25px;
    background-color: mediumaquamarine;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease 0s;
    font-family: 'Space Mono', monospace;
}

button:hover {
    background-color: var(--dark-color);
}

::-webkit-scrollbar {
    width: var(--scrollbar-width);
  }
  
::-webkit-scrollbar-track {
    background: var(--dark-color);
  }
  
::-webkit-scrollbar-thumb {
    background: var(--light-color);
}

h3 {
    color: var(--light-color);
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.5rem, 2vw, 2rem);
    padding: 0rem clamp(1rem, 2vw, 3rem);
}

.spacer {
    margin: 10vh 0;
    height: 1px;
}

.section {
    background-color: transparent;
    z-index: 4;
    top: 100%;
    scroll-behavior: smooth;
    transition: 0.5s;
}

.about {
    display: flex;
    gap: 2rem;
    color: white;
    font-family: 'Space Mono', monospace;
}

.about p {
    width: 30%;
    align-items: center;
    text-align: center;
}


.highlight {
    color: var(--light-color);
}

th {
    color: var(--light-color);
    font-family: 'Space Mono', monospace;
}

tr td {
    color: white;
    font-family: 'Space Mono', monospace;
}

table {
    width: 45%;
    text-align: center;

}

.socials-images img {
    height: 60px;
    background-color: var(--light-color);
}

.socials-images li {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
}  

.socials-images p {
    font-family: 'Space Mono', monospace;
    font-size: larger;
}
<div class="wrapper">
  <div id="blob"></div>
  <div id="blur">
    <header>
      <img class="logo" src="images/logo.png" alt="logo">
      <nav>
        <ul class="nav_links">
          <li><a href="#about">About me</a></li>
          <li><a href="#projects">Projects</a></li>
          <li><a href="#socials">Socials</a></li>
        </ul>
      </nav>
      <a class="cta" href="#"><button>Contact</button></a>
    </header>
    <div class="container">
      <h1 data-value="FRONTEND">FRONTEND</h1>
      <h2>Zsolt Pál</h2>
    </div>
    <div class="spacer"></div>
    
    <div class="section">
      <div class="spacer"></div>
      <div class="about">
        <div class="section-header">
          <h3 id="about">About Me</h3>
          <div class="spacer"></div>
        </div>
        <p>In High school there wasn't any programming or developing teaching for me, so I've decided to take matter in my own hands. After a few weeks I've instantly fell in love with <span class="highlight">front-end</span> developing.</p>
        <p>Being able to create and modify <span class="highlight">webpages</span> and <span class="highlight">web applicitations</span> are are a huge interest in my life since then. I'm always looking up for new <span class="highlight">methods</span> and <span class="highlight">creative ideas</span>.</p>
        <p>Currently I am looking for a <span class="highlight">Junior</span> or a <span class="highlight">Trainee</span> job.</p>
      </div>
      <div class="spacer"></div>
      <div class="projects">
        <div class="section-header">
          <h3 id="projects">Projects</h3>
        </div>
        <div class="spacer"></div>
        <table>
          <tr>
            <th>
              These are the projects that I've been envolved in.
            </th>
            <th>
              Some information about them.
            </th>
          </tr>
          <tr>
            <td><span class="hightlight">Name</span></td>
            <td><span class="hightlight">Function</span></td>
          </tr>
          <tr>
            <td>Wiki about Cars</td>
            <td>Basically you are able to search for any car and make at this website, and it gives you back a bunch of information about the searched car.</td>
          </tr>
        </table>
      </div>
      <div class="spacer"></div>
      <div class="socials">
        <div class="section-header">
          <h3 id="socials">Socials</h3>
        </div>
        <div class="spacer"></div>
        <div class="socials-images">
          <ul>
            <li class="social-image"><img src="images/twitter.png" alt="twitter">
              <p><a href="https://twitter.com/palimadarxd">Twitter</a></p>
            </li>
            <li class="social-image"><img src="images/instagram.png" alt="instagram">
              <p><a href="https://www.instagram.com/zsota02/?hl=en">Instagram</a></p>
            </li>
            <li class="social-image"><img src="images/github.png" alt="github">
              <p><a href="https://github.com/zsoltp2">Github</a></p>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Are you encountering issues with retrieving $http results from the cache?

During my initial $http requests, I am saving the results in cache using two functions in my controller. Both functions call the same function in a service which handles the $http request. The first function successfully saves the results in cache, but whe ...

Navigating through content on a screen can be accomplished in two

Is it feasible to incorporate both horizontal and vertical scrolling on a website using anchor tags? I recently created a website with horizontal scrolling for each main page. Within some of these main pages, there are subsections that I would like to hav ...

Angular's focus function poses certain challenges that need to be addressed

I am seeking assistance as a new programmer facing a beginner's challenge. I have two inputs and I would like to enter a series of numbers in the first input (DO) and have them automatically populate in the second input (communal code). Inputs: http ...

Setting up node.js for angular - serving static files with connect.static and running unit tests

Currently, I am in the process of setting up a basic node webserver by following a tutorial outlined in Pro AngularJS published by Apress. Node.js along with both the connect and karma modules have been successfully installed on my system. During the ins ...

"Exploring the usual progress of a standard GET request using Axios

My Objective: I am utilizing Vue And Axios, with the goal of displaying the progress in percentage on the console. The Challenge: The request itself takes around 4 seconds or more because it fetches a large amount of data, processes it into an excel fil ...

Restrict the height of posts created in the summernote editor

My goal is to create a structured page application using summernote. When using summernote, a div with contenteditable=true is appended to the body to allow users to add content. However, I want to set a fixed height for this div so that users can only ent ...

Guide to launching my application by clicking on a file from a local device using React Native

Currently, I am working with React Native and Expo. I have a file with a unique extension (let's say: SomeFileName.xxx) which contains some text. My goal is to open this file from the device in such a way that it launches the application (either on An ...

Clicking a button in jQuery to load the Pagemethods

<script type="text/javascript"> $(document).ready(function() { $('#loadbtn').click(function() { // can 't load opts = { title: 'ABCD', series: [{ ...

Anomalous Snackbar and Alert Interactions

Why am I getting an error with this code snippet: import Snackbar from "@mui/material/Snackbar"; import MuiAlert from "@mui/material/Alert"; const Alert = ({children}) => <MuiAlert>{children}</MuiAlert> <Snackbar ope ...

Toggle Jquery feature will dynamically add the "required" attribute to the input field when the specified div is visible, and it will automatically remove the attribute when the div

I am new to using jQuery and I am facing an issue with my code. I want to make a checkbox act as a toggle with jQuery. When the checkbox is clicked and the toggle displays the div, I want to add the required attribute to the checkbox input. Similarly, when ...

Using an npm package to include CSS styles in a stylesheet

I created an NPM package that includes a CSS file that needs to be included in my main CSS file. In a typical HTML CSS website, I would need to write @import url("./node_modules/web-creative-fonts/index.css") but what I really want is to simplify ...

Setting up Vue CLI 4 with ESLint, TypeScript, Stylelint for SCSS, and Airbnb rules in the VS Code editor with automatic fixes on save

After struggling with configuring Vue CLI 4 with ESLint, Prettier, Airbnb rules, TypeScript, and Vetur, I found myself at a crossroads. The challenges continued to mount as the nature of the problem evolved from my previous attempts.: How to configure Vue ...

Transforming JSON data into an interactive table with HTML

After spending four days searching for a solution, I am still unable to figure out my problem. My goal is to convert a JSON string data retrieved from a URL into a dynamic table using JQuery and JavaScript. To achieve this, I need to load the JSON string ...

I need the links to open up the content area on the website in HTML

Is it possible to have a fixed header that does not disappear when clicking links from the navigation bar? I tried dividing the page into tables to achieve this. Now, I want to open the links in the navigation bar in the right column (the main content col ...

Should I specify each protected route in the middleware file in the matcher for NextJs 14?

Below is the middleware file I've implemented: import { NextResponse } from "next/server"; import { NextRequest } from "next/server"; import { getApiAuth } from "./app/middleware/api/auth"; const validateApi = (req: Requ ...

Using Angular 2: A Beginner's Guide to Navigating with the Latest Angular 2.0.0-rc.1 Router

As I embarked on a new Angular 2 project, I was puzzled to discover that I inadvertently installed two different versions of the angular router: "@angular/router": "2.0.0-rc.1", "@angular/router-deprecated": "2.0.0-rc.1", Despite my best efforts, I co ...

Mobile WEBSITE Development with Ionic Framework

Exploring the potential of utilizing the Ionic Framework for my mobile website has piqued my curiosity. Are there any concerns I should be aware of when running Ionic Framework on mobile browsers? My plan is to leverage the framework's CSS and JS capa ...

When moving from Babel version 5.8.35 to 6.0.0, be prepared for app.js to throw a SyntaxError and encounter an unexpected token during compilation

Currently, I am in the process of enhancing my ReactJS components using webpack. However, I have encountered a hurdle while trying to transition from babel version 5 to 6. Upon attempting the upgrade, it resulted in a stack trace error within my app.js cl ...

Discover the method to calculate the combined file size of multiple uploads with jquery

One of the challenges I'm facing is ensuring that users can only upload multiple files if the total size does not exceed 3GB. Is there a way I can enforce this limit? Below is the current code snippet I am using: var fileCount = 0; var showFileCo ...

Tips for importing extensions with Rselenium

I could use some assistance in understanding how to activate a chrome extension using RSelenium. The extensions are visible in the browser tabs but are not automatically loaded when working with RSelenium. ...