File tree Expand file tree Collapse file tree 2 files changed +47
-9
lines changed
Code/skyrim_ui/src/app/components/root Expand file tree Collapse file tree 2 files changed +47
-9
lines changed Original file line number Diff line number Diff line change 4848 >
4949 {{ 'COMPONENT.ROOT.PLAYER_MANAGER' | transloco }}
5050 </ button >
51- < button
52- data-style-ornament ="inverted "
53- (click) ="revealPlayers() "
54- [disabled] ="revealingInProgress$ "
55- [class.reveal-disabled] ="revealingInProgress$ "
56- >
57- {{ 'COMPONENT.ROOT.REVEAL_PLAYERS' | transloco }}
51+ < button data-style-ornament ="inverted " (click) ="revealPlayers() ">
52+ <!-- See note in 'root.component.scss' for explanation -->
53+ < div style ="position: relative; ">
54+ < span
55+ class ="cooldown-supporting-text-normal "
56+ [class.cooldown-supporting-text-animating] ="revealingInProgress$ "
57+ >
58+ {{ 'COMPONENT.ROOT.REVEAL_PLAYERS' | transloco }}
59+ </ span >
60+ < span
61+ style ="position: absolute; left: 0; top: 0; "
62+ class ="text-cooldown-effect "
63+ [class.cooldown-active] ="revealingInProgress$ "
64+ [style.--cooldown-duration] ="revealingInProgress$ ? '6s' : '0.3s' "
65+ >
66+ {{ 'COMPONENT.ROOT.REVEAL_PLAYERS' | transloco }}
67+ </ span >
68+ </ div >
5869 </ button >
5970 </ ng-container >
6071 < button
Original file line number Diff line number Diff line change 132132 }
133133}
134134
135- .reveal-disabled {
136- opacity : 0.25 ;
135+ // Note: due to how `-webkit-background-clip` renders clipped text (that's needed for
136+ // the cooldown effect), we need to apply a few workarounds to make it look just right. I'm sorry!
137+
138+ .cooldown-supporting-text-normal {
139+ color : mod ($-color-background , 0.8 );
140+ transition : color 0.3s linear ;
141+ }
142+
143+ .cooldown-supporting-text-animating {
144+ color : mod ($-color-background , 0.3 );
145+ }
146+
147+ .text-cooldown-effect {
148+ --cooldown-duration : 6s ;
149+ background : linear-gradient (
150+ to left ,
151+ mod ($-color-background , 0.3 ) 50% ,
152+ mod ($-color-background , 1 ) 50%
153+ );
154+ background-clip : text ;
155+ -webkit-background-clip : text ;
156+ transition : background-position var (--cooldown-duration ) linear ;
157+ color : transparent ;
158+ background-size : 200% ;
159+ background-position : 0% ;
160+
161+ & .cooldown-active {
162+ background-position : 100% ;
163+ }
137164}
You can’t perform that action at this time.
0 commit comments