mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 18:24:12 +02:00
style fixes
This commit is contained in:
parent
fff554c3d3
commit
2dee28d022
4 changed files with 5 additions and 20 deletions
|
|
@ -17,20 +17,6 @@ export interface AnalyseProps {
|
|||
parser: AsyncParser;
|
||||
}
|
||||
|
||||
export interface AnalyseState {
|
||||
worldSize: {
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
backgroundBoundaries: WorldBoundaries;
|
||||
tick: number;
|
||||
playing: boolean;
|
||||
scale: number;
|
||||
error?: string;
|
||||
isShared: boolean;
|
||||
}
|
||||
|
||||
|
||||
export const Analyser = (props: AnalyseProps) => {
|
||||
const parser = props.parser;
|
||||
const intervalPerTick = props.header.interval_per_tick;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import {Panner} from "../Panner/Panner";
|
||||
import {createEffect, createSignal} from "solid-js";
|
||||
import {createEffect, createSignal, ParentProps} from "solid-js";
|
||||
|
||||
export class MapContainerProps {
|
||||
contentSize: {
|
||||
|
|
@ -7,10 +7,9 @@ export class MapContainerProps {
|
|||
height: number;
|
||||
};
|
||||
onScale?: (scale: number) => any;
|
||||
children: Element;
|
||||
}
|
||||
|
||||
export const MapContainer = ({children, contentSize, onScale}: MapContainerProps) => {
|
||||
export const MapContainer = ({children, contentSize, onScale}: ParentProps<MapContainerProps>) => {
|
||||
const [container, setContainer] = createSignal<Element>();
|
||||
const scale = () => Math.min(
|
||||
container().clientWidth / contentSize.width,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import {CenteredPanZoom} from './CenteredPanZoom';
|
||||
import {createSignal} from "solid-js";
|
||||
import {createSignal, ParentProps} from "solid-js";
|
||||
|
||||
export interface PannerProps {
|
||||
width: number;
|
||||
|
|
@ -10,10 +10,9 @@ export interface PannerProps {
|
|||
height: number;
|
||||
};
|
||||
onScale?: (scale: number) => any;
|
||||
children: Element;
|
||||
}
|
||||
|
||||
export const Panner = (props: PannerProps) => {
|
||||
export const Panner = (props: ParentProps<PannerProps>) => {
|
||||
const [scale, setScale] = createSignal(0);
|
||||
const [translateX, setTranslateX] = createSignal(0);
|
||||
const [translateY, setTranslateY] = createSignal(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue