Hi, I am trying to implement a button as in the example here:
The button however does not animate like in the example above with the code implemented.
Hi, I am trying to implement a button as in the example here:
The button however does not animate like in the example above with the code implemented.
Hey Simon,
Were you able to get this sorted?
I have just checked the button on your site and the gradient animates when you hover on the button just like the button on the link you sent:
Kindly try clearing your browser cache.
Hope this helps.
Thanks Jade, I have cleared cache and looked on another browser and it isn’t displaying. I am not sure why. Would you know?
This is what I see (with no hover effect at all when hovered)
Hey @simonpurdon,
I went ahead and assigned a class to your button gradient-button
and then applied the CSS from your given example in the Cornerstone’s page CSS section
.gradient-button {
-webkit-appearance: none;
background: -webkit-gradient(to right, #a2ccb6 0%, #fceeb5 50%, #ee786e 100%);
background: linear-gradient(to right, #a2ccb6 0%, #fceeb5 50%, #ee786e 100%);
background-size: 500%;
border: none;
border-radius: 5rem;
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
color: #fff;
cursor: pointer;
font: 1.5em Raleway, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
letter-spacing: 0.05em;
outline: none;
-webkit-tap-highlight-color: transparent;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.gradient-button:hover {
animation-name: gradient;
-webkit-animation-name: gradient;
animation-duration: 2s;
-webkit-animation-duration: s;
animation-iteration-count: 1;
-webkit-animation-iteration-count: 1;
animation-fill-mode: forwards;
-webkit-animation-fill-mode: forwards;
}
@keyframes gradient {
0% {
background-position: 0% 50%;
}
100% {
background-position: 100%;
}
}
This seems to have done the trick. Please clear your browser’s cache and check the page.
Cheers!
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.