What is the best way to postpone the onset of a dynamic scrolling backdrop (CSS)?

I have a series of animations set to display one after the other in a specific sequence:

  1. Logo
  2. h1
  3. hr
  4. background starts scrolling upwards

By applying animation-fill-mode: backwards, each element is hidden until it is animated into view. I want the same effect for the background, so it only appears once all other animations are completed and then starts scrolling upwards.

/*Top Gif*/

.banner {
  position: relative;
  float: left;
  width: 100%;
  height: 400px;
  text-align: center;
}

.opening {
  display: block;
  background: url(http://subtlepatterns2015.subtlepatterns.netdna-cdn.com/patterns/footer_lodyas.png);
  animation: 100s scroll infinite linear;
  animation-delay: 3s;
  animation-fill-mode: background;
  margin: 2px 0 0 0;
}

.textBox {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.logo {
  width: 300px;
  margin-bottom: 20px;
}

.logo--animated {
  animation: popUp 1s ease-out;
}

.textBox h1 {
  color: #FFF;
  font-size: 60px;
  text-shadow: 0px 4px 3px rgba(0, 0, 0, 0.4), 0px 8px 13px rgba(0, 0, 0, 0.1), 0px 18px 23px rgba(0, 0, 0, 0.1);
  line-height: 50px;
  animation: moveInRight 0.7s ease-out;
  animation-delay: 1.2s;
  animation-fill-mode: backwards;
}

hr.style-two {
  border: 0;
  height: 3px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
  animation: moveInRight 0.4s ease-out;
  animation-delay: 1.9s;
  animation-fill-mode: backwards;
}

.textBox h4 {
  line-height: 10px;
  font-weight: normal;
  font-size: 20px;
  animation: moveInRight 0.6s ease-out;
  animation-delay: 2.3s;
  animation-fill-mode: backwards;
}


/*Animations*/

@keyframes scroll {
  100% {
    background-position: 0px -3000px;
  }
}

@keyframes popUp {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }
  100% {
    opacity: 1;
    transform: translateY(0px);
  }
}

@keyframes moveInRight {
  0% {
    opacity: 0;
    transform: translateX(-80px);
  }
  100% {
    opacity: 1;
    transform: translate(0);
  }
}
<div class="row">
  <div class="col-lg-12">
    <div class="banner opening">
      <div class="opening">
        <div class="textBox">
          <img class="logo logo--animated" src="logo.png">
          <h1>Title</h1>
          <hr class="style-two">
          <h4>Sub-Title</h4>
        </div>
      </div>
    </div>
  </div>
</div>

Answer №1

If you're looking to make the background image appear smoothly, give this a try.

/*Top Gif*/

.banner {
  position: relative;
  float: left;
  width: 100%;
  height: 400px;
  text-align: center;
}

.opening {

  animation-delay: 5s;
  display: block;
  animation: 100s scroll infinite linear;
  animation-delay: 3s;
  animation-fill-mode: forwards;
  margin: 2px 0 0 0;
}

.textBox {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.logo {
  width: 300px;
  margin-bottom: 20px;
}

.logo--animated {
  animation: popUp 1s ease-out;
}

.textBox h1 {
  color: #FFF;
  font-size: 60px;
  text-shadow: 0px 4px 3px rgba(0, 0, 0, 0.4), 0px 8px 13px rgba(0, 0, 0, 0.1), 0px 18px 23px rgba(0, 0, 0, 0.1);
  line-height: 50px;
  animation: moveInRight 0.7s ease-out;
  animation-delay: 1.2s;
  animation-fill-mode: backwards;
}

hr.style-two {
  border: 0;
  height: 3px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
  animation: moveInRight 0.4s ease-out;
  animation-delay: 1.9s;
  animation-fill-mode: backwards;
}

.textBox h4 {
  line-height: 10px;
  font-weight: normal;
  font-size: 20px;
  animation: moveInRight 0.6s ease-out;
  animation-delay: 2.3s;
  animation-fill-mode: backwards;
}


/*Animations*/

@keyframes scroll {
0% {
  background-image: url(http://subtlepatterns2015.subtlepatterns.netdna-cdn.com/patterns/footer_lodyas.png);
}
  100% {
  background-image: url(http://subtlepatterns2015.subtlepatterns.netdna-cdn.com/patterns/footer_lodyas.png);
    background-position: 0px -3000px;
  }
}

@keyframes popUp {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }
  100% {
    opacity: 1;
    transform: translateY(0px);
  }
}

@keyframes moveInRight {
  0% {
    opacity: 0;
    transform: translateX(-80px);
  }
  100% {
    opacity: 1;
    transform: translate(0);
  }
}
<div class="row">
  <div class="col-lg-12">
    <div class="banner opening">
      <div class="opening">
        <div class="textBox">
          <img class="logo logo--animated" src="logo.png">
          <h1>Title</h1>
          <hr class="style-two">
          <h4>Sub-Title</h4>
        </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

Prevent the footer from overlapping with the text when printing several pages

Is there a way to prevent text from overlapping the footer when printing a page containing both? I have tried using CSS and HTML to adjust the positioning of the footer, but it still overlaps with long blocks of text. Any suggestions on how to fix this i ...

Navigate to the top of the page using jQuery

Attempting to implement a simple "scroll jump to target" functionality. I've managed to set it up for all parts except the "scroll to top". The jumping works based on the tag's id, so it navigates well everywhere else, but not to the very top. He ...

Arranging elements within distinct div containers

Utilizing Bootstrap 4, I crafted a card-deck containing two cards. Despite the equal height of both cards, the alignment of elements is affected by varying text lengths. <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min ...

The issue with CSS z-index not functioning properly when using absolute positioning

Here is the issue I'm facing: I have multiple div containers in my code. .outer { position: relative; z-index: 1; } .inner { position: absolute; z-index: 999; } <div class="outer"> <div class="inner"> <div class="option ...

Enhancing webpage design by dynamically changing borders and headers using JavaScript

I have implemented a fixed positioning for the table headers using the following code: onScroll={() => { document.querySelector('thead').style.transform = `translate(0,${this.scrollRef.scrollTop}px)`; }} However, when I scroll the ta ...

Having trouble with displaying the logo on the navigation bar (using bootstrap and django)?

Hello, I am struggling to include a logo in my navbar and it's not being displayed. Despite researching similar queries from others, I still can't figure out why the image won't show up. I'm uncertain whether the issue lies within my co ...

Exploring the techniques for displaying and concealing div elements with pure JavaScript

Here's an example of code I wrote to show and hide div elements using pure JavaScript. I noticed that it takes three clicks to initially hide the div elements. After that, it works smoothly. I was attempting to figure out how to display the elements ...

Exploring the world of using Bootstrap containers, rows, and columns

I have a good grasp on containers and columns, but I am a bit confused about rows. The example below shows a 50/50 split. <div class="container"> <div class="row"> <div class="col-md-6"> 50 / 50 Content </ ...

What is the best way to apply styles to a React component that is passed as a prop?

I'm currently working on a component that is passed as a label prop. In order for me to utilize justify-content: space between within my div, I must ensure it has a width of 100%. You can see how this appears in the developer tools by clicking here. r ...

Issue with Inheritance of CSS Styles in Angular 9 Components

I have a scenario where I have a parent component containing nested components with various HTML elements. The challenge is to ensure that CSS styles defined in the parent component are applied to the nested components as well. For instance, within the pa ...

Is there a way to align these blocks in a single row?

Having trouble aligning these buttons horizontally. Any suggestions? I've been tinkering with this for a couple of hours now, so decided to seek help here. The desired effect should resemble the image below, but it's not quite there yet. Thank yo ...

Employ a distinct styling approach for Chrome and Mozilla with only utilizing a single style

This is the CSS style defined in a PHP file for an Element line-height: 120px; display: list-item; display: -moz-inline; list-style: none; If the browser is Chrome, I want it to show display: list-item, and if it's Mozilla, then display: inline. Th ...

"Customize the centering offset of Google Maps based on the width of

Struggling to implement a design using my code, but it's not behaving as expected. When the old width is larger than the new width, the offset Center should be -50. And when the old width is smaller, the offset Center should be 50. The offset Center ...

Is there a way to make those three elements line up in a row side by side?

I'm working on a layout using HTML and CSS that will display two images on the left and right sides of the browser window, with text in between them. I want them all to be horizontally aligned within a container. Here is the code snippet: <div cla ...

Is there a way to create submit buttons that trigger printing in HTML? Additionally, how can I design a text input that spans 100% width on the same line as a <span>, <p>, or <div>?

These are the files I have: .dir { color: white; font-family: "Lucida Console", Monaco, monospace; font-size: 16px; } .cmdline { font-family: "Lucida Console", Monaco, monospace; background-color: black; border: 1px solid black; color: whi ...

Most effective method for designing a reusable <table> appearance

For my project, I need to create multiple tables using data from a database on different pages. I want to maintain a consistent styling throughout these tables: The first and last rows should have a bold font with reversed foreground/background colors. Th ...

What could be causing my text to not adapt to a mobile device screen?

Using my MacBook with a display size of 15.4-inch (2880 x 1800), I have captured screenshots of different sections of my homepage to show how they appear. #app (section1) https://i.sstatic.net/QjrXe.png #section2 (section2) https://i.sstatic.net/5HWp0. ...

When scrolling down a webpage, the background color of the content does not stretch along with the page

I've created a webpage with a sticky header and footer, along with a scrollbar on the main content. However, I'm facing an issue where the background color of the content does not extend beyond the viewport when scrolling down. The text is visibl ...

Text seems to be more robust when placed on a dark backdrop

I am currently facing an issue with fonts, particularly Google's Roboto font. In my tests, I have noticed that the font appears bolder on dark backgrounds (using Chrome 62.0.3202.62 on OSX Sierra 10.12.6), while it looks fine on Google's dark fon ...

Are your macOS devices not displaying the Scrollbar CSS buttons correctly?

I need help troubleshooting why my buttons are not appearing in the scrollbar on macOS. They function properly on Windows, so I suspect there may be a typo or error in my code. Can anyone take a look and provide some insight? ::-webkit-scrollbar { wid ...