@@ -19,6 +19,7 @@ import {
1919} from "./components/ui/accordion" ;
2020import MediaSelector from "./media-selector" ;
2121import { Address , Media , Profile } from "@courselit/common-models" ;
22+ import { Lightbulb } from "lucide-react" ;
2223
2324interface SectionBackgroundPanelProps {
2425 value : SectionBackground ;
@@ -60,8 +61,15 @@ const BACKGROUND_REPEAT_OPTIONS: { label: string; value: BackgroundRepeat }[] =
6061export function SectionBackgroundPanel ( {
6162 value = {
6263 type : "color" ,
63- backgroundColor : "transparent " ,
64+ backgroundColor : "#ff0000 " ,
6465 backgroundColorDark : undefined ,
66+ blur : 5 ,
67+ overlay : {
68+ color : "#ff0000" ,
69+ colorDark : undefined ,
70+ opacity : 3 ,
71+ blendMode : "normal" ,
72+ } ,
6573 } ,
6674 onChange,
6775 className,
@@ -107,7 +115,7 @@ export function SectionBackgroundPanel({
107115 < div className = { className } >
108116 < Accordion type = "single" collapsible className = "w-full" >
109117 < AccordionItem value = "background" className = "border-none" >
110- < AccordionTrigger className = "py-2 text-sm font-medium hover:no-underline" >
118+ < AccordionTrigger className = "py-2 font-medium hover:no-underline" >
111119 Background
112120 </ AccordionTrigger >
113121 < AccordionContent className = "space-y-6 pt-2" >
@@ -125,7 +133,7 @@ export function SectionBackgroundPanel({
125133 Image
126134 </ TabsTrigger >
127135 < TabsTrigger value = "gradient" >
128- Gradient
136+ Pattern
129137 </ TabsTrigger >
130138 </ TabsList >
131139
@@ -134,7 +142,7 @@ export function SectionBackgroundPanel({
134142 className = "space-y-4 mt-6"
135143 >
136144 < ColorSelector
137- title = "Background Color"
145+ title = "Color"
138146 value = { value . backgroundColor || "" }
139147 onChange = { ( color ) =>
140148 handleColorBackgroundChange ( {
@@ -152,6 +160,7 @@ export function SectionBackgroundPanel({
152160 } )
153161 }
154162 allowReset = { true }
163+ description = "Optional background color for dark mode"
155164 />
156165 </ TabsContent >
157166
@@ -251,6 +260,7 @@ export function SectionBackgroundPanel({
251260 } )
252261 }
253262 allowReset = { true }
263+ description = "Optional overlay color for dark mode"
254264 />
255265 < PageBuilderSlider
256266 title = "Opacity"
@@ -366,7 +376,15 @@ export function SectionBackgroundPanel({
366376 { /* Mask Image */ }
367377 < div className = "space-y-2" >
368378 < Label htmlFor = "mask-image" >
369- Mask Image (Optional)
379+ Mask Image{ " " }
380+ < a
381+ href = "https://developer.mozilla.org/en-US/docs/Web/CSS/mask-image"
382+ target = "_blank"
383+ rel = "noopener noreferrer"
384+ className = "text-muted-foreground text-xs underline"
385+ >
386+ Learn more
387+ </ a >
370388 </ Label >
371389 < Input
372390 id = "mask-image"
@@ -384,7 +402,7 @@ export function SectionBackgroundPanel({
384402 } ,
385403 )
386404 }
387- placeholder = "https://example.com/mask.svg "
405+ placeholder = "linear-gradient(black, transparent) "
388406 />
389407 </ div >
390408 </ AccordionContent >
@@ -396,10 +414,32 @@ export function SectionBackgroundPanel({
396414 value = "gradient"
397415 className = "space-y-4 mt-6"
398416 >
417+ < div >
418+ < p className = "text-xs text-muted-foreground" >
419+ For advanced users who know CSS.
420+ </ p >
421+ { /* <p className="text-xs text-muted-foreground">
422+ You can find patterns on sites like {" "}
423+ <a
424+ href="https://patterncraft.fun"
425+ target="_blank"
426+ rel="noopener noreferrer"
427+ className="underline"
428+ >
429+ PatternCraft</a> and {" "}
430+ <a
431+ href="https://magicpattern.design/"
432+ target="_blank"
433+ rel="noopener noreferrer"
434+ className="underline"
435+ >
436+ MagicPattern</a>.
437+ </p> */ }
438+ </ div >
399439 { /* Gradient CSS */ }
400440 < div className = "space-y-2" >
401441 < Label htmlFor = "gradient-css" >
402- Gradient CSS
442+ Background Image
403443 </ Label >
404444 < Input
405445 id = "gradient-css"
@@ -412,16 +452,16 @@ export function SectionBackgroundPanel({
412452 }
413453 placeholder = "linear-gradient(45deg, #ff0000, #0000ff)"
414454 />
415- < p className = "text-xs text-muted-foreground" >
455+ { /* <p className="text-xs text-muted-foreground">
416456 Enter CSS gradient syntax (e.g.,
417457 linear-gradient, radial-gradient)
418- </ p >
458+ </p> */ }
419459 </ div >
420460
421461 { /* Dark Mode Gradient */ }
422462 < div className = "space-y-2" >
423463 < Label htmlFor = "gradient-css-dark" >
424- Dark Mode Gradient (Optional)
464+ Dark Mode Background Image
425465 </ Label >
426466 < Input
427467 id = "gradient-css-dark"
@@ -523,8 +563,15 @@ export function SectionBackgroundPanel({
523563 { /* Mask Image */ }
524564 < div className = "space-y-2" >
525565 < Label htmlFor = "gradient-mask-image" >
526- Mask Image CSS
527- (Optional)
566+ Mask Image{ " " }
567+ < a
568+ href = "https://developer.mozilla.org/en-US/docs/Web/CSS/mask-image"
569+ target = "_blank"
570+ rel = "noopener noreferrer"
571+ className = "text-muted-foreground text-xs underline"
572+ >
573+ Learn more
574+ </ a >
528575 </ Label >
529576 < Input
530577 id = "gradient-mask-image"
@@ -543,12 +590,38 @@ export function SectionBackgroundPanel({
543590 } as any ,
544591 )
545592 }
546- placeholder = "clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); "
593+ placeholder = "linear-gradient(black, transparent) "
547594 />
548595 </ div >
549596 </ AccordionContent >
550597 </ AccordionItem >
551598 </ Accordion >
599+
600+ < div className = "flex items-center gap-1" >
601+ < Lightbulb className = "h-8 w-8 text-muted-foreground" />
602+ < p className = "text-xs text-muted-foreground" >
603+ You can find cool patterns on sites
604+ like{ " " }
605+ < a
606+ href = "https://patterncraft.fun"
607+ target = "_blank"
608+ rel = "noopener noreferrer"
609+ className = "underline"
610+ >
611+ PatternCraft
612+ </ a > { " " }
613+ and{ " " }
614+ < a
615+ href = "https://magicpattern.design/"
616+ target = "_blank"
617+ rel = "noopener noreferrer"
618+ className = "underline"
619+ >
620+ MagicPattern
621+ </ a >
622+ .
623+ </ p >
624+ </ div >
552625 </ TabsContent >
553626 </ Tabs >
554627 </ div >
0 commit comments