pref: 截图改用自定义协议传递。

This commit is contained in:
2023-03-20 09:27:47 +08:00
parent 5df7f54bed
commit 85ef261c51
7 changed files with 194 additions and 19 deletions

View File

@ -0,0 +1,33 @@
import { Component, createMemo } from 'solid-js';
import { DisplayInfo } from '../models/display-info.model';
import { displayStore } from '../stores/display.store';
import { DisplayInfoPanel } from './display-info-panel';
import { ScreenView } from './screen-view';
type DisplayViewProps = {
display: DisplayInfo;
};
export const DisplayView: Component<DisplayViewProps> = (props) => {
const size = createMemo(() => ({
width: props.display.width * displayStore.viewScale,
height: props.display.height * displayStore.viewScale,
}));
const style = createMemo(() => ({
top: `${props.display.y * displayStore.viewScale}px`,
left: `${props.display.x * displayStore.viewScale}px`,
}));
return (
<section class="absolute bg-gray-300" style={style()}>
<ScreenView
displayId={props.display.id}
height={size().height}
width={size().width}
/>
<DisplayInfoPanel
display={props.display}
class="absolute bg-slate-50/10 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded backdrop-blur w-1/3 min-w-[300px] text-black"
/>
</section>
);
};