odin-default-css-exercises/animation/03-pop-up/solution/solution.css

87 lines
1.4 KiB
CSS
Raw Normal View History

2021-10-18 21:33:12 +00:00
* {
padding: 0;
margin: 0;
}
2021-10-20 22:05:31 +00:00
body {
overflow: hidden;
}
.button-container {
2021-10-18 21:33:12 +00:00
width: 100vw;
height: 100vh;
2021-10-20 20:40:44 +00:00
background-color: #ffffff;
2021-10-20 22:05:31 +00:00
opacity: 100%;
2021-10-20 20:40:44 +00:00
transition: background-color 0.5s ease-in, opacity 0.5s ease-in;
}
2021-10-20 22:05:31 +00:00
.button-container.show {
2021-10-20 20:40:44 +00:00
background-color: #000000;
opacity: 40%;
}
#trigger-modal,
.popup-modal {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
2021-10-18 21:33:12 +00:00
}
2021-10-20 22:05:31 +00:00
#trigger-modal {
padding: 20px;
color: #ffffff;
background-color: #0e79dd;
border: none;
border-radius: 5px;
font-weight: 600;
}
#trigger-modal:hover {
cursor: pointer;
box-shadow: 1px 1px 2px #000000;
}
.popup-modal,
.popup-modal.show {
2021-10-18 21:33:12 +00:00
width: 30%;
2021-10-20 22:05:31 +00:00
height: 15%;
2021-10-18 21:33:12 +00:00
background-color: white;
2021-10-20 22:05:31 +00:00
border: 1px solid black;
border-radius: 10px;
2021-10-18 21:33:12 +00:00
display: flex;
2021-10-20 22:05:31 +00:00
justify-content: center;
align-items: center;
}
.popup-modal {
margin-top: 10%;
opacity: 0;
2021-10-18 21:33:12 +00:00
visibility: hidden;
2021-10-20 22:05:31 +00:00
transition: margin-top 0.5s ease-out, opacity 0.5s ease-out,
visibility 0.5s linear;
2021-10-18 21:33:12 +00:00
}
2021-10-20 20:40:44 +00:00
.popup-modal.show {
2021-10-20 22:05:31 +00:00
min-height: 90px;
opacity: 1;
2021-10-18 21:33:12 +00:00
visibility: visible;
2021-10-20 22:05:31 +00:00
margin-top: 0;
transition: margin-top 0.5s ease-out, opacity 0.5s ease-out,
visibility 0.5s linear;
}
#close-modal {
padding: 20px;
color: #ffffff;
background-color: #0e79dd;
border: none;
border-radius: 5px;
font-weight: 600;
}
#close-modal:hover {
cursor: pointer;
box-shadow: 1px 1px 2px #000000;
2021-10-18 21:33:12 +00:00
}