1
- import React , { useEffect } from ' react'
1
+ import React , { useEffect } from " react" ;
2
2
import {
3
3
useStoryblok ,
4
4
storyblokInit ,
5
5
apiPlugin ,
6
- StoryblokComponent
7
- } from ' @storyblok/react'
8
- import Layout from ' @theme/Layout'
6
+ StoryblokComponent ,
7
+ } from " @storyblok/react" ;
8
+ import Layout from " @theme/Layout" ;
9
9
10
- import Page from ' ../../components/sbComponents/Page'
11
- import { render } from ' storyblok-rich-text-react-renderer'
12
- import useDocusaurusContext from ' @docusaurus/useDocusaurusContext'
13
- import Architecture from ' ../../components/composer/Architecture'
14
- import Feature from ' ../../components/composer/Feature'
15
- import GetStarted from ' ../../components/composer/GetStarted'
16
- import LearnPlatformatic from ' ../../components/composer/Learnplatformatic'
10
+ import Page from " ../../components/sbComponents/Page" ;
11
+ import { render } from " storyblok-rich-text-react-renderer" ;
12
+ import useDocusaurusContext from " @docusaurus/useDocusaurusContext" ;
13
+ import Architecture from " ../../components/composer/Architecture" ;
14
+ import Feature from " ../../components/composer/Feature" ;
15
+ import GetStarted from " ../../components/composer/GetStarted" ;
16
+ import LearnPlatformatic from " ../../components/composer/Learnplatformatic" ;
17
17
18
18
storyblokInit ( {
19
19
accessToken : process . env . STORYBLOK_ACCESS_TOKEN ,
20
20
use : [ apiPlugin ] ,
21
21
components : {
22
- page : Page
22
+ page : Page ,
23
23
} ,
24
24
apiOptions : {
25
- region : 'eu'
26
- }
27
- } )
25
+ region : "eu" ,
26
+ } ,
27
+ } ) ;
28
28
29
- function PageHeader ( { blok } ) {
29
+ function PageHeader ( { blok } ) {
30
30
return (
31
- < header className = ' h-full dark overflow-hidden' >
32
- < div className = ' w-full flex flex-col lg:flex-row items-center overflow-x-hidden' >
33
- < div className = ' relative px-[2%] lg:px-0 lg:pl-[6rem] pt-[4rem]' >
31
+ < header className = " h-full dark overflow-hidden" >
32
+ < div className = " w-full flex flex-col lg:flex-row items-center overflow-x-hidden" >
33
+ < div className = " relative px-[2%] lg:px-0 lg:pl-[6rem] pt-[4rem]" >
34
34
< img
35
35
src = { blok . hero [ 0 ] . gradient_left . filename }
36
- className = ' absolute -z-10 left-0 lg:-top-[50%]'
37
- alt = ' gradient'
36
+ className = " absolute -z-10 left-0 lg:-top-[50%]"
37
+ alt = " gradient"
38
38
/>
39
- < div className = ' w-[90%] lg:w-[42.8rem] flex flex-col z-40' >
40
- < a className = ' mb-[2rem]' href = { blok . hero [ 0 ] . github_link . url } >
41
- < button className = ' h-[2.5rem] bg-[#2192FA] px-5 rounded-[6.25rem] flex items-center justify-center gap-1' >
39
+ < div className = " w-[90%] lg:w-[42.8rem] flex flex-col z-40" >
40
+ < a className = " mb-[2rem]" href = { blok . hero [ 0 ] . github_link . url } >
41
+ < button className = " h-[2.5rem] bg-[#2192FA] px-5 rounded-[6.25rem] flex items-center justify-center gap-1" >
42
42
< img
43
43
src = { blok . hero [ 0 ] . github_logo }
44
- className = ' w-[1rem] h-[1rem]'
45
- alt = ' github'
44
+ className = " w-[1rem] h-[1rem]"
45
+ alt = " github"
46
46
/>
47
- < span className = ' text-[#00050B] text-[0.8rem] uppercase' >
47
+ < span className = " text-[#00050B] text-[0.8rem] uppercase" >
48
48
{ blok . hero [ 0 ] . github_text }
49
49
</ span >
50
50
</ button >
51
51
</ a >
52
- < span className = ' text-white lg:w-auto text-[30px] lg:text-[3.5rem] font-[700] leading-[36.57px] lg:leading-[4.26rem] mb-[2rem]' >
52
+ < span className = " text-white lg:w-auto text-[30px] lg:text-[3.5rem] font-[700] leading-[36.57px] lg:leading-[4.26rem] mb-[2rem]" >
53
53
{ render ( blok . hero [ 0 ] . hero_title ) }
54
54
</ span >
55
- < span className = ' text-[#FFFFFFB2] md:w-[100%] lg:w-auto text-[1rem] lg:text-[1.2rem] font-[400]' >
55
+ < span className = " text-[#FFFFFFB2] md:w-[100%] lg:w-auto text-[1rem] lg:text-[1.2rem] font-[400]" >
56
56
{ render ( blok . hero [ 0 ] . hero_subtitle ) }
57
57
</ span >
58
- < div className = ' flex lg:items-center gap-3 lg:gap-4 mt-[2rem] lg:mt-[3.5rem]' >
58
+ < div className = " flex lg:items-center gap-3 lg:gap-4 mt-[2rem] lg:mt-[3.5rem]" >
59
59
{ blok . hero [ 0 ] . cta_buttons . map ( ( cta ) => (
60
60
< a
61
61
key = { cta . _uid }
62
62
href = { cta . cta_url . url }
63
63
className = { `${
64
- cta . btn_variant == ' filled'
65
- ? ' text-[#00283D]'
66
- : ' hover:text-white'
64
+ cta . btn_variant == " filled"
65
+ ? " text-[#00283D]"
66
+ : " hover:text-white"
67
67
} `}
68
68
>
69
69
< button
70
70
className = { `${
71
- cta . btn_variant == ' filled'
72
- ? ' bg-[#FFFFFF] text-[#00283D]'
73
- : ' border border-[#FFFFFF]'
71
+ cta . btn_variant == " filled"
72
+ ? " bg-[#FFFFFF] text-[#00283D]"
73
+ : " border border-[#FFFFFF]"
74
74
} rounded-[4px] h-[2.5rem] w-[8rem] lg:w-[9.28rem] text-[1rem] font-[600]`}
75
75
>
76
76
{ cta . btn_caption }
@@ -80,95 +80,109 @@ function PageHeader ({ blok }) {
80
80
</ div >
81
81
</ div >
82
82
</ div >
83
- < div className = '' >
84
- < img src = { blok . hero [ 0 ] . hero_image } alt = 'hero_image' />
83
+ < div className = "" >
84
+ < iframe
85
+ width = "560"
86
+ height = "315"
87
+ src = { blok . hero [ 0 ] . hero_embed . url }
88
+ title = "YouTube video player"
89
+ frameBorder = "0"
90
+ allow = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
91
+ allowFullScreen
92
+ > </ iframe >
85
93
</ div >
86
94
</ div >
87
95
</ header >
88
- )
96
+ ) ;
89
97
}
90
98
91
- export default function Composer ( ) {
92
- const { siteConfig } = useDocusaurusContext ( )
93
- let slug = ' composer'
94
- const story = useStoryblok ( slug , { version : ' draft' } )
99
+ export default function Composer ( ) {
100
+ const { siteConfig } = useDocusaurusContext ( ) ;
101
+ let slug = " composer" ;
102
+ const story = useStoryblok ( slug , { version : " draft" } ) ;
95
103
96
104
useEffect ( ( ) => {
97
- const script = document . createElement ( ' script' )
98
- script . src = ' https://js.hsforms.net/forms/v2.js'
99
- document . body . appendChild ( script )
105
+ const script = document . createElement ( " script" ) ;
106
+ script . src = " https://js.hsforms.net/forms/v2.js" ;
107
+ document . body . appendChild ( script ) ;
100
108
101
- script . addEventListener ( ' load' , ( ) => {
109
+ script . addEventListener ( " load" , ( ) => {
102
110
if ( window . hbspt ) {
103
111
window . hbspt . forms . create ( {
104
- portalId : ' 22380288' ,
105
- formId : ' 63b16ade-bdfb-475d-b40e-f017f7278e1a' ,
106
- target : ' #composer' ,
107
- region : ' na1' ,
108
- cssClass : ' light-mode' ,
112
+ portalId : " 22380288" ,
113
+ formId : " 63b16ade-bdfb-475d-b40e-f017f7278e1a" ,
114
+ target : " #composer" ,
115
+ region : " na1" ,
116
+ cssClass : " light-mode" ,
109
117
onFormReady : function ( $form ) {
110
- const iframe = document . querySelector ( ' iframe' )
118
+ const iframe = document . querySelector ( " iframe" ) ;
111
119
if ( iframe ) {
112
- const observer = new MutationObserver ( ( mutationsList , observer ) => {
113
- for ( const mutation of mutationsList ) {
114
- if ( mutation . type === 'childList' && iframe . contentDocument ) {
115
- const doc =
116
- iframe . contentDocument || iframe . contentWindow ?. document
117
- if ( doc ) {
118
- // Set the background color of the iframe's body
119
- doc . body . style . backgroundColor = '#040607'
120
- // doc.body.style.backgroundColor = darkMode
121
- // ? '#00050b'
122
- // : '#FAFAFA'
120
+ const observer = new MutationObserver (
121
+ ( mutationsList , observer ) => {
122
+ for ( const mutation of mutationsList ) {
123
+ if (
124
+ mutation . type === "childList" &&
125
+ iframe . contentDocument
126
+ ) {
127
+ const doc =
128
+ iframe . contentDocument ||
129
+ iframe . contentWindow ?. document ;
130
+ if ( doc ) {
131
+ // Set the background color of the iframe's body
132
+ doc . body . style . backgroundColor = "#040607" ;
133
+ // doc.body.style.backgroundColor = darkMode
134
+ // ? '#00050b'
135
+ // : '#FAFAFA'
123
136
124
- const labels = doc . querySelectorAll ( 'label' )
125
- labels . forEach ( ( label ) => {
126
- // label.style.color = darkMode ? 'white' : '#00050b'
127
- label . style . color = '#ffffff'
128
- } )
129
- observer . disconnect ( ) // Stop observing after labels and background are adjusted
137
+ const labels = doc . querySelectorAll ( "label" ) ;
138
+ labels . forEach ( ( label ) => {
139
+ // label.style.color = darkMode ? 'white' : '#00050b'
140
+ label . style . color = "#ffffff" ;
141
+ } ) ;
142
+ observer . disconnect ( ) ; // Stop observing after labels and background are adjusted
143
+ }
130
144
}
131
145
}
132
146
}
133
- } )
147
+ ) ;
134
148
135
149
observer . observe ( iframe . contentDocument , {
136
150
childList : true ,
137
- subtree : true
138
- } )
151
+ subtree : true ,
152
+ } ) ;
139
153
} else {
140
- console . error ( ' Iframe not found.' )
154
+ console . error ( " Iframe not found." ) ;
141
155
}
142
- }
143
- } )
156
+ } ,
157
+ } ) ;
144
158
} else {
145
- console . error ( ' hbspt not available.' )
159
+ console . error ( " hbspt not available." ) ;
146
160
}
147
- } )
161
+ } ) ;
148
162
149
- script . addEventListener ( ' error' , ( ) => {
150
- console . error ( ' Failed to load the script.' )
151
- } )
152
- } , [ story ] )
163
+ script . addEventListener ( " error" , ( ) => {
164
+ console . error ( " Failed to load the script." ) ;
165
+ } ) ;
166
+ } , [ story ] ) ;
153
167
154
- if ( globalThis . window && globalThis . window . location . pathname !== '/' ) {
155
- slug = globalThis . window . location . pathname . replace ( '/' , '' )
168
+ if ( globalThis . window && globalThis . window . location . pathname !== "/" ) {
169
+ slug = globalThis . window . location . pathname . replace ( "/" , "" ) ;
156
170
}
157
171
if ( ! story || ! story . content ) {
158
- return < div > Loading...</ div >
172
+ return < div > Loading...</ div > ;
159
173
}
160
174
161
175
return (
162
- < Layout title = ' Hello' description = ' Hello React Page' >
176
+ < Layout title = " Hello" description = " Hello React Page" >
163
177
< PageHeader blok = { story . content } />
164
178
< Architecture blok = { story . content } />
165
179
< Feature blok = { story . content } />
166
180
< GetStarted blok = { story . content } />
167
181
< LearnPlatformatic blok = { story . content } />
168
182
< div
169
- className = ' !text-[#00050b] dark:!text-white w-[90%] lg:w-[35%] mx-auto border border-[#FFFFFF26] rounded-[6px] my-4 px-[1rem] py-8'
170
- id = ' composer'
183
+ className = " !text-[#00050b] dark:!text-white w-[90%] lg:w-[35%] mx-auto border border-[#FFFFFF26] rounded-[6px] my-4 px-[1rem] py-8"
184
+ id = " composer"
171
185
/>
172
186
</ Layout >
173
- )
187
+ ) ;
174
188
}
0 commit comments