mapcomplete/UI/MapControlButton.ts

25 lines
696 B
TypeScript
Raw Normal View History

2022-09-08 21:40:48 +02:00
import BaseUIElement from "./BaseUIElement"
import Combine from "./Base/Combine"
/**
* A button floating above the map, in a uniform style
*/
export default class MapControlButton extends Combine {
2022-09-08 21:40:48 +02:00
constructor(
contents: BaseUIElement,
options?: {
dontStyle?: boolean
}
) {
super([contents])
if (!options?.dontStyle) {
contents.SetClass("mapcontrol p-1")
this.SetClass("p-1")
}
this.SetClass(
"relative block rounded-full w-10 h-10 pointer-events-auto z-above-map subtle-background m-0.5 md:m-1"
2022-09-08 21:40:48 +02:00
)
this.SetStyle("box-shadow: 0 0 10px var(--shadow-color);")
}
2021-07-19 16:23:13 +02:00
}