11import { VerificationPair } from "@service/limit-service/verification/common"
22import verificationProcessor from "@service/limit-service/verification/processor"
3- import { LINK_STYLE } from "../modal-style"
3+ import { FILTER_STYLES , LINK_STYLE } from "../modal-style"
44import { t as t_ , locale , I18nKey , tN as tN_ , I18nResultItem } from "@i18n"
55import { LimitMessage , verificationMessages } from "@i18n/message/app/limit"
66
@@ -49,10 +49,16 @@ const CONFIRM_STYLE: Partial<CSSStyleDeclaration> = {
4949 padding : "50px 20px 20px 20px" ,
5050 position : "absolute" ,
5151 textAlign : "center" ,
52- background : "#111" ,
5352 borderRadius : "8px" ,
5453}
5554
55+ const computeConfirmStyle = ( limitFilter : timer . limit . FilterType ) : Partial < CSSStyleDeclaration > => {
56+ return {
57+ ...CONFIRM_STYLE ,
58+ ...FILTER_STYLES [ limitFilter || "translucent" ] ?. delayConfirm || { }
59+ }
60+ }
61+
5662const INPUT_STYLE : Partial < CSSStyleDeclaration > = {
5763 color : "#000" ,
5864 padding : "2px 6px" ,
@@ -94,7 +100,7 @@ export class DelayConfirm {
94100 private onError : ( msg : string ) => void
95101
96102 constructor ( option : timer . option . DailyLimitOption ) {
97- const { limitLevel = "nothing" , limitPassword, limitVerifyDifficulty } = option || { }
103+ const { limitLevel = "nothing" , limitPassword, limitVerifyDifficulty, limitFilter } = option || { }
98104 let tips : I18nResultItem < HTMLElement > [ ] = [ ]
99105 if ( limitLevel === "password" && limitPassword ) {
100106 this . answerValue = limitPassword
@@ -121,9 +127,8 @@ export class DelayConfirm {
121127 return
122128 }
123129 this . dom = document . createElement ( "div" )
124- Object . assign ( this . dom . style || { } , CONFIRM_STYLE )
130+ Object . assign ( this . dom . style || { } , computeConfirmStyle ( limitFilter ) )
125131 this . dom . style . display = 'none'
126- // tips
127132 const tipContainer = document . createElement ( 'div' )
128133 tipContainer . append ( ...tips )
129134 this . dom . append ( tipContainer )
0 commit comments