Iframe Popup
To create an iframe popup element use the iframe
factory method:
use NormanHuth\NovaMenu\MenuSection; use NormanHuth\NovaMenu\MenuGroup; use NormanHuth\NovaMenu\MenuItem; Nova::mainMenu(function (Request $request) { return [ //.. MenuSection::iframe('Norman Huth', 'https://huth.it'), MenuGroup::iframe('Norman Huth', 'https://huth.it'), MenuItem::iframe('Norman Huth', 'https://huth.it'), // .. ];});
Customize
Iframe Element
Default attributes:
{ "classes": [], "styles": { "position": "fixed", "width": "100vw", "height": "100vh", "padding": "50px", "box-sizing": "border-box", "background-color": "rgba(0, 0, 0, 0.9)", "z-index": "200000", "left": "0", "top": "0", "border-radius": "5px" }}
Add Classes To Iframe Element
You can add classes to the iframe class attribute by invoking the addIframeClasses
method when defining the element:
use NormanHuth\NovaMenu\MenuSection; use NormanHuth\NovaMenu\MenuGroup; use NormanHuth\NovaMenu\MenuItem; Nova::mainMenu(function (Request $request) { return [ //.. MenuItem::iframe('Norman Huth', 'https://huth.it') ->addIframeClasses(['iframe-popup', 'opacity-90']), // .. ];});
Add Styles To Iframe Element
You can add styles to the iframe class attribute by invoking the addIframeStyles
method when defining the element:
use NormanHuth\NovaMenu\MenuSection; use NormanHuth\NovaMenu\MenuGroup; use NormanHuth\NovaMenu\MenuItem; Nova::mainMenu(function (Request $request) { return [ //.. MenuItem::iframe('Norman Huth', 'https://huth.it') ->addIframeStyles([ 'padding' => '100px' ]), // .. ];});
Set Iframe Styles
You can remove the styles add new styles to the iframe style attribute by invoking the setIframeStyles
method when defining the
element:
use NormanHuth\NovaMenu\MenuSection; use NormanHuth\NovaMenu\MenuGroup; use NormanHuth\NovaMenu\MenuItem; Nova::mainMenu(function (Request $request) { return [ //.. MenuItem::iframe('Norman Huth', 'https://huth.it') ->setIframeStyles([ 'border' => '5px solid red' ]), // .. ];});
Iframe Wrapper Element
Default attributes:
{ "classes": [], "styles": { "background-color": "white", "width": "100%", "height": "100%" }}
Add Classes To Iframe Wrapper Element
You can add classes to the iframe wrapper class attribute by invoking the addIframeClasses
method when defining the element:
use NormanHuth\NovaMenu\MenuSection; use NormanHuth\NovaMenu\MenuGroup; use NormanHuth\NovaMenu\MenuItem; Nova::mainMenu(function (Request $request) { return [ //.. MenuItem::iframe('Norman Huth', 'https://huth.it') ->addIframeClasses(['iframe-popup-wrapper', 'cursor-zoom-out']), // .. ];});
Add Styles To Iframe Wrapper Element
You can add styles to the iframe wrapper class attribute by invoking the addIframeStyles
method when defining the element:
use NormanHuth\NovaMenu\MenuSection; use NormanHuth\NovaMenu\MenuGroup; use NormanHuth\NovaMenu\MenuItem; Nova::mainMenu(function (Request $request) { return [ //.. MenuItem::iframe('Norman Huth', 'https://huth.it') ->addIframeStyles([ 'border' => '5px solid red' ]), // .. ];});
Set Iframe Wrapper Element Styles
You can remove the styles add new styles to the iframe wrapper style attribute by invoking the setIframeWrapperStyles
method when defining the
element:
use NormanHuth\NovaMenu\MenuSection; use NormanHuth\NovaMenu\MenuGroup; use NormanHuth\NovaMenu\MenuItem; Nova::mainMenu(function (Request $request) { return [ //.. MenuItem::iframe('Norman Huth', 'https://huth.it') ->setIframeWrapperStyles([ 'border' => '5px solid red' ]), // .. ];});