Hover animation bounce - html

I am trying to make it so that the H2 and the span text has a bit of a bounce effect towards the end of the hover animation I've created. What I am trying to do can be seen in the following example. Just to be clear in that example, SCSS is being used. I am not using SCSS so I am not 100% sure what I am trying to do is possible with just plain CSS but I sure hope it is because that is what I am using for my project. So the code below shows you what I was able to do. The H2 and span text have a basic start point and end point animation on hover. I want it to have a little bounce towards the end(like in the linked example I shared) something I feel I need to add key-frames to in order to achieve. But I don't know if its even possible to add a key-frame animation on hover especially if I want it to animate back to its original position on mouse out. Am I wrong about this? I appreciate any solutions you guys might have. thank you.
body {
background-color: black;
}
.featured-list li {
display: inline-block;
margin-right: .8%;
}
.featured-list a {
display: block;
}
.featured-list {
text-align: center;
padding: 0;
margin: 0 auto;
}
a.feature-img img {
width: 425px;
border-radius: 5px;
transition: .2s linear;
}
a.feature-img {
text-align: center;
}
.f-cta, .f-img-content h2 {
font-family: 'Abel',Helvetica,Arial,Lucida,sans-serif;
font-weight: 100;
position: absolute;
left: 0;
right: 0;
margin: 0 auto;
}
.f-img-content h2 {
color: #fff;
top: -60%;
transition: .2s linear;
}
.f-cta {
background: #fff;
width: 50%;
border-radius: 3px;
padding: 7px;
color: #000;
top: 120%;
font-size: 1.3em;
transition: .2s linear;
}
.f-img-content {
position: relative;
text-align: center;
overflow: hidden;
}
a.feature-img:hover img {
opacity: .6;
}
a.feature-img:hover h2 {
transform: translateY(1065%);
}
a.feature-img:hover span.f-cta {
transform: translateY(-600%);
}
<ul class="featured-list">
<li><a href="#" class="feature-img">
<div class="f-img-content">
<img src="https://i.imgur.com/EENJU66.gif">
<h2>Lorem Ipsum project title</h2>
<span class="f-cta">View Project</span>
</div>
</a></li>
<!--li><a href="#" class="feature-img">
<img src="https://i.imgur.com/EENJU66.gif">
</a></li>
<li><a href="#" class="feature-img">
<img src="https://i.imgur.com/EENJU66.gif">
</a></li>
<li><a href="#" class="feature-img">
<img src="https://i.imgur.com/EENJU66.gif">
</a></li-->
</ul>

You just need cubic-bezier transitions.
Something like this one - https://easings.net/#easeInOutBack
Or the same as this from your example:
transition:all .3s cubic-bezier(.3, 0, 0, 1.3);
Just play around with it :)

Related

My navigation buttons in HTML website renders in Chrome and Firefox but not Safari?

Here I have the issue where my navigation bar for my website renders in Chrome and Firefox, but in Safari, it does not render at all. The clicks still work, but I cannot see the buttons visually.
See this picture:
Firefox is on the left and Safari is on the right.
Here is the HTML code for the navigation bar:
<nav class="topbar">
<div class="nav_graphics">
<a href="https://play.google.com/store/apps/dev?id=4853083882678511028" target="_blank">
<img class="toxic_flame_icon" src="/images/toxicflame427_icon.png" alt="ToxicFlame427 Icon"/>
</a>
<h1 class="title_header">ToxicFlame427</h1>
</div>
<div class="nav_buttons">
<!--Link the different pages to the main site-->
<a href="/index.html">
<button>
<h3>Home</h3>
</button>
</a>
<a href="/pages/my_creations.html">
<button>
<h3>My Creations</h3>
</button>
</a>
<a href="/pages/about.html">
<button>
<h3>About</h3>
</button>
</a>
<a href="/pages/bug_report.html" class="report_bug_button">
<button>
<h3>Report A Bug</h3>
</button>
</a>
</div>
</nav>
And here is the CSS for it too:
#font-face {
font-family: "ArcadeClassic";
src: url("/font/ArcadeClassic.woff");
}
.topbar{
padding: 10px;
align-content: flex-start;
width: 100%;
height: wrap;
background-color: black;
}
.nav_graphics{
display: flex;
}
.nav_buttons{
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.title_header{
font-family: "ArcadeClassic";
font-size: 2.0em;
vertical-align: top;
display: inline-block;
color: teal;
margin-left: 20px;
margin-right: 20px;
}
.toxic_flame_icon{
display: inline-block;
height: 100px;
transition: 1s;
}
.toxic_flame_icon:hover{
transform: rotate(180deg);
}
.topbar button{
font-size: 0.9em;
transition: 0.25s;
-webkit-transition: 0.25s;
-moz-transition: 0.25s;
-o-transition: 0.25s;
position: relative;
bottom: 15px;
border-radius: 5px;
border-color: transparent;
color: red;
height: 15%;
width: 130px;
background-color: transparent;
font-weight: bold;
margin-top: 15px;
}
#media only screen and (max-width:600px){
.topbar button{
font-size: 0.8em;
}
.title_header{
font-size: 1.7em;
}
}
.topbar button:hover{
color: turquoise;
transform: translateY(-5px);
-webkit-transform: translateY(-5px);
-o-transform: translateY(-5px);
-ms-transform: translateY(-5px);
-moz-transform: translateY(-5px);
}
/*Make sure that the little blue lines cant be seen*/
.topbar a{
color: transparent;
}
May it have something to do with font? Or something else i did not catch?
The site is online at https://toxicflame427.xyz if anyone needs to see more code.
It's happening because your button element has 15% height and the way Safari and other browsers handle the overflow inside a button is different.
Simply remove the height restriction (or set it larger) and it will work.
Also, side note: in both browsers, the button is not covering its content and it's not a good practice. Plus, a percentage height inside an a element without a specified height is not good either.

Slow down transition top ease of button

I have a button that goes up when hovered. The transition time is supposed to be 1 second but it's not working. Here is the code:
<style>
#talk-to-us {
padding: 10px!important;
height: 43px!important;
width: 148px!important;
background-color: #0ee9f5!important;
display: inline-auto!important;
margin-right: 5px;
position: relative;
transition: top ease 1.0s; /*this is not working*/
}
#talk-to-us:hover {
top: -10px;
text-decoration:underline;
}
#link {
color: white!important;
font-size: 14px!important;
padding: 10px!important;
}
</style>
<button id="talk-to-us">
<b>
<a id="link" href="#">TALK TO US!</a>
</b>
</button>
Any idea what the cause could be?
If you need a transition from something to anything... first you need to give the "something" the transition property. So just add top:0 to the origin. like this:
<style>
#talk-to-us {
padding: 10px!important;
height: 43px!important;
width: 148px!important;
background-color: #0ee9f5!important;
display: inline-auto!important;
margin-right: 5px;
position: relative;
transition: top ease 1.0s; /*this is not working*/
top:0;
}
#talk-to-us:hover {
top: -10px;
text-decoration:underline;
}
#link {
color: white!important;
font-size: 14px!important;
padding: 10px!important;
}
</style>
<button id="talk-to-us">
<b>
<a id="link" href="#">TALK TO US!</a>
</b>
</button>

How to change the properties of a fontawesome icon inside a div?

I've been trying to change the icon on my website's side navigation bar to beige but I cannot seem to do it...
I am aware that I should override the icon's property in CSS to do so however, I'm not sure which property I should set
I've tried:
setting .fa-twitter class position to relative
setting .fa-twitter class color to beige
creating a div for the icons inside the parent side navigation div
then changing class fa-twitter's color to white
notes: I used a hover animation for my navigation bar so I want that to stay
HTML:
<div class="container">
<div class="sidebar">
<img id="mainicon" src="mainicon.png">
<h2>Nikukurin</h2>
<hr>
<a id="hvr-bounce-to-right" href="#">HOME</a>
<a id="hvr-bounce-to-right" href="#">PORTFOLIO</a>
<a id="hvr-bounce-to-right" href="#">COMMISSIONS</a>
<a id="hvr-bounce-to-right" href="#">PRODUCTS</a>
</div>
</div>
CSS:
.container {
display: flex;
flex-direction: row;
}
.sidebar {
text-align: center;
position: fixed;
width: 20%;
top: 0;
bottom: 0;
left: 0;
min-width: 200px;
background: #ff9999;
padding: 1%;
}
#mainicon {
border-radius: 50%;
width: 40%;
padding: 3%;
}
.sidebar a {
text-align: left;
text-decoration: none;
display: block;
padding: 5%;
color: beige;
font-family: nikuhead;
letter-spacing: 2px;
position: relative;
margin: 5%;
}
#hvr-bounce-to-right:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #ffbc57;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transform-origin: 0 50%;
transform-origin: 0 50%;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.2s;
transition-duration: 0.5s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
#hvr-bounce-to-right:hover,
#hvr-bounce-to-right:focus,
#hvr-bounce-to-right:active {
color: #ff6666;
text-decoration: none;
}
#hvr-bounce-to-right:hover:before,
#hvr-bounce-to-right:focus:before,
#hvr-bounce-to-right:active:before {
-webkit-transform: scaleX(1);
transform: scaleX(1);
-webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
}
output right now:
output i want: there's supposed to be a twitter icon right under the "nikukurin" and it's supposed to be white but it's the same color as the div background
thank you for taking the time to read this and thank you for anyone answering in advanced!
ok i found the answer!
so what i was doing wrong is particularly this line:
which was supposed to be
<i class="fa fa-twitter"></i>
First thing is u are missing syntax ,
<i class="fa fa-twitter"></i>
And if that doesn't change the color then:
.sidebar a{
color : white;
}
your code should be changed to this:
<i class="fa fa-twitter"></i>
I am unable to understand the question clearly but whatever i have understood you have to first correct html syntax
<i class="fa fa-twitter"></i>
it will show you the icon, then apply the css to change the icon color
.sidebar a{color:#F5F5DC}

Why is there a link under the navbar element? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am just trying to remove the underline that is on the navbar sub categories (courses, about me). I think it is because there is a href, but I don't know what code to use to get rid of it. I tried using text-decoration: none but that didn't work. Also feel free to give me more suggestions on how I can make this website better!
body {
margin: 0;
}
/*Headings*/
/*Navbar*/
.navbar {
background-color: #005070;
overflow: hidden;
}
.navbar a {
font-family: 'Montserrat Alternates', sans-serif;
float: right;
color: white;
margin: 23px 20px 0px 0px;
animation: fadeIn 2s;
text-decoration: none;
}
.navtext::after {
content: '';
display: block;
width: 0;
height: 2px;
background: #fff;
transition: width .3s;
}
.navtext:hover::after {
width: 100%;
transition: width .3s;
}
.navimg {
width: 175px;
height: auto;
margin: 5px 0px 5px 20px;
animation: fadeIn 2s;
}
.navlogin {
width: 75px;
height: auto;
float: right;
margin: 15px 20px 0px 0px;
animation: fadeIn 4s;
}
#keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.fadeIn {
animation-name: fadeIn;
}
<div class="navbar">
<img class="navimg" src="Assets/Logo White.png">
<img class="navlogin" src="Assets/Login.png">
<a class="navtext" href="Pages/Courses/index.html">Courses</a>
<a class="navtext" href="Pages/About Me/index.html">About Me</a>
</div>
<div class="head1">
<h1>Placeholder text</h1>
</div>
<div class="head2">
<h1>Placeholder text</h1>
</div>
If you mean the underline on mouse over the link, try removing this code from your CSS:
.navtext::after {
content: '';
display: block;
width: 0;
height: 2px;
background: #fff;
transition: width .3s;
}
.navtext:hover::after {
width: 100%;
transition: width .3s;
}
If you don't have the link in that URL then use below property to that selector
text-decoration:none;
here is the example:
<a style="text-decoration:none" href="http://google.Com">Google</a>
this is an example for your code:
.navtext {
text-decoration: none;
}
<div class="navbar">
<img class="navimg" src="Assets/Logo White.png">
<img class="navlogin" src="Assets/Login.png">
<a class="navtext" href="Pages/Courses/index.html">Courses</a>
<a class="navtext" href="Pages/About Me/index.html">About Me</a>
</div>

How to change color of parent on hover the child element

I have a div with social links and I want to make background color to fill whole div when hover any anchor with different color depending on which link is hovered.
For now background changes only beneath the anchor text.
I'm researching the way to fill whole parent with child's background color using pure CSS.
#social {
width: 400px;
height: 300px;
position: relative;
font-size: 36px;
font-weight: bold;
text-align: center;
}
a:link {
text-decoration: none;
transition: all .5s ease;
}
a:hover {
color: white;
}
#facebook:hover {
background: #3b5998;
}
#twitter:hover {
background: lightblue;
}
#google-plus:hover {
background: tomato;
}
#instagram:hover {
background: lightgreen;
}
<div id="social">
<a id="facebook" href="#"> <span>Facebook</span></a><br>
<a id="twitter" href="#"> <span>Twitter</span></a><br>
<a id="google-plus" href="#"> <span>Google plus</span></a><br>
<a id="instagram" href="#"> <span>Instagram</span></a><br>
</div>
For first sight It looks like another attempt to change style of parent element, but there is a way to achieve the effect using pure CSS.
The way is to use ::after pseudo-selector for anchor elements. We need to define it as absolutely positioned and set up to 100% dimensions of parent. Also to prevent overlapping of siblings, we need to decrease z-index attribute of pseudo-selector to render it beneath text.
Here is a snippet:
#social {
width: 400px;
height: 300px;
position: relative;
font-size: 36px;
font-weight: bold;
text-align: center;
}
a::after{
content: " ";
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: -1;
border-radius: 20px;
background: transparent;
transition: background .5s ease;
}
a:link {
text-decoration: none;
transition: color .5s ease;
}
a:hover {
color: white;
}
#facebook:hover::after {
background: #3b5998;
}
#twitter:hover::after {
background: lightblue;
}
#google-plus:hover::after {
background: tomato;
}
#instagram:hover::after {
background: lightgreen;
}
<div id="social">
<a id="facebook" href="#"> <span>Facebook</span></a><br>
<a id="twitter" href="#"> <span>Twitter</span></a><br>
<a id="google-plus" href="#"> <span>Google plus</span></a><br>
<a id="instagram" href="#"> <span>Instagram</span></a><br>
</div>