Image gets abnormally scaled when hovering on other images - html

I have a site which has a couple of images and I implemented a hover effect on the images but for some reason, one of my other images (in another div scales up and gets misaligned). I thought this might be because of some conflicting classes. But that doesn't seem to be the case.
Since, I might have to upload the code for the whole site. I've uploaded it on a JSFiddle.
Here it is: https://jsfiddle.net/40swprv2/7/
Here's the error causing code
.tile {
position: relative;
width: 100%;
}
.image {
display: block;
width: 100%;
height: auto;
}
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
transition: .5s ease;
background-color: rgba(0, 0, 0, 0.8);
}
.tile:hover .overlay {
opacity: 1;
}
.text {
color: white;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
text-align: center;
}
The code causing the error is in style.css line 263 - 303 of the JSFiddle. I've commented it out for now so u can see the result.
What am I doing wrong?

Related

CSS Hover - Not aplying to certain element

I'm quite new to coding and I'm having trouble with the "hover".
It opens already on other parts of the website, but not on the specific location I want. Also it somehow stays opened after hovering and leaving the position. Does someone know why? :)
.pill1 {
position: absolute;
left: 300px;
top:10px;
opacity: 1;
display: block;
transition: .5s ease;
backface-visibility: hidden;
}
.middle {
transition: .5s ease;
opacity: 0;
position: absolute;
top: 15%;
left: 38%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
text-align: center;
z-index: 100;
}
.container:hover .pill1 {
}
.container:hover .middle {
opacity: 1;
}
.text {
background-color: rgba(22, 32, 162, 0.44);
color: rgba(242, 0, 255, 0.55);
font-family: Akzidenz-Grotesk Pro, bold;
font-size: 20px;
padding: 16px 32px;
width: 300px;
}
<div class="container">
<img src="images/xanax0001.png" alt="Avatar" class="pill1" >
<div class="middle">
<div class="text">"....".</div>
</div>

iPhone (Safari and Chrome both) position: fixed bug?

I have this website
On desktop everything works fine, but on iPhone (Safari and Chrome both) I have problem with preloader:
Bug screenshot
CSS:
.preloader_wrapper {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background: #000;
z-index: 100500;
}
.preloader {
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 50%;
width: 50px;
height: 50px;
}
.preloader::before {
content: '';
position: absolute;
box-sizing: border-box;
top: 0;
left: 0;
width: 50px;
height: 50px;
border-radius: 50%;
border: 4px solid #951b25;
border-left-color: transparent;
border-right-color: transparent;
animation: spin 1s linear infinite;
}
#keyframes spin {
0% {
transform: rotate(0deg) scale(1);
}
50% {
transform: rotate(45deg) scale(1.2);
}
100% {
transform: rotate(360deg) scale(1);
}
}
HTML:
<div class="preloader_wrapper">
<div class="preloader"></div>
</div>
Due to my googling I think the problem is in position fixed. How to solve it?
Hmm, I think .preloader absolute positing might fix it. I'm on a phone right now so can't test it. Otherwise I suggest to try display; flex; with justify and alignment props on the .preloader_wrapper and remove all the positioning stuff from the .preloader itself.

Animation jerking on mobile and sometimes not working at all

I am trying to create a different loading animation (revealing content). I managed to get it to work pretty well on the desktop, but it doesn't want to work well on mobiles. On a mobile it will jerk or when it does catch up the animation has completed.
The animation is just 2 divs like this:
<div id="loader-wrapper">
<div class="loader-background"></div>
</div>
And the CSS is like this:
#loader-wrapper {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
}
#loader-wrapper .loader-background {
position: fixed;
top: 0;
width: 100%;
height: 100%;
z-index: 1000;
background-color: #000000;
}
#loader-wrapper .loader-background::after {
content: "";
position: absolute;
border-radius: 100%;
top: -750px;
right: 0;
width: 2000px;
height: 2000px;
box-shadow: 0 0 0 20000px #000000;
transition: all 3s;
transform: scale(0.1);
opacity: 1;
/* Start off-screen */
}
.loaded #loader-wrapper {
visibility: hidden;
}
.loaded #loader-wrapper .loader-background::after {
transform: scale(1);
opacity: 0;
}
I have created this on code pen so you can see it in action:
https://codepen.io/r3plica/pen/rwLagV
Does anyone know of a way I can get this working without having the jerking motion?

Issues with getting layer to show as transparent until displayed with z-index

I have a couple sets of layers that are all set to position: absolute; and they display over each other. I have delays and fadeOut's in place so it acts in sequence. For some reason on my last display layer, if I set the z-index to a number that is displays, it effects all of the others, even though it is not showing. There will just be a blank section with my background-color, sort of like a block.
Here is the code for it. The div in question is home-learn. I have tried changing the z-index to be above the other layers, equal and less than equal. Each different way causes its own separate issue.
For example, right now I have it set to 1 z-index number less than the layer over top of that. Doing this causes it not to show, but if I make it equal or more, the background-color will go over-top of blue-home-text in the size of the wording for home-learn.
Does anyone see what I am doing wrong? To see this live may help. In a comment below, I will add the live site. You will see it right on page load, after the sequence completes.
<div class="red">
<div id="hand-wrap"><img src="/images/hand.png" class="hand" alt="HELLO"></div>
<span class="hand-text">HELLO</span>
<div class="circle">
<div class="spinner top topright"></div>
<div class="spinner top topleft"></div>
<div class="spinner bottom bottomleft"></div>
<div class="spinner bottom bottomright"></div>
<div class="mask q2"></div>
<div class="mask q4"></div>
</div>
<div id="circle-text">We're Optimum
<br>Designs</div>
<div id="blue-home-text">We build beautiful, engaging sites for companies both large and small.</div>
<!-- <div id="text-button"><span class="border-span">More About Us</span></div> -->
<div id="home-learn">
<div id="curtain-div"></div>
Learn more...
</div>
</div>
.red {
background-color: #0085A1;
width: 100%;
height: 100vh;
position: relative;
text-align: center;
}
.hand {
width: auto;
height: auto;
position: absolute;
z-index: 100;
-webkit-transform: translate(-50%, -50%) rotate(0deg);
transform: translate(-50%, -50%) rotate(0deg);
top: 60%;
left: 50%;
-webkit-animation: wave 4s 1 normal forwards;
animation: wave 4s 1 normal forwards;
}
.hand-text {
position: absolute;
text-align: center;
left: 0;
right: 0;
top: 42%;
color: #FFF;
font-size: 2em;
font-weight: bold;
opacity: 0;
-webkit-animation: waveTxt 2s 0s 2 alternate;
animation: waveTxt 2s 0s 2 alternate;
}
.circle {
display: none;
z-index: 99;
width: 500px;
height: 500px;
position: absolute;
background: inherit;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%) rotate(0deg);
transform: translate(-50%, -50%) rotate(0deg);
}
.spinner {
width: 250px;
height: 250px;
position: absolute;
border: 5px solid #b5f2ff;
z-index: 10;
}
#circle-text {
display: none;
position: absolute;
color: #FFF;
font-size: 2.3em;
text-align: center;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
z-index: 100;
}
#blue-home-text {
color: #FFF;
display: none;
text-align: center;
position: absolute;
margin: 0 25%;
top: 50%;
font-size: 2.3em;
z-index: 99;
}
#home-learn {
color: #FFF;
position: absolute;
text-align: center;
/*margin: 0 25%;*/
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
font-size: 2.3em;
z-index: 98;
}
After reviewing your code I believe the following CSS should help with the laying issue. This should avoid the curtain layer from showing on top of the blue-home-text.
#home-learn {
z-index: 99;
}
#blue-home-text {
z-index: 100;
}

How to apply a thickness for this door?

Please see the code in the code pen in this link.
I wasted two or three hours on this and decided to not to waste anymore.
I already tried the code right here and it is not working.
.coin {
background-image: url("http://coins.thefuntimesguide.com/images/blogs/presidential-dollar-coin-reverse-statue-of-liberty-public-domain.png");
background-size: 100% 100%;
border-radius: 100%;
height: 100px;
margin: 50px auto;
position: relative;
width: 100px;
-webkit-transition: .5s linear;
-webkit-transform-style: preserve-3d;
}
.coin:after {
background-color: #a37131;
background-image: -webkit-linear-gradient(hsla(0,0%,100%,.25), hsla(0,0%,0%,.25));
bottom: 0;
content: '';
left: 45px;
position: absolute;
top: 0;
width: 5px;
z-index: -10;
-webkit-transform: rotateY(-90deg);
-webkit-transform-origin: 100% 50%;
}
.coin:before {
background-color: #a37131;
background-image: -webkit-linear-gradient(hsla(0,0%,100%,.25), hsla(0,0%,0%,.25));
border-radius: 100%;
content: '';
height: 100px;
left: 0;
position: absolute;
top: 0;
width: 100px;
-webkit-transform: translateZ(-5px);
}
.coin:hover {
-webkit-transform: rotateY(90deg);
}
All I want to know is how to apply thickness to the door visible to a user.
You need to add -webkit-transform-style: preserve-3d; to 'div.thumb' element.