18
18
</head >
19
19
<body class =" font-sans antialiased" >
20
20
21
+ @if (($_COOKIE [' password' ] ?? ' ' ) === ' nachi' )
22
+
21
23
<div x-data =" benefitsPresenter()"
22
24
class =" max-w-md mx-auto bg-white rounded-xl shadow-md overflow-hidden md:max-w-5xl p-6" >
23
25
<div >
@@ -68,15 +70,37 @@ class="text-slate-500 hover:text-sky-700">Back to all categories
68
70
:key =" index" >
69
71
<div >
70
72
73
+ <template x-if =" benefit.media_type == 'Document'" >
74
+ <div class =" flex flex-row rounded shadow p-3 gap-4" >
75
+ <div >
76
+ <div class =" rounded-full bg-indigo-300 size-8 flex flex-row justify-center items-center" >
77
+ <div class =" fa fa-newspaper text-white" ></div >
78
+ </div >
79
+ </div >
80
+ <div class =" border-l-slate-200 border-l-2 pl-5" >
81
+ <a :href =" benefit.url" x-text =" benefit.title" class =" text-slate-700 text-lg" ></a >
82
+ </div >
83
+ </div >
84
+ </template >
85
+
71
86
<template x-if =" benefit.media_type == 'Video'" >
72
- <a :href =" benefit.url" x-text =" benefit.title" class =" text-yellow-300 text-lg" ></a >
87
+ <div class =" flex flex-row rounded shadow p-3 gap-4" >
88
+ <div >
89
+ <div class =" rounded-full bg-red-500 size-8 flex flex-row justify-center items-center" >
90
+ <div class =" fa fa-play text-white" ></div >
91
+ </div >
92
+ </div >
93
+ <div class =" border-l-slate-200 border-l-2 pl-5" >
94
+ <a :href =" benefit.url" x-text =" benefit.title" class =" text-slate-700 text-lg" ></a >
95
+ </div >
96
+ </div >
73
97
</template >
74
98
75
99
<template x-if =" benefit.media_type == 'Tagline'" >
76
100
<div x-text =" benefit.title" class =" text-lg" ></div >
77
101
</template >
78
102
79
- <template x-if =" benefit.media_type != 'Tagline' && benefit.media_type != 'Video'" >
103
+ <template x-if =" benefit.media_type != 'Tagline' && benefit.media_type != 'Video' && benefit.media_type != 'Document' " >
80
104
<a :href =" benefit.url" x-text =" benefit.title" class =" text-blue-700 text-lg hover:underline" target =" _blank" ></a >
81
105
</template >
82
106
</div >
@@ -86,6 +110,35 @@ class="text-slate-500 hover:text-sky-700">Back to all categories
86
110
</div >
87
111
</div >
88
112
</div >
113
+ @else
114
+ <div class =" flex items-center justify-center h-screen gap-4" >
115
+ Password
116
+ <input type =" password" x-model =" password" id =" passwordInput" >
117
+ </div >
118
+ <script >
119
+ const passwordInput = document .getElementById (' passwordInput' );
120
+
121
+ passwordInput .addEventListener (' keyup' , function (event ) {
122
+ if (event .key === ' Enter' ) {
123
+ submitPassword ();
124
+ }
125
+ });
126
+
127
+ const handleKeyUp = (event ) => {
128
+ if (event .key === ' Enter' ) {
129
+ submitPassword ();
130
+ }
131
+ }
132
+ const submitPassword = () => {
133
+ console .log (' submitPassword' )
134
+ const password = passwordInput .value ;
135
+ document .cookie = " password=" + passwordInput .value + " ; path=/" ;
136
+ location .reload ();
137
+ }
138
+ </script >
139
+ @endif
140
+
141
+
89
142
90
143
<script >
91
144
const benefitsList = [
@@ -99,6 +152,16 @@ class="text-slate-500 hover:text-sky-700">Back to all categories
99
152
" featured" : false ,
100
153
" media_type" : " Document"
101
154
},
155
+ {
156
+ " title" : " Video Test" ,
157
+ " description" : " Download our comprehensive Membership Guide." ,
158
+ " category" : " About InterNACHI®" ,
159
+ " subcategory" : " " ,
160
+ " url" : " https://www.nachi.org/guide" ,
161
+ " free" : true ,
162
+ " featured" : false ,
163
+ " media_type" : " Video"
164
+ },
102
165
{
103
166
" title" : " Meet our staff" ,
104
167
" description" : " Get to know the InterNACHI® team." ,
0 commit comments