parent
9aff7f9f6d
commit
344f213566
After Width: | Height: | Size: 236 KiB |
@ -0,0 +1,23 @@
|
|||||||
|
#ingame_HUD_CatMemes {
|
||||||
|
position: absolute;
|
||||||
|
@include S(width, 150px);
|
||||||
|
@include S(height, 150px);
|
||||||
|
background: transparent center center / contain no-repeat;
|
||||||
|
|
||||||
|
right: 0;
|
||||||
|
@include S(bottom, 150px);
|
||||||
|
|
||||||
|
& {
|
||||||
|
/* @load-async */
|
||||||
|
background-image: uiResource("res/ui/memes/cat1.png") !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@include InlineAnimation(0.5s ease-in-out) {
|
||||||
|
0% {
|
||||||
|
transform: translateX(100%);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
import { makeDiv } from "../../../core/utils";
|
||||||
|
import { BaseHUDPart } from "../base_hud_part";
|
||||||
|
import { DynamicDomAttach } from "../dynamic_dom_attach";
|
||||||
|
|
||||||
|
const memeShowIntervalSeconds = 70 * 60;
|
||||||
|
const memeShowDuration = 5;
|
||||||
|
|
||||||
|
export class HUDCatMemes extends BaseHUDPart {
|
||||||
|
createElements(parent) {
|
||||||
|
this.element = makeDiv(parent, "ingame_HUD_CatMemes");
|
||||||
|
}
|
||||||
|
|
||||||
|
initialize() {
|
||||||
|
this.domAttach = new DynamicDomAttach(this.root, this.element);
|
||||||
|
}
|
||||||
|
|
||||||
|
update() {
|
||||||
|
const now = this.root.time.realtimeNow();
|
||||||
|
this.domAttach.update(now % memeShowIntervalSeconds > memeShowIntervalSeconds - memeShowDuration);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue