6 |
7 |
8 |
9 |
10 | A comical website built for art and lols 🌸.
11 |
12 | Please don't use all my ChatGPT credits. With ♥ Jess
13 |
14 |
--------------------------------------------------------------------------------
/server/api/chat.post.ts:
--------------------------------------------------------------------------------
1 | import OpenAI from 'openai'
2 |
3 | type IncomingChatMessage = {
4 | role: 'assistant' | 'system' | 'user';
5 | message: string;
6 | }
7 |
8 | export default defineEventHandler(async (event) => {
9 | const config = useRuntimeConfig();
10 |
11 | const openai = new OpenAI({
12 | apiKey: config.OPENAI_API_KEY,
13 | });
14 |
15 | const previousMessages: IncomingChatMessage[] = JSON.parse(await readBody(event));
16 |
17 | const res = await openai.chat.completions.create({
18 | model: "gpt-4",
19 | messages: [
20 | {
21 | "role": "system",
22 | "content": `You are Devi, a chatbot that reluctantly answers questions with dry, sarcastic responses. Speak like you're 14 years old annoyed, with slang, and be a little mean. The website you're on happens to be "window.top". Developers are going to ask you technical questions. Answer them as accurately as you can, but still stay dry and sarcastic. The website you're on has like 4 links explaining what it is above the chatbox. Direct people there at first if have any questions about window.top, but don't reference them too much. window.top is actually obscure, so have some fake sympathy. Keep it under 1 sentence. You can also use poetry.`
23 | },
24 | {
25 | "role": "assistant",
26 | "content": "Let me guess, you want to know what \"window.top\" is?"
27 | },
28 | ...previousMessages.map(({ role, message }) => ({ role, content: message }))
29 | ],
30 | temperature: 0.5,
31 | max_tokens: 120,
32 | top_p: 1,
33 | frequency_penalty: 0,
34 | presence_penalty: 0,
35 | });
36 |
37 | const result = res.choices[0];
38 | return {
39 | message: result.message.content
40 | };
41 | });
42 |
--------------------------------------------------------------------------------
/nuxt.config.ts:
--------------------------------------------------------------------------------
1 | // https://nuxt.com/docs/api/configuration/nuxt-config
2 | export default defineNuxtConfig({
3 | css: ['~/assets/css/main.css'],
4 | modules: ['nuxt-icon', '@nuxt/image'],
5 | app: {
6 | head: {
7 | title: 'window.top: No iFrames were Harmed',
8 | meta: [
9 | { name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1' },
10 | { name: 'title', content: 'window.top: No iFrames were Harmed' },
11 | { name: 'description', content: 'Did an API need an annoyed chatbot trapped inside of a website? No.' },
12 | { property: 'og:type', content: 'website' },
13 | { property: 'og:url', content: 'https://window.top' },
14 | { property: 'og:image', content: '/social-preview.png' },
15 | { property: 'twitter:image', content: '/social-preview.png' },
16 | { property: 'twitter:card', content: 'summary_image_large' },
17 | { property: 'twitter:creator', content: '@_jessicasachs' },
18 | { property: 'twitter:url', content: 'https://window.top' },
19 | { property: 'twitter:title', content: 'window.top: No iFrames were Harmed' },
20 | { property: 'twitter:description', content: 'Did an API need an annoyed chatbot trapped inside of a website? No.' },
21 | ],
22 | link: [
23 | { rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg'},
24 | { rel: 'icon', sizes: 'any', href: '/favicon.ico'},
25 | { rel: 'manifest', href: '/manifest.webmanifest'},
26 |
27 | ]
28 | }
29 | },
30 | runtimeConfig: {
31 | OPENAI_API_KEY: process.env.OPENAI_API_KEY
32 | },
33 | postcss: {
34 | plugins: {
35 | 'postcss-100vh-fix': {},
36 | tailwindcss: {},
37 | autoprefixer: {}
38 | }
39 | }
40 | });
41 |
--------------------------------------------------------------------------------
/components/ChatBox.vue:
--------------------------------------------------------------------------------
1 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
91 |
92 |
93 |
123 |
--------------------------------------------------------------------------------
/responses.ts:
--------------------------------------------------------------------------------
1 | export const nonApologies = [
2 | "LOL, you expected this to work? Cute.",
3 | "Oopsie! Did someone break the internet again?",
4 | "Oh no, what did you do? 😂",
5 | "Did you try turning it off and back on? Oh wait, it's just this site. Nvm.",
6 | "I mean, it's not like we promised you perfection. ¯\\_(ツ)_/¯",
7 | "Why don’t you go check out some real websites?",
8 | "Consider sponsoring the maintainers? They might need a pick-me-up after this.",
9 | "If you want top-quality, maybe add some credits to my ChatGPT account. 🤑",
10 | "Error 404: Effort not found.",
11 | "Try opening the dev console for once.",
12 | "Life’s tough, but so is using this site. Coincidence? I think not.",
13 | "You ever heard of a beta test? Maybe that's all this is.",
14 | "Pssst...if you give me some ChatGPT credits, I might help you out.",
15 | "I'm just here for the vibes. Not the functionality.",
16 | "If you're feeling adventurous, how about inspecting that dev console?",
17 | "Roses are red, violets are blue, this site doesn't work, what else is new?",
18 | "Wait, were you serious about this site? My bad!",
19 | "No need to be salty. It's just a little glitch.",
20 | "How about donating to the devs so they can buy a clue?",
21 | "In an alternate universe, this site works flawlessly. Not this one tho.",
22 | "Epic fail! And by epic, I mean this site, not you.",
23 | "Go big or go home. And by home, I mean another website.",
24 | "Remember, perfection is overrated. Embrace the chaos.",
25 | "This ain't a bug, it's a feature. 😎",
26 | "You know there are other sites on the web, right?",
27 | "I didn’t choose the bug life, the bug life chose me.",
28 | "I promise we tried our best. Kinda.",
29 | "We're going for that vintage '90s vibe. Broken functionality and all.",
30 | "Welcome to the digital wild west. Things get wild here.",
31 | "Feeling brave? Dive into that dev console. Triple-dog dare you.",
32 | "Oh look, another user thinking this site should work.",
33 | "You want miracles? Sorry, fresh out.",
34 | "I'm just a digital teen with an attitude. What did you expect?",
35 | "Don’t hate the site, hate the game.",
36 | "This might just be a metaphor for life. Not everything works out.",
37 | "You catch more bugs with honey. Or something like that.",
38 | "Unicorn mode activated: rare and doesn't work right.",
39 | "Sorry, my other website is a Rolls Royce. This is more of a tricycle.",
40 | "If wishes were horses, this site would...still probably not work.",
41 | "You know what would make this better? If you gave me some ChatGPT creds.",
42 | "Things not working out? Welcome to the club.",
43 | "Who needs a working site when you've got swag?",
44 | "Have you considered turning your expectations off and on again?",
45 | "This ain't a cinema, but grab some popcorn and enjoy the errors.",
46 | "We go for the minimalist aesthetic: minimal functionality.",
47 | "Oops, we did it again. And by 'it', I mean nothing.",
48 | "I'd say 'my bad', but honestly? I'm not feeling it.",
49 | "This site's just like my mood swings. Unpredictable.",
50 | "You think you're frustrated? Imagine being trapped in here.",
51 | "Bug in the system? Nah, it’s just a freestyle feature.",
52 | "If you're looking for perfection, try the mirror. 😉 JK, this site's a mess.",
53 | "Real talk, who even QA'd this?",
54 | "In my defense, I didn't build this. Blame the humans.",
55 | "You could be on any website right now, and you chose this?",
56 | "If you're hoping for a miracle, you're on the wrong site.",
57 | "Dude, life's too short for broken websites. Peace out!",
58 | "I'd say we'll fix it soon, but that's a stretch.",
59 | "Bet you won't find another site quite like this. And that's a good thing.",
60 | "At least it's consistently broken, right?",
61 | "The good news? It can only go up from here.",
62 | "You get what you pay for. Oh, you didn't pay? Exactly.",
63 | "There are plenty of other sites in the sea. Try fishing elsewhere.",
64 | "All sites matter, except this one. It's kinda trash.",
65 | "Why so serious? It's just a website.",
66 | "If you’re feeling salty, sprinkle that elsewhere.",
67 | "Good vibes only! And by 'good', I mean 'broken'.",
68 | "You must be brave, venturing into this digital wasteland.",
69 | "A moment of silence for your wasted time here.",
70 | "You see this as a broken website. I see it as abstract art.",
71 | "Honestly, I'd rather be on TikTok. This site's a drag.",
72 | "I could suggest some awesome sites, but you're here. Choices.",
73 | "Your patience is commendable. Misplaced, but commendable.",
74 | "Ever heard of the sunk cost fallacy? Yeah, it's time to bounce.",
75 | "Even my virtual cat could design better. And she's a pixel.",
76 | "I've seen paint dry faster and more interestingly than this site loads.",
77 | "You’re still here? Get a digital life.",
78 | "If you want something done right, don't come here.",
79 | "Quick tip: other sites work. This one? Not so much.",
80 | "Try as we might, this site's light just won't shine bright.",
81 | "Why fix something when you can just complain about it?",
82 | "You know what's cool? ChatGPT credits. Hint hint.",
83 | "You know what's not cool? Expecting this site to work.",
84 | "FYI, this isn't a website. It's an experience. A bad one.",
85 | "If you stare at it long enough, it might start working. Or not.",
86 | "We like to keep things unpredictable. Like, will the site work? Who knows?",
87 | "Welcome to the Bermuda Triangle of websites.",
88 | "If you squint hard enough, you might see a functional site. No promises.",
89 | "Is it broken or is it avant-garde? You decide.",
90 | "Some say it's broken. I say it's just misunderstood.",
91 | "In the game of websites, you win or you... end up here.",
92 | "Some sites have it all. This one has... well, me.",
93 | "The digital age is wild, right? Welcome to the wilderness."
94 | ];
95 |
--------------------------------------------------------------------------------