This commit is contained in:
Rizky 2024-01-23 06:45:23 +07:00
parent edbbe34310
commit df73b97c2b
2 changed files with 98 additions and 89 deletions

View File

@ -113,11 +113,13 @@ export const prepDCode = async (site_id: string) => {
} }
if (exists) { if (exists) {
Bun.spawn({ const chmod = Bun.spawn({
cmd: ["chmod", "777", "-R", "."], cmd: ["chmod", "-R", "777", "."],
cwd: dir.path(`${g.datadir}/site}`), cwd: dir.path(`${g.datadir}/site`),
}); });
await chmod.exited;
const src_bin = Y.encodeStateAsUpdate(docs.code[site_id].src as Doc); const src_bin = Y.encodeStateAsUpdate(docs.code[site_id].src as Doc);
const build_bin = Y.encodeStateAsUpdate(docs.code[site_id].build as Doc); const build_bin = Y.encodeStateAsUpdate(docs.code[site_id].build as Doc);

View File

@ -60,7 +60,7 @@ export const EdMain = () => {
<div <div
className={cx( className={cx(
"flex flex-1 relative overflow-auto", "flex flex-1 relative overflow-auto",
p.mode === "mobile" ? "flex-col items-center" : "" p.mode === "mobile" ? "flex-col items-center" : "",
)} )}
ref={(el) => { ref={(el) => {
if (el) { if (el) {
@ -104,7 +104,14 @@ const mainStyle = (p: PG, meta?: IMeta) => {
bottom: 0px; bottom: 0px;
` `
: "inset-0", : "inset-0",
css` p.mode === "mobile"
? css`
width: ${width};
height: ${`${(1 / scale) * 100}%`};
transform: scale(${scale});
transform-origin: 50% 0% 0px;
`
: css`
width: ${width}; width: ${width};
height: ${`${(1 / scale) * 100}%`}; height: ${`${(1 / scale) * 100}%`};
transform: scale(${scale}); transform: scale(${scale});
@ -141,6 +148,6 @@ const mainStyle = (p: PG, meta?: IMeta) => {
border: 2px solid #1c88f3; border: 2px solid #1c88f3;
} }
} }
` `,
); );
}; };