body {
margin: 0px;
}
.items_container {
display: flex;
align-items: center;
width: 100%;
height: 50px;
background-color: rgb(200,200,200);
}
.circle_container {
display: flex;
align-items: center;
position: relative;
z-index: 100;
}
.circle {
position: absolute;
margin: 0px 10px;
border: 0.5px solid black;
width: 50px;
height: 50px;
border-radius: 50%;
background-color: black;
}
.btext {
padding: 0px;
margin: 0px;
color: white;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
hr {
position: absolute;
width: 100%;
z-index: 90;
}
.finish_container {
display: flex;
justify-content: flex-end;
align-items: center;
position: relative;
width: 100%;
z-index: 95;
}
.finish {
position: absolute;
margin: 0px 10px;
border: 0.5px solid black;
width: 50px;
height: 50px;
border-radius: 50%;
background-color: white;
}
.wtext {
padding: 0px;
margin: 0px;
color: black;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
<div class="items_container">
<div class="circle_container">
<div class="circle">
<p class="btext">
Start
</p>
</div>
</div>
<hr>
<div class="finish_container">
<div class="finish">
<p class="wtext">
Finish
</p>
</div>
</div>
</div>
I want to roll black (start) circle to the white (finish) circle with smooth animation. Is it possible to make this? If it is, how can i do that?
![Do not mind this sentence. System gives an error that says 'It looks like your post is mostly code; please add some more details.' For posting my question I am adding this, sorry.]!
<div classname="rotate"></div>
#keyframes anirotate {
0% {
transform: translateX(0) rotate(0);
}
100%{
transform: translateX(100px) rotate(360deg);
}
}
.rotate::after{
content: 'Start'
}
.rotate{
width : 200px;
height: 200px;
border-radius: 50%;
background-color: lightblue;
animation : anirotate 2s 0s 1 forwards;
}
Related
I have implemented animation on a list. List should move horizontally on the screen. There is a div element for information i.e. waiting token.
List should not cross that div.
here goes my code:
.list_wrapper__content {
position: absolute;
top: 25%;
left: 0;
height: 5vh;
background-color: #fff;
animation: animate_opp_2 25s linear infinite;
display: flex;
margin-left: 10%;
}
.list_wrapper__content___item {
height: 5vh;
border: 1px solid red;
width: 200px;
margin-right: 1%;
text-align: center;
border-radius: 8px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
color: grey;
font-size: 30px;
font-weight: bold;
display: flex;
justify-content: center;
}
#keyframes animate_opp_2 {
0% {
left: 10;
transform: translate(20%);
}
100% {
left: 0;
transform: translate(-100%);
}
}
.header {
height: 140px;
width: 200px;
border: 1px solid black;
z-index: 3;
position: relative;
}
<div class="list_wrapper">
<div class="header"> Waiting Tokens</div>
<div class="list_wrapper__content">
<div class="list_wrapper__content___item" *ngFor="let item of ListItems">
{{item}}
</div>
</div>
</div>
Stackblitz for the same:
https://stackblitz.com/edit/angular-ivy-pvmjdz?file=src/app/app.component.css
Looks like I am missing something. Any help will be highly appreciated
Replace all list_wrapper__content___item with
<div class="list_wrapper__content___item" *ngFor="let item of ListItems">
{{item}}
</div>
.list_wrapper {
height: 60px;
display: flex;
background-color: grey;
overflow:hidden;
}
.header {
text-transform: uppercase;
min-width: 100px;
font-weight: bold;
border-right: 1px solid black;
display: flex;
align-items: center;
text-align: center;
background-color: white;
z-index:1
}
.list_wrapper__content {
animation: animate_opp_2 25s linear infinite;
display: flex;
align-items: center;
}
.list_wrapper__content___item {
height: 30px;
border: 1px solid red;
width: 200px;
margin-right: 1%;
border-radius: 2px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
color: grey;
font-size: 30px;
font-weight: bold;
display: flex;
justify-content: center;
align-items: center;
background-color: white;
}
#keyframes animate_opp_2 {
0% {
left: 10;
transform: translate(20%);
}
100% {
left: 0;
transform: translate(-100%);
}
}
<div class="list_wrapper">
<div class="header"> Waiting Tokens</div>
<div class="list_wrapper__content">
<div class="list_wrapper__content___item">
1000
</div>
<div class="list_wrapper__content___item">
1001
</div>
<div class="list_wrapper__content___item">
1002
</div>
<div class="list_wrapper__content___item">
1003
</div>
<div class="list_wrapper__content___item">
1004
</div>
<div class="list_wrapper__content___item">
1005
</div>
<div class="list_wrapper__content___item">
1006
</div>
</div>
</div
you put an animation on your wrapper div, if you want to stop the animation right before
<div class="header"> Waiting Tokens</div>
you should put your animation on .list_wrapper__content___item
i slightly modified your css
.list_wrapper {
padding: 2rem;
position: relative;
overflow: hidden;
display: flex;
align-items: center;
}
.list_wrapper__content {
/* position: absolute; */
left: 0;
height: 250px;
background-color: #fff;
display: flex;
/* margin-left: 10%; */
position: relative;
overflow: hidden;
}
.list_wrapper__content___item {
height: 5vh;
border: 1px solid red;
width: 200px;
margin-right: 1%;
text-align: center;
border-radius: 8px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
color: grey;
font-size: 30px;
font-weight: bold;
display: inline-flex;
justify-content: center;
animation: animate_opp_2 5s linear infinite;
}
working example:
https://angular-ivy-5egh19.stackblitz.io
when the screen gets smaller on my website, the elements go to irrelevant places. I did some research and thought I could remove it using '%' but it didn't work.
This is 1 scale:
This is 0.25 scale
/*my container*/
.container-home{
width: 100%;
height: 60rem;
display: flex;
align-items: center;
}
/*
the articles are here*/
.words {
display: flex;
flex-direction: column;
justify-content: center;
width: 60%;
height: 100vh;
margin-left: 25vh;
transition: 1.5s;
}
.header{
font-size: 5rem;
font-weight: 500;
}
.description {
display: block;
margin-top: 3rem;
font-size: 2rem;
}
/*explore text span*/
.explore{
margin-top: 2.5rem;
width: 15rem;
height: 4rem;
text-align: center;
display: block;
font-size: 2rem;
border: 0.1rem solid #000;
border-radius: 2.5rem;
margin-left: 1.5rem;
position: relative;
z-index: 1;
}
/*explore text a*/
.explore a{
display: block;
text-decoration: none;
font-size: 2rem;
color: #000;
text-align: center;
margin-top: 0.7rem;
}
.explore:hover {
border-color: transparent;
text-align: center;
transition: 1s;
transform: translateY(0.6rem) translateX(-1rem);
}
/*colored rectangle under text explore*/
.explore-hover{
display: inline;
position: absolute;
width: 15rem;
height: 4rem;
border-radius: 2.5rem;
background-color: #f1e0d4;
top: 42rem;
}
/*circle , solid circle and image in this*/
.image-design{
width: 100%;
height:100vh;
}
.circle{
position: relative;
width: 100%;
height: 100%;
clip-path: circle(300px at center);
background-color: #d7e7f1;
margin-top:8rem;
}
.solid-circle{
position: absolute;
width: 60rem;
height: 60rem;
border-radius: 50%;
background-color: transparent;
top: 30%;
left: 28%;
border: 1px solid #3398d7;
}
/*I created it to put an image on top of the circles*/
.conainer-image-design{
position: absolute;
width: 100%;
left: 25rem;
height:100vh;
}
.image{
position: relative;
top: 25%;
left: 12%;
}
<div class="container-home">
<div class="words">
<span class="header">
Handcrafted<br>
& ethically sourced
</span>
<span class="description">A collection inspired by old-world charm, crafted
<br>with moisannites and diamonds.
</span>
<span class="explore">Explore→</span>
<div class="explore-hover"></div>
</div>
<div class="image-design">
<div class="conainer-image-design">
<div class="circle"></div>
<div class="solid-circle"></div>
</div>
<span class="image"><img src="./ring.png"></span>
</div>
</div>
what do you recommend to give the measurements, I mainly use rem or % .which is better to keep the image intact?
This question already has answers here:
How to affect other elements when one element is hovered
(9 answers)
Closed 8 months ago.
I need to make when hovering over a div with an image, there is black background with opacity and when hovering over the button, it changes its values. I got the following:
.promo__girl {
background-repeat: no-repeat;
background-image: url('https://i.ibb.co/r0rnSP0/1.png');
position: absolute;
width: 300px;
height: 300px;
margin-top: 136px;
right: 7.469rem;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
}
.promo__girl-image {
width: 100%;
}
.promo__girl-hover {
width: 300px;
height: 300px;
border-radius: 10px;
position: absolute;
display: flex;
justify-content: center;
align-items: center;
}
.promo__girl .button_yellow {
font-size: 16px;
color: #162E3C;
background-color: #DDF0A7;
border: 2px solid #DDF0A7;
text-align: center;
margin-top: 10px;
border-radius: 64px;
margin-right: 4px;
height: 52px;
width: 233px;
z-index: 1;
}
.promo__girl .button_yellow:hover {
width: 233px;
background-color: inherit;
color: white;
border-color: white;
opacity: 1;
}
.promo__girl-hover:hover {
background-color: black;
opacity: 0.7;
transition: 0.5s;
}
<div class="promo__girl">
<div class="promo__girl-hover"><button class="button_yellow">Watch Introduction</button></div>
</div>
So now when i hovering image, opacity applies to button to, but i donr need it. Maybe someone will help me? Maybe you can do this with display:none or visibility: hidden/visible? I tried it but there is 0 result.
You can't override parent opacity in a child. But you can use "another" element to be darker... the :after pseudo element. It works.
.promo__girl {
background-repeat: no-repeat;
background-image: url('https://i.ibb.co/r0rnSP0/1.png');
position: absolute;
width: 300px;
height: 300px;
margin-top: 136px;
right: 7.469rem;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
}
.promo__girl-image {
width: 100%;
}
.promo__girl-hover {
width: 300px;
height: 300px;
border-radius: 10px;
position: absolute;
display: flex;
justify-content: center;
align-items: center;
}
.promo__girl .button_yellow {
font-size: 16px;
color: #162E3C;
background-color: #DDF0A7;
border: 2px solid #DDF0A7;
text-align: center;
margin-top: 10px;
border-radius: 64px;
margin-right: 4px;
height: 52px;
width: 233px;
z-index: 1;
}
.promo__girl .button_yellow:hover {
width: 233px;
background-color: inherit;
color: white;
border-color: white;
opacity: 1;
}
.promo__girl-hover:after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: black;
opacity: 0;
transition: 0.5s;
pointer-events: none;
}
.promo__girl-hover:hover:after {
opacity: 0.7;
transition: 0.5s;
}
<div class="promo__girl">
<div class="promo__girl-hover">
<button class="button_yellow">Watch Introduction</button>
</div>
</div>
I'm simply trying to have a line connect a loading bar to a circle.
The line is not being displayed underneath the loading bar however. I've tried messing around with z-indexes and also putting them in containers. Any ideas?
https://jsfiddle.net/sfcurv4h/
body {
justify-content: center;
align-items: center;
background: #1e1e2f;
display: flex;
height: 100vh;
padding: 0;
margin: 0;
}
.progress {
background: rgba(255,255,255,0.1);
justify-content: flex-start;
border-radius: 100px;
align-items: center;
position: relative;
padding: 0 5px;
display: flex;
height: 40px;
width: 500px;
z-index: 1;
}
.progress-value {
animation: load 3s normal forwards;
border-radius: 100px;
background: #fff;
height: 30px;
width: 0;
z-index: 1;
}
#keyframes load {
0% { width: 0; }
100% { width: 68%; }
}
.active-services-circle {
width: 40px;
height: 40px;
background: #fff;
border: 2px solid #ACACA6;
border-radius: 50%;
transition: background 1s;
}
.active-services-circle.completed {
border: 2px solid #4B81BD;
background: #4B81BD;
}
.space-between-lb-features {
position: relative;
display: flex;
justify-content: space-between;
width: 600px;
}
.line-connector {
position: absolute;
width: 100%;
height: 50%;
border-bottom: 2px solid #ACACA6;
z-index: -1;
}
<div class="space-between-lb-features">
<div class="progress">
<div class="progress-value"></div>
</div>
<div class="active-services-circle"></div>
<div class="line-connector"></div>
</div>
hi i have a div and i want to put it as the scrollbar. this is the image of my div
i used this style "overflow-y: scroll;" but it's not what i'm looking for
this is my html tag
body {
height: 100vh;
background-color: black;
display: flex;
justify-content: center;
align-items: center;
}
.mouse {
width: 100px;
height: 150px;
border: 2px solid white;
border-radius: 50px;
position: relative;
overflow-y: scroll;
}
.mouse::before {
position: absolute;
content: "";
width: 20px;
height: 20px;
background-color: white;
top: 30px;
left: 50px;
transform: translateX(-50%);
border-radius: 50%;
animation: scroll 1s infinite;
}
#keyframes scroll {
from {
opacity: 1;
top: 30px;
}
to {
opacity: 0;
top: 100px;
}
}
<div class="mouse"></div>
what should I do???
You should change overflow-y: scroll; to overflow-y: auto;. For example:
.mouse {
overflow-y: auto;
}
body {
height: 100vh;
background-color: black;
display: flex;
justify-content: center;
align-items: center;
}
.mouse {
width: 100px;
height: 150px;
border: 2px solid white;
border-radius: 50px;
position: relative;
overflow-y: auto;
}
.mouse::before {
position: absolute;
content: "";
width: 20px;
height: 20px;
background-color: white;
top: 30px;
left: 50px;
transform: translateX(-50%);
border-radius: 50%;
animation: scroll 1s infinite;
}
#keyframes scroll {
from {
opacity: 1;
top: 30px;
}
to {
opacity: 0;
top: 100px;
}
}
<div class="mouse"></div>
Of course you can delete overflow-y from .mouse