1+ {{- $src := .Get "src" -}}
2+ {{- $title := .Get "title" | default "Embedded Content" -}}
3+ {{- $aspectRatio := .Get "aspectRatio" | default "16/9" -}}
4+ {{- $mobileBreakpoint := .Get "mobileBreakpoint" | default "700px" -}}
5+ {{- $uniqueId := printf "iframe%d" now.UnixNano -}}
6+
7+ < style >
8+ .iframe-fullscreen-wrapper {
9+ position : relative;
10+ width : 100% ;
11+ height : calc (100vh - 150px );
12+ min-height : {{ $mobileBreakpoint }};
13+ aspect- ratio: {{ $aspectRatio }};
14+ }
15+ .iframe-fullscreen-wrapper : fullscreen {
16+ aspect-ratio : auto;
17+ max-height : none;
18+ }
19+ .iframe-fullscreen-wrapper : fullscreen iframe {
20+ width : 100vw ;
21+ height : 100vh ;
22+ }
23+ .iframe-fullscreen-wrapper : fullscreen button {
24+ display : none;
25+ }
26+ .iframe-fullscreen-wrapper button {
27+ position : absolute;
28+ top : 10px ;
29+ left : 50% ;
30+ transform : translateX (-50% );
31+ z-index : 1000 ;
32+ background : rgba (0 , 0 , 0 , 0.7 );
33+ color : white;
34+ border : none;
35+ padding : 8px 16px ;
36+ border-radius : 4px ;
37+ cursor : pointer;
38+ font-size : 14px ;
39+ transition : background 0.2s ;
40+ }
41+ .iframe-fullscreen-wrapper button : hover {
42+ background : rgba (0 , 0 , 0 , 0.9 );
43+ }
44+ .iframe-fullscreen-wrapper iframe {
45+ width : 100% ;
46+ height : 100% ;
47+ border : none;
48+ }
49+ .iframe-mobile-msg {
50+ display : none;
51+ text-align : center;
52+ padding : 3rem 2rem ;
53+ background : # f8f9fa ;
54+ border-radius : 8px ;
55+ margin : 2rem 0 ;
56+ }
57+ .iframe-mobile-msg h3 {
58+ margin-top : 0 ;
59+ color : # 333 ;
60+ }
61+ .iframe-mobile-msg p {
62+ color : # 666 ;
63+ line-height : 1.6 ;
64+ margin : 1rem 0 ;
65+ }
66+ @media (max-width: {{ $mobileBreakpoint }}) {
67+ .iframe-fullscreen-wrapper {
68+ display : none;
69+ }
70+ .iframe-mobile-msg {
71+ display : block;
72+ }
73+ }
74+ </ style >
75+
76+ < script >
77+ function toggleFullscreen ( wrapperId ) {
78+ var wrapper = document . getElementById ( wrapperId ) ;
79+ if ( document . fullscreenElement ) {
80+ document . exitFullscreen ( ) ;
81+ } else {
82+ wrapper . requestFullscreen ( ) . catch ( function ( e ) {
83+ console . error ( 'Error attempting to enable fullscreen:' , e ) ;
84+ } ) ;
85+ }
86+ }
87+ </ script >
88+
89+ < div id ="{{ $uniqueId }} " class ="iframe-fullscreen-wrapper ">
90+ < button onclick ="toggleFullscreen('{{ $uniqueId }}') "> ⛶ Fullscreen</ button >
91+ < iframe src ="{{ $src }} " title ="{{ $title }} " allow ="fullscreen " sandbox ="allow-scripts allow-same-origin allow-forms allow-popups allow-presentation "> </ iframe >
92+ </ div >
93+
94+ < div class ="iframe-mobile-msg ">
95+ < h3 > 💻 Desktop Experience Recommended</ h3 >
96+ < p > For the best experience working with integrations, we recommend using Kaoto on a desktop or laptop device.</ p >
97+ < p > Mobile screens are too small to effectively visualize and manage complex integration flows.</ p >
98+ </ div >
0 commit comments