Skip to content

Commit 25ebd7f

Browse files
committed
Adjust code styling and dimensions
1 parent ad8b2ac commit 25ebd7f

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

lazyweb/components/snippets/micro/Code.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ const Code = ({noHeading}: Props) => {
6262
style={{
6363
borderRadius: `${borderRadius}px`,
6464
width: '100%',
65-
minHeight: '50vh',
6665

6766

6867
}}
@@ -77,7 +76,7 @@ const Code = ({noHeading}: Props) => {
7776
onChange={onChange}
7877
fontSize={16}
7978
showPrintMargin={false}
80-
minLines={10}
79+
minLines={5}
8180
maxLines={Infinity}
8281
showGutter={false}
8382
wrapEnabled={true}

lazyweb/components/snippets/micro/Container.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ const Container = ({children}: Props) => {
128128
return (
129129
<>
130130
<div ref={divRef} style={{
131-
minHeight: `${height}vh`,
132131
width: `${width}vw`,
133132
background: atob(color),
134133
borderRadius: (paddingX===0 && paddingY===0) ? `${borderRadius}px` : `${containerBorderRadius}px`,

lazyweb/components/snippets/micro/Selector.tsx

+16-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type Props = {
2727

2828
const Selector = ({save, saveSVG, savePDF, uploadImage}: Props) => {
2929
const [isEditOpen, setIsEditOpen] = useState(false);
30-
const {paddingX, setPaddingX,containerBorderRadius, setContainerBorderRadius, paddingY,setPaddingY,setGradient,borderRadius, setBorderRadius} = useUIStore()
30+
const {paddingX, setPaddingX,width, setWidth, containerBorderRadius, setContainerBorderRadius, paddingY,setPaddingY,setGradient,borderRadius, setBorderRadius} = useUIStore()
3131
const router = useRouter()
3232
const colorRef = useRef<HTMLInputElement>(null)
3333
let selectedTheme = router.query.theme as string || 'monokai'
@@ -109,6 +109,21 @@ const Selector = ({save, saveSVG, savePDF, uploadImage}: Props) => {
109109
))}
110110

111111
</Select>
112+
<Slider
113+
label="Width"
114+
step={1}
115+
maxValue={80}
116+
minValue={30}
117+
defaultValue={50}
118+
value={Number(width)}
119+
onChange={e=>{
120+
setWidth(e+'')
121+
}}
122+
classNames={{
123+
base: 'w-[5vw] text-white',
124+
label:'text-[0.7vw]'
125+
}}
126+
/>
112127
<Slider
113128
label="Pad X"
114129
step={1}

lazyweb/pages/snippet.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export async function getServerSideProps(context:any) {
113113
const defaults = {
114114
language: 'javascript',
115115
theme: 'monokai',
116-
code: btoa(`console.log('Hello World')`),
116+
code: btoa(`//print fibonacci\nfunction printFibonacci(n) {\n\tlet fib = [0, 1];\n\tfor (let i = 2; i < n; i++) {\n\t\tfib[i] = fib[i - 1] + fib[i - 2];\n\t}\n\tconsole.log(fib.slice(0, n).join(', '));\n}`),
117117
borderWidth: '1',
118118
borderColor: 'rgba(255,255,255,0.5)',
119119
color: btoa(generateGradient()),

0 commit comments

Comments
 (0)