Preloader with scss - sass

I have this code. I really do not understand why it does not work.
I am using SCSS and compile it into CSS, but everything works, except of animation.
#keyframes spin {
form {
transform: translate(-50%, -50%) rotate(0deg);
}
to {
transform: translate(-50%, -50%) rotate(360deg);
}
}
.preloader {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgb(3, 25, 39);
z-index: 10;
.loader {
width: 70px;
height: 70px;
border: 10px solid $secondary-color;
border-radius: 50%;
border-top-color: $main-color;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
animation: 5s spin infinite linear;
}
}

You have typo in your code.
Form should be from.
#keyframes spin {
from {
transform: translate(-50%, -50%) rotate(0deg);
}
to {
transform: translate(-50%, -50%) rotate(360deg);
}
}
.preloader {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgb(3, 25, 39);
z-index: 10;
}
.loader {
width: 70px;
height: 70px;
border: 10px solid red;
border-radius: 50%;
border-top-color: black;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
animation: 5s spin infinite linear;
}
<div class="preloader">
<div class="loader"></div>
</div>

Related

How can I start an animation on click

I am trying to create an egg that cracks open, it works, but the animation starts on its own. How can I make it work that the egg only opens when the user clicks on it?
I've tried using jQuery, javascript and only css. And searched the whole internet. But I just don't get it to work. This is my first animation, so I don't know much about it.
Here is my code:
<div id="easter-egg-animation">
<div class="easter-egg">
<div class="egg">
<div class="egg-top">
<div class="day">1
</div>
</div></div>
<div class="egg-bottom"></div>
<div class="shadow"></div>
<div class="text">happy <br> easter</div>
</div>
body {
display: flex;
background: grey;
align-items: center;
justify-content: center;
height: 100vh;
}
#easter-egg-animation {
position: relative;
cursor: pointer;
transform: translate(-90%);
transition-property: transform;
transition-duration: 9s;
}
.egg {
}
.day {
position: relative;
align-items: center;
justify-content: center;
top: 45px;
left: 65px;
font-size: 30px;
padding-top: 30px;
color: white;
}
.egg-top {
border-radius: 50% 50% 70% 30% / 100% 100% 0% 0%;
background-color: pink;
width: 140px;
height: 120px;
position: absolute;
transform-origin: left;
top: -20px;
left: 0;
right: 20px;
animation: open .5s ease forwards .5s;
}
#keyframes open {
0% {transform: rotate(0);}
100% {transform: rotate(-150deg); top: 90px; left: -30px;}
}
.egg-bottom {
border-radius: 0% 100% 50% 50% / 0% 0% 100% 100%;
background-color: pink;
width: 140px;
height: 80px;
position: relative;
top: 100px;
}
.egg:before, .egg:after, .egg-top:before, .egg-bottom:before {
content:"";
position: absolute;
border-style: solid;
}
.egg:before {
top: -0px;
}
.egg:after {
top: -0px;
left: 140px;
}
.egg-top:before {
top: 10px;
}
.egg-top:after {
content:"";
position: absolute;
width: 25px;
height: 60px;
border-radius: 50%;
transform: rotate(-27deg);
top: 15px;
left: 115px;
}
.shadow {
position: absolute;
width:220px;
height:30px;
background-color: rgba(0,0,0,.1);
border-radius:50%;
z-index:-1;
top:147px;
left:-27px;
}
.text {
position: absolute;
top: 110px;
left: 45px;
text-align: center;
color: pink;
font-size: 24px;
z-index:-1;
background-color: white;
transform-origin: bottom;
animation: up 1s ease forwards 1.5s;
}
#keyframes up {
0% {transform: translateY(0) scale(1);}
100% {transform: translateY(-80px) scale(2);}
}

keyframe animation not working in IOS devices

I have the below code, where the loading animation is not working in IOS devices
I have used transform: rotate which is not working on IOS but they are working fine on android devices
any reason why this code is not working, I have tried various ways mentioned on the StackOverflow but still they are not working
body{
background: blueviolet;
}
.loading-steps {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-width: 300px;
margin: 40px auto 0 auto;
}
.load-animation {
transition: all 450ms;
}
ol, ul {
list-style: none;
}
.loading-steps li {
margin-bottom: 15px;
display: flex;
position: relative;
height: 21px;
font-size: 13px;
color: black;
font-weight: 400;
}
.box {
position: absolute;
margin-bottom: 0.25em;
vertical-align: top;
transition: 0.3s color, 0.3s border, 0.3s transform, 0.3s opacity;
margin-right: 0;
left: -3px;
margin-top: -4px;
}
.loading {
border: 3px solid #4D86C8;
border-top-color: #FFDD51;
border-radius: 50%;
-webkit-animation: 1s webkit-loading linear;
animation: 1s loading linear;
animation-iteration-count: initial;
position: relative;
display: inline-block;
width: 1.5em;
height: 1.5em;
color: inherit;
vertical-align: middle;
pointer-events: none;
position: relative;
display: flex;
justify-content: center;
margin: 0px auto;
-o-animation-fill-mode: both;
opacity: 0;
transition: .5s;
}
.loading {
border: 3px solid #4d86c8;
border-top-color: #ffdd51;
border-radius: 50%;
-webkit-animation: 1s webkit-loading linear;
animation: 1s loading linear;
animation-iteration-count: initial;
position: relative;
display: inline-block;
width: 1.5em;
height: 1.5em;
color: inherit;
vertical-align: middle;
pointer-events: none;
position: relative;
display: flex;
justify-content: center;
margin: 0px auto;
-o-animation-fill-mode: both;
opacity: 0;
transition: 0.5s;
}
.loading:before {
content: "";
display: block;
width: inherit;
height: inherit;
position: absolute;
top: -0.4em;
left: -0.4em;
border-radius: 50%;
opacity: 0.5;
}
#-webkit-keyframes webkit-loading {
0% {
-webkit-transform: rotate(0deg);
-webkit-opacity: 1;
}
50% {
-webkit-transform: rotate(360deg);
-webkit-opacity: 1;
}
90% {
-webkit-transform: rotate(360deg);
-webkit-opacity: 1;
}
100% {
-webkit-transform: rotate(360deg);
-webkit-opacity: 0;
-webkit-transform: scale(0);
}
}
#keyframes loading {
0% {
transform: rotate(0deg);
opacity: 1;
}
50% {
transform: rotate(360deg);
opacity: 1;
}
90% {
transform: rotate(360deg);
opacity: 1;
}
100% {
transform: rotate(360deg);
opacity: 0;
transform: scale(0);
}
}
.loading:before {
content: '';
display: block;
width: inherit;
height: inherit;
position: absolute;
top: -0.4em;
left: -0.4em;
border-radius: 50%;
opacity: 0.5;
}
li svg {
width: 15px;
margin-right: 8px;
margin-top: -6px;
}
<body>
<div class="loading-steps load-animation">
<ul>
<li>
<div class="box">
<div class="loading" style="animation-delay: 2s;"></div>
</div>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 24 24" id="Layer_1" version="1.0" viewBox="0 0 24 24" xml:space="preserve"><polyline class="path" fill="none" points="20,6 9,17 4,12" stroke="#FFDD51" stroke-miterlimit="10" stroke-width="3" style="animation-delay: 2s;"></polyline></svg>
</li>
<li>
<div class="box">
<div class="loading" style="animation-delay: 2.5s;"></div>
</div>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 24 24" id="Layer_1" version="1.0" viewBox="0 0 24 24" xml:space="preserve"><polyline class="path" fill="none" points="20,6 9,17 4,12" stroke="#FFDD51" stroke-miterlimit="10" stroke-width="3" style="animation-delay: 2.5s;"></polyline></svg>
</li>
</ul>
</div>
</body>

GSAP, animation with translateX/Y, macOS Safari <= 13 version

I have this scene with animation, also I have an issue with Safari v.13(and lower) and glitching blurred balls (.intro-circle) in my scene.
So, when I open my scene on Safari v.13 and lower, my blurred balls very sad, and I don't know how can I solve this issue.
Thanks a lot in advance!
This is my pen
html:
<section class="intro">
<img class="intro-circle js_image intro-circle--yellow"
src="https://studiogalo.dev.cheitgroup.com/wp-content/themes/studio-galo/assets/img/intro/intro-circle-yellow.svg" alt="">
<img class="intro-circle js_image intro-circle--blue"
src="https://studiogalo.dev.cheitgroup.com/wp-content/themes/studio-galo/assets/img/intro/intro-circle-blue.svg" alt="">
<h1 class="intro-title">Welcome to <br>Paradise</h1>
<h2 class="intro-sub_title">We empower dreamers <br>who dare to make a difference.</h2>
</section>
css:
.intro {
position: fixed;
background-color: #F6F5F0;
-webkit-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
transition: all 0.3s ease;
overflow: hidden;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1500;
visibility: visible; }
.intro-bg {
background-size: cover;
background-repeat: no-repeat;
background-position: center;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
-webkit-transform: scale(1.001);
-ms-transform: scale(1.001);
transform: scale(1.001); }
.intro-bg--mobile {
display: none; }
.intro.animationEnd {
-webkit-transition: all 1.2s ease;
-o-transition: all 1.2s ease;
transition: all 1.2s ease;
opacity: 0;
visibility: hidden;
pointer-events: none; }
.intro-title {
position: absolute;
left: 50%;
top: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
font-size: 3.05vw;
text-align: center;
font-weight: 300;
opacity: 0;
-webkit-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
transition: all 0.2s ease; }
.intro-sub_title {
position: absolute;
left: 4.86vw;
top: 4.16vw;
font-size: 3.05vw;
text-align: left;
line-height: 1.1;
font-weight: 300;
-webkit-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
transition: all 0.2s ease; }
.intro-circle {
position: absolute;
-webkit-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
transition: all 0.2s ease;
-webkit-transform-origin: center;
-ms-transform-origin: center;
transform-origin: center;
will-change: transform; }
.intro-circle--yellow {
left: -3.75%;
top: -22.03%;
width: 48.61vw;
height: 48.61vw; }
.intro-circle--blue {
left: -18.75%;
top: 25.97%;
width: 54.16vw;
height: 54.16vw;
opacity: 0; }
.intro-circle--mobile {
display: none; }
js:
introAnimationStart()
function clearEntrance() {
$('.intro').addClass('animationEnd');
$('.site-wrapper, .header, body').addClass('load');
canMoveOn = true;
setTimeout(() => {
$('.intro').remove();
}, 1000);
}
function introAnimationStart() {
// /* intro animation GSAP */
window.history.scrollRestoration = 'manual';
window.scrollTo(0,0);
if (window.innerWidth >= 992) {
let introAnim = gsap.timeline({
defaults: {
duration: 1,
},
ease: Power1.easeInOut,
onComplete: function onComplete() {
// setTimeout(clearEntrance, 1000);
}
});
introAnim
.to(".intro-circle--yellow", {
delay: 1,
top: '-20%',
left: '70%',
}, 'subtitleAndYellow2')
.to(".intro-sub_title", {
delay: 1,
opacity: 0
}, 'subtitleAndYellow2')
.to(".intro-circle--blue", {
opacity: 1,
})
.to(".intro-circle--yellow", {
duration: 1.5,
left: '50%',
top: '50%',
translateX: '-50%',
translateY: '-50%',
}, 'YellowBlueTitle')
.to(".intro-circle--blue", {
duration: 1.5,
left: '50%',
top: '50%',
translateX: '-50%',
translateY: '-50%',
}, 'YellowBlueTitle')
.to(".intro-title", {
duration: 1.5,
opacity: 1,
}, 'YellowBlueTitle');
$('.intro').click(function () {
introAnim.timeScale(14);
});
} else {
/**
* Mobile animation-OPTIMIZATION
*/
// 1st step
setTimeout(() => {
$(".intro-circle--yellow, .intro-sub_title").addClass('fst_step');
}, 1000);
// 2nd step
setTimeout(() => {
$(".intro-circle--blue").addClass('snd_step');
}, 2200);
// 3rd step
setTimeout(() => {
$(".intro-circle--yellow, .intro-circle--blue, .intro-title").addClass('trd_step');
}, 3000);
setTimeout(clearEntrance, 6000);
}
}

Next Js with SCSS not applied in production (built-mode)

I have problem with some parts of my spinning-wheel component in built-mode when I deploy my application to server.I have no issue if I run the code locally with "npm run dev", but the problems come when run the code with "npm run build" and "npm start".
Here is the snapshots of development mode (picture 1) and built mode (picture 2):
And this is the scss file I used :
.board-arisan-container {
--wheel-size: 300px;
--wheel-slice-spacing: 50px;
--wheel-border-size: 5px;
--wheel-color: #ffad00;
--neutral-color: #ffffff;
--PI: 3.60;
--nb-item: 0;
--item-nb: 0;
--selected-item: 0;
--nb-turn: 5;
--spinning-duration: 4s;
--reset-duration: 0.25s;
transform: rotate(-90deg);
.wheel-container {
display: block;
position: relative;
box-sizing: content-box;
width: calc(var(--wheel-size) + 2 * var(--wheel-border-size));
height: calc(var(--wheel-size) + 2 * var(--wheel-border-size));
padding: 3px;
margin: auto;
background-color: var(--neutral-color);
border: solid var(--wheel-color) 10px;
border-radius: 50%;
user-select: none;
}
.wheel-container::before,
.wheel-container::after {
content: "";
display: block;
position: absolute;
height: 0;
width: 0;
top: 50%;
transform: translateY(-50%);
z-index: 2;
border: solid transparent 20px;
border-left-width: 0;
}
.wheel-container::before {
right: 0px;
border-right-color: var(--wheel-color);
}
.wheel-container::after {
right: -5px;
border-right-color: var(--neutral-color);
}
/* Roue */
.wheel {
display: block;
position: relative;
box-sizing: content-box;
margin: auto;
width: var(--wheel-size);
height: var(--wheel-size);
overflow: hidden;
border-radius: 50%;
border: solid var(--wheel-color) var(--wheel-border-size);
background-color: var(--wheel-color);
transition: transform var(--reset-duration);
transform: rotate(0deg);
cursor: pointer;
}
.wheel.spinning {
transition: transform var(--spinning-duration);
transform: rotate(calc(var(--nb-turn) * 360deg + (-360deg * var(--selected-item) / var(--nb-item, 1))));
}
.wheel::after {}
.wheel-item {
display: block;
position: absolute;
box-sizing: border-box;
/* position de l'item */
top: 50%;
left: 50%;
width: 50%;
transform-origin: center left;
transform: translateY(-50%) rotate(calc(var(--item-nb) * (360deg / var(--nb-item, 1))));
/* texte */
color: var(--neutral-color);
text-align: right;
padding: 0 50px 0 50px;
font-family: var(--wheel-font);
}
/* Background de l'élément = triangle rose plus clair */
.wheel-item:before {
content: " ";
display: block;
position: absolute;
box-sizing: border-box;
z-index: -1;
width: 0;
height: 0;
top: 50%;
left: 50%;
transform: translate(-47%, -50%);
padding-left: 0px;
--slice-max-width: calc(var(--PI) * var(--wheel-size) + var(--wheel-size) / 2);
--slice-width: calc((var(--slice-max-width) / var(--nb-item)) - var(--wheel-slice-spacing));
border: solid transparent calc(var(--slice-width) / 2);
border-left: solid transparent 0;
border-right: solid var(--neutral-color) calc(var(--wheel-size) / 2);
}
}
here is the the component code :
...
const wheelVars = {
'--nb-item': props.items.length,
'--selected-item': selectedItem,
}
const spinning = selectedItem !== null ? 'spinning' : '';
return( <div className="board-arisan-container">
<div className="wheel-container">
<div className={`wheel ${spinning}`} style={wheelVars} onClick={() => clearSelectedItem()}>
{props.items.map((item, index) => (
<div className="wheel-item" key={index} style={{
'--item-nb': index,
color: '#ffad00',
fontSize: 30,
fontWeight: 'bolder',
}}>
<span>{item}</span>
</div>
))}
</div>
</div>
</div>)
Thanks!

How do I make hover for my ".pic" class to get effected?

I want to add :hover this class ".pic".
So it can contain more description on .pic:hover
I use transform SASS, width, and height on .pic:hover that seems not working.
I can't find out the problem.
Please help to find out my question.
Please watch it on my codepen for any details
.pic
width: 250px
height: 250px
//it doesn't get bigger when mouse is hovering over it
.pic:hover
width: 400px
height: 400px
Codepen
Your code isn't formatted correctly. With CSS, make sure to surround everything with brackets {}. Also make sure to add a semicolon after every line in a class so it knows where to break it up. Change your code to the below and it'll work:
// Adding {} and ; fixed this issue
.pic {
width: 250px;
height: 250px;
}
.pic:hover {
width: 400px;
height: 400px;
}
You can do something like this,
.item {
position: relative;
border: 1px solid #333;
margin: 2%;
overflow: hidden;
width: 540px;
}
.item img {
max-width: 100%;
-moz-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
}
.item:hover img {
-moz-transform: scale(1.5);
-webkit-transform: scale(1.5);
transform: scale(1.5);
}
<div class="item">
<img src="https://image.freepik.com/free-vector/technological-background-with-circular-shapes_1035-4291.jpg" alt="pepsi" width="540" height="548">
<div class="item-overlay top"></div>
</div>
Your code,
#charset "UTF-8";
* {
font-family: 微軟正黑體;
position: relative;
}
html, body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
.wrapper {
height: 100%;
background: linear-gradient(#fc68d7, #8a3ab9, #bc2a8d, #cd486b, #e95950, #fbad50, #fccc63);
display: flex;
justify-content: center;
align-items: center;
}
.camera {
width: 200px;
height: 200px;
border: 10px solid #fff;
border-radius: 50px;
position: absolute;
transform: translateY(-50%);
animation: ballUp 0.5s 1s both, ballDown 0.2s 1.5s ease-in both, cameraIn 0.3s 1.7s both;
perspective: 500;
-webkit-perspective: 500;
}
.lens {
width: 100px;
height: 100px;
border-radius: 50%;
border: 15px solid #fff;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
animation: lensIn 0.3s 1.85s backwards;
}
.flashlight {
width: 20px;
height: 20px;
background: #fff;
border-radius: 50%;
position: absolute;
right: 20px;
top: 20px;
animation: flashlightIn 0.3s 2.15s backwards;
}
.flashlight:after {
content: "";
width: 200px;
height: 200px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.5);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
animation: flash 0.3s 2.45s both;
}
.pic {
width: 250px;
height: 250px;
border: 5px solid #fff;
border-bottom: 25px solid #fff;
background: #ccc;
display: inline-block;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
animation: picIn 1s 2.48s both, picFlip 1s 3.5s both;
overflow: hidden;
transition: 0.3s;
box-sizing: border-box;
}
.pic:hover img {
-moz-transform: scale(1.5);
-webkit-transform: scale(1.5);
transform: scale(1.5);
}
.pic img {
max-width: 100%;
-moz-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
}
#keyframes ballUp {
0% {
top: 50%;
width: 5px;
height: 5px;
opacity: 0;
}
10% {
opacity: 1;
}
100% {
top: 10%;
width: 5px;
height: 5px;
}
}
#keyframes ballDown {
0% {
top: 10%;
}
100% {
top: 50%;
}
}
#keyframes cameraIn {
0% {
width: 5px;
height: 5px;
}
80% {
width: 250px;
height: 250px;
}
100% {
height: 200px;
width: 200px;
}
}
#keyframes lensIn {
0% {
width: 0;
height: 0;
opacity: 0;
}
10% {
opacity: 1;
}
80% {
width: 120px;
height: 120px;
}
100% {
width: 100px;
height: 100px;
}
}
#keyframes flashlightIn {
0% {
transform: scale(0);
}
80% {
transform: scale(1.2);
}
100% {
transform: scale(1);
}
}
#keyframes flash {
0% {
opacity: 0;
}
25% {
opacity: 1;
}
50% {
opacity: 0;
}
75% {
opacity: 1;
}
100% {
opacity: 0;
}
}
#keyframes picIn {
0% {
height: 0;
width: 0;
top: 100%;
transform: translate(-50%, 0);
opacity: 0;
}
100% {
height: 120px;
width: 120px;
top: 100%;
transform: translate(-50%, 0);
opacity: 1;
}
}
#keyframes picFlip {
0% {
transform: translate(-50%, 0) rotateX(0deg);
top: 100%;
width: 120px;
height: 120px;
}
100% {
transform: translate(-50%, -50%) rotateX(360deg);
top: 50%;
width: 250px;
height: 250px;
}
}
#keyframes showImg {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
<div class="wrapper">
<div class="camera">
<div class="lens"></div>
<div class="flashlight"></div>
<div class="pic">
<div class="imgbox"><img src="https://image.freepik.com/free-vector/technological-background-with-circular-shapes_1035-4291.jpg" alt=""/></div>
<div class="text">
<h1>Hello</h1>
<h2>This is my memory</h2>
</div>
</div>
</div>
</div>
or zoom out with text inside,
#charset "UTF-8";
* {
font-family: 微軟正黑體;
position: relative;
}
html,
body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
.wrapper {
height: 100%;
background: linear-gradient(#fc68d7, #8a3ab9, #bc2a8d, #cd486b, #e95950, #fbad50, #fccc63);
display: flex;
justify-content: center;
align-items: center;
z-index: 1;
}
h5 {
position: absolute;
left: 0px;
top: 0px;
bottom: 0;
z-index: -1;
}
.camera {
width: 200px;
height: 200px;
border: 10px solid #fff;
border-radius: 50px;
position: absolute;
transform: translateY(-50%);
animation: ballUp 0.5s 1s both, ballDown 0.2s 1.5s ease-in both, cameraIn 0.3s 1.7s both;
perspective: 500;
-webkit-perspective: 500;
}
.lens {
width: 100px;
height: 100px;
border-radius: 50%;
border: 15px solid #fff;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
animation: lensIn 0.3s 1.85s backwards;
}
.flashlight {
width: 20px;
height: 20px;
background: #fff;
border-radius: 50%;
position: absolute;
right: 20px;
top: 20px;
animation: flashlightIn 0.3s 2.15s backwards;
}
.flashlight:after {
content: "";
width: 200px;
height: 200px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.5);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
animation: flash 0.3s 2.45s both;
}
.pic {
width: 250px;
height: 250px;
border: 5px solid #fff;
border-bottom: 25px solid #fff;
background: #ccc;
display: inline-block;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
animation: picIn 1s 2.48s both, picFlip 1s 3.5s both;
overflow: hidden;
transition: 0.3s;
box-sizing: border-box;
}
.pic:hover img {
-moz-transform: scale(0.65);
-webkit-transform: scale(0.65);
transform: scale(0.65);
}
.pic img {
max-width: 100%;
-moz-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
}
#keyframes ballUp {
0% {
top: 50%;
width: 5px;
height: 5px;
opacity: 0;
}
10% {
opacity: 1;
}
100% {
top: 10%;
width: 5px;
height: 5px;
}
}
#keyframes ballDown {
0% {
top: 10%;
}
100% {
top: 50%;
}
}
#keyframes cameraIn {
0% {
width: 5px;
height: 5px;
}
80% {
width: 250px;
height: 250px;
}
100% {
height: 200px;
width: 200px;
}
}
#keyframes lensIn {
0% {
width: 0;
height: 0;
opacity: 0;
}
10% {
opacity: 1;
}
80% {
width: 120px;
height: 120px;
}
100% {
width: 100px;
height: 100px;
}
}
#keyframes flashlightIn {
0% {
transform: scale(0);
}
80% {
transform: scale(1.2);
}
100% {
transform: scale(1);
}
}
#keyframes flash {
0% {
opacity: 0;
}
25% {
opacity: 1;
}
50% {
opacity: 0;
}
75% {
opacity: 1;
}
100% {
opacity: 0;
}
}
#keyframes picIn {
0% {
height: 0;
width: 0;
top: 100%;
transform: translate(-50%, 0);
opacity: 0;
}
100% {
height: 120px;
width: 120px;
top: 100%;
transform: translate(-50%, 0);
opacity: 1;
}
}
#keyframes picFlip {
0% {
transform: translate(-50%, 0) rotateX(0deg);
top: 100%;
width: 120px;
height: 120px;
}
100% {
transform: translate(-50%, -50%) rotateX(360deg);
top: 50%;
width: 250px;
height: 250px;
}
}
#keyframes showImg {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
<div class="wrapper">
<div class="camera">
<div class="lens"></div>
<div class="flashlight"></div>
<div class="pic">
<div class="imgbox">
<h5>
Tech-Background
</h5>
<img src="https://image.freepik.com/free-vector/technological-background-with-circular-shapes_1035-4291.jpg" alt="" />
</div>
<div class="text">
<h1>Hello</h1>
<h2>This is my memory</h2>
</div>
</div>
</div>
</div>
Your problem is wrong css. You have to use curly braises and semi colons as well.
.pic{
width: 250px;
height: 250px;
}
.pic:hover{
width: 400px;
height: 400px;
}

Resources