-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from NJUPT-SAST/dev-bqx
Dev bqx
- Loading branch information
Showing
14 changed files
with
280 additions
and
129 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
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,30 +1,47 @@ | ||
@use '../_variables/color.scss' as *; | ||
@use '../_variables/radius.scss' as *; | ||
@use '../_variables/shadow.scss' as *; | ||
@use '../_variables/duration.scss' as *; | ||
@use '../_variables/animation.scss' as *; | ||
@mixin color-badge($color-name) { | ||
background-color: rgba(var(--#{$color-name}-color-background-rgb), 1); | ||
color: var(--#{$color-name}-color); | ||
background-color: $color-name; | ||
color: $white-color; | ||
font-weight: bold; | ||
} | ||
|
||
.base { | ||
padding: 3px 10px; | ||
border-radius: 5px; | ||
border-radius: $radius-5; | ||
@include shadow; | ||
transition: all $duration-100 $cubic-bezier; | ||
&:hover { | ||
opacity: 0.8; | ||
} | ||
&.info { | ||
@include color-badge(primary); | ||
@include color-badge($primary-color); | ||
} | ||
&.success { | ||
@include color-badge(success); | ||
@include color-badge($success-color); | ||
} | ||
&.warning { | ||
@include color-badge(warning); | ||
@include color-badge($warning-color); | ||
} | ||
&.error { | ||
@include color-badge(danger); | ||
@include color-badge($danger-color); | ||
} | ||
&.ghost { | ||
@include color-badge($pale-white-color); | ||
color: $black-color; | ||
} | ||
&.medium { | ||
font-size: 14px; | ||
padding: 2px 11px; | ||
} | ||
&.large { | ||
font-size: 18px; | ||
padding: 3px 14px; | ||
} | ||
&.small { | ||
font-size: 10px; | ||
padding: 2px 8px; | ||
} | ||
} |
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
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,72 +1,100 @@ | ||
@use '../variables' as *; | ||
@use '../_variables/shadow.scss' as *; | ||
@use '../_variables/animation.scss' as *; | ||
@use '../_variables/color.scss' as *; | ||
|
||
@property --blur { | ||
syntax: '<length>'; | ||
inherits: false; | ||
initial-value: 0px; | ||
} | ||
|
||
@property --opacity-background { | ||
syntax: '<percentage>'; | ||
inherits: false; | ||
initial-value: 0%; | ||
} | ||
|
||
@property --opacity-card { | ||
syntax: '<percentage>'; | ||
inherits: false; | ||
initial-value: 0%; | ||
} | ||
|
||
@property --scale { | ||
syntax: '<percentage>'; | ||
inherits: false; | ||
initial-value: 80%; | ||
} | ||
|
||
@mixin animation($name) { | ||
animation-name: $name; | ||
animation-duration: 400ms; | ||
animation-duration: 500ms; | ||
animation-timing-function: $cubic-bezier; | ||
animation-fill-mode: forwards; | ||
} | ||
|
||
.background { | ||
top: 0; | ||
left: 0; | ||
@mixin dialog-animation() { | ||
&.dialog-in { | ||
@include animation(dialog-in); | ||
} | ||
&.dialog-hide { | ||
@include animation(dialog-hide); | ||
} | ||
} | ||
|
||
.dialog-container { | ||
height: 100%; | ||
width: 100%; | ||
left: 0; | ||
top: 0; | ||
position: absolute; | ||
box-sizing: border-box; | ||
background-color: $background-shadow-color; | ||
&.background-in { | ||
@include animation(in); | ||
&.mask { | ||
background-color: rgb($black-color, var(--opacity-background)); | ||
backdrop-filter: blur(var(--blur)); | ||
} | ||
&.background-hide { | ||
@include animation(hide); | ||
&.no-mask { | ||
all: unset; | ||
} | ||
.base { | ||
@include absolute-center; | ||
&.in { | ||
@include animation(dialog-in); | ||
} | ||
&.hide { | ||
@include animation(dialog-hide); | ||
} | ||
@include dialog-animation(); | ||
.dialog { | ||
z-index: 1; | ||
position: absolute; | ||
top: 50%; | ||
transform: translateY(-50%); | ||
padding: 0; | ||
border: none; | ||
border-radius: 8px; | ||
scale: var(--scale); | ||
opacity: var(--opacity-card); | ||
@include dialog-animation(); | ||
} | ||
} | ||
|
||
@keyframes dialog-in { | ||
0% { | ||
opacity: 0; | ||
transform: translate(-50%, -50%) scale(0.8); | ||
--blur: 0px; | ||
--opacity-background: 0%; | ||
--opacity-card: 0%; | ||
--scale: 70%; | ||
} | ||
100% { | ||
opacity: 1; | ||
transform: translate(-50%, -50%) scale(1); | ||
--blur: 4px; | ||
--opacity-background: 40%; | ||
--opacity-card: 100%; | ||
--scale: 100%; | ||
} | ||
} | ||
|
||
@keyframes dialog-hide { | ||
0% { | ||
opacity: 1; | ||
transform: translate(-50%, -50%) scale(1); | ||
} | ||
100% { | ||
opacity: 0; | ||
transform: translate(-50%, -50%) scale(0.8); | ||
} | ||
} | ||
|
||
@keyframes in { | ||
0% { | ||
opacity: 0; | ||
} | ||
100% { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
@keyframes hide { | ||
0% { | ||
opacity: 1; | ||
--blur: 4px; | ||
--opacity-background: 40%; | ||
--opacity-card: 100%; | ||
--scale: 100%; | ||
} | ||
100% { | ||
opacity: 0; | ||
--blur: 0px; | ||
--opacity-background: 0%; | ||
--opacity-card: 0%; | ||
--scale: 80%; | ||
} | ||
} |
Oops, something went wrong.