Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ulixee
GitHub Repository: ulixee/secret-agent
Path: blob/main/replay/backend/overlays/MessageOverlay.ts
1030 views
1
import BaseOverlay from '~backend/overlays/BaseOverlay';
2
import { VIEW_Y_OFFSET } from '~shared/constants/design';
3
4
const width = 350;
5
export default class MessageOverlay extends BaseOverlay {
6
public static width = width;
7
constructor() {
8
super({
9
name: 'message-overlay',
10
bounds: {
11
width,
12
height: 200,
13
y: VIEW_Y_OFFSET + 100,
14
},
15
calcBounds(bounds) {
16
const height = Math.max(this.lastHeight, 200);
17
return {
18
width,
19
height: height + 20,
20
x: bounds.width / 2 - width / 2,
21
y: bounds.y + bounds.height / 2 - height,
22
};
23
},
24
});
25
}
26
}
27
28