Create engaging text animation by transitioning from horizontally displayed text to vertically displayed text with the letters standing upright using An

I'm trying to create an animation where an acronym is displayed horizontally in the middle of the screen and then flips vertically. The challenge I'm facing is rotating individual letters once they are vertical so that the text reads from top to bottom instead of left to right.

Here is my current code:

<!DOCTYPE html>
<html>
<head>
<style> 
.move{
    font-size: 105px;
    position: relative;
    animation: mover 5s ease 0s normal forwards; 
}

.move span
{
    position: relative;
    animation: rotate 5s ease 0s normal forwards; 
}

@keyframes mover {
0.0%{
        transform: scale(1) translate(-0px, 0) skew(0deg);
    }
100%{
         transform: scale(1) translate(-20%, 300px) skew(0deg) rotate(90deg);
    }
    
}

@keyframes rotate
{
0.0%{
        transform: scale(1) translate(-0px, 0) skew(0deg);
    }
100%{
         transform: scale(1) translate(0px, 0px) skew(0deg) rotate(-90deg);
        
    }
}

</style>
</head>
<body>

<CENTER>
<h2 class="move">

<span>L</span>
<span>E</span>
<span>M</span>
<span>O</span>
<span>N</span>

</h2> 
</CENTER>


</body>
</html>

I'm looking for a way to make all the letters flip to the correct orientation (left to right) at the end while still remaining vertical.

Something like this:

L
E
M
O
N

Any help would be greatly appreciated!

Answer №1

Your snippet is quite similar to mine, with the only difference being that the spans are set to inline-block so they follow the transform:

<!DOCTYPE html>
<html>

<head>
  <style>
    .move {
      font-size: 105px;
      position: relative;
      animation: mover 5s ease 0s normal forwards;
    }
    
    .move span {
      position: relative;
      display: inline-block;
      animation: rotate 5s ease 0s normal forwards;
    }
    
    @keyframes mover {
      0.0% {
        transform: scale(1) translate(-0px, 0) skew(0deg);
      }
      100% {
        transform: scale(1) translate(-20%, 300px) skew(0deg) rotate(90deg);
      }
    }
    
    @keyframes rotate {
      0.0% {
        transform: scale(1) translate(-0px, 0) skew(0deg);
      }
      100% {
        transform: scale(1) translate(0px, 0px) skew(0deg) rotate(-90deg);
      }
    }
  </style>
</head>

<body>

  <CENTER>
    <h2 class="move">

      <span>L</span>
      <span>E</span>
      <span>M</span>
      <span>O</span>
      <span>N</span>

    </h2>
  </CENTER>


</body>

</html>

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

`Modified regions determined by cursor location`

I am working with a split layout featuring two columns, and I need the ability to make each column separately scrollable. Due to using a specialized scroll-to function, I cannot use overflow-y: scroll; or overflow: auto;. I am looking for alternative solut ...

What is the best way to have a text field automatically insert a hyphen after specific numbers?

Is there a way to make a text field insert hyphens automatically after certain numbers? For example, when typing a date like 20120212, could we have the input automatically formatted with hyphens after the first 4 digits and the second two, so it displays ...

Responsive HTML grid with a distinct line separating each row

My challenge is to create a layout that features a grid of floating divs with horizontal lines under intermediate rows. The catch is that there should not be a line under the last row, and if there is only one row of elements, no line should be displayed. ...

What is the best way to link CSS files from libraries that are downloaded using npm?

For instance, let's say I installed a package: npm install --save package and it gets saved in ./node_modules/package/ Inside that folder, there might be a directory named styles and within that directory, you could find style.css. How can I link ...

Set a default selection for radio buttons in Angular template-driven forms

I'm having an issue with setting a default selection for a radio button in my template-driven form. Here's the relevant part of my code: <div class="donut-form-promos"> <span>Promo:</span> <div class=&quo ...

Javascript Object and Conditional Statement

I am working on a Dygraph object creation script that includes a data variable. However, I want to avoid passing in this variable for older browsers. Here is the code snippet: function prime() { g = new Dygraph( document.getElementById("g"), d ...

Overlap bug with Flash content

In both Google Chrome (16.0.912.75 m) and Safari (5.1.1), I am encountering the well-known flash / html overlay issue. Despite setting the wmode attribute to transparent as suggested here and here, along with trying opaque, the problem persists. Following ...

Issues with Laravel 5.8 and Bootstrap not functioning properly in Jquery

Check out this link for using Bootstrap Select. The code works perfectly in the view, but when I try to implement it with jQuery below, it doesn't work. Can someone help me fix this issue? View Code: <table id="tableAppointment" style=&q ...

The functionality of Angular animate becomes compromised when there is a conflict between predefined CSS states and transition states

Explore this example CSS code: /* animations at the start */ .error-animation.ng-enter { -webkit-transition: 0.5s linear all; transition: 0.5s linear all; opacity: 0; } ...

Ways to merge multiple cells horizontally in a table right from the beginning

Is there a way to start the colspan from the second column (Name)? See image below for reference: https://i.stack.imgur.com/RvX92.png <table width="100%"> <thead style="background-color: lightgray;"> <tr> <td style="width ...

Collapsed Grid System

Is it possible to create a CSS grid system that meets the following requirements: The grid should have arbitrary height (with consistent width) and when a grid overflows, it should stack vertically underneath the preceding grid, regardless of other grid ...

Using AngularJS to bind radio buttons to ng-model

Here is a snippet of my HTML code where I attempted to bind the "formFriendsAll" scope to the ng-model. <form ng-submit="submitForm()" > <div class="col-sm-3"> <div class="form-group"> <label>Which Persons to show?< ...

Various background positions

Is it possible to declare multiple background positions for the same background image? I have a span with the class page_heading and I want this class to display the same image twice, once at the beginning of the text and once at the end. HTML: <h1&g ...

JavaScript code that uses jQuery does not function properly on an HTML form

Hello everyone, I am having trouble with some JavaScript code. Here is what I have: $(document).ready(function(){ $(".replyLink").click(function(){ $("#form-to-"+this.id).html(htmlForm()).toggle(500); return false; }); function htmlForm(){ var htm ...

Determining the file path in HTML5

Can anyone help me with retrieving the file path using html5 javascript once a user selects a file? I require the file path for a specific scenario: In this case, the user uploads a file and pauses it (currently only supported by Mozilla browsers), then c ...

Adjusting the height of a DIV element to suit the window dimensions

I am facing an issue with the following HTML code: <div id="subpageHeaderImageSection"> <div id="subpageHeaderLeft"> <span id="holdImageP"></span> <!--[if lte IE 10]><img id="igm" src="theImages/sub ...

adjusting the font size based on the size of the screen

Hi everyone, I've encountered an issue with adjusting font sizes based on screen size. My framework is Bootstrap 3 and I'm using LESS. Here is the initial part of my LESS code: @font-size-base: 16px; @font-size-large: ceil((@fo ...

Transferring the final space from a node containing a mixture of content to a separate

Having a multitude of HTML files generated by MS Word, my objective is to modify the contents in order to extract data and perform other tasks. In an HTML paragraph with mixed content, I have noticed that spaces after italicized or bold words also become ...

Do not incorporate a div in the overlay

I have an image inside a container. When hovering over the image/container, overlay information is displayed (which is currently working correctly). The overlay should cover the entire container (the grey part) where the image is located. The product-tit ...

From HTML element to pug-template with the use of the # symbol

I have a code snippet with 2 angular material radio buttons. Both of them contain the #attribute/element (I'm not sure what it's called) within them. How can I convert them into pug so that the attribute/element with the # works? Below is the sam ...