diff --git a/hifi-src/src/components/PublicLayout.jsx b/hifi-src/src/components/PublicLayout.jsx
index d227c9c..96d0617 100644
--- a/hifi-src/src/components/PublicLayout.jsx
+++ b/hifi-src/src/components/PublicLayout.jsx
@@ -45,6 +45,7 @@ const DEFAULT_SITE_SETTINGS = {
package_card_layout: 'strip',
package_wheel_hint_interval: 8,
gallery_card_text_x: 0,
+ gallery_card_text_y: 100,
};
// Das Impressum (und die anderen rechtlichen Pflichtseiten) müssen laut § 5 DDG
diff --git a/hifi-src/src/context/SiteSettingsContext.jsx b/hifi-src/src/context/SiteSettingsContext.jsx
index ef5cc82..70f9961 100644
--- a/hifi-src/src/context/SiteSettingsContext.jsx
+++ b/hifi-src/src/context/SiteSettingsContext.jsx
@@ -15,6 +15,7 @@ const SiteSettingsContext = createContext({
hero_image_path: null,
ga_measurement_id: null,
gallery_card_text_x: 0,
+ gallery_card_text_y: 100,
});
export const SiteSettingsProvider = SiteSettingsContext.Provider;
diff --git a/hifi-src/src/pages/admin/settings/WebsiteSettings.jsx b/hifi-src/src/pages/admin/settings/WebsiteSettings.jsx
index c3cc993..351aec6 100644
--- a/hifi-src/src/pages/admin/settings/WebsiteSettings.jsx
+++ b/hifi-src/src/pages/admin/settings/WebsiteSettings.jsx
@@ -33,6 +33,7 @@ const emptyForm = {
package_card_layout: 'strip',
package_wheel_hint_interval: 8,
gallery_card_text_x: 0,
+ gallery_card_text_y: 100,
};
const PACKAGE_CARD_THEMES = [
@@ -59,20 +60,30 @@ export default function WebsiteSettings() {
const galleryPreviewRef = useRef(null);
const [galleryDragging, setGalleryDragging] = useState(false);
- const galleryXFromPointer = (clientX) => {
+ // Beide Achsen aus einer Zeigerposition berechnen und in einem Schritt uebernehmen (statt
+ // zweimal ueber die generische update(field, value)-Hilfsfunktion), damit ein Drag sich wie
+ // eine einzige Bewegung anfuehlt statt wie zwei unabhaengige Werte.
+ const galleryPercentsFromPointer = (clientX, clientY) => {
const rect = galleryPreviewRef.current.getBoundingClientRect();
- const pct = ((clientX - rect.left) / rect.width) * 100;
- return Math.max(0, Math.min(100, Math.round(pct)));
+ return {
+ x: Math.max(0, Math.min(100, Math.round(((clientX - rect.left) / rect.width) * 100))),
+ y: Math.max(0, Math.min(100, Math.round(((clientY - rect.top) / rect.height) * 100))),
+ };
+ };
+ const setGalleryPosition = (clientX, clientY) => {
+ const { x, y } = galleryPercentsFromPointer(clientX, clientY);
+ setForm((f) => ({ ...f, gallery_card_text_x: x, gallery_card_text_y: y }));
+ setSaved(false);
};
const handleGalleryDragStart = (e) => {
e.preventDefault();
e.currentTarget.setPointerCapture(e.pointerId);
setGalleryDragging(true);
- update('gallery_card_text_x', galleryXFromPointer(e.clientX));
+ setGalleryPosition(e.clientX, e.clientY);
};
const handleGalleryDragMove = (e) => {
if (!galleryDragging) return;
- update('gallery_card_text_x', galleryXFromPointer(e.clientX));
+ setGalleryPosition(e.clientX, e.clientY);
};
const handleGalleryDragEnd = (e) => {
setGalleryDragging(false);
@@ -115,6 +126,7 @@ export default function WebsiteSettings() {
package_card_layout: res.package_card_layout || 'strip',
package_wheel_hint_interval: res.package_wheel_hint_interval || 8,
gallery_card_text_x: res.gallery_card_text_x ?? 0,
+ gallery_card_text_y: res.gallery_card_text_y ?? 100,
})
)
.finally(() => setLoading(false));
@@ -450,7 +462,7 @@ export default function WebsiteSettings() {
- Ausrichtung des Marken-/Projekt-Namens auf den Kacheln der Bildergalerie-Übersicht und der
+ Position des Marken-/Projekt-Namens auf den Kacheln der Bildergalerie-Übersicht und der
Marken-Detailseite.
Position:{' '}
- {form.gallery_card_text_x}%
+ {form.gallery_card_text_x}% / {form.gallery_card_text_y}%
Schnellauswahl
+ Schnellauswahl waagerecht
+
+ Schnellauswahl senkrecht
+ Bildergalerie-Kacheln
this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(DN.current||P4(),this.shouldReduceMotion=Xp.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),rn(this.notifyUpdate),rn(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&hN.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:u,duration:d}=n.accelerate,h=new uN({element:this.current,name:e,keyframes:a,times:l,ease:u,duration:Ot(d)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const r=ho.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&oe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in xu){const n=xu[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ve()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(LN.current||A4(),this.shouldReduceMotion=Zp.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),sn(this.notifyUpdate),sn(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&fN.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:u,duration:d}=n.accelerate,h=new dN({element:this.current,name:e,keyframes:a,times:l,ease:u,duration:Ot(d)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const r=po.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&ae.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in xu){const n=xu[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ve()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r 1&&s==this.$to.end(--r);)++s;return s}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:s}=this.frontier[n],i=nqy&&(e.x=1),e.yt*1e3,Zt=t=>t/1e3,Fg=(t,e)=>e?t*(1e3/e):0,IS=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,o3=1e-7,a3=12;function l3(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=IS(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>o3&&++a=pu?1/0:e}function U3(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(Gg(r),pu);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:Zt(s)}}const Ae={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ip(t,e){return t*Math.sqrt(1-e*e)}const W3=12;function K3(t,e,n){let r=n;for(let s=1;sJy&&(e.x=1),e.y-1&&l.updateNodeAt(u,d,h,p,e)||l.updateNextNode(u,d,h,e,f,s)||l.addNode(u,d,h,e,s),s+=u.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==ks)&&(o&&this.protectLocalComposition(e,o),Ij(this.contentDOM,this.children,e),Yi&&lB(this.dom))}localCompositionInfo(e,n){let{from:r,to:s}=e.state.selection;if(!(e.state.selection instanceof Y)||r