44@section (' description' , ' Get started with EU Code Week: Run a coding activity, join a local event, or share your experience using #EUCodeWeek. No experience needed!' )
55 @php
66 $list = [(object ) [' label' => ' Get Involved' , ' href' => ' ' ]];
7+
8+ $optionalValue = static function (string $key ): ?string {
9+ $value = __ ($key );
10+
11+ if ($value === $key ) {
12+ return null ;
13+ }
14+
15+ $value = trim ($value );
16+
17+ return $value !== ' ' ? $value : null ;
18+ };
19+
20+ $isTruthy = static function (?string $value ): bool {
21+ if ($value === null ) {
22+ return false ;
23+ }
24+
25+ return in_array (strtolower ($value ), [' 1' , ' true' , ' yes' , ' on' ], true );
26+ };
27+
28+ $makeCardLink = static function (string $cardKey ) use ($optionalValue , $isTruthy ): array {
29+ $href = $optionalValue (" cw2020.get-involved.cards.{$cardKey }.href" );
30+ $newTab = $isTruthy ($optionalValue (" cw2020.get-involved.cards.{$cardKey }.new_tab" ));
31+
32+ return [
33+ ' href' => $href ,
34+ ' target' => $href && $newTab ? ' _blank' : null ,
35+ ' rel' => $href && $newTab ? ' noopener noreferrer' : null ,
36+ ];
37+ };
38+
39+ $engagementLinks = [
40+ ' community' => $makeCardLink (' community' ),
41+ ' activity' => $makeCardLink (' activity' ),
42+ ' ambassadors' => $makeCardLink (' ambassadors' ),
43+ ' stories' => $makeCardLink (' stories' ),
44+ ];
745 @endphp
846
947@section (' layout.breadcrumb' )
@@ -111,7 +149,7 @@ class="text-dark-blue text-[22px] md:text-4xl leading-7 md:leading-[44px] font-m
111149 <!-- First Row of Icons -->
112150 <div class =" grid grid-cols-1 gap-10 items-start mb-12 w-full md:grid-cols-2 max-md:mb-10" >
113151 <!-- Connect with Community -->
114- <article class =" flex flex-col justify-center engagement-card" >
152+ <article class =" group flex flex-col justify-center engagement-card" >
115153 <div class =" engagement-icon flex gap-2.5 items-center p-7 bg-[#FFD700] h-[120px] rounded-[60px] w-[120px] max-md:px-5 mb-2.5"
116154 role =" img" aria-label =" Community connection icon" >
117155 <svg xmlns =" http://www.w3.org/2000/svg" width =" 64" height =" 64"
@@ -123,7 +161,16 @@ class="text-dark-blue text-[22px] md:text-4xl leading-7 md:leading-[44px] font-m
123161 </div >
124162 <div class =" pt-1 w-full text-gray-700" >
125163 <h5 class =" mb-2 text-2xl font-medium leading-7 text-gray-700" >
126- Connect with your local Code Week community
164+ @if ($engagementLinks [' community' ][' href' ] )
165+ <a href =" {{ $engagementLinks [' community' ][' href' ] } }"
166+ @if ($engagementLinks [' community' ][' target' ] ) target =" {{ $engagementLinks [' community' ][' target' ] } }" @endif
167+ @if ($engagementLinks [' community' ][' rel' ] ) rel =" {{ $engagementLinks [' community' ][' rel' ] } }" @endif
168+ class =" transition-colors duration-200 hover:text-[#1C4DA1] hover:underline focus-visible:underline group-hover:text-[#1C4DA1]" >
169+ Connect with your local Code Week community
170+ </a >
171+ @else
172+ Connect with your local Code Week community
173+ @endif
127174 </h5 >
128175 <p class =" text-base leading-6 text-gray-700 !p-0" >
129176 Find educators, mentors and organisers near you through the Code Week map or national hubs. There’s a whole network ready to support and collaborate.
@@ -132,7 +179,7 @@ class="text-dark-blue text-[22px] md:text-4xl leading-7 md:leading-[44px] font-m
132179 </article >
133180
134181 <!-- Register Activities -->
135- <article class =" flex flex-col justify-center engagement-card" >
182+ <article class =" group flex flex-col justify-center engagement-card" >
136183 <div class =" engagement-icon flex gap-2.5 items-center p-7 bg-[#FFD700] h-[120px] rounded-[60px] w-[120px] max-md:px-5 mb-2.5"
137184 role =" img" aria-label =" Activity registration icon" >
138185 <svg xmlns =" http://www.w3.org/2000/svg" width =" 64" height =" 64"
@@ -156,7 +203,16 @@ class="text-dark-blue text-[22px] md:text-4xl leading-7 md:leading-[44px] font-m
156203 </div >
157204 <div class =" pt-1 w-full text-gray-700" >
158205 <h5 class =" mb-2 text-2xl font-medium leading-7 text-gray-700" >
159- Register your Code Week activity
206+ @if ($engagementLinks [' activity' ][' href' ] )
207+ <a href =" {{ $engagementLinks [' activity' ][' href' ] } }"
208+ @if ($engagementLinks [' activity' ][' target' ] ) target =" {{ $engagementLinks [' activity' ][' target' ] } }" @endif
209+ @if ($engagementLinks [' activity' ][' rel' ] ) rel =" {{ $engagementLinks [' activity' ][' rel' ] } }" @endif
210+ class =" transition-colors duration-200 hover:text-[#1C4DA1] hover:underline focus-visible:underline group-hover:text-[#1C4DA1]" >
211+ Register your Code Week activity
212+ </a >
213+ @else
214+ Register your Code Week activity
215+ @endif
160216 </h5 >
161217 <p class =" text-base leading-6 text-gray-700 !p-0" >
162218 Planning something? Add it to the Code Week map so others can see it.
@@ -168,7 +224,7 @@ class="text-dark-blue text-[22px] md:text-4xl leading-7 md:leading-[44px] font-m
168224 <!-- Second Row of Icons -->
169225 <div class =" grid grid-cols-1 gap-10 items-center w-full md:grid-cols-2" >
170226 <!-- Connect with Ambassadors -->
171- <article class =" flex flex-col justify-center engagement-card" >
227+ <article class =" group flex flex-col justify-center engagement-card" >
172228 <div class =" engagement-icon flex gap-2.5 items-center p-7 bg-[#FFD700] h-[120px] rounded-[60px] w-[120px] max-md:px-5 mb-2.5"
173229 role =" img" aria-label =" Ambassador connection icon" >
174230 <svg xmlns =" http://www.w3.org/2000/svg" width =" 64" height =" 64"
@@ -187,7 +243,16 @@ class="text-dark-blue text-[22px] md:text-4xl leading-7 md:leading-[44px] font-m
187243 </div >
188244 <div class =" pt-1 w-full text-gray-700" >
189245 <h5 class =" mb-2 text-2xl font-medium leading-7 text-gray-700" >
190- Connect with EU Code Week Ambassadors
246+ @if ($engagementLinks [' ambassadors' ][' href' ] )
247+ <a href =" {{ $engagementLinks [' ambassadors' ][' href' ] } }"
248+ @if ($engagementLinks [' ambassadors' ][' target' ] ) target =" {{ $engagementLinks [' ambassadors' ][' target' ] } }" @endif
249+ @if ($engagementLinks [' ambassadors' ][' rel' ] ) rel =" {{ $engagementLinks [' ambassadors' ][' rel' ] } }" @endif
250+ class =" transition-colors duration-200 hover:text-[#1C4DA1] hover:underline focus-visible:underline group-hover:text-[#1C4DA1]" >
251+ Connect with EU Code Week Ambassadors
252+ </a >
253+ @else
254+ Connect with EU Code Week Ambassadors
255+ @endif
191256 </h5 >
192257 <p class =" text-base leading-6 text-gray-700 !p-0" >
193258 Ambassadors help coordinate Code Week in their countries. Reach out for support, advice or to join local projects and challenges.
@@ -196,7 +261,7 @@ class="text-dark-blue text-[22px] md:text-4xl leading-7 md:leading-[44px] font-m
196261 </article >
197262
198263 <!-- Share Stories -->
199- <article class =" flex flex-col justify-center engagement-card" >
264+ <article class =" group flex flex-col justify-center engagement-card" >
200265 <div class =" engagement-icon flex gap-2.5 items-center p-7 bg-[#FFD700] h-[120px] rounded-[60px] w-[120px] max-md:px-5 mb-2.5"
201266 role =" img" aria-label =" Story sharing icon" >
202267 <svg xmlns =" http://www.w3.org/2000/svg" width =" 64" height =" 64"
@@ -217,7 +282,16 @@ class="text-dark-blue text-[22px] md:text-4xl leading-7 md:leading-[44px] font-m
217282 </div >
218283 <div class =" pt-1 w-full text-gray-700" >
219284 <h5 class =" mb-2 text-2xl font-medium leading-7 text-gray-700" >
220- Share your coding experience and stories
285+ @if ($engagementLinks [' stories' ][' href' ] )
286+ <a href =" {{ $engagementLinks [' stories' ][' href' ] } }"
287+ @if ($engagementLinks [' stories' ][' target' ] ) target =" {{ $engagementLinks [' stories' ][' target' ] } }" @endif
288+ @if ($engagementLinks [' stories' ][' rel' ] ) rel =" {{ $engagementLinks [' stories' ][' rel' ] } }" @endif
289+ class =" transition-colors duration-200 hover:text-[#1C4DA1] hover:underline focus-visible:underline group-hover:text-[#1C4DA1]" >
290+ Share your coding experience and stories
291+ </a >
292+ @else
293+ Share your coding experience and stories
294+ @endif
221295 </h5 >
222296 <p class =" text-base leading-6 text-gray-700 !p-0" >
223297 Post photos, videos and stories using <strong >#EUCodeWeek</strong >. Highlight what you’ve learned, celebrate your community, and inspire others to join
0 commit comments