Skip to content

Commit e7bb6c0

Browse files
committed
Nachi WIP.
1 parent 44e4295 commit e7bb6c0

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

resources/views/nachi/benefits.blade.php

+31
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
</head>
1919
<body class="font-sans antialiased">
2020

21+
@if(($_COOKIE['password'] ?? '') === 'nachi')
22+
2123
<div x-data="benefitsPresenter()"
2224
class="max-w-md mx-auto bg-white rounded-xl shadow-md overflow-hidden md:max-w-5xl p-6">
2325
<div>
@@ -86,6 +88,35 @@ class="text-slate-500 hover:text-sky-700">Back to all categories
8688
</div>
8789
</div>
8890
</div>
91+
@else
92+
<div class="flex items-center justify-center h-screen gap-4">
93+
Password
94+
<input type="password" x-model="password" id="passwordInput">
95+
</div>
96+
<script>
97+
const passwordInput = document.getElementById('passwordInput');
98+
99+
passwordInput.addEventListener('keyup', function(event) {
100+
if (event.key === 'Enter') {
101+
submitPassword();
102+
}
103+
});
104+
105+
const handleKeyUp = (event) => {
106+
if (event.key === 'Enter') {
107+
submitPassword();
108+
}
109+
}
110+
const submitPassword = () => {
111+
console.log('submitPassword')
112+
const password = passwordInput.value;
113+
document.cookie = "password=" + passwordInput.value + "; path=/";
114+
location.reload();
115+
}
116+
</script>
117+
@endif
118+
119+
89120

90121
<script>
91122
const benefitsList = [

0 commit comments

Comments
 (0)