Uploads: frame a photo before it goes (crop, zoom, position)
A photo field with a shape (crop: square for people, 16:9 for event photos, covers and hero photos, the photo's own for block images and schedule graphics) opens Frame the photo when a JPEG, PNG or WebP is uploaded: drag or arrow keys to place it, a zoom slider, and a shape menu. The framed part is drawn on a canvas and uploaded in place of the original; Upload as is skips it. Logos, SVGs and GIFs go as they are. No new dependency and nothing stored beside the picture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
034ad95b8a
commit
07be48d770
9 changed files with 298 additions and 10 deletions
|
|
@ -51,7 +51,7 @@ export const blogPosts = {
|
|||
full: true,
|
||||
help: "A sentence or two for the card. Default: the body's first paragraph.",
|
||||
},
|
||||
{ path: "cover_image", label: "Cover image", widget: "image", resolve: mediaUrl, full: true },
|
||||
{ path: "cover_image", label: "Cover image", widget: "image", crop: 16 / 9, resolve: mediaUrl, full: true },
|
||||
{
|
||||
path: "show_contents",
|
||||
label: "Show contents",
|
||||
|
|
@ -71,7 +71,7 @@ export const blogPosts = {
|
|||
note: "For a writer with no People record. People who wrote it go under Authors below; both can be set.",
|
||||
fields: [
|
||||
{ path: "guest_author", label: "Name" },
|
||||
{ path: "guest_photo", label: "Photo", widget: "image", resolve: mediaUrl, full: true },
|
||||
{ path: "guest_photo", label: "Photo", widget: "image", crop: 1, resolve: mediaUrl, full: true },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@ export const events = {
|
|||
path: "photo",
|
||||
label: "Event photo",
|
||||
widget: "image",
|
||||
crop: 16 / 9,
|
||||
resolve: mediaUrl,
|
||||
full: true,
|
||||
help: "16:9, eg. 1920 x 1080, shown whole: at the top of the event's page, as the front page's featured event, on featured cards, in the newsletter and when the page is shared.",
|
||||
|
|
@ -165,6 +166,7 @@ export const events = {
|
|||
path: "card_image",
|
||||
label: "Card background",
|
||||
widget: "image",
|
||||
crop: 1,
|
||||
resolve: mediaUrl,
|
||||
full: true,
|
||||
help: "Only behind the event's card, faded so the text stays readable and cropped to the card's shape (about square). Keep the subject centered and leave words out.",
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ export const frontPage = {
|
|||
title: (row) => row.caption || row.media || "New photo",
|
||||
blank: { media: "", alt: "", caption: "" },
|
||||
fields: [
|
||||
{ path: "media", label: "Photo", required: true, widget: "image", resolve: mediaUrl, full: true },
|
||||
{ path: "media", label: "Photo", required: true, widget: "image", crop: 16 / 9, resolve: mediaUrl, full: true },
|
||||
{ path: "alt", label: "Description", help: "For screen readers" },
|
||||
{ path: "caption", label: "Caption", full: true },
|
||||
{ path: "link_url", label: "Link", help: "Optional; makes the caption a link" },
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export const people = {
|
|||
full: true,
|
||||
help: "One line shown in directories, eg. Vocals, piano · Gospel, folk",
|
||||
},
|
||||
{ path: "photo", label: "Photo", widget: "image", resolve: mediaUrl, full: true },
|
||||
{ path: "photo", label: "Photo", widget: "image", crop: 1, resolve: mediaUrl, full: true },
|
||||
{
|
||||
path: "primary_org_id",
|
||||
label: "Home organization",
|
||||
|
|
|
|||
|
|
@ -188,6 +188,7 @@ export const featuredCardsChild = {
|
|||
path: "image",
|
||||
label: "Image",
|
||||
widget: "image",
|
||||
crop: "free",
|
||||
resolve: mediaUrl,
|
||||
full: true,
|
||||
frameFrom: "url",
|
||||
|
|
@ -403,6 +404,7 @@ export const blocksChild = {
|
|||
path: "media",
|
||||
label: "Image",
|
||||
widget: "image",
|
||||
crop: "free",
|
||||
resolve: mediaUrl,
|
||||
full: true,
|
||||
when: { path: "type", value: ["image", "video"] },
|
||||
|
|
@ -495,6 +497,7 @@ export const blocksChild = {
|
|||
path: "media",
|
||||
label: "Picture",
|
||||
widget: "image",
|
||||
crop: 16 / 9,
|
||||
resolve: mediaUrl,
|
||||
full: true,
|
||||
help: "Optional. Default: none, the card is text only.",
|
||||
|
|
@ -512,6 +515,7 @@ export const blocksChild = {
|
|||
path: "media",
|
||||
label: "Graphic",
|
||||
widget: "image",
|
||||
crop: "free",
|
||||
resolve: mediaUrl,
|
||||
full: true,
|
||||
help: "Optional, in the fold-out: a map of the site, a slide, a poster",
|
||||
|
|
@ -535,6 +539,7 @@ export const blocksChild = {
|
|||
path: "map_image",
|
||||
label: "Map image",
|
||||
widget: "image",
|
||||
crop: "free",
|
||||
resolve: mediaUrl,
|
||||
full: true,
|
||||
help: "Optional: your own map, eg. the camp with the room marked. Shown in the fold-out in place of the Google map (which stays a link), and as a slide when the schedule is presented.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue