Add a customisable shadow to canvas boxes
A box can now cast a shadow, independent of its frame: ticking "Shadow" in the box editor gives a hard offset shadow, and Hard/Soft/Glow presets or any typed CSS box-shadow value customise it. The value is stored on Box and Component and carried through duplicates, components and layouts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -31,6 +31,7 @@ type layoutBox struct {
|
||||
H int `json:"h"`
|
||||
Z int `json:"z"`
|
||||
Framed bool `json:"framed"`
|
||||
Shadow string `json:"shadow,omitempty"`
|
||||
HideOnMobile bool `json:"hideOnMobile"`
|
||||
AdminOnly bool `json:"adminOnly"`
|
||||
// ComponentID is the component a linked box was linked to. HTML is
|
||||
@@ -104,7 +105,7 @@ func snapshotPage(db *gorm.DB, page, name string) (layout models.Layout, empty b
|
||||
stored[i] = layoutBox{
|
||||
Kind: b.Kind, Widget: b.Widget, HTML: b.HTML, Title: b.Title,
|
||||
X: b.X, Y: b.Y, W: b.W, H: b.H, Z: b.Z,
|
||||
Framed: b.Framed, HideOnMobile: b.HideOnMobile, AdminOnly: b.AdminOnly,
|
||||
Framed: b.Framed, Shadow: b.Shadow, HideOnMobile: b.HideOnMobile, AdminOnly: b.AdminOnly,
|
||||
ComponentID: b.ComponentID,
|
||||
}
|
||||
}
|
||||
@@ -217,7 +218,7 @@ func applyLayoutTo(tx *gorm.DB, layout *models.Layout, page string, replace bool
|
||||
boxes[i] = models.Box{
|
||||
Page: page, Kind: b.Kind, Widget: b.Widget, HTML: b.HTML, Title: b.Title,
|
||||
X: b.X, Y: b.Y, W: b.W, H: b.H, Z: b.Z + zShift,
|
||||
Framed: b.Framed, HideOnMobile: b.HideOnMobile, AdminOnly: b.AdminOnly,
|
||||
Framed: b.Framed, Shadow: b.Shadow, HideOnMobile: b.HideOnMobile, AdminOnly: b.AdminOnly,
|
||||
}
|
||||
if b.ComponentID != nil && live[*b.ComponentID] {
|
||||
boxes[i].ComponentID = b.ComponentID
|
||||
|
||||
Reference in New Issue
Block a user