Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ulixee
GitHub Repository: ulixee/secret-agent
Path: blob/main/replay/backend/overlays/MainMenu.ts
1030 views
1
import { DIALOG_MARGIN_TOP, DIALOG_MARGIN } from '~shared/constants/design';
2
import BaseOverlay from '~backend/overlays/BaseOverlay';
3
import IRectangle from '~shared/interfaces/IRectangle';
4
5
export default class MainMenu extends BaseOverlay {
6
constructor() {
7
const menuWidth = 330;
8
const menuHeight = 204;
9
super({
10
name: 'main-menu',
11
calcBounds(bounds: IRectangle) {
12
return {
13
width: menuWidth,
14
height: menuHeight,
15
x: bounds.x - menuWidth + DIALOG_MARGIN + DIALOG_MARGIN,
16
y: bounds.y + 20 - DIALOG_MARGIN_TOP,
17
};
18
},
19
onWindowBoundsUpdate: () => {
20
this.hide();
21
},
22
});
23
}
24
}
25
26