mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 17:11:17 +00:00
feat: init waitlist website (#60)
* feat: init waitlist website Co-authored-by: Ona <no-reply@ona.com> * feat[waitlist]: tweak copy Co-authored-by: Ona <no-reply@ona.com> * fix[waitlist]: reminify lottie json Co-authored-by: Ona <no-reply@ona.com> * feat[waitlist]: seo and preview stuff * chore[waitlist]: clean up * build[waitlist]: add fly.io config * feat(waitlist): add time-of-day greeting and duplicate email message Co-authored-by: Ona <no-reply@ona.com> * feat(waitlist): handle duplicate emails and send confirmation Co-authored-by: Ona <no-reply@ona.com> * chore: remove stray console.log Co-authored-by: Ona <no-reply@ona.com> * feat(waitlist): add privacy policy page Co-authored-by: Ona <no-reply@ona.com> * feat(waitlist): add footer with bottom progressive blur Co-authored-by: Ona <no-reply@ona.com> * feat(waitlist): add trouble message and improve error handling Co-authored-by: Ona <no-reply@ona.com> * fix(waitlist): fix timeOfDay logic, typo, and add audienceId Co-authored-by: Ona <no-reply@ona.com> * feat(waitlist): add .ico fallback favicon and style error page Co-authored-by: Ona <no-reply@ona.com> * chore(waitlist): add robots.txt, sitemap, clean dockerignore Co-authored-by: Ona <no-reply@ona.com> * feat(waitlist): add footer to privacy policy page Co-authored-by: Ona <no-reply@ona.com> * fix(waitlist): use segments instead of audienceId Co-authored-by: Ona <no-reply@ona.com> * fix[waitlist]: remove segmentId from dup check Co-authored-by: Ona <no-reply@ona.com> * fix(waitlist): reset logo animation on mouse leave Co-authored-by: Ona <no-reply@ona.com> --------- Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
66
apps/waitlist-website/app/chat/message.ts
Normal file
66
apps/waitlist-website/app/chat/message.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
export interface UserMessage {
|
||||
role: "user"
|
||||
message: string
|
||||
bubbleLayoutId?: string
|
||||
}
|
||||
|
||||
export interface SystemMessage {
|
||||
role: "system"
|
||||
message: string
|
||||
}
|
||||
|
||||
export type Message = UserMessage | SystemMessage
|
||||
|
||||
function timeOfDay() {
|
||||
const hours = new Date().getHours()
|
||||
if (hours >= 5 && hours < 12) {
|
||||
return "morning"
|
||||
} else if (hours >= 12 && hours < 18) {
|
||||
return "afternoon"
|
||||
} else if (hours >= 18 && hours < 22) {
|
||||
return "evening"
|
||||
}
|
||||
return "night"
|
||||
}
|
||||
|
||||
export const INITIAL_MESSAGES: Message[] = [
|
||||
{
|
||||
role: "user",
|
||||
message: "Who are you?",
|
||||
},
|
||||
{
|
||||
role: "system",
|
||||
message: `Hey! I'm **Aelis** — your personal assistant that brings you the right thing, at the right time, in the right place.
|
||||
|
||||
- Jubilee line down? I've already found you an alternative route.
|
||||
- Dinner reservation at 8? I'll have the restaurant, directions, and the menu ready before you head out.
|
||||
|
||||
I learn your routines, anticipate what's next, and surface what matters before you even think to look for it.
|
||||
|
||||
I'm not ready yet — [@kennethnym](https://x.com/kennethnym) is still building me. **Drop your email below** and I'll let you know when I'm available.`,
|
||||
},
|
||||
]
|
||||
|
||||
export function waitListJoinedMessage(email: string): SystemMessage {
|
||||
return {
|
||||
role: "system",
|
||||
message: `Thanks for joining the waitlist! I've sent you a confirmation email.
|
||||
I'll send an email to **${email}** when I'm ready.
|
||||
|
||||
Have a good ${timeOfDay()}!`,
|
||||
}
|
||||
}
|
||||
|
||||
export function duplicateEmailMessage(): SystemMessage {
|
||||
return {
|
||||
role: "system",
|
||||
message: `I appreciate your excitement! You are already on the waitlist. When I am ready, I will reach out again. Have a good ${timeOfDay()} :)`,
|
||||
}
|
||||
}
|
||||
|
||||
export function troubleMessage(): SystemMessage {
|
||||
return {
|
||||
role: "system",
|
||||
message: `I apologize, but I am having trouble adding you to the waitlist. Could you refresh the page and try again please in a moment?`,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user