forked from ProtonMail/WebClients
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add full screen on mobile modal variant
CP-2753 CP-2812 Co-authored-by: Matthieu Bué <[email protected]>
- Loading branch information
1 parent
6dd384b
commit c6c8278
Showing
4 changed files
with
181 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,124 @@ | ||
@import '~@proton/styles/scss/config'; | ||
|
||
.modal-two-backdrop { | ||
position: fixed; | ||
inset: 0; | ||
z-index: 666; | ||
display: flex; | ||
padding: 2em; | ||
overflow: hidden; | ||
flex-flow: column nowrap; | ||
align-items: center; | ||
justify-content: center; | ||
background: var(--backdrop-norm); | ||
animation: 0.1s ease-out forwards; | ||
animation-name: anime-modal-two-backdrop-in; | ||
|
||
@include respond-to($breakpoint-tiny) { | ||
padding: 1em; | ||
} | ||
|
||
&--out { | ||
animation-name: anime-modal-two-backdrop-out; | ||
|
||
.modal-two { | ||
animation-name: anime-modal-two-out; | ||
} | ||
} | ||
|
||
&--fullscreen-on-mobile { | ||
@include respond-to($breakpoint-tiny) { | ||
padding: 0; | ||
align-items: stretch; | ||
background: none; | ||
} | ||
} | ||
|
||
@keyframes anime-modal-two-backdrop-in { | ||
from { | ||
opacity: 0; | ||
} | ||
|
||
to { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
@keyframes anime-modal-two-backdrop-out { | ||
from { | ||
opacity: 1; | ||
} | ||
|
||
to { | ||
opacity: 0; | ||
} | ||
} | ||
} | ||
|
||
.modal-two { | ||
--size: #{rem(480)}; // medium | ||
--margin: #{rem(48)}; | ||
|
||
@include respond-to(392) { | ||
--margin: #{rem(24)}; | ||
} | ||
|
||
position: relative; | ||
display: flex; | ||
max-inline-size: var(--size); | ||
overflow: hidden; | ||
padding: 0; | ||
margin: auto; | ||
transform-origin: center top; | ||
flex: 0 1 auto; | ||
flex-flow: column nowrap; | ||
justify-content: flex-start; | ||
align-items: stretch; | ||
border-radius: var(--border-radius-large); | ||
box-shadow: var(--shadow-lifted); | ||
background: var(--background-norm); | ||
color: var(--text-norm); | ||
animation: .25s easing(easeOutCubic) forwards; | ||
animation-name: anime-modal-two-in; | ||
|
||
&--small { | ||
--size: #{rem(392)}; | ||
--margin: #{rem(24)}; | ||
} | ||
|
||
&--large { | ||
--size: #{rem(600)}; | ||
} | ||
|
||
&--full { | ||
--size: 100%; | ||
inline-size: var(--size); | ||
} | ||
|
||
&-backdrop--out & { | ||
animation-name: anime-modal-two-out; | ||
} | ||
|
||
@keyframes anime-modal-two-in { | ||
0% { | ||
transform: scale(0.9); | ||
} | ||
|
||
100% { | ||
transform: scale(1); | ||
} | ||
} | ||
|
||
@keyframes anime-modal-two-out { | ||
0% { | ||
transform: scale(1); | ||
} | ||
|
||
100% { | ||
transform: scale(0.9); | ||
} | ||
} | ||
|
||
&-backdrop { | ||
position: fixed; | ||
inset: 0; | ||
z-index: 666; | ||
display: flex; | ||
padding: 2em; | ||
overflow: hidden; | ||
flex-flow: column nowrap; | ||
align-items: center; | ||
justify-content: center; | ||
background: var(--backdrop-norm); | ||
animation: 0.1s ease-out forwards; | ||
animation-name: anime-modal-two-backdrop-in; | ||
|
||
@include respond-to(392) { | ||
padding: 1em; | ||
} | ||
|
||
&--out { | ||
animation-name: anime-modal-two-backdrop-out; | ||
} | ||
} | ||
|
||
@keyframes anime-modal-two-backdrop-in { | ||
from { | ||
opacity: 0; | ||
} | ||
|
||
to { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
@keyframes anime-modal-two-backdrop-out { | ||
from { | ||
opacity: 1; | ||
} | ||
|
||
to { | ||
opacity: 0; | ||
} | ||
} | ||
--size: #{rem(480)}; // medium | ||
--margin: #{rem(48)}; | ||
|
||
@include respond-to($breakpoint-tiny) { | ||
--margin: #{rem(24)}; | ||
} | ||
|
||
position: relative; | ||
display: flex; | ||
max-inline-size: var(--size); | ||
overflow: hidden; | ||
padding: 0; | ||
margin: auto; | ||
transform-origin: center top; | ||
flex: 0 1 auto; | ||
flex-flow: column nowrap; | ||
justify-content: flex-start; | ||
align-items: stretch; | ||
border-radius: var(--border-radius-large); | ||
box-shadow: var(--shadow-lifted); | ||
background: var(--background-norm); | ||
color: var(--text-norm); | ||
animation: 0.25s easing(easeOutCubic) both; | ||
animation-name: anime-modal-two-in; | ||
|
||
&--small { | ||
--size: #{rem(392)}; | ||
--margin: #{rem(24)}; | ||
} | ||
|
||
&--large { | ||
--size: #{rem(600)}; | ||
} | ||
|
||
&--full { | ||
--size: 100%; | ||
inline-size: var(--size); | ||
} | ||
|
||
&-backdrop--fullscreen-on-mobile & { | ||
@include respond-to($breakpoint-tiny) { | ||
flex: 1 0 100%; | ||
border-radius: 0; | ||
} | ||
} | ||
|
||
@keyframes anime-modal-two-in { | ||
0% { | ||
transform: scale(0.9); | ||
} | ||
|
||
100% { | ||
transform: scale(1); | ||
} | ||
} | ||
|
||
@keyframes anime-modal-two-out { | ||
0% { | ||
transform: scale(1); | ||
} | ||
|
||
100% { | ||
transform: scale(0.9); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters