-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡️ perf: optimize setting editor layout for mobile devices
- Loading branch information
Showing
8 changed files
with
124 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { ReactNode } from "react"; | ||
import useModeStore from "@/stores/modeStore"; | ||
|
||
interface A4BackgroundProps { | ||
children: ReactNode; | ||
} | ||
|
||
const A4Background: React.FC<A4BackgroundProps> = ({ children }) => { | ||
const { editModeStore } = useModeStore(); | ||
return ( | ||
<div | ||
id="export-html" | ||
className={`print-remove-styles flex flex-col items-center bg-gray-300 overflow-auto max-sm:h-screen max-sm:overflow-hidden transition-all duration-500 ease-in-out ${ | ||
editModeStore ? "md:ml-80" : "" | ||
} `} | ||
> | ||
<div | ||
id="export-page" | ||
className={`print-remove-styles mt-24 md:mb-6 max-sm:scale-[0.4] ${ | ||
editModeStore ? "max-sm:-mt-64" : "max-sm:-mt-56" | ||
}`} | ||
> | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default A4Background; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
import React from 'react'; | ||
|
||
interface StyleSliderProps { | ||
min: number; | ||
max: number | ||
value?: number; | ||
onChange: (newValue: number) => void; | ||
} | ||
|
||
const StyleSlider: React.FC<StyleSliderProps> = ({ min, max, value, onChange }) => { | ||
|
||
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
onChange(Number(e.target.value)); | ||
}; | ||
|
||
return ( | ||
<div className="flex flex-col items-center"> | ||
<input | ||
type="range" | ||
min={min} | ||
max={max} | ||
value={value} | ||
onChange={handleChange} | ||
className="w-full h-2 bg-slate-200 rounded-lg appearance-none cursor-pointer" | ||
/> | ||
<div className="text-center mt-2"> | ||
<span className="font-mono font-semibold italic text-slate-800">{value} px</span> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default StyleSlider; | ||
import React from 'react'; | ||
|
||
interface StyleSliderProps { | ||
min: number; | ||
max: number | ||
value?: number; | ||
onChange: (newValue: number) => void; | ||
} | ||
|
||
const StyleSlider: React.FC<StyleSliderProps> = ({ min, max, value, onChange }) => { | ||
|
||
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
onChange(Number(e.target.value)); | ||
}; | ||
|
||
return ( | ||
<div className="flex flex-col items-center"> | ||
<input | ||
type="range" | ||
min={min} | ||
max={max} | ||
value={value} | ||
onChange={handleChange} | ||
className="w-full max-sm:w-40 h-2 bg-slate-200 rounded-lg appearance-none cursor-pointer" | ||
/> | ||
<div className="text-center mt-2"> | ||
<span className="font-mono font-semibold italic text-slate-800 max-sm:text-xs">{value} px</span> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default StyleSlider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters