Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8850391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:53:31+00:00 2026-06-14T12:53:31+00:00

I have a some animation which in the end will hopefully make up a

  • 0

I have a some animation which in the end will hopefully make up a nice CSS-only Vintage Flip Clock.

Basically i have the numbers split into two parts and animate each of the two parts with a 180° Rotation on the X-Axis.

╔═══════╗   
║   ##  ║   
║  ###  ║   
║ # ##  ║  
║   ##  ║ 
╠═══════╣   
║   ##  ║   
║   ##  ║     
║   ##  ║     
║  #### ║   
╚═══════╝   

However, due to the infinite cycle of the keyframes I have a problem with the z-index – at the end of the cycle the wrong figure is on top, thus for a brief moment the wrong digits are shown.

I have two demo-versions of the animation (currently only webkit prefixed):

z-index predeclared

reordered markup

The first one uses z-index in the animation cycles, the latter one uses the natural ordering (and thus the default z-index) of the figures.

<div class="nr">
    <div class="top t0">0</div>
    <div class="bottom b0">0</div>
    <!-- 1 to 9 -->
</div>

The keyframes are the following (first example):

.top{
    -webkit-transform-origin:50% 100%; 
    -webkit-animation-name: flipT;
}
.bottom{
    -webkit-transform-origin:50% 0;
    -webkit-animation-name: flipB;
    -webkit-transform: rotateX(180deg);
}

@-webkit-keyframes flipT {
    from{-webkit-transform:rotateX(0deg)    }
    10% {-webkit-transform:rotateX(-180deg);}
    90% {-webkit-transform:rotateX(-180deg);}
    91% {-webkit-transform:rotateX(0deg);   }
}
@-webkit-keyframes flipB {
    from{-webkit-transform:rotateX(180deg);z-index:100;}
    10% {-webkit-transform:rotateX(0deg);  }
    11% {z-index:0;}
    20% {-webkit-transform:rotateX(0deg);  }
    21% {-webkit-transform:rotateX(180deg);}
}

If you wonder why they seem to look so strange – it’s to prevent further animation which would cause flickering – you can see this by changing the perspective to some low value.

You will see the z-index problem at the end of the cycle. Also one of the above demos has some flickering. Do you have any idea how to fix this? I can’t seem to wrap my head around this.

Sidenote: Is SASS choking on the @keyframe directive, because the animations won’t get played when I switch the CSS Panel to SCSS?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:53:32+00:00Added an answer on June 14, 2026 at 12:53 pm

    Here you go:

    http://jsfiddle.net/2TAc4/

    It’s a combination of the two you posted. With natural ordering they all have the same index. So using this concept, we toggle between 0, 1, and 2.

    I slowed it down (helps a lot) and used a background color to see the frames change.

    Here’s the key part:

    @-webkit-keyframes flipT {
        from{-webkit-transform:rotateX(0deg); z-index:1;}
        10% {-webkit-transform:rotateX(-180deg);}
        90% {-webkit-transform:rotateX(-180deg);}
        91% {-webkit-transform:rotateX(0deg); z-index:0;}
    }
    @-webkit-keyframes flipB {
        from{-webkit-transform:rotateX(180deg); z-index: 2;}
        10% {-webkit-transform:rotateX(0deg);}
        18% {-webkit-transform:rotateX(0deg);}
        19% {-webkit-transform:rotateX(180deg); z-index: 0;}
    }
    

    Here’s the final version:

    http://jsfiddle.net/S6EMe/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added some animation using jquery but it's not working: $('.test-container').click(function(){ $(this).css('background-color', 'rgb(119,
I have a thread which performs some tasks. At the end I want to
I have some objects in an animation which are continously animating in a rotation
Title is quite self explanatory, but I have some animation being done in a
i creating an application with movie animation , i have a animation some group
I'm working with sprite animation (OpenGL + C++). I have some trouble working with
Doing some jquery animation. I have certain divs set up with an attribute of
As titled, how can I do that? I have been reading some Silverlight/WPF animation
I have a storyboard like the following Duration=0:0:1 Completed=DeviceExplorer_Completed> The animation for some reason
I have some jQuery which i think could be written a lot simpler, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.