Canvas Frustratingly Covers Headline

Several months ago, I successfully created my portfolio. However, upon revisiting the code after six months, I encountered issues with its functionality. Previously, text would display above a canvas using scrollmagic.js, and while the inspector shows that the opacity is still changing, the content itself remains invisible. This problem persists in both Safari and Chrome.

Below are relevant parts of the code that may be causing this error:

<section id="wrapper">
    <canvas class="canvasScreen intro">
      <h1 class="hideit hello"><span class="head1">Dream.</span><span class="head2">Create.</span></h1>
      
      <h1 class="showme">Hi, I'm XXX. <br/>
      Media & Interaction Design Student. <br/>
      I want to dream new interesting ideas and create fascinating tech.
      </h1>
      <div class="hideit container">
        <div class="chevron"></div>
        <div class="chevron"></div>
        <div class="chevron"></div>
        </div>
      </canvas>
    </section>

I attempted to rectify the problem by adding the wrapper element without success. Additionally, adjusting the z-index did not resolve the issue either.

.canvasScreen{
  z-index: -1;
  height: 100vh !important;
  width: 100vw !important;
}


.hello{
    z-index: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: Poppins, sans-serif;
    font-weight: 700;
    font-size: 10vw;
    color: white;
    text-decoration: none;
}

.showme{
  z-index: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: Poppins, sans-serif;
  font-weight: 700;
  font-size: 1.5vw;
  color: white;
  text-decoration: none;
  padding: 0;
  opacity: 0;
}

#wrapper{
  min-height: 350vh;

}

If necessary (although it appears to work):

//TEXTANIMATION
const textAnim = TweenMax.fromTo(text, 3, {opacity: 1}, {opacity: 0});

const scene2 = new ScrollMagic.Scene({
    triggerElement: wrapper,
    triggerHook: 0,
    duration: 800,
})
.setTween(textAnim)
.addTo(controller)

No error codes are being displayed. Does anyone have insight into what might be causing this issue?

Answer №1

I successfully relocated the Text from the Canvas in HTML, which has restored its functionality to how it was previously.

<section id="wrapper">
    <canvas class="canvasScreen intro">
      </canvas>
      <h1 class="hideit hello"><span class="head1">Dream.</span><span class="head2">Create.</span></h1>
      
      <h1 class="showme">Hi, I'm XXX. <br/>
      Media & Interaction Design Student. <br/>
      I want to dream new interesting ideas and create fascinating tech.
      </h1>
      <div class="hideit container">
        <div class="chevron"></div>
        <div class="chevron"></div>
        <div class="chevron"></div>
        </div>
    </section>

Although the reasons for its previous malfunction remain unclear, I am pleased that it is now functioning properly once more. Hopefully, this solution may be of assistance to others in similar situations in the future :)

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

simultaneous image hover effect for all images

I am experiencing an issue with my CSS and Bootstrap hover effect. The overlay tags are enclosed within a div class, but they all hover simultaneously. Each overlay belongs to a different Bootstrap grid, yet the effect extends even to the empty spaces betw ...

Can someone provide guidance on how to properly format the Jquery Datepicker?

Seeking guidance on how to customize the Jquery datepicker format. My goal is to have it display as dd/mm/yyyy exclusively, but currently, it is showing as mm/dd/yyyy. I attempted this solution without success: $(function() { $( "#datepicker" ...

Extra horizontal spacing in CSS

Struggling to eliminate the excess horizontal space on my HTML/CSS page. Any thoughts on what might be causing this? Appreciate any help! ...

I need assistance in making my Gradient design compatible with different browsers

Currently, I am using this Gradient style: background: -moz-linear-gradient(center top , #FFFFFF 0px, #DDDDDD 100%) repeat scroll 0 0 transparent; However, I need a multi-browser compatible version of it. Can anyone help me with that? ...

Basic AJAX request not functioning properly

I am encountering an issue with a very simple AJAX call on my localhost. I am using a Windows 10 Machine with XAMPP running. I have checked the packages, and it seems that the AJAX request is not being sent to handle.php. Can someone help me figure out wha ...

Prettyprint XML in Angular 8+ without using any external libraries

I am working with Angular 8+ and I need to display XML content in a nicely formatted way on my HTML page. The data is coming from the backend (Java) as a string, and I would like to present it in its XML format without relying on any external libraries or ...

Real-time data feeds straight from JSON

Currently, I have a JSON file that is generated dynamically and it contains match information along with a unique id. This JSON data is categorized into live, upcoming, and recent arrays. Being new to Javascript, I am unsure about the best approach to crea ...

How can I combine multiple styles using Material-UI themes in TypeScript?

There are two different styles implementations in my code. The first one is located in global.ts: const globalStyles = (theme: Theme) => { return { g: { marginRight: theme.spacing(40), }, } } export const mergedStyle = (params: any) ...

Mastering the art of properly connecting Angular HttpPromise

Recently, I encountered an angular Service containing a crucial function: service.getItemByID = function(id) { var hp = $http({method: "GET", url: "service/open/item/id", headers: {"token": $rootScope.user.token}, para ...

Why won't setInterval function properly with innerHTML?

I've been attempting to include a small feature on my website that displays the running seconds, but for some reason my JavaScript function isn't working. Strangely, it's not throwing any errors either. Here's the code I'm using: f ...

Top Method for Incorporating Syntax Highlighting into Code Blocks - React Sanity Blog

I'm currently exploring the most effective method to incorporate syntax highlighting into my react sanity.io blog. Here's a look at the article component I've developed using react: import React, {useEffect, useState} from "react"; import ...

Modify the data displayed on the chart by choosing the desired year from the dropdown options

In my Angular app, I am showcasing a chart that visualizes data based on selected starting and ending years from dropdown menus. The X axis represents 18 cities, while the Y axis displays "IAP" values. To calculate the "IAP" values for each city within the ...

Can 'fr' units be used in the `calc()` function of CSS?

In this particular scenario, the query arises whether the CSS calc() function extends its support to the fr unit as presented in the below example? .sample-grid { --main-fr: 60fr; grid-template-columns: var(--main-fr) 1rem calc(100 - var(--main-fr ...

What are the alternative methods to execute a React.js application without using react-scripts?

After creating my React.js app using the command below: npx create-react-app my-app I'm now looking to modify the package.json script section to run the app without react-scripts. How can I achieve this? "scripts": { "start&quo ...

Error encountered: Exceeded maximum update depth in Material UI Data Grid

Encountering an error or warning when inputting rows in the table that is causing the screen to freeze. Warning: Maximum update depth exceeded. This issue can arise when a component triggers setState within useEffect, but useEffect doesn't have a de ...

Utilizing jQuery to place an element beside another and maintain its position

I need ElementA to be positioned next to ElementB as shown in this example. The key difference is that I want ElementA to move along with ElementB if the latter is relocated. Is there a way to keep a specific element fixed to another one? Re-calculating ...

Storing API data in localStorage using VueJS: A step-by-step guide

As I work on practicing building a simple SPA with VueJS, one of my current tasks involves listening to an API and storing certain data in the browser's localStorage. However, my experience with VueJS is still limited, so I'm unsure about how to ...

Creating word spacing in CSS paired with a navigation menu using Dreamweaver

As a beginner in Dreamweaver, CSS, and HTML, I may have made some mistakes or overlooked simple solutions. I am currently struggling with how to separate words in my navigation menu, as they always appear centered. Despite trying adjustments like "word-spa ...

The fade-in effect will initiate from the start once the mouse leaves the element (with a

Currently, I am in search of a solution for improving the navigation menu I am developing. By clicking on this JSFiddle link, you can view the code in action. The issue I am facing is that the fadeIn effect should only occur when hovering over the nav-ite ...

Attempting to render an image onto a canvas and apply Caman.js for image editing purposes

Currently, I have a code snippet that allows me to draw an image onto a canvas. Here is the code: var imageLoader = document.getElementById('imageLoader'); imageLoader.addEventListener('change', handleImage, false); var ...