diff --git a/Resources/Private/Fusion/Presentation/Atom/Hotspot.fusion b/Resources/Private/Fusion/Presentation/Atom/Hotspot.fusion index bb5df73..ff034c0 100644 --- a/Resources/Private/Fusion/Presentation/Atom/Hotspot.fusion +++ b/Resources/Private/Fusion/Presentation/Atom/Hotspot.fusion @@ -5,7 +5,7 @@ prototype(FormatD.HotspotEditor:Atom.Hotspot) < prototype(Neos.Fusion:Component) description = 'This is a hotspot item' props { hoverTitle = 'Hover title' - content = ' + content = ' ' @@ -31,7 +31,7 @@ prototype(FormatD.HotspotEditor:Atom.Hotspot) < prototype(Neos.Fusion:Component) yPosition = '50' uri = '' identifier = null - content = ' + content = ' ' @@ -40,18 +40,31 @@ prototype(FormatD.HotspotEditor:Atom.Hotspot) < prototype(Neos.Fusion:Component) inBackend = ${documentNode.context.inBackend} renderer = afx` -
- +
-
- {props.content} -
-
{props.hoverTitle}
- -
+ {props.content} +
+
+ {props.hoverTitle} +
+ ` diff --git a/Resources/Private/Fusion/Presentation/Atom/Hotspot.scss b/Resources/Private/Fusion/Presentation/Atom/Hotspot.scss index fbf2c70..a556696 100644 --- a/Resources/Private/Fusion/Presentation/Atom/Hotspot.scss +++ b/Resources/Private/Fusion/Presentation/Atom/Hotspot.scss @@ -1,25 +1,58 @@ +* { + --hotspot-backend-notice-width: 11rem; + --hotspot-backend-notice-top-position: 3rem; + --hotspot-backend-notice-left-position: 0; + --hotspot-backend-notice-bg-color: #000000; + --hotspot-backend-notice-text-color: #ffffff; + + --hotspot-height: 3.125rem; + --hotspot-hover-title-color: #ffffff; + --hotspot-hover-title-transition: all 0.3s ease-in-out; +} + .hotspot { - @apply absolute; + position: absolute; + z-index: 20; + display: flex; + align-items: center; + justify-content: center; + height: var(--hotspot-height); &:hover { .hotspot--hover-title { - @apply opacity-100 w-auto ml-20; + opacity: 1; + width: auto; + margin-left: 1rem; } } +} +a.hotspot { + cursor: pointer; - .hotspot-link { - @apply flex items-center; - } - - .hotspot--hover-title { - @apply opacity-0 w-0 overflow-hidden; - transition: all 0.3s ease-in-out; - } - + &:hover { + text-decoration: none; + } } +.hotspot--hover-title { + opacity: 0; + width: 0; + overflow: hidden; + color: var(--hotspot-hover-title-color); + transition: var(--hotspot-hover-title-transition); +} .hotspot--backend-notice { - @apply text-xs bg-black text-white p-5 rounded-20 mt-10; - width: 145px; + position: absolute; + z-index: 2; + top: var(--hotspot-backend-notice-top-position); + left: var(--hotspot-backend-notice-left-position); + width: var(--hotspot-backend-notice-width); + padding: 0.75rem; + margin-top: 0.75rem; + font-size: 0.75rem; + line-height: 1rem; + color: var(--hotspot-backend-notice-text-color); + background-color: var(--hotspot-backend-notice-bg-color); + border-radius: 1rem; } diff --git a/Resources/Private/Fusion/Presentation/Molecule/ContentWithHotspots.fusion b/Resources/Private/Fusion/Presentation/Molecule/ContentWithHotspots.fusion index c73f3b8..e8fbac2 100644 --- a/Resources/Private/Fusion/Presentation/Molecule/ContentWithHotspots.fusion +++ b/Resources/Private/Fusion/Presentation/Molecule/ContentWithHotspots.fusion @@ -21,9 +21,13 @@ prototype(FormatD.HotspotEditor:Molecule.ContentWithHotspots) < prototype(Neos.F hotspots = '' renderer = afx` -
+
{props.content} -
+
{props.hotspots}
diff --git a/Resources/Private/Fusion/Presentation/Molecule/ContentWithHotspots.scss b/Resources/Private/Fusion/Presentation/Molecule/ContentWithHotspots.scss index a40fae7..093eb47 100644 --- a/Resources/Private/Fusion/Presentation/Molecule/ContentWithHotspots.scss +++ b/Resources/Private/Fusion/Presentation/Molecule/ContentWithHotspots.scss @@ -1,7 +1,9 @@ -.hotspots-area { - @apply relative; - .hotspots-container { - @apply absolute inset-0; - } +.content-with-hotspots { + position: relative; +} + +.content-with-hotspots--container { + position: absolute; + inset: 0; } diff --git a/Resources/Private/Scripts/HotspotEditorFrontend/Hotspots.ts b/Resources/Private/Scripts/HotspotEditorFrontend/Hotspots.ts index 7fcc7d5..cb43bec 100644 --- a/Resources/Private/Scripts/HotspotEditorFrontend/Hotspots.ts +++ b/Resources/Private/Scripts/HotspotEditorFrontend/Hotspots.ts @@ -80,7 +80,7 @@ export default class Hotspots { mouseEvent.preventDefault(); const containerElement = mouseEvent.composedPath().find((element: HTMLElement) => { - return element.className === 'hotspots-container'; + return element.className === 'content-with-hotspots--container'; }); this._dispatchHotspotDraggedEvent({