How would I be able to implement that?
Half an image on each side
Where 1 image fills both left and right panels.
I want one image to show as 1 whole image, then the transition effect to split it into 2 images.
code: https://jsfiddle.net/kqLpv21h/
.panel-left,
.paneldoor-right {
position: absolute;
height: 100%;
width: 50%;
top: 0%;
transition: all ease 8s;
background-image: url("https://picsum.photos/600");
background-size: 100%;
background-repeat: no-repeat;
background-position: top;
}
.panel-left {
left: 0%;
background-color: rgb(91, 96, 106);
}
.panel-right {
left: 50%;
background-color: rgb(229, 211, 211);
}
.curtain.slide .panel-left {
left: -50%;
}
.curtain.slide .panel-right {
left: 100%;
}
<div class="panel-left"> </div>
<div class="panel-right"> </div>
Currently the image fills in both the left and right side.
I want only one image to appear, that fills in both sides.
.panel-left,
.panel-right {
position: absolute;
height: 100%;
width: 50%;
top: 0%;
transition: all ease 8s;
background-image: url("https://picsum.photos/600");
- background-size: 100%;
+ background-size: 100vw;
background-repeat: no-repeat;
background-position: top;
}
.panel-left {
left: 0%;
background-color: rgb(91, 96, 106);
+ background-position: left;
}
.panel-right {
left: 50%;
background-color: rgb(229, 211, 211);
+ background-position: right;
}
This will make the Image seem like one. You might have to adjust some tiny things to fit your needs, but that's generally it.
Related
I want to create a gradient border animation starting from the top left to the bottom right. The animation will be used for images within this div.
I tried every degree of angle, but didn't get this to work in the direction I want, it always starts at the right top or at the bottom right.
Also tried it with negative degree values.
.block {
position: relative;
margin: 30px auto 0;
width: 250px;
height: 250px;
background: #272727;
}
.block:before, .block:after {
content: '';
position: absolute;
left: -1px;
top: -1px;
background: linear-gradient(45deg, rgba(0,0,0,0)35%, rgba(0,204,255,1)50%, rgba(0,0,0,0)65%);
background-size: 400%;
width: calc(100% + 2px);
height: calc(100% + 2px);
z-index: -1;
animation: shine 8s linear infinite;
}
#keyframes shine {
to {
background-position: 400% center;
}
}
.block:after {
filter: blur(8px);
}
<div class="block"></div>
Update your code like below:
.block {
position: relative;
margin: 30px auto 0;
width: 250px;
height: 250px;
background: #272727;
}
.block:after {
content: '';
position: absolute;
inset: -1px;
background: linear-gradient(-45deg, rgba(0, 0, 0, 0)35%, rgba(0, 204, 255, 1)50%, rgba(0, 0, 0, 0)65%);
background-size: 400% 400%;
z-index: -1;
animation: shine 3s linear infinite;
filter: blur(8px);
}
#keyframes shine {
from {
background-position: 100% 100%
}
to {
background-position: 0 0
}
}
<div class="block"></div>
I have a problem with a styling thing.
See preview:
The blue part is an div with an light gradient, the white part is an after with an white SVG.
What I want is de red part there comes an image, this means that I need to remove the after with the white SVG. But is it possible to make an border like the white SVG so the white part is transparant?
Hope someone can help me out!
Ps. sorry for my bad English.
Current code:
.border-bottom-white::after {
content: '';
background-image: url('img/bottom_border_white.svg');
background-size: cover;
background-position: bottom right;
background-repeat: no-repeat;
display: block;
width: 100%;
height: 85px;
position: absolute;
bottom: 0;
right: 0;
}
#topheader {
position: relative;
display: block;
width: 100%;
background: rgb(20,44,176);
background: linear-gradient(0deg, rgba(20,44,176,1) 0%, rgba(24,57,191,1) 100%);
background-size: auto;
background-image: url('img/header-bg.svg');
background-position: bottom center;
background-size: 100% auto;
padding-top: 15px;
padding-bottom: 45px;
transition: min-height 0.5s ease-out;
-webkit-transition: min-height 0.5s ease-out;
}
I have found the solution guys!
#topheader{
position: relative;
display: block;
width: calc(100% + 24px);
background: rgb(20, 44, 176);
background: linear-gradient(0deg, rgba(20, 44, 176, 1) 0%, rgba(24, 57, 191, 1) 100%);
background-size: auto;
background-image: url('img/header-bg.svg');
background-position: bottom center;
background-size: 100% auto;
padding-top: 45px;
padding-bottom: 45px;
transition: min-height 0.5s ease-out;
-webkit-transition: min-height 0.5s ease-out;
border-bottom-right-radius: 80px;
transform: rotate(1deg);
left: -20px;
top: -30px;
}
#topheader>.container{
transform: rotate(-1deg);
}
I'm trying to have an image inside a clip-path'd container display correctly. I wanted to add a slight zoom effect on hover as well.
A small part at the bottom is being cut off when not hovered.
However, once you hover the image and it zooms in, everything looks fine.
I cannot set a fixed height, which would solve the problem more easily since I want to add the image to a responsive flex container later.
I reduced the problem to its core in this jsfiddle: https://jsfiddle.net/pzf459cd/1/
.Image-Wrapper {
width: 50%;
}
.Image-Zoom-Wrapper {
clip-path: polygon(100% 0, 100% 91%, 62% 100%, 0 91%, 0 0, 62% 9%);
object-fit: contain;
}
.Image {
transition: all 0.5s linear;
}
.Image-Wrapper:hover .Image {
transform: scale(1.05, 1.05);
transition: all 0.5s linear;
}
body {
background-color: #000;
}
<div class="Image-Wrapper">
<div class="Image-Zoom-Wrapper">
<img class="Image" src="https://picsum.photos/id/304/500/300">
</div>
</div>
See my solution for a similiar task below. It works, but there might be an easier/better one.
jsfiddle: https://jsfiddle.net/fj5z7bue/
.wrap{
position: relative;
width: 50%;
filter: drop-shadow(3px 4px 8px rgba(38, 50, 56, 0.4));
}
.clip{
position: relative;
display: block;
overflow: hidden;
clip-path: polygon(60% 5%, 100% 0, 100% 95%, 60% 100%, 0 95%, 0 0);
height: 100%;
width: 100%;
background-color: rgb(240, 240, 240);
}
.pseudoimg{
width: 100%;
opacity: 0;
}
.img{
position: absolute;
top: 0;
left: 0;
z-index: 2;
background-image: url('https://picsum.photos/id/304/500/300');
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
min-height: 100%;
min-width: 100%;
transform: scale(1);
transition: all 0.4s ease-out;
}
.wrap:hover{
cursor: pointer;
}
.wrap:hover .img{
transform: scale(1.4);
transition: all 12s ease-out;
}
.button{
position: absolute;
height: 60px;
width: 60px;
border-radius: 30px;
background-color: rgb(255, 255, 255);
z-index: 3;
right: -15px;
bottom: -5px;
filter: drop-shadow(3px 4px 8px rgba(38, 50, 56, 0.4));
}
<div class="wrap">
<div class="button"></div>
<div class="clip">
<img class="pseudoimg" src="https://picsum.photos/id/304/500/300"/>
<div class="img"></div>
</div>
</div>
Is it possible to do free transforms of an element using CSS - similar to a mesh transform?
The closest I can get to this is using something like transform: perspective(400px) rotateY(45deg); with three elements, but I would like it to be one continuous img element.
You can consider 3 elements and background-image. The trick is to adjust the background-size/background-position to create the illusion of one continuous image.
Hover to see the result:
.box {
margin: 50px auto;
width: 200px;
height: 200px;;
background-size: 300% auto;
background-position: center;
position: relative;
}
.box:before,
.box:after {
content: "";
position: absolute;
width: 100%;
top: 0;
bottom: 0;
background-image: inherit;
background-size: 300% auto;
transform: perspective(800px);
transition: 0.5s all;
}
.box:before {
right: 100%;
background-position: left;
transform-origin: right;
}
.box:after {
left: 100%;
background-position: right;
transform-origin: left;
}
.box:hover::before {
transform: perspective(800px) rotateY(50deg);
filter: brightness(0.8);
}
.box:hover::after {
transform: perspective(800px) rotateY(-50deg);
filter: brightness(0.8);
}
<div class="box" style="background-image: url(https://picsum.photos/id/1/1000/800)">
</div>
I'm using a psuedo element to fade a gradient over another div which has an image as a background for that div.
My html layout is like so:
<div class='portfolio_thumb'>
<div class='portfolio_thumb_caption'></div
</div
and my CSS for those items
.portfolio_thumb {
position: relative;
width: 100%;
height: 300px;
background-size: cover;
}
.portfolio_thumb .portfolio_thumb_caption:before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(to bottom, rgba(72,76,97,0) 0%, rgba(72,76,97,0.8) 75%);
content: '';
opacity: 0;
transform: translate3d(0,50%,0);
}
.portfolio_thumb:hover .portfolio_thumb_caption:before {
transform: translate3d(0,0,0);
opacity: 1;
}
Right now the gradient fades in and starts to slide, but it is shown past the parent div. I only want the gradient shown within the bounds of the portfolio_thumb div. Also, both divs in that html snippet are the same heights. Does anyone have any ideas? I'm going for this kind of approach. http://tympanus.net/Development/HoverEffectIdeas/
Thanks!
Use overflow: hidden on the container to cut-off the gradient.
Use transform: translateY(x%) to move the gradient up and down. As we are not creating 3d animations, there is no point using translate3d, which requires more grunt to run.
The transition smoothly shows and hides the overlay
Complete Example
.portfolio_thumb {
position: relative;
background: url(http://lorempixel.com/output/animals-q-c-640-300-1.jpg);
background-size: cover;
overflow: hidden;
height: 300px;
width: 100%;
max-width: 840px;
margin: 0 auto;
}
.portfolio_thumb .portfolio_thumb_caption:before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(to bottom, rgba(72, 76, 97, 0) 0%, rgba(72, 76, 97, 0.8) 75%);
content: '';
transition: all 0.5s;
transform: translateY(50%);
opacity: 0;
}
.portfolio_thumb:hover .portfolio_thumb_caption:before {
transform: translateY(0);
opacity: 1;
}
<div class='portfolio_thumb'>
<div class='portfolio_thumb_caption'></div>
</div>