How do I make my website buttons shrink with the screen resolution? - html

My current website is having "issues" (not really a issue just bothers me) with my buttons hiding when the resolution changes to something smaller. Here is a gif so you understand it better. https://i.imgur.com/nlkJs5G.gifv. How can I fix it so it shrinks with the page so people can still click it on different screen resolutions?
Underneath is the html for the buttons. The .css for fab or fa-steam-symbol or fa-discord etc. is from https://fontawesome.com/ (if anyone is not familiar with it)
.awrapper{
align-content:center;
background-size:cover;
display:flex;
display:-ms-flexbox;
display:-webkit-flex;
flex-direction:row;
flex-wrap:wrap;
justify-content:center;
min-height:100%;
ms-flex-direction:row;
ms-flex-line-pack:center;
ms-flex-pack:center;
ms-flex-wrap:wrap;
webkit-align-content:center;
webkit-flex-direction:row;
webkit-flex-wrap:wrap;
webkit-justify-content:center;
}
.media{
font-size:30px;
text-align:center;
padding-top:30px;
}
.media>a{
margin-right:80px;
text-decoration:none;
transition:color 0.5s ease;
}
.media>a#vk{
font-size:35px;
}
.media>a:last-child{
margin-right:0;
}
.animated{
-webkit-animation-duration:2s;
animation-duration:3s;
-webkit-animation-fill-mode:both;
animation-fill-mode:both
margin: 500px
}
#-webkit-keyframes fadeInUpBig{
from{
opacity:0;
-webkit-transform:translate3d(0,2000px,0);
transform:translate3d(0,2000px,0)
}
to{
opacity:1;
-webkit-transform:none;
transform:none
}
}
#keyframes fadeInUpBig{
from{
opacity:0;
-webkit-transform:translate3d(0,2000px,0);
transform:translate3d(0,2000px,0)
}
to{
opacity:1;
-webkit-transform:none;
transform:none
}
}
.fadeInUpBig{
-webkit-animation-name:fadeInUpBig;
animation-name:fadeInUpBig
}
.hvr-grow {
display: inline-block;
vertical-align: middle;
-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);
box-shadow: 0 0 1px transparent;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-property: transform;
transition-property: transform;
}
.hvr-grow:hover, .hvr-grow:focus, .hvr-grow:active {
-webkit-transform: scale(2);
transform: scale(2);
}
<div class="awrapper">
<div class="media animated fadeInUpBig" style="animation-delay: 5s;">
<a href="BLNAK_LINK/Steam" target="_blank">
<i class="fab fa-steam-symbol hvr-grow" title="Steam"></i>
<a href="BLNAK_LINK/discord" target="_blank">
<i class="fab fa-discord hvr-grow" title="Discord"></i>
</a>
<a href="BLNAK_LINK/hosting" target="_blank">
<i class="fab fa-ioxhost hvr-grow" title="Hosting"></i>
</a>
<a href="BLNAK_LINK/TRADEOFFER" target="_blank">
<i class="far fa-handshake hvr-grow" title="Tradelink"></i>
</a>
<a href="BLNAK_LINK/PLAYLIST" target="_blank">
<i class="fas fa-music hvr-grow" title="Playlist"></i>
</a>
</div>
</div>
If I am missing anything or if you have questions please let me know and I will try to answer them.

Thanks for your help guys. You can check out the site and how it looks.
I added a new class called unmoveable
From
<div class="media animated fadeInUpBig" style="animation-delay: 5s;">
To
<div class="media animated fadeInUpBig unmoveable">
The css
.unmoveable {
animation-delay: 5s;
position:fixed;
bottom: 100px;
}

Related

Why my keyframes aren´t working as i hover over? [duplicate]

This question already has answers here:
CSS transform doesn't work on inline elements
(2 answers)
Closed 14 days ago.
I am trying to do a css animation on different spans as i hover over them but they are not working and i cant figure out why.
This is my html:
<div className="content">
<h2>Hello, I´m <br/>
<span className='bounce'>M</span>
<span className='bounce'>a</span>
<span className='bounce'>t</span>
<span className='bounce'>e</span>
<span className='bounce'>o </span>
<span className='bounce'>G</span>
<span className='bounce'>h</span>
<span className='bounce'>i</span>
<span className='bounce'>d</span>
<span className='bounce'>i</span>
<span className='bounce'>n</span>
<span className='bounce'>i</span></h2>
<div className="animated-text">
<h3>Web Designer</h3>
<h3>Jr Full-stack Web Developer</h3>
</div>
<Button className="btn" content="See My Work"/>
<div className="media-icons">
<i className="fab fa-linkedin-in"></i>
<i className="fab fa-github"></i>
</div>
</div>
And this is my css:
.main .content h2{
color:#FFF;
font-size:2em;
font-weight:500;
}
.main .content h2 span{
font-size:2.8em;
font-weight:600;
}
.main .content h2 span:hover{
color: #08fdd8;
animation: animate 0.6s;
}
#keyframes animate {
25%{
transform: scale(0.8, 1.3);
}
50%{
transform: scale(1.1, 0.8);
}
75%{
transform: scale(0.7, 1.2);
}
}
So as i hover the property that changes the color works, but it seems that the animation isn´t being triggered or something because it doesn´t do anything
You should put display: inline-block on those spans for animation to work. You can't manipulate the size of them as they are inline elements by default:
.main .content h2 span{
font-size:2.8em;
font-weight:600;
display: inline-block;
}

CSS transition with nested classes

I am trying to create animation using pure CSS.
Here is my html structure
<div class="portfolio-item col-xs-12 col-sm-4 col-md-3" data-groups='["all", "identety", "interface"]'>
<div class="portfolio-bg">
<div class="portfolio">
<div class="tt-overlay"></div>
<div class="links">
<a class="image-link" href="images/works/portfolio-1.jpg"><i class="fa fa-search-plus"></i></a>
<i class="fa fa-link"></i>
</div><!-- /.links -->
<img class="portfolio-image" src="images/works/portfolio-1.jpg" alt="image">
<div class="portfolio-info">
<h3>Portfolio Title</h3>
</div><!-- /.portfolio-info -->
</div><!-- /.portfolio -->
</div><!-- /.portfolio-bg -->
</div><!-- /.portfolio-item -->
And my CSS styles
#imageHoverRotationAngle : 10deg;
#imageHoverScaleValue : 1.5;
#imageHoverAnimationTime : 0.5s;
.portfolio:hover .tt-overlay,
.portfolio:hover .links {
opacity: 1;
-webkit-transform: translate(0,0);
-moz-transform: translate(0,0);
-ms-transform: translate(0,0);
-o-transform: translate(0,0);
transform: translate(0,0);
}
.portfolio:hover .portfolio-image {
-webkit-transform:rotate(#imageHoverRotationAngle) scale(#imageHoverScaleValue);
-moz-transform:rotate(#imageHoverRotationAngle) scale(#imageHoverScaleValue);
-ms-transform:rotate(#imageHoverRotationAngle) scale(#imageHoverScaleValue);
-o-transform:rotate(#imageHoverRotationAngle) scale(#imageHoverScaleValue);
transform:rotate(#imageHoverRotationAngle) scale(#imageHoverScaleValue);
}
.portfolio .portfolio-image {
-webkit-transition:all #imageHoverAnimationTime ease-out;
-moz-transition:all #imageHoverAnimationTime ease-out;
-ms-transition:all #imageHoverAnimationTime ease-out;
-o-transition:all #imageHoverAnimationTime ease-out;
transition:all #imageHoverAnimationTime ease-out;
}
I cannot get it working.
In this case only portfolio-image is being animated, if css animation styles for portfolio-image than tt-overlay and links will work.
Is it possible to achieve both animations tt-overlay,links and portfolio-image at the same time ?
You haven't set initial opacity for your elements and every animated element should have transition property. + your example is a little bit empty without values.
Here is a plunker. I've added some values, so you can see changes. It's in Sass, but no a big difference.
.portfolio .tt-overlay, .portfolio .links { opacity: 0; }
https://plnkr.co/edit/ll29vpEkifg68W0yvaal?p=preview

Trying to get an image overlay and image zoom to appear at same time on mouse hover

I'm having difficulty trying to get an image overlay and image zoom to appear at the same time on mouse hover. For some reason, the overlay disappears when I added the image zoom. It seems like one webkit transition cancels the other out. Either the zoom will work or the overlay will appear but not both. Any help is greatly appreciated, I've been researching for hours and can't seem to figure it out.
HTML Code:
<div class="image_wrap">
<div class="caption">
<i class="fa fa-search-plus" aria-hidden="true"></i>
<p class="heading">
Resort Website
</p>
</div>
<img src="css/images/resort.jpg" alt="resort" class="portfolio-pic">
</div>
CSS Code:
.image_wrap{
position:relative;
}
.image_wrap .caption{
position:absolute;
width:100%;
height:100%;
opacity: 0;
text-align:center
display:inline-block;
background: linear-gradient(rgba(51, 153, 170, 0.9), rgba(51, 153, 170, 0.8));
-webkit-transition:all .4s ease-in-out;
transition:all .4s ease-in-out
}
.image_wrap .caption:hover{
opacity: 1;
}
.image_wrap .caption img {
position:relative;
-webkit-transition:all .4s linear;
transition:all .4s linear;
}
.image_wrap .caption:hover img {
-ms-transform:scale(1.2);
-webkit-transform:scale(1.2);
transform:scale(1.2);
}
I detect two problems on your code, change this:
.image_wrap .caption:hover img {
-ms-transform:scale(1.2);
-webkit-transform:scale(1.2);
transform:scale(1.2);
}
For this:
.image_wrap:hover img {
-ms-transform: scale(1.2);
-webkit-transform: scale(1.2);
transform: scale(1.2);
z-index:8;
}
You can answer why. Because your image not inside .caption and you didn't declare the z-index (caption on the image).
Declare the z-index on caption too.
.image_wrap:hover .caption {
opacity: 1;
z-index:9999;
}
Here is the link for jsfiddle where I test our code: link

How to apply effect just to background image and not text

I'm searching a way to make an css effect but with exception of not applying the effect to the letters and the buttons (Only to the image), so I need create a rule in css. I can't change the order of the things.
With my code, I get something like this.
This is my code, like you can see I applied some effect in css and this is getting applied to all. I only need it for the image.
.myimage01 {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.myimage01:hover {
-webkit-transform: scale(1.3);
transform: scale(1.3);
}
<li id="armonioso-text-2" class="widget widget_armonioso_text">
<div class="armonioso-textwidget-wrapper armonioso-textwidget-no-paddings">
<!-- Here I'm currently Applying the efect -->
<div class="armonioso-textwidget myimage01" data-style="background-image: url(http:www.myurl.com/image.jpg);padding: 40px 30px ;color: #ffffff;text-align: center;">
<h5>hello world</h5>
<h3>Here how works</h3>
<p>Take a look of new things
<p><a class="btn alt" href="about/index.html" target="_self">About me</a>
</div>
</div>
<!-- Here I'm currently Applying the efect -->
</li>
When I apply the effect apply the effect to the letters (h5, h3, p and the button with btn class)
I don't want the effect for them, only for the background-image.
How can I do?
for transition backgrounds use the property background-size, and use background-position to adjust as fits you better
body {
margin: 0
}
.myimage01 {
background-size: 100%;
background-position:center center;
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
background-image: url(http://lorempixel.com/1600/900);
padding: 40px 30px;
color: #ffffff;
text-align: center;
}
.myimage01:hover {
background-size: 130%;
}
<li id="armonioso-text-2" class="widget widget_armonioso_text">
<div class="armonioso-textwidget-wrapper armonioso-textwidget-no-paddings">
<!-- Here I'm currently Applying the efect -->
<div class="armonioso-textwidget myimage01">
<h5>hello world</h5>
<h3>Here how works</h3>
<p>Take a look of new things
<p><a class="btn alt" href="about/index.html" target="_self">About me</a>
</div>
</div>
<!-- Here I'm currently Applying the efect -->
</li>
Use background-size for transition:
div {
background-image: url(http://lorempixel.com/400/200/sports/1/);
background-size: 100%;
background-repeat:no-repeat;
background-position:50% 50%;
width:400px;
height:200px;
transition: background-size 200ms linear;
text-align:center;
line-height:200px;
}
div:hover {
background-size: 120%;
}
<div>
Some text
</div>
try to transform the background-size property instead of scaling the whole container.
You can apply transform on background-size, background-position to get the effect on the background image.
.myimage01 {
background-size:100%;
background-position:0px 0px;
-webkit-transform: all;
transform: all;
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.myimage01:hover {
background-size:140%;
background-position:-50px -50px;
-webkit-transform: all;
transform: all;
}
<li id="armonioso-text-2" class="widget widget_armonioso_text">
<div class="armonioso-textwidget-wrapper armonioso-textwidget-no-paddings">
<!-- Here I'm currently Applying the efect -->
<div class="armonioso-textwidget myimage01" style="background-image: url(http://dummyimage.com/600x200/000/fff);padding: 40px 30px ;color: #ffffff;text-align: center;">
<h5>hello world</h5>
<h3>Here how works</h3>
<p>Take a look of new things
<p><a class="btn alt" href="about/index.html" target="_self">About me</a>
</div>
</div>
<!-- Here I'm currently Applying the efect -->
</li>

auto zoom in n out CSS (apple-like slideshow effect)

I like pretty much the slow auto zoom in and out effect on that site : http://watchingtheworldcup.com/ for banner images such as the very top one.
I tired to replicate it, by looking at developer tools wihtin browser, but have some trouble implementing it as in developper tool some mentions are stroked etc.
here is my html :
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<a href="#">
<article class="article_container">
<img class="article_image_hompage5" src="#">
<h2 class="article_title_hompage3"> a favourite thai soup</h2>
</article>
</a>
</div>
</div>
and my css for the image :
.article_image_hompage5{
width: 100%;
border-radius: 2px 2px 2px 2px;
position:relative;
display:block;
margin-left:auto;
margin-right:auto;
margin-top:15px;
z-index:0;
}
Can someone help with with finding the right css settings ?
cheers,
Use css animation you can get the similar result.
/* Chrome, Safari, Opera */
#-webkit-keyframes zoom {
from {
-webkit-transform: scale(1,1);
}
to {
-webkit-transform: scale(1.5,1.5);
}
}
/* Standard syntax */
#keyframes zoom {
from {
transform: scale(1,1);
}
to {
transform: scale(1.5,1.5);
}
}
img {
-webkit-animation: zoom 50s; /* Chrome, Safari, Opera */
animation: zoom 50s;
}
<img alt="" src="http://watchingtheworldcup.com/photos/worldcup1.jpg" />
If you want to also zoom out you need to define the the milestones in your keyframes as such:
#-webkit-keyframes zoominout {
0% {
-webkit-transform: scale(1,1);
}
50% {
-webkit-transform: scale(1.5,1.5);
}
100% {
-webkit-transform: scale(1.1,1.1);
}
}
Use css transform:scale();
like:
JavaScript:
window.onload=function(){
$("#content").fadeOut(4000);
$("#background").addClass("zoom");
setTimeout(function(){
$("#background").removeClass("zoom");
},5000);
}
body{
margin:0px;
padding:0px;
width:100%;
height:100%;
}
#background{
position:absolute;
top:0px;
left:0px;
width:100%;
height:100%;
background:url("http://watchingtheworldcup.com/photos/worldcup1.jpg") center center no-repeat;
background-size: 100% 100%;
display:inline-block;
z-index:2;
transition:all ease 4.1s;
/* transform:scale(1,1);*/
}
#content{
position:absolute;
top:0px;
left:0px;
width:100%;
height:100%;
z-index:3;
background-color:rgba(0,0,0,0.5);
color:#ffffff;
font-size:50px;
}
.zoom{
transform:scale(1.2,1.2);
}
HTML:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<div id="background">
</div>
<div id="content">
<center><br /><br /><br /><br /><br /><br />
Watching...
</center>
</div>