mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-26 07:44:01 +08:00
fading ads out when in focus mode
This commit is contained in:
parent
d042ac273d
commit
17cc2824a8
2 changed files with 14 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
#ad-vertical-left-wrapper,
|
||||
#ad-vertical-right-wrapper {
|
||||
margin-top: 2rem;
|
||||
transition: margin-top 0.125s;
|
||||
transition: margin-top 0.125s opacity 0.125s;
|
||||
}
|
||||
|
||||
#ad-footer-wrapper,
|
||||
|
@ -27,11 +27,16 @@
|
|||
background: var(--sub-alt-color);
|
||||
display: grid;
|
||||
grid-template-areas: "col";
|
||||
transition: opacity 0.125s;
|
||||
|
||||
& > div {
|
||||
grid-area: col;
|
||||
}
|
||||
|
||||
&.focus {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: 3rem;
|
||||
height: 100%;
|
||||
|
|
|
@ -14,6 +14,10 @@ export function set(foc: boolean, withCursor = false): void {
|
|||
$("#middle").addClass("focus");
|
||||
$("#bannerCenter").addClass("focus");
|
||||
$("#capsWarning").addClass("focus");
|
||||
$("#ad-vertical-right-wrapper").addClass("focus");
|
||||
$("#ad-vertical-left-wrapper").addClass("focus");
|
||||
$("#ad-footer-wrapper").addClass("focus");
|
||||
$("#ad-footer-small-wrapper").addClass("focus");
|
||||
} else if (!foc && state) {
|
||||
state = false;
|
||||
Caret.startAnimation();
|
||||
|
@ -24,6 +28,10 @@ export function set(foc: boolean, withCursor = false): void {
|
|||
$("#bannerCenter").removeClass("focus");
|
||||
$("#capsWarning").removeClass("focus");
|
||||
$("#app").removeClass("focus");
|
||||
$("#ad-vertical-right-wrapper").removeClass("focus");
|
||||
$("#ad-vertical-left-wrapper").removeClass("focus");
|
||||
$("#ad-footer-wrapper").removeClass("focus");
|
||||
$("#ad-footer-small-wrapper").removeClass("focus");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue