CSS-only spinning cube stops on one side before continuing rotation

Could someone please assist with adding an 8-second pause to a FACE when it is in the Front view, before playing the animation?

Below is the code snippet:

body {
color: rgb(6, 106, 117);
text-transform: uppercase;
font-family: sans-serif;
font-size: 100%;
background: #F4F6F8;
padding: 3em 0 0 0;
line-height: 62px;
-webkit-perspective: 1000px;
}

.cube {
width: 30%;
text-align: center;
margin: 0 auto;
height: 100px;

-webkit-transform-style: preserve-3d;
-webkit-animation: rotate-cube 10s linear infinite;
}

.front, .bottom, .top, .back {
background: rgb(247, 247, 247);
border: 1px solid rgba(147, 184, 189, .8);
-webkit-border-radius: 5px;
-webkit-box-shadow: 0 5px 20px rgba(105, 108, 109, .3), 0 0 8px 5px rgba(208, 223, 226, .4) inset;
height: 100px;
    position: absolute;
    width: 100%;
}

.front {
-webkit-transform: translateZ(50px);
}

.bottom {
-webkit-transform: rotateX(90deg) translateZ(-50px) rotateY(180deg) rotateZ(180deg);
}

.top {
-webkit-transform: rotateX(-90deg) translateZ(-50px) rotateY(180deg) rotateZ(180deg);
}

.back {
-webkit-transform: rotateX(180deg) translateZ(50px);
}

@-webkit-keyframes rotate-cube {
0%{-webkit-transform: rotateX(0deg);}
10%{-webkit-transform: rotateX(90deg);}
40%{-webkit-transform: rotateX(180deg);}
60%{-webkit-transform: rotateX(270deg);}
90%{-webkit-transform: rotateX(360deg);}
100{-webkit-transform: rotateX(360deg);}
}
<div class="cube">
<div class="front">
<h1>Front</h1>
</div>
<div class="bottom">
<h2>Bottom</h2>
</div>
<div class="top">
<h2>Top</h2>
</div>
<div class="back">
<h2>Back</h2>
</div>
</div>

I am looking to implement an 8-second pause for each face of the cube. Any help would be greatly appreciated.

Answer №1

Kindly check out the code snippet below:

body {
color: rgb(6, 106, 117);
text-transform: uppercase;
font-family: sans-serif;
font-size: 100%;
background: #F4F6F8;
padding: 3em 0 0 0;
line-height: 62px;
-webkit-perspective: 1000px;
}

.cube {
width: 30%;
text-align: center;
margin: 0 auto;
height: 100px;

-webkit-transform-style: preserve-3d;
-webkit-animation: rotate-cube 33s linear infinite;
}

.front, .bottom, .top, .back {
background: rgb(247, 247, 247);
border: 1px solid rgba(147, 184, 189, .8);
-webkit-border-radius: 5px;
-webkit-box-shadow: 0 5px 20px rgba(105, 108, 109, .3), 0 0 8px 5px rgba(208, 223, 226, .4) inset;
height: 100px;
    position: absolute;
    width: 100%;
}

.front {
-webkit-transform: translateZ(50px);
}

.bottom {
-webkit-transform: rotateX(90deg) translateZ(-50px) rotateY(180deg) rotateZ(180deg);
}

.top {
-webkit-transform: rotateX(-90deg) translateZ(-50px) rotateY(180deg) rotateZ(180deg);
}

.back {
-webkit-transform: rotateX(180deg) translateZ(50px);
}

@-webkit-keyframes rotate-cube {
0%{-webkit-transform: rotateX(0deg);}
  24%{-webkit-transform: rotateX(0deg);}
25%{-webkit-transform: rotateX(90deg);}
  49%{-webkit-transform: rotateX(90deg);}
50%{-webkit-transform: rotateX(180deg);}
  74%{-webkit-transform: rotateX(180deg);}
75%{-webkit-transform: rotateX(270deg);}
  99%{-webkit-transform: rotateX(270deg);}
99.999%{-webkit-transform: rotateX(360deg);}
  100%{-webkit-transform: rotateX(0deg);}
}
<div class="cube">
<div class="front">
<h1>Front</h1>
</div>
<div class="bottom">
<h2>Bottom</h2>
</div>
<div class="top">
<h2>Top</h2>
</div>
<div class="back">
<h2>Back</h2>
</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

Can a time duration be applied to the background image of a DIV element?

Is there a way to set different time spans for background images of a DIV? Has anyone tried using jQuery for this task? I'm looking to have the first image displayed for 20 seconds, then switch to the second image for 5 seconds. Is it possible to ach ...

In JavaScript, you can ensure that only either :after or :before is executed, but not both

My html slider is causing me some trouble <div class="range-handle" style="left: 188.276px;">100,000</div> Upon loading the page, I noticed that in Firebug it appears like this https://i.sstatic.net/Rgqvo.png On the actual page, it looks li ...

Avoid using CSS browser prefixes when selecting plugins or addons

I tried searching on Google for a solution, but I couldn't find anything! Is there a trick or library available to avoid repeating CSS extensions for browsers? Instead of using -webkit-, -moz-, and -o- prefixes? -webkit-animation: NAME-YOUR-ANIMATI ...

How to Override Global CSS in a Freshly Created Angular Component

My CSS skills are a bit rusty and I need some assistance with a project I'm working on. The project includes multiple global CSS files that have properties defined for different tags, such as .btn. However, these global CSS files are causing conflicts ...

Animating elements with folding effects using CSS transforms

Check out this square: https://jsfiddle.net/34f93mL3/ If you hover over it, you'll see that the top folds down and turns into a pink polka-dotted pattern when it reaches the bottom. However, my goal is to make it look more like an actual folding mot ...

CSS is broken when transitioning from the development to the live site

After configuring the CSS for this site using CodeIgnitor, I placed it in the specified location: {link rel="stylesheet" type="text/css" href="<? echo base_url();?>application/assets/css/public.css" /> Although Firebug confirms that the link is ...

How can one effectively generate room within an HTML/CSS file?

Within my div element, I have organized rows of three images each. These images are uniform in size. Previously, I used small, completely clear transparent images to create spaces between the images by explicitly setting their height and width. An example ...

Headline at the top of the page, perfectly centered with a division below

Trying to create an effect where there is a div that is centered both vertically and horizontally within a dynamic containing div. This can be achieved with the following CSS: #centered-div { vertical-align: middle; margin: auto; } However, I als ...

The CSS background seems to be malfunctioning in Chrome

Could you please explain why this HTML and CSS code works on FF, IE9, jsfiddle, but not on the live site using Google Chrome? HTML: <p> <a href="http://tambnguyen.com/wp-content/uploads/2012/05/256501557_1280.jpg"> <span class= ...

Bootstrap 5 introduces an innovative animated hamburger icon that transforms into an X symbol when clicked

I have encountered an unusual behavior when trying to animate the hamburger button using Bootstrap 5. Previously, with Bootstrap 4, everything worked smoothly. However, in Bootstrap 5, I noticed that the icon initially displays as 'X' and then sw ...

What may be causing the MuiThemeProvider to override the style of a component?

Within my outer component, I am utilizing MuiThemeProvider: <MuiThemeProvider theme={full_theme_e}> <div> <AppBar /> <Filter /> </div> </MuiThemeProvider> Inside the Filter component, I have specified a ...

Style your Checkbox Button with the Checkbox component from Element Plus

Currently, I am utilizing Vue 3 along with the Element Plus library. My goal is to modify the hover, active, and select colors of the Checkbox Button that I have implemented. Unfortunately, my attempts to do so have not been successful. I essentially copie ...

Left-align elements within a div container that is centered

I want to left-align my elements within a div container that is centered. I used the text-align property to center the overall div, but now I'm having trouble aligning another content container's text to the left within the center-aligned div. H ...

Are the menubar menus positioned beneath a different div element?

Currently facing an issue with an HTML Menubar where the menus are appearing below another div, and not getting displayed as expected: ...

Unique Menu: Challenge when adjusting the width of 5 divs upon hovering while maintaining full site width at 100%

I'm looking to create a sleek custom menu with 5 fields. I want the field under the mouse to expand in width on mouseover, while the other fields shrink in width. The issue I'm facing is that the transition effect is not smooth and the total wid ...

When making updates to the HTML code, the cursor unexpectedly moves to the beginning of the code tag

Whenever I try to type in the code box and the content updates with the script provided, my cursor keeps getting moved to the beginning of the code. What can I do to resolve this issue? function MaintainCursorPosition(Control) { var target = $(&apo ...

Exploring ways to adjust font and table dimensions with the use of <style type="text/css"> in rmarkdown

Could someone assist me in adjusting table cell sizes on rmakrdown? I attempted to add the following code, but it did not have any effect on the tables within the document: <style type="text/css"> } td { /* Table */ font-size: 12px; border-c ...

Adjust the height of the parent (div) to match the size of its child (p) following a window resize

$(window).on("resize", function () { var totalHeight = 0 var $p = $("#cwt-help").children(); $p.each(function () { totalHeight += $("#cwt-help").outerHeight(); }); $("#cwt-help").css({ "height": totalHeight }) }); I'm ...

What are the steps to design a versatile gallery page that can serve various projects?

Allow me to get straight to the point. What is my goal? I am aiming to develop galleries for various projects. Each project's thumbnail on the main page should open a gallery as a new page. These galleries will all have the same layout but different ...

Utilize a Javascript function to retrieve a string and set it as the ID

I'm trying to modify a div ID by appending either a 'W' or 'H' depending on whether the screen width is greater than the height. I figured I could achieve this using JavaScript since PHP lacks the ability to detect screen sizes. A ...