CSS drop down menu isn't animating - css

I'm trying to learn how to animate with CSS in a DevTips Tutorial but had to stop about 8-minutes in since my code isn't animating the menu items properly. They simply pop into place, but are supposed to flip and fade in simultaneously.
I hope it isn't taboo to post something that's been written at CodePen; my sincerest apologies if it is. If it's kosher, CLICK HERE.
As far as I can tell, my code matches exactly what's in the tutorial, so I was hoping someone could spot whatever error I'm overlooking.
Achtung!! My codepen syntax is using Pug and SASS preprocessors, so if you don't like looking at that kind of syntax, the compiled HTML and CSS is included below.
Many thanks in advance.
HTML ::
<nav>
<ul>
<li>style 1
<ul class="drop-menu menu-#{i}">
<li>uno</li>
<li>dos</li>
<li>tres</li>
<li>cuatro</li>
<li>cinco</li>
<li>seis</li>
</ul>
</li>
<li>style 2
<ul class="drop-menu menu-#{i}">
<li>uno</li>
<li>dos</li>
<li>tres</li>
<li>cuatro</li>
<li>cinco</li>
<li>seis</li>
</ul>
</li>
<li>style 3
<ul class="drop-menu menu-#{i}">
<li>uno</li>
<li>dos</li>
<li>tres</li>
<li>cuatro</li>
<li>cinco</li>
<li>seis</li>
</ul>
</li>
<li>style 4
<ul class="drop-menu menu-#{i}">
<li>uno</li>
<li>dos</li>
<li>tres</li>
<li>cuatro</li>
<li>cinco</li>
<li>seis</li>
</ul>
</li>
</ul>
</nav>
CSS ::
nav {
padding: 50px;
text-align: center;
}
nav > ul {
list-style: none;
padding: 0;
margin: 0;
display: inline-block;
background: #ddd;
border-radius: 5px;
}
nav > ul > li {
float: left;
width: 150px;
height: 65px;
line-height: 65px;
position: relative;
text-transform: uppercase;
font-size: 14px;
color: DarkGray;
color: rgba(0, 0, 0, 0.7);
cursor: pointer;
}
nav > ul > li:hover {
background: #d5d5d5;
border-radius: 5px;
}
ul.drop-menu {
position: absolute;
top: 100%;
left: 0;
width: 100%;
padding: 0;
}
ul.drop-menu li {
background: #666;
color: White;
color: rgba(255, 255, 255, 0.7);
}
ul.drop-menu li:hover {
background: #606060;
}
ul.drop-menu li:last-child {
border-radius: 0 0 5px 5px;
}
ul.drop-menu li {
display: none;
}
li:hover > ul.drop-menu li {
display: block;
}
li:hover > ul.drop-menu.menu-1 {
-webkit-perspective: 1000px;
perspective: 1000px;
}
li:hover > ul.drop-menu.menu-1 li {
opacity: 0;
-webkit-animation-name: menu1;
animation-name: menu1;
-webkit-animation-duration: 500ms;
animation-duration: 500ms;
-webkit-animation-timing-function: ease-in-out;
animation-timing-function: ease-in-out;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
#-webkit-keyframes menu1 {
0% {
opacity: 0;
-webkit-transform: rotateY(-90deg) translateY(30px);
transform: rotateY(-90deg) translateY(30px);
}
100% {
opacity: 1;
-webkit-transform: rotateY(0deg) translateY(0px);
transform: rotateY(0deg) translateY(0px);
}
}
#keyframes menu1 {
0% {
opacity: 0;
-webkit-transform: rotateY(-90deg) translateY(30px);
transform: rotateY(-90deg) translateY(30px);
}
100% {
opacity: 1;
-webkit-transform: rotateY(0deg) translateY(0px);
transform: rotateY(0deg) translateY(0px);
}
}

Looks like you have a very simple problem with your Pug processing in this line:
ul(class="drop-menu menu-#{i}")
This isn't adding the class "menu-1" through "menu-4" as expected. To fix this write the Pug statement like this instead:
ul(class="drop-menu menu-" + i)
This is the new syntax that Pug specifies using, you can read more here.

Related

Progressive CSS3 animation

I need to make progressive bar similar to this:
https://dribbble.com/shots/1664914-Onboarding-Progress-Steps?list=searches&tag=onboarding&offset=31
I have tried till this point: Codepen Link
CSS
body{
background-color: #34495e;
}
.mail{
border: 1px solid #d35400;
border-radius: 50%;
border-width: 50%;
float: left;
background-color: #d35400;
color: white;
}
.navbar-inverse .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus {
background-color: #16a085;
}
.navbar-inverse{
background-color: #1abc9c;
}.icon-bar {
width: 90px;
background-color: #555;
}
.icon-bar a {
display: block;
text-align: center;
padding: 16px;
transition: all 0.3s ease;
color: white;
font-size: 36px;
background-color: #34495e;
}
.same{
float: left;
font-size: 32px;
}
.icon-bar a:hover {
color: #1abc9c;
}
.active {
color: #1abc9c !important;
}
.header{
color: white;
background-color: #34495e;
margin-left: 2%;
}
.fs1 {
font-size: 32px;
}
.container{
width: 100%;
}
.progressionbar li{
list-style-type: none;
width: 33.33%;
float: left;
position: relative;
}
.progressionbar li >span{
width: 20%;
height:30%;
border:2px solid transparent;
display: block;
text-align: center;
margin: 0 auto 10px auto;
border-radius: 50%;
padding: 5%;
background-color: white;
box-shadow: rgba(0, 0, 0, 0.792157) 3px 3px 3px 0;
}
.progressionbar li:after{
content: '';
position: absolute;
width: 100%;
height: 6px;
background-color: #9b59b6;
top: 35%;
left: -50%;
z-index: -1;
}
.first{
animation-name: example;
animation-duration: 10s;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-delay:2s;
}
.first{
animation-duration: 2s;
animation-name: example;
animation-iteration-count: 1;
}
.second{
animation-name: example;
animation-duration: 10s;
animation-iteration-count: infinite;
animation-delay: 6s;
}
.second{
animation-duration: 2s;
animation-name: example;
animation-iteration-count: 1;
}
.third{
animation-name: example;
animation-duration: 10s;
animation-iteration-count: infinite;
animation-delay: 8s;
}
.third{
animation-duration: 2s;
animation-name: example;
animation-iteration-count: 1;
}
#-webkit-keyframes example {
from {background-color: white;}
to {background-color: #9b59b6;}
0% {
transform: scale(0.1);
opacity: 0;
}
60% {
transform: scale(1.2);
opacity: 1;
}
100% {
transform: scale(1);
}
}
.progressionbar li:first-child:after{
content: none;
left: -50%;
}
HTML
<html><body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<a style="background-color: #34495e" class="navbar-brand active" href="#"><span class="icon-brand same"></span></a>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown active">
Rupam Verma<b class="caret"></b>
<ul class="dropdown-menu">
<li><h1 class="mail">R</h1><h5>Rupam varma</h5><br><h5 style="float: right;"><a href="https://plus.google.com/u/0/105904544623478465796"> mahi.roops#gmail.com</h5></li>
</ul>
</div>
</nav></a></li></ul></li></ul></div></nav>
<div class="row">
<div class="col-md-12">
<h3 class="header">Menu</h3></div>
<div class="col-md-1">
<div class="icon-bar">
<a class="active" href="#"><span class="icon-circle"></span></a>
<span class="icon-toggle-off"></span></i>
<span class="icon-checklist"></span></div></div>
<div class="col-md-11">
<div class="progressionbar">
<ul class="">
<div class="fs1">
<li><span class="icon-gift first"></span><h3 style="text-align: center">gift</h3></li>
<li><span class="icon-truck2 second"> </span><h3 style="text-align: center;"> car</h3></li>
<li> <span class="icon-profile-male third"></span><h3 style="text-align: center;"> user</h3></li>
</div>
</ul>
</div></div></div></div>
</body>
</html>
I really don't know how to achieve such a thing exactly since This has to be done only through css3 and no JS.
This timer and zoom-in zoom-out is my issue. Also, its not repeating.
Any help would be greatly appreciated, thanks.
Ok so the answer is actually simple for the delays.
FOR THE DELAYS:
You can see a fiddle here showing the solution.
CSS3 got no delay between animation loops, only for the first one. But a quick search on CSS trick show you how to do that.
The idea is to create more keyframes to make the delay.
#-webkit-keyframes example3 {
0% {
transform: scale(1);
opacity: 1;
background-color: white;
}
59% {
transform: scale(1);
opacity: 1;
background-color: white;
}
60% {
transform: scale(0.1);
opacity: 0;
background-color: white;
}
72% {
transform: scale(1.2);
opacity: 1;
}
80% {
transform: scale(1);
background-color: #9b59b6;
}
100% {
transform: scale(1);
background-color: #9b59b6;
}
}
Here is the code for an animation during 10 seconds. You can notice that nothing happens for the 6 first seconds because we want to delay it of 6 seconds each loop (third button for your case).
After that, we do the animation during the time we wnat, here 2secondes, ie 20%, and we let the final state untill 100%.
The 59% - 60% weird stuff happends because you want an abrupt change at the start of the animation. It's not always necessary.
Consequently, your problem is only a basic math problem afterall, just calculate when do you have to wait for each animation etc.. I did it for you for the 3 buttons so you can see the result.
FOR THE PROGRESSIVE BAR :
The strategy should be the same than before. Just create another bar with a background color #9b59b6, and make the width change with the percentage, soemtimes waiting 2sec at a certain width for a "button" animation going on before continuing its way, and the work is done!
In your case, you decided to make the progressive bar with after, and not an absolute one, so it is in two parts etc etc..
What I suggest you is to just create a absolute positionned one with the right background color which will recover the ":after" ones, makes it normal width to 0%, and make it grow with animation just like I explained.
Why didn't I do it ? Well you have the strategy now and I am too lazy to position it perfectly. And it's your work at the end.. It will always be better for you if you practice on the progress bar rather than copy paste my code.
i would go on 2 animation.
one to draw the progress line (as a background)
a second for the poping circle (flex children)
/* keyframes for animation */
#keyframes run {
to {
background-size:10000% 5px
}
}
#keyframes popup {
65% {
transform:scale(1.4)
}
60%, 100% {
background:purple;
transform:scale(1)
}
}
/* call and delay animations */
.progress span {
animation:popup 0.5s forwards;
}
.progress span:nth-child(2){
animation-delay:1.25s;
}
.progress span:nth-child(3){
animation-delay:2.75s;
}
.progress {
animation:run 3s linear forwards;
}
/* styling */
.progress {
background:linear-gradient(to right, purple 1%, white 1%) rgb(52, 73, 94) no-repeat left center; /* to animate via keyframes */
display:flex;
justify-content:space-between;
margin:1em 2em;
background-size: 100% 3px;
}
.progress span {
display:flex;
align-items:center;
justify-content:center;
box-shadow:2px 2px 5px black;
width:80px;
height:80px;
background:white;
border-radius:100%;
color:white;
font-size:30px;
}
body {background:rgb(52, 73, 94)}
<p class="progress">
<span>1</span>
<span>2</span>
<span>3</span>
</p>
pen to play with

Background-Image Transition Not Working On Firefox

I am trying to create a logo transition with css however it only works in Chrome and not FF or even IE so what should i do ?
MY CSS
.logo {
-moz-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
-webkit-transition: all 0.5s ease;
transition: all 0.5s ease;
background-image: url(../images/text.enter.png);
border-style: none;
height: 70px;
left: 50%;
margin-left: -138.5px;
margin-top: -35px;
position: absolute;
top: 50%;
width: 277px;
}
.logo:hover { background-image: url(../images/logo.png); }
Demo : http://jsfiddle.net/lotusgodkk/GCu2D/242/
CSS:
* {
margin: 0;
padding: 0;
}
#nav li:hover {
-webkit-animation: NAME-YOUR-ANIMATION 500ms;
/* Safari 4+ */
-moz-animation: NAME-YOUR-ANIMATION 500ms;
/* Fx 5+ */
-o-animation: NAME-YOUR-ANIMATION 500ms;
/* Opera 12+ */
animation: NAME-YOUR-ANIMATION 500ms;
/* IE 10+, Fx 29+ */
}
#nav {
width: 400px;
margin: 40px auto;
}
#nav li {
list-style-type:none;
font-size:2em;
}
#nav li a {
background-image:url('http://css-tricks.com/examples/CSS-Sprites/Example1After/img/image_nav.gif');
background-repeat:no-repeat;
padding: 0 0 0 90px;
display: block;
height: 72px;
}
#nav li a.item1 {
background-position:0px 0px;
}
#nav li a:hover.item1 {
background-position:0px -72px;
}
#nav li a.item2 {
background-position:0px -143px;
}
#nav li a:hover.item2 {
background-position:0px -215px;
}
#nav li a.item3 {
background-position:0px -287px;
}
#nav li a:hover.item3 {
background-position:0px -359px;
}
#nav li a.item4 {
background-position:0px -431px;
}
#nav li a:hover.item4 {
background-position:0px -503px;
}
#nav li a.item5 {
background-position:0px -575px;
}
#nav li a:hover.item5 {
background-position:0px -647px;
}
#-webkit-keyframes NAME-YOUR-ANIMATION {
0% {
opacity: 1;
}
50% {
opacity:0.5;
}
100% {
opacity: 1;
}
}
#-moz-keyframes NAME-YOUR-ANIMATION {
0% {
opacity: 1;
}
50% {
opacity:0.5;
}
100% {
opacity: 1;
}
}
#-o-keyframes NAME-YOUR-ANIMATION {
0% {
opacity: 1;
}
50% {
opacity:0.5;
}
100% {
opacity: 1;
}
}
#keyframes NAME-YOUR-ANIMATION {
0% {
opacity: 1;
}
50% {
opacity:0.5;
}
100% {
opacity: 1;
}
}
HTML:
<ul id="nav">
<li><a class="item1" href="#" title="Some Link 1">Item 1</a>
</li>
<li><a class="item2" href="#" title="Some Link 2">Item 2</a>
</li>
<li><a class="item3" href="#" title="Some Link 3">Item 3</a>
</li>
<li><a class="item4" href="#" title="Some Link 4">Item 4</a>
</li>
<li><a class="item5" href="#" title="Some Link 5">Item 5</a>
</li>
</ul>
I used keyframes for animation. You can learn more about it here: http://css-tricks.com/snippets/css/keyframe-animation-syntax/
The example may not be perfect as per your needs but it can surely help you to achieve what you want.

3D Transform Flip Down CSS Sub Menu

I used a tutorial on creating a 3D flip down sub-menu.
Files found here:
Flip Up Down Menu (Zip File)
http://www.webdesignermag.co.uk/tutorial-files/issue-217-tutorial-files/
I modified to my usage and works great.
Here is the fiddle:
http://jsfiddle.net/yx8qc/6/
Here is the code:
<div class="menu_holder">
<ul class="nav">
<li class="main_menu">MENU
<div class="sub">
<ul><li>Home</li>
<li>ONE</li>
<li>TWO</li>
<li>THREE</li>
</ul> </div>
</li>
</ul>
</div>
Here is the CSS
.menu_holder {
background-color: #bd4832;
text-align: center;
-moz-perspective: 80px;
-webkit-perspective: 80px;
-o-perspective: 80px;
perspective: 80px;
position: fixed;
right: 0;
top: 0;
height: 64px;
z-index: 900;
width: 100%;
}
.menu_holder ul {
padding: 0;
margin: 0;
}
.menu_holder a {
color: #fff;
font-family:'League Gothic', sans-serif;
font-size: 2em;
font-weight: normal;
}
.menu_holder ul li {
display: inline;
}
.main_menu {
width: 100%;
}
ul.nav li a {
display: inline-block;
padding: 0 1em;
letter-spacing: 2px;
}
.menu_holder ul.nav {
-moz-transform-style: preserve-3d;
-webkit-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.sub {
}
.menu_holder ul.nav div {
width: 100%;
position:absolute;
background-color: #d3634e;
-webkit-transition: 0.3s;
-moz-transition: 0.3s;
-o-transition: 0.3s;
transition: 0.3s;
-moz-transform-origin: 0px 0px;
-moz-transform: rotateX(-90deg);
-webkit-transform-origin: 0px 0px;
-webkit-transform: rotateX(-90deg);
-o-transform-origin: 0px 0px;
-o-transform: rotateX(-90deg);
transform-origin: 0px 0px;
transform: rotateX(-90deg);
-moz-backface-visibility: hidden;
-webkit-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55);
/* inner shadow */
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55);
/* inner shadow */
box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55);
/* inner shadow */
}
.menu_holder ul.nav li:hover div {
-moz-transform: rotateX(0deg);
-webkit-transform: rotateX(0deg);
-o-transform: rotateX(0deg);
transform: rotateX(0deg);
}
.menu_holder ul.nav li:hover > a {
color:#115b64;
}
.menu_holder ul.nav div.sub {
width: 100%;
display: block;
}
When hovered it flips down, when hovered out flips back up.
On desktop it works great.
On touch devices, the menu flips down, but in order for it to flip back up you have to touch outside the main link.
Goal:
To get it working with touch devices. Tapping "Menu" will drop sub-menu down. Tap SAME main "Menu" item will flip it back.
Any help or leads with touch devices is greatly appreciated.
Thank You.
Does this works? I don't have here any touch device.
HTML
<div class="menu_holder">
<ul class="nav">
<li class="main_menu"><label for="toggle-1">MENU</label>
<input type="checkbox" id="toggle-1">
<div class="sub">
<ul>
<li>Home
</li>
<li>ONE
</li>
<li>TWO
</li>
<li>THREE
</li>
</ul>
</div>
</li>
</ul>
</div>
CSS (Yours + this)
input[type=checkbox] {
position: absolute;
top: -9999px;
left: -9999px;
}
label {
cursor: pointer;
}
input[type=checkbox]:checked ~ div {
-moz-transform: rotateX(0deg);
-webkit-transform: rotateX(0deg);
-o-transform: rotateX(0deg);
transform: rotateX(0deg);
}
And here is demo: http://jsfiddle.net/yx8qc/7/
This will simply use label to activate checkbox, and in function of its state show or hide content.

CSS3 transform difference in Firefox and Chrome and IE

I think it may have something to do with a pseudo element, but I'm not sure. I am having difficulties with the effect of a transform transition using css3. In Firefox v24, the effect works as I want it to - see the CodePen here http://codepen.io/patrickwc/pen/aKEec but in Chrome and IE, the border effect of the links animate and then suddenly switch back into position. It is difficult to describe so the best way is to look at the effect in Firefox then in Chrome or IE.
body {
background: #000;
color: #fff;
}
p {
text-align: center;
}
nav.footer-social-links a {
position: relative;
margin: 0 10px;
text-transform: uppercase;
letter-spacing: 1px;
padding: 1px 12px 0 8px;
height: 32px;
line-height: 30px;
outline: none;
font-size: 0.8em;
text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
}
nav.footer-social-links a:hover,
nav.footer-social-links a:focus {
outline: none;
}
.footer-social-links a::before,
.footer-social-links a::after {
position: absolute;
width: 30px;
height: 2px;
background: #fff;
content: '';
opacity: 0.2;
-moz-transition: all 0.3s;
-o-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
pointer-events: none;
}
.footer-social-links a::before {
top: 0;
left: 0;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
transform: rotate(90deg);
-webkit-transform-origin: 0 0;
-moz-transform-origin: 0 0;
transform-origin: 0 0;
}
.footer-social-links a::after {
right: 0;
bottom: 0;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
transform: rotate(90deg);
-webkit-transform-origin: 100% 0;
-moz-transform-origin: 100% 0;
transform-origin: 100% 0;
}
.footer-social-links a:hover::before,
.footer-social-links a:hover::after,
.footer-social-links a:focus::before,
.footer-social-links a:focus::after {
opacity: 1;
}
.footer-social-links {
margin: 0;
text-align: center;
}
.footer-social-links a {
color: white;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
display: inline-block;
text-decoration: none;
}
.footer-social-links a:hover::before,
.footer-social-links a:focus::before {
width: 80%;
left: 10%;
-webkit-transform: rotate(0deg) translateX(50%);
-moz-transform: rotate(0deg) translateX(50%);
transform: rotate(0deg) translateX(50%);
}
.footer-social-links a:hover::after,
.footer-social-links a:focus::after {
width: 80%;
right: 5%;
-webkit-transform: rotate(0deg) translateX(50%);
-moz-transform: rotate(0deg) translateX(50%);
transform: rotate(0deg) translateX(50%);
}
<br/>
<nav class="footer-social-links">
<a href="google" target="_blank">
<i class="shc icon-e-gplus"></i>Gplus </a>
<a href="facebook" target="_blank">
<i class="shc icon-e-facebook"></i>Facebook </a>
<a href="twitter" target="_blank">
<i class="shc icon-e-twitter"></i>Twitter </a>
<a href="linkedin" target="_blank">
<i class="shc icon-e-linkedin"></i>Linkedin </a>
<a href="skype" target="_blank">
<i class="shc icon-e-skype"></i>Skype </a>
<a href="http://last.fm/user/zerodegreeburn" target="_blank">
<i class="shc icon-e-lastfm"></i>Lastfm </a>
</nav>
<p>Fixed with help from css-tricks forum and stackoverflow here
</p>
I have a feeling messing with transform-origin might fix it, but I've been unable to get that to work. Any help or explanation as to the difference would be greatly appreciated.
I am not sure about why Chrome has problems with your code, but you can simplify it and then it will work ok in all the browsers.
You should change your CSS to
.footer-social-links a:hover::before,
.footer-social-links a:focus::before {
width: 80%;
left: 10%;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
transform: rotate(0deg);
}
.footer-social-links a:hover::after,
.footer-social-links a:focus::after {
width: 80%;
right: 10%;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
transform: rotate(0deg);
}
It is useless to do a translate in X and at the same time modify your left value; better concentrate the changes in a single value (left) and eliminate the translateX

Links not displayed in IE10 when another element has CSS3 animation

I am trying to create a header with CSS3 animation and I am encountering a problem. The problem is that the menu links do not show up in IE10 on load. However, the menu items do show up when I randomly move the mouse over the area where the links should have been present.
I searched a lot but cannot find the root-cause. However, I managed to sort of figure out that this happens only in IE10 and that too only when the animation is enabled.
Below, I have included two jsFiddle versions. One is without animation property where the menu is displayed correctly. The other is with animation where the menu doesn't show up.
With Animation | Without Animation
Note:
There are no issues in Chrome 30, FireFox 23, Opera 15 and Safari
5.1.7
The Heading and Sub-heading will have multi-lingual text which would be fetched from Database. Hence I don't want to do this
animation with images. I am also not looking for any JavaScript or
jQuery alternates/work-arounds.
HTML
<header id="header">
<div id="banner" class="banner left">
<div id="first_line">Heading</div>
<div>Sub-heading</div>
</div>
<nav class="menu right">
<ul>
<li>Link1
</li>
<li>Link2
</li>
<li>Link3
</li>
<li>Link4
</li>
<li class="mselected">Link5</li>
<li>Link6
</li>
</ul>
</nav>
</header>
CSS
.left {
float: left;
}
.right {
float: right;
}
#header {
background-color: black;
color: white;
font-size: 15px;
height: 70px;
padding-top: 20px;
overflow: hidden;
}
.banner {
cursor: default;
letter-spacing: 1px;
padding-left: 10px;
-webkit-animation: entry 2s linear 2s 5 alternate;
-moz-animation: entry 2s linear 2s 5 alternate;
animation: entry 2s linear 2s 5 alternate; /* This seems to cause the problem */
}
#-webkit-keyframes entry {
from {
-webkit-transform: scale(0.5) rotateX(0deg);
}
25% {
-webkit-transform: scale(0.625) rotateX(90deg);
}
75% {
-webkit-transform: scale(0.875) rotateX(270deg);
}
to {
-webkit-transform: scale(1) rotateX(360deg);
}
}
#keyframes entry {
from {
transform: scale(0.5) rotateX(0deg);
}
25% {
transform: scale(0.625) rotateX(90deg);
}
75% {
transform: scale(0.875) rotateX(270deg);
}
to {
transform: scale(1) rotateX(360deg);
}
}
#-moz-keyframes entry {
from {
-moz-transform: scale(0.5) rotateX(0deg);
}
25% {
-moz-transform: scale(0.625) rotateX(90deg);
}
75% {
-moz-transform: scale(0.875) rotateX(270deg);
}
to {
-moz-transform: scale(1) rotateX(360deg);
}
}
.menu {
padding-right: 10px;
letter-spacing: 0.5px;
}
#first_line {
font-size: 30px;
line-height: 45px;
}
.menu ul {
margin-top: 45px;
}
.menu li {
list-style: none;
display: inline;
padding: 10px 10px 10px 10px;
border: 1px solid black;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-khtml-border-radius: 5px;
border-radius: 5px;
background-clip: padding-box;
}
.menu li a {
color: white;
}
.menu li:hover {
background-color: white;
}
.menu li:hover a, .menu li a:hover {
color: black;
}
.mselected {
background-color: white;
color: black;
}
It seems like the issue is caused due to the delay set for the animation. If we remove the delay, it works as expected and the links are displayed on page load. Fiddle
animation: entry 2s linear 5 alternate;
Note: This is just a work-around solution. I will update if I manage to find out the reason why it doesn't work with animation delay.

Resources