PythonGallery/onlylegs/static/sass/components/notification.sass
2023-09-26 13:43:00 +01:00

130 lines
2.2 KiB
Sass

@keyframes notificationTimeout
0%
width: 0
100%
width: 100%
@mixin notification($color)
color: RGB($color)
&::after
background-color: RGB($color)
.notifications
margin: 0
padding: 0
width: 24rem
height: auto
position: fixed
bottom: 0.3rem
right: 0.3rem
display: flex
flex-direction: column-reverse
z-index: 621
.sniffle__notification
margin-top: 0.3rem
padding: 0
height: auto
max-height: 100px
display: flex
flex-direction: row
position: relative
background-color: RGB($bg-300)
border-radius: $rad-inner
color: RGB($fg-white)
opacity: 0
transform: scale(0.8)
box-sizing: border-box
overflow: hidden
transition: opacity 0.2s ease-in-out, transform 0.2s cubic-bezier(.68,-0.55,.27,1.55)
&::after
content: ""
width: 0
height: 3px
position: absolute
bottom: 0
left: 0
background-color: RGB($fg-white)
z-index: +2
animation: notificationTimeout 5.1s ease-out forwards
&.success
@include notification($success)
&.warning
@include notification($warning)
&.critical
@include notification($critical)
&.info
@include notification($info)
&.show
opacity: 1
transform: scale(1)
&.hide
margin: 0
max-height: 0
opacity: 0
transform: translateY(1rem)
transition: all 0.4s ease-in-out, max-height 0.2s ease-in-out
.sniffle__notification-icon
margin: 0
padding: 1rem
width: auto
height: auto
display: flex
justify-content: center
align-items: center
background-color: RGB($bg-200)
i
font-size: 1.25rem
.sniffle__notification-text
margin: 0
padding: 1rem
width: auto
height: auto
display: flex
flex-direction: column
justify-self: center
align-self: center
font-size: 1rem
font-weight: 600
line-height: 1
text-align: left
@media (max-width: $breakpoint)
.notifications
bottom: 3.8rem
width: calc(100vw - 0.6rem)
height: auto
.sniffle__notification
width: 100%
.sniffle__notification-time
width: 100%