Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Change Requests #72

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"semi": false,
"singleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "avoid"
Expand Down
4 changes: 2 additions & 2 deletions app/about/sections/conclusion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export default function Conclusion() {
tokens.colors.accent.dimmer + "75",
tokens.colors.accent.dimmer + "25 30%",
tokens.colors.transparent + " 50%",
tokens.colors.transparent
)
tokens.colors.transparent,
),
}}
center
className="border-t-2 border-default"
Expand Down
16 changes: 8 additions & 8 deletions app/about/sections/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useCallback } from "react"
const toHex = (num: number): string => num.toString(16).padStart(2, "0")

export default function Header({
percentage
percentage,
}: {
percentage: MotionValue<number>
}) {
Expand All @@ -19,33 +19,33 @@ export default function Header({
0,
tokens.colors.root + `${toHex(100 + p * 100)}`,
tokens.colors.root + `${toHex(50 + p * 100)} ${10 + p * 10}%`,
`transparent ${20 + p * 20}%`
`transparent ${20 + p * 20}%`,
),
gr.radial(
`circle at 50% ${100 - 90 * p}%`,
tokens.colors.red[500] + "55",
tokens.colors.red[500] + "25 30%",
"transparent 70%",
"transparent"
"transparent",
),
gr.rRadial(
`circle at 50% ${150 - 90 * p}%`,
...gr.stack(
["transparent", 400 - 150 * p],
[tokens.colors.outline.dimmest + "25", 404 - 150 * p]
)
)
[tokens.colors.outline.dimmest + "25", 404 - 150 * p],
),
),
)
}, [])

const smoothPercentage = useSpring(percentage, {
mass: 0.05
mass: 0.05,
})

const background = useTransform(
smoothPercentage,
[0, 1],
[backgroundImage(0), backgroundImage(1)]
[backgroundImage(0), backgroundImage(1)],
)

const translateY = useTransform(smoothPercentage, [0, 1], ["0%", "-50%"])
Expand Down
10 changes: 5 additions & 5 deletions app/about/sections/inspiration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export default function Inspiration() {
tokens.colors.accent.dimmest + "45",
tokens.colors.accent.dimmest + "15 20%",
tokens.colors.transparent + " 50%",
tokens.colors.transparent
tokens.colors.transparent,
),
gr.radial(
"circle at 100% 50%",
tokens.colors.accent.dimmest + "45",
tokens.colors.accent.dimmest + "15 20%",
tokens.colors.transparent + " 50%",
tokens.colors.transparent
tokens.colors.transparent,
),
gr.linear(
0,
Expand All @@ -32,9 +32,9 @@ export default function Inspiration() {
tokens.colors.accent.dimmest + "45",
tokens.colors.accent.dimmest + "15",
tokens.colors.root + " 70%",
tokens.colors.root
)
)
tokens.colors.root,
),
),
}}
className="border-t-2 border-default"
>
Expand Down
59 changes: 31 additions & 28 deletions app/about/sections/intro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import { MotionValue, useSpring, useTransform } from "framer-motion"
import { styled } from "react-tailwind-variants"

export default function Intro({
percentage
percentage,
}: {
percentage: MotionValue<number>
}) {
const smoothPercentage = useSpring(percentage, {
mass: 0.05
mass: 0.05,
})

const slideWidgetsX = useTransform(smoothPercentage, [0, 1], ["0", "-100%"])
Expand All @@ -27,8 +27,8 @@ export default function Intro({
tokens.colors.default + "ac",
tokens.colors.default + "87 20%",
tokens.colors.root + " 85%",
tokens.colors.root
)
tokens.colors.root,
),
}}
center
className="border-t-2 border-default"
Expand All @@ -53,7 +53,7 @@ export default function Intro({
gap={4}
center
style={{
translateX: slideWidgetsX
translateX: slideWidgetsX,
}}
>
<CompareItem
Expand All @@ -64,22 +64,22 @@ export default function Intro({
values: [
[
"code-llama",
{ value: 0.288, type: MetaPropertyType.Number }
{ value: 0.288, type: MetaPropertyType.Number },
],
[
"mistral-7b",
{ value: 0.305, type: MetaPropertyType.Number }
{ value: 0.305, type: MetaPropertyType.Number },
],
[
"gemini pro",
{ value: 0.677, type: MetaPropertyType.Number }
{ value: 0.677, type: MetaPropertyType.Number },
],
["PaLM 8b", { value: 0.036, type: MetaPropertyType.Number }],
[
"code-davinci-002",
{ value: 0.658, type: MetaPropertyType.Number }
]
]
{ value: 0.658, type: MetaPropertyType.Number },
],
],
}}
/>
<CompareItem
Expand All @@ -91,18 +91,21 @@ export default function Intro({
["gpt-4", { value: 8192, type: MetaPropertyType.Number }],
[
"gpt-3.5-turbo",
{ value: 4096, type: MetaPropertyType.Number }
{ value: 4096, type: MetaPropertyType.Number },
],
[
"gpt-4-turbo-preview",
{ value: 128000, type: MetaPropertyType.Number }
{ value: 128000, type: MetaPropertyType.Number },
],
[
"replit-code-v1-3b",
{ value: 32000, type: MetaPropertyType.Number }
{ value: 32000, type: MetaPropertyType.Number },
],
[
"llama-2-7b",
{ value: 4000, type: MetaPropertyType.Number },
],
["llama-2-7b", { value: 4000, type: MetaPropertyType.Number }]
]
],
}}
/>
<CompareItem
Expand All @@ -115,29 +118,29 @@ export default function Intro({
"gpt-4",
{
value: "multimodal",
type: MetaPropertyType.String
}
type: MetaPropertyType.String,
},
],
[
"dalle-2",
{ value: "text-to-image", type: MetaPropertyType.String }
{ value: "text-to-image", type: MetaPropertyType.String },
],
[
"sora",
{ value: "text-to-video", type: MetaPropertyType.String }
{ value: "text-to-video", type: MetaPropertyType.String },
],
[
"CodeLlama-70b-hf",
{
value: "code generation",
type: MetaPropertyType.String
}
type: MetaPropertyType.String,
},
],
[
"musicgen-small",
{ value: "text-to-music", type: MetaPropertyType.String }
]
]
{ value: "text-to-music", type: MetaPropertyType.String },
],
],
}}
/>
</WidgetContainer>
Expand All @@ -149,9 +152,9 @@ export default function Intro({

const { WidgetGutter, WidgetContainer } = {
WidgetGutter: styled("div", {
base: "w-full px-4 h-[256px] relative"
base: "w-full px-4 h-[256px] relative",
}),
WidgetContainer: styled(MotionFlex, {
base: "absolute top-0 left-0 *:shrink-0"
})
base: "absolute top-0 left-0 *:shrink-0",
}),
}
24 changes: 12 additions & 12 deletions app/admin/actions/remove-contributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { EmbedBuilder, WebhookClient } from "discord.js"
import { z } from "zod"

const webhook = new WebhookClient({
url: process.env.DISCORD_WEBHOOK_URL_ADMIN
url: process.env.DISCORD_WEBHOOK_URL_ADMIN,
})

const removeContributorInput = z.object({
userId: z.number(),
reason: z.string().min(3).max(255)
reason: z.string().min(3).max(255),
})

export type RemoveContributorInput = z.infer<typeof removeContributorInput>
Expand All @@ -33,8 +33,8 @@ export async function removeContributor(e: RemoveContributorInput) {

const contributor = await prisma.user.findFirst({
where: {
id: userId
}
id: userId,
},
})

if (!contributor) throw new Error("Contributor not found")
Expand All @@ -48,8 +48,8 @@ export async function removeContributor(e: RemoveContributorInput) {
await prisma.user.update({
where: { id: userId },
data: {
role: UserRole.user
}
role: UserRole.user,
},
})

await resend.emails.send({
Expand All @@ -60,10 +60,10 @@ export async function removeContributor(e: RemoveContributorInput) {
html: baseEmail({
title: "Your contributor status has been removed",
paragraphs: [
`Your contributor status has been revoked by an administrator for this reason: "${reason}". If you have any questions or if you believe this was done in error, you may respond directly to this email.`
`Your contributor status has been revoked by an administrator for this reason: "${reason}". If you have any questions or if you believe this was done in error, you may respond directly to this email.`,
],
buttonLinks: []
})
buttonLinks: [],
}),
})

const embed = new EmbedBuilder()
Expand All @@ -72,16 +72,16 @@ export async function removeContributor(e: RemoveContributorInput) {
.setColor(0xef4444)

await webhook.send({
embeds: [embed]
embeds: [embed],
})

return {
success: true
success: true,
}
} catch (error) {
return {
success: false,
message: formatError(error)
message: formatError(error),
}
}
}
Loading
Loading