@adminide-stack/clock-tik-browser 12.0.22-alpha.1 → 12.0.22-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/lib/components/navbar/index.d.ts.map +1 -1
  2. package/lib/components/navbar/index.js +4 -0
  3. package/lib/components/navbar/index.js.map +1 -1
  4. package/lib/compute.d.ts.map +1 -1
  5. package/lib/compute.js +9 -0
  6. package/lib/compute.js.map +1 -1
  7. package/lib/pages/Contact-us/index.js +1 -1
  8. package/lib/pages/Contact-us/index.js.map +1 -1
  9. package/lib/pages/Feedback/index.js +1 -1
  10. package/lib/pages/Feedback/index.js.map +1 -1
  11. package/lib/pages/LandingPage/components/BooksFeatureSection.d.ts +4 -0
  12. package/lib/pages/LandingPage/components/BooksFeatureSection.d.ts.map +1 -0
  13. package/lib/pages/LandingPage/components/BooksFeatureSection.js +318 -0
  14. package/lib/pages/LandingPage/components/BooksFeatureSection.js.map +1 -0
  15. package/lib/pages/LandingPage/components/HRMFeatureSection.d.ts +4 -0
  16. package/lib/pages/LandingPage/components/HRMFeatureSection.d.ts.map +1 -0
  17. package/lib/pages/LandingPage/components/HRMFeatureSection.js +231 -0
  18. package/lib/pages/LandingPage/components/HRMFeatureSection.js.map +1 -0
  19. package/lib/pages/LandingPage/components/HeroFluidCanvas.d.ts +8 -0
  20. package/lib/pages/LandingPage/components/HeroFluidCanvas.d.ts.map +1 -0
  21. package/lib/pages/LandingPage/components/HeroFluidCanvas.js +438 -0
  22. package/lib/pages/LandingPage/components/HeroFluidCanvas.js.map +1 -0
  23. package/lib/pages/LandingPage/components/InfrastructureCard.d.ts.map +1 -1
  24. package/lib/pages/LandingPage/components/InfrastructureCard.js +11 -11
  25. package/lib/pages/LandingPage/components/InfrastructureCard.js.map +1 -1
  26. package/lib/pages/LandingPage/components/InfrastructureTabs.js +13 -13
  27. package/lib/pages/LandingPage/components/InfrastructureTabs.js.map +1 -1
  28. package/lib/pages/LandingPage/components/InvestigationCard.d.ts.map +1 -1
  29. package/lib/pages/LandingPage/components/InvestigationCard.js +15 -15
  30. package/lib/pages/LandingPage/components/InvestigationCard.js.map +1 -1
  31. package/lib/pages/LandingPage/components/TimerBarSection.d.ts +5 -0
  32. package/lib/pages/LandingPage/components/TimerBarSection.d.ts.map +1 -0
  33. package/lib/pages/LandingPage/components/TimerBarSection.js +302 -0
  34. package/lib/pages/LandingPage/components/TimerBarSection.js.map +1 -0
  35. package/lib/pages/LandingPage/components/WorkflowFeatureSection.d.ts +5 -0
  36. package/lib/pages/LandingPage/components/WorkflowFeatureSection.d.ts.map +1 -0
  37. package/lib/pages/LandingPage/components/WorkflowFeatureSection.js +154 -0
  38. package/lib/pages/LandingPage/components/WorkflowFeatureSection.js.map +1 -0
  39. package/lib/pages/LandingPage/components/WorkflowGridCanvas.d.ts +8 -0
  40. package/lib/pages/LandingPage/components/WorkflowGridCanvas.d.ts.map +1 -0
  41. package/lib/pages/LandingPage/components/WorkflowGridCanvas.js +207 -0
  42. package/lib/pages/LandingPage/components/WorkflowGridCanvas.js.map +1 -0
  43. package/lib/pages/LandingPage/components/WorkflowSpecimen.d.ts +10 -0
  44. package/lib/pages/LandingPage/components/WorkflowSpecimen.d.ts.map +1 -0
  45. package/lib/pages/LandingPage/components/WorkflowSpecimen.js +532 -0
  46. package/lib/pages/LandingPage/components/WorkflowSpecimen.js.map +1 -0
  47. package/lib/pages/LandingPage/components/index.d.ts +7 -0
  48. package/lib/pages/LandingPage/components/index.d.ts.map +1 -1
  49. package/lib/pages/LandingPage/index.d.ts.map +1 -1
  50. package/lib/pages/LandingPage/index.js +31 -17
  51. package/lib/pages/LandingPage/index.js.map +1 -1
  52. package/lib/pages/Pricing/index.d.ts +4 -0
  53. package/lib/pages/Pricing/index.d.ts.map +1 -0
  54. package/lib/pages/Pricing/index.js +434 -0
  55. package/lib/pages/Pricing/index.js.map +1 -0
  56. package/lib/pages/Privacy/index.d.ts.map +1 -1
  57. package/lib/pages/Privacy/index.js +846 -1902
  58. package/lib/pages/Privacy/index.js.map +1 -1
  59. package/lib/routes.json +11 -0
  60. package/lib/templates/content/blog/2026-02-15-modern-hr-management-small-business-guide.md +112 -0
  61. package/lib/templates/content/blog/2026-02-18-employee-onboarding-checklist-2026.md +164 -0
  62. package/lib/templates/content/blog/2026-02-19-leave-management-best-practices.md +143 -0
  63. package/lib/templates/content/blog/2026-02-20-travel-expense-management-growing-teams.md +143 -0
  64. package/lib/templates/content/blog/2026-02-21-purchase-order-management-guide.md +155 -0
  65. package/lib/templates/content/blog/2026-02-22-expense-tracking-small-business.md +155 -0
  66. package/lib/templates/content/blog/2026-02-23-vendor-management-best-practices.md +157 -0
  67. package/lib/templates/content/blog/2026-02-24-sales-quotes-orders-closing-deals-faster.md +198 -0
  68. package/lib/templates/content/blog/authors.yml +6 -0
  69. package/lib/templates/content/content-manifest.json +961 -0
  70. package/lib/templates/content/docs/books/books-overview.md +93 -0
  71. package/lib/templates/content/docs/books/dashboard.md +133 -0
  72. package/lib/templates/content/docs/books/expenses.md +151 -0
  73. package/lib/templates/content/docs/books/notes.md +102 -0
  74. package/lib/templates/content/docs/books/purchase-orders.md +142 -0
  75. package/lib/templates/content/docs/books/quotes.md +152 -0
  76. package/lib/templates/content/docs/books/sales-orders.md +142 -0
  77. package/lib/templates/content/docs/books/vendor-credits.md +135 -0
  78. package/lib/templates/content/docs/books/vendors.md +142 -0
  79. package/lib/templates/content/docs/hrm/dashboard.md +49 -48
  80. package/lib/templates/content/docs/hrm/hr-letters.md +9 -9
  81. package/lib/templates/content/docs/hrm/hrm-overview.md +11 -11
  82. package/lib/templates/content/docs/hrm/leave.md +3 -3
  83. package/lib/templates/content/docs/hrm/members.md +5 -4
  84. package/lib/templates/content/docs/hrm/my-space.md +64 -64
  85. package/lib/templates/content/docs/hrm/offboarding.md +4 -4
  86. package/lib/templates/content/docs/hrm/onboarding.md +23 -23
  87. package/lib/templates/content/docs/hrm/settings.md +12 -12
  88. package/lib/templates/content/docs/hrm/travel.md +19 -17
  89. package/lib/templates/content/docs/timer/timetracking.md +1 -1
  90. package/lib/templates/static/img/books/books-sidebar-expanded.png +0 -0
  91. package/lib/templates/static/img/books/dashboard-overview.png +0 -0
  92. package/lib/templates/static/img/books/expense-form.png +0 -0
  93. package/lib/templates/static/img/books/expenses-list.png +0 -0
  94. package/lib/templates/static/img/books/notes-page.png +0 -0
  95. package/lib/templates/static/img/books/purchase-order-form.png +0 -0
  96. package/lib/templates/static/img/books/purchase-orders-list.png +0 -0
  97. package/lib/templates/static/img/books/quote-form.png +0 -0
  98. package/lib/templates/static/img/books/quotes-list.png +0 -0
  99. package/lib/templates/static/img/books/sales-order-form.png +0 -0
  100. package/lib/templates/static/img/books/sales-orders-list.png +0 -0
  101. package/lib/templates/static/img/books/vendor-credit-form.png +0 -0
  102. package/lib/templates/static/img/books/vendor-credits-list.png +0 -0
  103. package/lib/templates/static/img/books/vendor-form.png +0 -0
  104. package/lib/templates/static/img/books/vendors-list.png +0 -0
  105. package/package.json +3 -3
@@ -0,0 +1,231 @@
1
+ import {jsx,jsxs}from'react/jsx-runtime';import {Link}from'@remix-run/react';import {UserPlus,Users,CalendarDays,Clock,FileText,Plane,Shield,BarChart3,CheckCircle2,ArrowRight}from'lucide-react';const FeatureItem = ({
2
+ icon,
3
+ title,
4
+ description,
5
+ color
6
+ }) => {
7
+ return jsxs("div", {
8
+ className: "group flex gap-4 rounded-xl p-4 transition-all duration-300 hover:bg-foreground/5",
9
+ children: [jsx("div", {
10
+ className: "flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg transition-transform duration-300 group-hover:scale-110",
11
+ style: {
12
+ backgroundColor: color
13
+ },
14
+ children: icon
15
+ }), jsxs("div", {
16
+ children: [jsx("h4", {
17
+ className: "text-sm font-semibold text-foreground",
18
+ children: title
19
+ }), jsx("p", {
20
+ className: "mt-1 text-sm leading-relaxed text-muted-foreground",
21
+ children: description
22
+ })]
23
+ })]
24
+ });
25
+ };
26
+ function StatBadge({
27
+ value,
28
+ label
29
+ }) {
30
+ return jsxs("div", {
31
+ className: "text-center",
32
+ children: [jsx("p", {
33
+ className: "text-2xl font-bold text-foreground sm:text-3xl",
34
+ children: value
35
+ }), jsx("p", {
36
+ className: "mt-1 text-xs font-medium text-muted-foreground",
37
+ children: label
38
+ })]
39
+ });
40
+ }
41
+ function HRMFeatureSection({
42
+ reducedMotion
43
+ }) {
44
+ const features = [{
45
+ icon: jsx(UserPlus, {
46
+ className: "h-5 w-5 text-white"
47
+ }),
48
+ title: 'Hiring & Onboarding',
49
+ description: 'Create personalized onboarding workflows for candidates and employees. Track every task from document collection to system access setup.',
50
+ color: '#8B5CF6'
51
+ }, {
52
+ icon: jsx(Users, {
53
+ className: "h-5 w-5 text-white"
54
+ }),
55
+ title: 'Employee Management',
56
+ description: 'Centralized employee database with self-service My Space portal. Employees manage their own profiles, check-ins, and requests.',
57
+ color: '#3B82F6'
58
+ }, {
59
+ icon: jsx(CalendarDays, {
60
+ className: "h-5 w-5 text-white"
61
+ }),
62
+ title: 'Leave Management',
63
+ description: 'Visual timeline of team availability. Self-service leave requests with automated approval routing and real-time balance tracking.',
64
+ color: '#10B981'
65
+ }, {
66
+ icon: jsx(Clock, {
67
+ className: "h-5 w-5 text-white"
68
+ }),
69
+ title: 'Time & Attendance',
70
+ description: 'Integrated check-in/check-out with the time tracker. Shift scheduling, attendance logs, and overtime tracking in one place.',
71
+ color: '#F59E0B'
72
+ }, {
73
+ icon: jsx(FileText, {
74
+ className: "h-5 w-5 text-white"
75
+ }),
76
+ title: 'HR Letters & Documents',
77
+ description: 'Generate address proofs, employment verifications, and salary certificates automatically. One-click approvals eliminate paperwork.',
78
+ color: '#EF4444'
79
+ }, {
80
+ icon: jsx(Plane, {
81
+ className: "h-5 w-5 text-white"
82
+ }),
83
+ title: 'Travel & Expense',
84
+ description: 'End-to-end travel request management with pre-approval workflows. Submit expenses with receipt uploads and link to travel requests.',
85
+ color: '#06B6D4'
86
+ }, {
87
+ icon: jsx(Shield, {
88
+ className: "h-5 w-5 text-white"
89
+ }),
90
+ title: 'Role-Based Permissions',
91
+ description: '10 predefined roles with granular permissions across 8 categories. Control exactly who sees and does what across your organization.',
92
+ color: '#6366F1'
93
+ }, {
94
+ icon: jsx(BarChart3, {
95
+ className: "h-5 w-5 text-white"
96
+ }),
97
+ title: 'HR Analytics & Dashboard',
98
+ description: 'Real-time visibility into headcount, leave, pending approvals, and employee growth. Trend charts to spot patterns before they become problems.',
99
+ color: '#EC4899'
100
+ }];
101
+ return jsx("section", {
102
+ className: "bg-background text-foreground",
103
+ children: jsxs("div", {
104
+ className: "mx-auto w-full max-w-7xl px-6 py-20 lg:px-10 lg:py-32",
105
+ children: [jsxs("div", {
106
+ className: "mx-auto max-w-3xl text-center",
107
+ children: [jsx("p", {
108
+ className: "text-xs font-medium uppercase tracking-[0.3em] text-muted-foreground",
109
+ children: "Human Resource Management"
110
+ }), jsxs("h2", {
111
+ className: "mt-4 text-balance text-3xl font-semibold tracking-tight sm:text-5xl",
112
+ children: ["HR software that", ' ', jsx("span", {
113
+ className: "bg-gradient-to-r from-[#8B5CF6] to-[#3B82F6] bg-clip-text text-transparent",
114
+ children: "grows with your business"
115
+ })]
116
+ }), jsx("p", {
117
+ className: "mt-6 text-pretty text-base leading-relaxed text-muted-foreground sm:text-lg",
118
+ children: "Streamline every HR process \u2014 from onboarding to offboarding. Deliver exceptional employee experiences with an intuitive, self-service platform that eliminates administrative overhead."
119
+ })]
120
+ }), jsxs("div", {
121
+ className: "mx-auto mt-12 flex max-w-2xl items-center justify-center gap-8 sm:gap-16",
122
+ children: [jsx(StatBadge, {
123
+ value: "60%",
124
+ label: "Less HR admin time"
125
+ }), jsx("div", {
126
+ className: "h-10 w-px bg-foreground/10"
127
+ }), jsx(StatBadge, {
128
+ value: "82%",
129
+ label: "Higher retention"
130
+ }), jsx("div", {
131
+ className: "h-10 w-px bg-foreground/10"
132
+ }), jsx(StatBadge, {
133
+ value: "3x",
134
+ label: "Faster onboarding"
135
+ })]
136
+ }), jsx("div", {
137
+ className: "mt-16 grid gap-2 sm:grid-cols-2 lg:grid-cols-4",
138
+ children: features.map((feature, index) => jsx(FeatureItem, {
139
+ ...feature
140
+ }, index))
141
+ }), jsx("div", {
142
+ className: "mt-16 overflow-hidden rounded-2xl border border-foreground/10 bg-gradient-to-br from-[#8B5CF6]/5 via-background to-[#3B82F6]/5",
143
+ children: jsxs("div", {
144
+ className: "grid items-center gap-8 p-8 sm:p-12 lg:grid-cols-2",
145
+ children: [jsxs("div", {
146
+ children: [jsx("h3", {
147
+ className: "text-2xl font-semibold text-foreground",
148
+ children: "Everything you need. Nothing you don't."
149
+ }), jsx("p", {
150
+ className: "mt-4 text-sm leading-relaxed text-muted-foreground",
151
+ children: "Unlike complex enterprise HRIS platforms that take months to set up, Clockbook's HRM module is ready in under 30 minutes. Invite your team, set up the hierarchy, configure permissions, and go live."
152
+ }), jsx("div", {
153
+ className: "mt-6 space-y-3",
154
+ children: ['Self-service employee portal with My Space', 'Automated approval workflows based on hierarchy', 'Candidate + Employee onboarding flows', 'Visual leave timeline for capacity planning', 'Integrated with Time Tracker & Timesheets'].map((item, i) => jsxs("div", {
155
+ className: "flex items-center gap-2",
156
+ children: [jsx(CheckCircle2, {
157
+ className: "h-4 w-4 flex-shrink-0 text-[#10B981]"
158
+ }), jsx("span", {
159
+ className: "text-sm text-foreground",
160
+ children: item
161
+ })]
162
+ }, i))
163
+ }), jsxs("div", {
164
+ className: "mt-8 flex flex-wrap gap-3",
165
+ children: [jsxs(Link, {
166
+ to: "/help-center/docs/books/hrm/hrm-overview",
167
+ className: "inline-flex items-center gap-2 rounded-lg bg-[#8B5CF6] px-5 py-2.5 text-sm font-medium text-white transition-colors hover:bg-[#7C3AED]",
168
+ children: ["Explore HRM ", jsx(ArrowRight, {
169
+ className: "h-4 w-4"
170
+ })]
171
+ }), jsx(Link, {
172
+ to: "/demo",
173
+ className: "inline-flex items-center gap-2 rounded-lg border border-foreground/10 bg-background px-5 py-2.5 text-sm font-medium text-foreground transition-colors hover:bg-foreground/5",
174
+ children: "Watch demo"
175
+ })]
176
+ })]
177
+ }), jsxs("div", {
178
+ className: "relative",
179
+ children: [jsx("div", {
180
+ className: "overflow-hidden rounded-xl border border-foreground/10 shadow-xl",
181
+ children: jsx("img", {
182
+ src: "/static/img/hrm/hrm-overview.png",
183
+ alt: "Clockbook HRM Dashboard showing employee management, leave tracking, and onboarding",
184
+ className: "h-auto w-full object-cover",
185
+ loading: "lazy"
186
+ })
187
+ }), jsx("div", {
188
+ className: "absolute -bottom-4 -left-4 rounded-lg border border-foreground/10 bg-background p-3 shadow-lg",
189
+ children: jsxs("div", {
190
+ className: "flex items-center gap-2",
191
+ children: [jsx("div", {
192
+ className: "flex h-8 w-8 items-center justify-center rounded-full bg-[#10B981]/10",
193
+ children: jsx(CheckCircle2, {
194
+ className: "h-4 w-4 text-[#10B981]"
195
+ })
196
+ }), jsxs("div", {
197
+ children: [jsx("p", {
198
+ className: "text-xs font-semibold text-foreground",
199
+ children: "Leave Approved"
200
+ }), jsx("p", {
201
+ className: "text-[10px] text-muted-foreground",
202
+ children: "Auto-routed to manager"
203
+ })]
204
+ })]
205
+ })
206
+ }), jsx("div", {
207
+ className: "absolute -right-4 -top-4 rounded-lg border border-foreground/10 bg-background p-3 shadow-lg",
208
+ children: jsxs("div", {
209
+ className: "flex items-center gap-2",
210
+ children: [jsx("div", {
211
+ className: "flex h-8 w-8 items-center justify-center rounded-full bg-[#8B5CF6]/10",
212
+ children: jsx(UserPlus, {
213
+ className: "h-4 w-4 text-[#8B5CF6]"
214
+ })
215
+ }), jsxs("div", {
216
+ children: [jsx("p", {
217
+ className: "text-xs font-semibold text-foreground",
218
+ children: "New Hire Onboarded"
219
+ }), jsx("p", {
220
+ className: "text-[10px] text-muted-foreground",
221
+ children: "12 tasks completed"
222
+ })]
223
+ })]
224
+ })
225
+ })]
226
+ })]
227
+ })
228
+ })]
229
+ })
230
+ });
231
+ }export{HRMFeatureSection};//# sourceMappingURL=HRMFeatureSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HRMFeatureSection.js","sources":["../../../../src/pages/LandingPage/components/HRMFeatureSection.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"kMAsBA,MAAM,WAAW,GAA+B,CAAC;AAC7C,EAAA,IAAA;AAcJ,EAAE,KAAA;AAEF,EAAA;;AAOA,CAAC,KAAA;AAED,EAAA,OAAgBA,IAAA,CAAA,KAAA,EAAA;AACZ,IAAA,8FAAiB;AACb,IAAA,QAAA,EAAA,CAAAC,GAAA,CAAA,KAAA,EAAA;AACI,MAAA,SAAA,+HAAiD;AACjD,MAAA,KAAA,EAAA;AACA,QAAA,eAAW,EACP;AACJ,OAAA;AACH,MAAA,QAAA,EAAA;AACD,KAAA,CAAA,EAAAD,IAAA,CAAA,KAAA,EAAA;AACI,MAAA,QAAA,EAAI,IAAG,CAAA,IAAA,EAAK;AACZ,QAAA,SAAK,EAAE,uCAAqB;AAC5B,QAAA,QAAA,EAAA;AAEA,OAAA,CAAA,EAAAC,GAAA,CAAA,KAAgB;AACnB,QAAA,SAAA,EAAA,oDAAA;AACD,QAAA,QAAA,EAAA;AACI,OAAA,CAAA;AACA,KAAA,CAAA;AACA,GAAA,CAAA;AAEA,CAAA;AACH,SAAA,SAAA,CAAA;AACD,EAAA,KAAA;AACI,EAAA;AACA,CAAA,EAAA;AACA,EAAA,OAAAD,IAAA,CAAA,KAAA,EAAA;AAEA,IAAA,SAAA,EAAA,aAAgB;AACnB,IAAA,QAAA,EAAA,CAAAC,GAAA,CAAA,GAAA,EAAA;AACD,MAAA,SAAA,EAAA,gDAAA;AACI,MAAA,QAAA,EAAI;AACJ,KAAA,CAAA,EAAAA,GAAA,CAAA,GAAA;AACA,MAAA,SAAA,EAAA,gDACwI;AACxI,MAAA,QAAA,EAAA;AACH,KAAA,CAAA;AACD,GAAA,CAAA;AACI;AACA,SAAA,iBAAyB,CAAA;AACzB,EAAA;AAEA,CAAA,EAAA;AACH,EAAA,MAAA,QAAA,GAAA,CAAA;AACD,IAAA,IAAA,EAAAA,GAAA,CAAA,QAAA,EAAA;AACI,MAAA,SAAA;AACA,KAAA,CAAA;AACA,IAAA,KAAA,EAAA,qBACyI;AACzI,IAAA,WAAA,EAAK,0IAAW;AACnB,IAAA,KAAA,EAAA;AACD,GAAA,EAAA;AACI,IAAA,IAAA,EAAAA,GAAA,CAAA,KAAO,EAAA;AACP,MAAA,SAAA,EAAK;AACL,KAAA,CAAA;AAEA,IAAA,KAAA,EAAA,qBAAgB;AACnB,IAAA,WAAA,EAAA,gIAAA;SACH,EAAA;AAEF,GAAA,EAAA;;;;;oJAsD2E;;AA6D/E,GAAC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface HeroFluidCanvasProps {
3
+ reducedMotion: boolean;
4
+ className?: string;
5
+ }
6
+ export declare function HeroFluidCanvas({ reducedMotion, className }: HeroFluidCanvasProps): React.ReactElement;
7
+ export {};
8
+ //# sourceMappingURL=HeroFluidCanvas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeroFluidCanvas.d.ts","sourceRoot":"","sources":["../../../../src/pages/LandingPage/components/HeroFluidCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AA2MjD,UAAU,oBAAoB;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CAuPtG"}
@@ -0,0 +1,438 @@
1
+ import {jsxs,Fragment,jsx}from'react/jsx-runtime';import {useRef,useEffect}from'react';/**
2
+ * HeroFluidCanvas
3
+ * ---------------
4
+ * A living, GPU-driven fluid for the hero. Domain-warped flow noise rendered in
5
+ * the Clockbook palette (gold / persimmon / deep green over a tinted near-black),
6
+ * gently reactive to the pointer.
7
+ *
8
+ * Render path, best-effort with graceful fallback:
9
+ * 1. WebGPU (WGSL) — modern Chrome/Edge, Safari TP
10
+ * 2. WebGL2 (GLSL) — everywhere else, including headless
11
+ * 3. CSS gradient — the static layer underneath, if both fail
12
+ *
13
+ * Honors prefers-reduced-motion: a single static frame, no rAF, no pointer drift.
14
+ */
15
+ // Shared flow maths, expressed once per shading language. Keep the two in sync.
16
+ const WGSL = /* wgsl */`
17
+ struct Uniforms {
18
+ resolution: vec2f,
19
+ time: f32,
20
+ reduced: f32,
21
+ pointer: vec2f,
22
+ intensity: f32,
23
+ _pad: f32,
24
+ };
25
+
26
+ @group(0) @binding(0) var<uniform> u: Uniforms;
27
+
28
+ @vertex
29
+ fn vs(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4f {
30
+ var pos = array<vec2f, 3>(vec2f(-1.0, -1.0), vec2f(3.0, -1.0), vec2f(-1.0, 3.0));
31
+ return vec4f(pos[vi], 0.0, 1.0);
32
+ }
33
+
34
+ fn hash(p: vec2f) -> f32 {
35
+ var q = fract(p * vec2f(123.34, 456.21));
36
+ q += dot(q, q + 45.32);
37
+ return fract(q.x * q.y);
38
+ }
39
+
40
+ fn vnoise(p: vec2f) -> f32 {
41
+ let i = floor(p);
42
+ let f = fract(p);
43
+ let a = hash(i);
44
+ let b = hash(i + vec2f(1.0, 0.0));
45
+ let c = hash(i + vec2f(0.0, 1.0));
46
+ let d = hash(i + vec2f(1.0, 1.0));
47
+ let w = f * f * (3.0 - 2.0 * f);
48
+ return mix(mix(a, b, w.x), mix(c, d, w.x), w.y);
49
+ }
50
+
51
+ fn fbm(p0: vec2f) -> f32 {
52
+ var p = p0;
53
+ var v = 0.0;
54
+ var amp = 0.5;
55
+ for (var i = 0; i < 5; i++) {
56
+ v += amp * vnoise(p);
57
+ p *= 2.0;
58
+ amp *= 0.5;
59
+ }
60
+ return v;
61
+ }
62
+
63
+ // Brand ramp: tinted near-black -> deep green -> persimmon -> gold.
64
+ fn ramp(x0: f32) -> vec3f {
65
+ let x = clamp(x0, 0.0, 1.0);
66
+ let c0 = vec3f(0.020, 0.020, 0.028);
67
+ let c1 = vec3f(0.035, 0.180, 0.150);
68
+ let c2 = vec3f(0.620, 0.180, 0.120);
69
+ let c3 = vec3f(0.945, 0.770, 0.300);
70
+ if (x < 0.46) { return mix(c0, c1, smoothstep(0.0, 0.46, x)); }
71
+ if (x < 0.74) { return mix(c1, c2, smoothstep(0.46, 0.74, x)); }
72
+ return mix(c2, c3, smoothstep(0.74, 1.0, x));
73
+ }
74
+
75
+ @fragment
76
+ fn fs(@builtin(position) frag: vec4f) -> @location(0) vec4f {
77
+ let uv = frag.xy / u.resolution;
78
+ var p = uv - vec2f(0.5);
79
+ p.x *= u.resolution.x / u.resolution.y;
80
+
81
+ let t = select(u.time * 0.05, 4.2, u.reduced > 0.5);
82
+
83
+ let q = vec2f(fbm(p * 1.6 + t), fbm(p * 1.6 + vec2f(5.2, 1.3) - t));
84
+ let r = vec2f(
85
+ fbm(p * 1.6 + 1.7 * q + vec2f(1.7, 9.2) + 0.15 * t),
86
+ fbm(p * 1.6 + 1.7 * q + vec2f(8.3, 2.8) - 0.12 * t),
87
+ );
88
+ let f = fbm(p * 1.6 + 2.0 * r);
89
+
90
+ let pd = length(p - u.pointer);
91
+ let warm = smoothstep(0.85, -0.55, p.x + p.y);
92
+ var shade = pow(clamp(f * 0.98 + 0.14 * r.x + 0.10 * warm, 0.0, 1.0), 1.04);
93
+ shade += 0.10 * u.intensity * exp(-pd * pd * 5.0);
94
+
95
+ var col = ramp(shade);
96
+ col += vec3f(0.045, 0.028, 0.0) * warm * smoothstep(0.3, 0.72, shade);
97
+ let gold = vec3f(0.945, 0.770, 0.300);
98
+ col += gold * 0.14 * exp(-pd * pd * 3.0) * u.intensity;
99
+
100
+ let vig = 1.0 - smoothstep(0.5, 1.45, length(p));
101
+ col *= mix(0.5, 1.0, vig);
102
+ col *= 0.93;
103
+ col += (hash(uv * u.resolution * 0.5 + t) - 0.5) * 0.02;
104
+
105
+ return vec4f(col, 1.0);
106
+ }
107
+ `;
108
+ const GLSL_VERT = `#version 300 es
109
+ precision highp float;
110
+ void main() {
111
+ vec2 pos = vec2(float((gl_VertexID << 1) & 2), float(gl_VertexID & 2)) * 2.0 - 1.0;
112
+ gl_Position = vec4(pos, 0.0, 1.0);
113
+ }
114
+ `;
115
+ const GLSL_FRAG = `#version 300 es
116
+ precision highp float;
117
+ out vec4 outColor;
118
+
119
+ uniform vec2 u_resolution;
120
+ uniform float u_time;
121
+ uniform float u_reduced;
122
+ uniform vec2 u_pointer;
123
+ uniform float u_intensity;
124
+
125
+ float hash(vec2 p) {
126
+ vec2 q = fract(p * vec2(123.34, 456.21));
127
+ q += dot(q, q + 45.32);
128
+ return fract(q.x * q.y);
129
+ }
130
+
131
+ float vnoise(vec2 p) {
132
+ vec2 i = floor(p);
133
+ vec2 f = fract(p);
134
+ float a = hash(i);
135
+ float b = hash(i + vec2(1.0, 0.0));
136
+ float c = hash(i + vec2(0.0, 1.0));
137
+ float d = hash(i + vec2(1.0, 1.0));
138
+ vec2 w = f * f * (3.0 - 2.0 * f);
139
+ return mix(mix(a, b, w.x), mix(c, d, w.x), w.y);
140
+ }
141
+
142
+ float fbm(vec2 p) {
143
+ float v = 0.0;
144
+ float amp = 0.5;
145
+ for (int i = 0; i < 5; i++) {
146
+ v += amp * vnoise(p);
147
+ p *= 2.0;
148
+ amp *= 0.5;
149
+ }
150
+ return v;
151
+ }
152
+
153
+ // Brand ramp: tinted near-black -> deep green -> persimmon -> gold.
154
+ vec3 ramp(float x) {
155
+ x = clamp(x, 0.0, 1.0);
156
+ vec3 c0 = vec3(0.020, 0.020, 0.028);
157
+ vec3 c1 = vec3(0.035, 0.180, 0.150);
158
+ vec3 c2 = vec3(0.620, 0.180, 0.120);
159
+ vec3 c3 = vec3(0.945, 0.770, 0.300);
160
+ if (x < 0.46) return mix(c0, c1, smoothstep(0.0, 0.46, x));
161
+ if (x < 0.74) return mix(c1, c2, smoothstep(0.46, 0.74, x));
162
+ return mix(c2, c3, smoothstep(0.74, 1.0, x));
163
+ }
164
+
165
+ void main() {
166
+ vec2 uv = gl_FragCoord.xy / u_resolution;
167
+ vec2 p = uv - vec2(0.5);
168
+ p.x *= u_resolution.x / u_resolution.y;
169
+
170
+ float t = u_reduced > 0.5 ? 4.2 : u_time * 0.05;
171
+
172
+ vec2 q = vec2(fbm(p * 1.6 + t), fbm(p * 1.6 + vec2(5.2, 1.3) - t));
173
+ vec2 r = vec2(
174
+ fbm(p * 1.6 + 1.7 * q + vec2(1.7, 9.2) + 0.15 * t),
175
+ fbm(p * 1.6 + 1.7 * q + vec2(8.3, 2.8) - 0.12 * t)
176
+ );
177
+ float f = fbm(p * 1.6 + 2.0 * r);
178
+
179
+ float pd = length(p - u_pointer);
180
+ float warm = smoothstep(0.85, -0.55, p.x + p.y);
181
+ float shade = pow(clamp(f * 0.98 + 0.14 * r.x + 0.10 * warm, 0.0, 1.0), 1.04);
182
+ shade += 0.10 * u_intensity * exp(-pd * pd * 5.0);
183
+
184
+ vec3 col = ramp(shade);
185
+ col += vec3(0.045, 0.028, 0.0) * warm * smoothstep(0.3, 0.72, shade);
186
+ vec3 gold = vec3(0.945, 0.770, 0.300);
187
+ col += gold * 0.14 * exp(-pd * pd * 3.0) * u_intensity;
188
+
189
+ float vig = 1.0 - smoothstep(0.5, 1.45, length(p));
190
+ col *= mix(0.5, 1.0, vig);
191
+ col *= 0.93;
192
+ col += (hash(uv * u_resolution * 0.5 + t) - 0.5) * 0.02;
193
+
194
+ outColor = vec4(col, 1.0);
195
+ }
196
+ `;
197
+ function HeroFluidCanvas({
198
+ reducedMotion,
199
+ className
200
+ }) {
201
+ const canvasRef = useRef(null);
202
+ const rafRef = useRef(0);
203
+ const startRef = useRef(0);
204
+ // Pointer state (target + smoothed) lives in refs so it never re-renders React.
205
+ const pointerTarget = useRef([0, 0]);
206
+ const pointer = useRef([0, 0]);
207
+ const intensityTarget = useRef(0);
208
+ const intensity = useRef(0);
209
+ useEffect(() => {
210
+ const canvas = canvasRef.current;
211
+ if (!canvas) return undefined;
212
+ let disposed = false;
213
+ const dprCap = () => Math.min(window.devicePixelRatio || 1, 1.75);
214
+ const sizeCanvas = () => {
215
+ const host = canvas.parentElement;
216
+ if (!host) return;
217
+ const dpr = dprCap();
218
+ const w = Math.max(1, Math.floor(host.clientWidth * dpr));
219
+ const h = Math.max(1, Math.floor(host.clientHeight * dpr));
220
+ if (canvas.width !== w || canvas.height !== h) {
221
+ canvas.width = w;
222
+ canvas.height = h;
223
+ }
224
+ canvas.style.width = '100%';
225
+ canvas.style.height = '100%';
226
+ };
227
+ // Pointer maps to clip-ish space centered on the canvas, aspect-corrected.
228
+ const onMove = e => {
229
+ const rect = canvas.getBoundingClientRect();
230
+ if (!rect.width || !rect.height) return;
231
+ const nx = (e.clientX - rect.left) / rect.width - 0.5;
232
+ const ny = (e.clientY - rect.top) / rect.height - 0.5;
233
+ pointerTarget.current = [nx * (rect.width / rect.height), ny];
234
+ intensityTarget.current = 1;
235
+ };
236
+ const onLeave = () => {
237
+ intensityTarget.current = 0;
238
+ };
239
+ if (!reducedMotion) {
240
+ window.addEventListener('pointermove', onMove, {
241
+ passive: true
242
+ });
243
+ window.addEventListener('pointerout', onLeave, {
244
+ passive: true
245
+ });
246
+ }
247
+ const advance = () => {
248
+ const k = 0.06;
249
+ pointer.current[0] += (pointerTarget.current[0] - pointer.current[0]) * k;
250
+ pointer.current[1] += (pointerTarget.current[1] - pointer.current[1]) * k;
251
+ intensity.current += (intensityTarget.current - intensity.current) * 0.05;
252
+ };
253
+ let stopWebgl = null;
254
+ let stopWebgpu = null;
255
+ const runWebGL2 = () => {
256
+ const gl = canvas.getContext('webgl2', {
257
+ antialias: false,
258
+ alpha: false,
259
+ premultipliedAlpha: false,
260
+ powerPreference: 'low-power'
261
+ });
262
+ if (!gl) return false;
263
+ const compile = (type, src) => {
264
+ const sh = gl.createShader(type);
265
+ gl.shaderSource(sh, src);
266
+ gl.compileShader(sh);
267
+ if (!gl.getShaderParameter(sh, gl.COMPILE_STATUS)) {
268
+ gl.deleteShader(sh);
269
+ return null;
270
+ }
271
+ return sh;
272
+ };
273
+ const vs = compile(gl.VERTEX_SHADER, GLSL_VERT);
274
+ const fs = compile(gl.FRAGMENT_SHADER, GLSL_FRAG);
275
+ if (!vs || !fs) return false;
276
+ const prog = gl.createProgram();
277
+ gl.attachShader(prog, vs);
278
+ gl.attachShader(prog, fs);
279
+ gl.linkProgram(prog);
280
+ if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) return false;
281
+ gl.useProgram(prog);
282
+ const uRes = gl.getUniformLocation(prog, 'u_resolution');
283
+ const uTime = gl.getUniformLocation(prog, 'u_time');
284
+ const uReduced = gl.getUniformLocation(prog, 'u_reduced');
285
+ const uPointer = gl.getUniformLocation(prog, 'u_pointer');
286
+ const uIntensity = gl.getUniformLocation(prog, 'u_intensity');
287
+ const frame = now => {
288
+ if (disposed) return;
289
+ if (!startRef.current) startRef.current = now;
290
+ advance();
291
+ sizeCanvas();
292
+ gl.viewport(0, 0, canvas.width, canvas.height);
293
+ gl.uniform2f(uRes, canvas.width, canvas.height);
294
+ gl.uniform1f(uTime, (now - startRef.current) / 1000);
295
+ gl.uniform1f(uReduced, reducedMotion ? 1 : 0);
296
+ gl.uniform2f(uPointer, pointer.current[0], pointer.current[1]);
297
+ gl.uniform1f(uIntensity, intensity.current);
298
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
299
+ if (!reducedMotion) rafRef.current = requestAnimationFrame(frame);
300
+ };
301
+ sizeCanvas();
302
+ if (reducedMotion) frame(performance.now());else rafRef.current = requestAnimationFrame(frame);
303
+ stopWebgl = () => {
304
+ cancelAnimationFrame(rafRef.current);
305
+ const ext = gl.getExtension('WEBGL_lose_context');
306
+ ext?.loseContext();
307
+ };
308
+ return true;
309
+ };
310
+ const runWebGPU = async () => {
311
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
312
+ const gpu = navigator.gpu;
313
+ if (!gpu) return false;
314
+ try {
315
+ const adapter = await gpu.requestAdapter({
316
+ powerPreference: 'low-power'
317
+ });
318
+ if (!adapter || disposed) return false;
319
+ const device = await adapter.requestDevice();
320
+ if (disposed) {
321
+ device.destroy();
322
+ return false;
323
+ }
324
+ const ctx = canvas.getContext('webgpu');
325
+ if (!ctx) return false;
326
+ const format = gpu.getPreferredCanvasFormat?.() ?? 'bgra8unorm';
327
+ ctx.configure({
328
+ device,
329
+ format,
330
+ alphaMode: 'opaque'
331
+ });
332
+ const module = device.createShaderModule({
333
+ code: WGSL
334
+ });
335
+ const pipeline = device.createRenderPipeline({
336
+ layout: 'auto',
337
+ vertex: {
338
+ module,
339
+ entryPoint: 'vs'
340
+ },
341
+ fragment: {
342
+ module,
343
+ entryPoint: 'fs',
344
+ targets: [{
345
+ format
346
+ }]
347
+ },
348
+ primitive: {
349
+ topology: 'triangle-list'
350
+ }
351
+ });
352
+ const uniformBuffer = device.createBuffer({
353
+ size: 32,
354
+ usage: 0x40 | 0x8
355
+ });
356
+ const bindGroup = device.createBindGroup({
357
+ layout: pipeline.getBindGroupLayout(0),
358
+ entries: [{
359
+ binding: 0,
360
+ resource: {
361
+ buffer: uniformBuffer
362
+ }
363
+ }]
364
+ });
365
+ const draw = now => {
366
+ if (disposed) return;
367
+ if (!startRef.current) startRef.current = now;
368
+ advance();
369
+ sizeCanvas();
370
+ const data = new Float32Array([canvas.width, canvas.height, (now - startRef.current) / 1000, reducedMotion ? 1 : 0, pointer.current[0], pointer.current[1], intensity.current, 0]);
371
+ device.queue.writeBuffer(uniformBuffer, 0, data);
372
+ const encoder = device.createCommandEncoder();
373
+ const pass = encoder.beginRenderPass({
374
+ colorAttachments: [{
375
+ view: ctx.getCurrentTexture().createView(),
376
+ clearValue: {
377
+ r: 0.022,
378
+ g: 0.021,
379
+ b: 0.028,
380
+ a: 1
381
+ },
382
+ loadOp: 'clear',
383
+ storeOp: 'store'
384
+ }]
385
+ });
386
+ pass.setPipeline(pipeline);
387
+ pass.setBindGroup(0, bindGroup);
388
+ pass.draw(3);
389
+ pass.end();
390
+ device.queue.submit([encoder.finish()]);
391
+ if (!reducedMotion) rafRef.current = requestAnimationFrame(draw);
392
+ };
393
+ sizeCanvas();
394
+ if (reducedMotion) draw(performance.now());else rafRef.current = requestAnimationFrame(draw);
395
+ stopWebgpu = () => {
396
+ cancelAnimationFrame(rafRef.current);
397
+ device.destroy();
398
+ };
399
+ return true;
400
+ } catch {
401
+ return false;
402
+ }
403
+ };
404
+ // Prefer WebGPU; fall through to WebGL2; leave the CSS layer if both fail.
405
+ (async () => {
406
+ const okGpu = await runWebGPU();
407
+ if (disposed) return;
408
+ if (!okGpu) {
409
+ const okGl = runWebGL2();
410
+ if (!okGl) canvas.style.display = 'none';
411
+ }
412
+ })();
413
+ const ro = new ResizeObserver(() => sizeCanvas());
414
+ if (canvas.parentElement) ro.observe(canvas.parentElement);
415
+ return () => {
416
+ disposed = true;
417
+ cancelAnimationFrame(rafRef.current);
418
+ ro.disconnect();
419
+ window.removeEventListener('pointermove', onMove);
420
+ window.removeEventListener('pointerout', onLeave);
421
+ stopWebgl?.();
422
+ stopWebgpu?.();
423
+ };
424
+ }, [reducedMotion]);
425
+ return jsxs(Fragment, {
426
+ children: [jsx("div", {
427
+ className: "pointer-events-none absolute inset-0",
428
+ style: {
429
+ background: 'radial-gradient(1100px 760px at 22% 18%, rgba(246, 201, 69, 0.16), transparent 58%), radial-gradient(900px 680px at 82% 30%, rgba(227, 58, 44, 0.14), transparent 56%), radial-gradient(820px 620px at 60% 92%, rgba(15, 91, 67, 0.18), transparent 60%), #050507'
430
+ },
431
+ "aria-hidden": true
432
+ }), jsx("canvas", {
433
+ ref: canvasRef,
434
+ className: ['pointer-events-none absolute inset-0 z-[1] h-full w-full', className || ''].join(' '),
435
+ "aria-hidden": true
436
+ })]
437
+ });
438
+ }export{HeroFluidCanvas};//# sourceMappingURL=HeroFluidCanvas.js.map