Appear gradually and descend

Is there a way to enhance the animation on my homepage headline? Currently, I have set it to fade in when the page loads using CSS.

I came across some sites with impressive animations that not only fade in the title but also move it down slightly. How can I modify my code to achieve a similar effect?

<div class="homepage">
    <div class="headline">
        <h1><span>WELCOME</span></h1>
    </div>
    <div class="subheadline">
        <h1>
            <span>To the home of</span>
        </h1>
    </div>
    <div class="subheadline">
        <h1>
            <span>Multimedia Journalist</span>
        </h1>
    </div>
    <div class="subheadline">
        <h1>
            <span>Dan Morris</span>
        </h1>
    </div>

    <a href="#contact" class="smoothScroll" id="contactlink">Let's talk</a>
    <div class="down-link">
        <a class="w-downlink" href="#about">
            <i class="fa fa-chevron-down"></i>
        </a>
    </div>
</div>
.headline {
    height: auto;
    width: 75%;
    margin-left: 78px;
    margin-top: 120px;
    margin-right: auto;
    font: 200 18px/1.3 'Roboto', 'Helvetica Neue', 'Segoe UI Light', sans-serif;
    font-size: 12px;
    font-weight: 200;
    color: #676767;
    text-align: left;
    opacity: 0;
}

@-webkit-keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.fadeIn {
    -webkit-animation: fadeIn 1s ease-in .5s both;
    animation: fadeIn .1s ease-in .5s both;
}

Answer №1

One way to achieve this effect is by using the top property in conjunction with position: relative;:

You can refer to this JSFiddle link for a live example: https://jsfiddle.net/svArtist/sc7dduue/

.headline {
    height: auto;
    width: 75%;
    margin-left: 78px;
    margin-top: 120px;
    margin-right: auto;
    font: 200 18px/1.3 'Roboto', 'Helvetica Neue', 'Segoe UI Light', sans-serif;
    font-size: 12px;
    font-weight: 200;
    color: #676767;
    text-align: left;
    opacity: 0;
}

@-webkit-keyframes fadeIn {
    0% {
        opacity: 0;
        top: -40px;
    }
    100% {
        opacity: 1;
        top: 0px;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        top: -40px;
    }
    100% {
        opacity: 1;
        top: 0px;
    }
}


.fadeIn {
    position:relative;
    -webkit-animation: fadeIn 1s ease-in .5s both;
    animation: fadeIn 1s ease-in .5s both;
}
<div class="homepage">
<div class="headline fadeIn">
<h1><span>WELCOME</span></h1>
</div>
<div class="subheadline">
  <h1><span>To the home of</span></h1></div><div class="subheadline"><h1><span>Multimedia Journalist</span></h1></div>
<div class="subheadline"><h1><span>Dan Morris</span></h1></div>
<a href="#contact" class="smoothScroll" id="contactlink">Let's talk</a>
<div class="down-link"><a class="w-downlink" href="#about"><i class="fa fa-chevron-down"></i></a></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

Creating clickable links for selected text in React: A step-by-step guide

I've been working on creating a WYSISYG editor and integrating hyperlinking to text selections, but I'm facing some difficulties. Despite searching the internet, I can't seem to figure out why it's not functioning as expected. My appro ...

Execute PHP script via hyperlink

Is there a way for me to have a small PHP script that only gets the current page URL and echoes it when a user clicks on a submit button? I'm struggling because there are no other form items on the page, making it difficult to trigger the script. I th ...

How come every time I make changes to the search input, the code seems to run repeatedly even though it's not directly linked to the state that's being triggered?

After adding a search input, I noticed that the following code keeps running repeatedly when I type: const { list } = useList() The search input appears to be ineffective as it updates only the searchValue state and is not linked to the list above. It se ...

Sending Parameters Using Higher Order Functions

Utilizing React and attempting to pass multiple arguments along with the 'event', I opted to implement a Higher Order function for this purpose. Unfortunately, it seems that the 'id' passed to the Higher Order function is not being rec ...

Guide on implementing a Pug for loop using AJAX

For my school project, I am developing a web application similar to Tinder using Node.js, Express, and Pug. The main goal of the project is to provide potential matches to users based on either their proximity or common interests with the current user. Whe ...

arranging <li> elements in alphabetical order

I'm looking for a way to alphabetically sort an unordered list while still keeping the outer html intact. My current method sorts the list alphabetically, but it only reorganizes the inner html of the list elements and not the entire element itself. T ...

In the `angular-daterangepicker.js` file, add the option "Single Date" to the list of available ranges

I'm currently working on implementing a new feature that is similar to the "Custom Range" option, but with a twist. I want to provide users with the ability to choose only one date, much like a "Single Date Picker". By adding this new option under "Cu ...

AngularJS dilemma

Everything seems to be working fine on my application. However, when I click the back or forward buttons on Chrome, the URL changes, but all I see is a blank screen with an empty body tag containing the ng-view attribute. I've checked the controllers ...

Update individual component based on selected value

I am working on a blogs page that consists of two main components: filter and card <template> <div> <div v-if='$apollo.loading'>Fetching data...</div> <div v-else> <FilterComponent :categorie ...

Despite successfully retrieving the response from the YouTube API Fetch, I am unable to access the items

Many questions regarding this issue focus on having the wrong key, but I believe my key is correct. Now I am confused whether the problem lies with the YouTube API or the fetch() method. In simple terms, I am sending the following request: export functio ...

Tips on verifying the count with sequelize and generating a Boolean outcome if the count is greater than zero

I'm currently working with Nodejs and I have a query that retrieves a count. I need to check if the count > 0 in order to return true, otherwise false. However, I am facing difficulties handling this in Nodejs. Below is the code snippet I am strugg ...

Challenges arising when transferring data from Django to HTML

I am trying to calculate the sum of elements in lista[] which consists of decimal numbers, but I keep getting this error message: lista[] is composed of decimal numbers ValueError at / argument must be a sequence of length 3 This is my code : views.py ...

Tags for multilingual websites

I am in the process of creating a website that will be available in multiple languages. I vaguely remember hearing about a meta tag that can inform search engines about the URL of the same page in a different language. Currently, I am using the following ...

AngularJS $compile function is failing to render a custom template

Hi there, I am facing an issue while trying to render a custom template using the $compile function. The error message I keep getting is: unrecognized expression: {{senddata}} I have provided my code below for reference: app.controller('MainCtrl&ap ...

A guide to setting up Firebase(FCM) Push Notifications on nuxtjs / vuejs

Despite extensive hours scouring the internet for a user-friendly method to incorporate Firebase FCM Push Notification into my nuxt project, I came up empty-handed. ...

Ways to showcase particular information once it has finished loading

While I understand that I shouldn't include links here due to potential changes, my current issue can be viewed at: There seems to be an issue with the social buttons loading strangely under the red header. I am looking to hide them initially and onl ...

New to CSS: Having trouble with responsive design not showing up as expected

I am new to learning CSS. I have a task for my course where I need to style just one page (you can view the tablet mockup here: Mockup-tablet). However, I'm having trouble with my div elements not displaying correctly. On desktop, one is on the secon ...

The various sections of my website are neatly tucked away under one tab, only revealing themselves to users as they click on each individual tab

My recently published website is experiencing a strange issue. When the site loads, all contents including paragraphs and videos from other pages are displayed under one tab (the HOME tab). However, once any other tab is clicked, the issue fixes itself. Yo ...

Tips for minimizing database queries for each data type

I'm currently developing an App that requires the user to input numbers into two different fields. The first field is for entering numbers, while the second field displays a calculation based on the input. Each time the user enters a number, a call to ...

JQuery selector is unable to locate element when passing Span Id

I've been researching and I believed this solution would be effective, but it seems that I made a mistake. The issue involves using Ajax Manager within a function. Here is my Javascript: function makeGetRequest2(wordId, docId) { var ajaxManager ...