diff --git a/apps/api/package.json b/apps/api/package.json index 99e58cf9..ac4dd6b5 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -8,7 +8,7 @@ "test": "echo \"Error: no test specified\" && exit 1", "dev": "tsx src/index.ts", "build": "prisma generate && tsc", - "postinstall": "[ -f prisma/schema.prisma ] && prisma generate || true" + "postinstall": "node -e \"const fs = require('fs'); if (fs.existsSync('prisma/schema.prisma')) { require('child_process').execSync('prisma generate', { stdio: 'inherit' }); }\"" }, "keywords": [], "author": "Ajeet Pratpa Singh", diff --git a/apps/api/prisma/dev.db b/apps/api/prisma/dev.db new file mode 100644 index 00000000..e69de29b diff --git a/apps/api/prisma/schema.prisma b/apps/api/prisma/schema.prisma index eae3c69b..aabd7e20 100644 --- a/apps/api/prisma/schema.prisma +++ b/apps/api/prisma/schema.prisma @@ -3,7 +3,7 @@ generator client { } datasource db { - provider = "postgresql" + provider = "sqlite" url = env("DATABASE_URL") } diff --git a/apps/api/src/prisma.ts b/apps/api/src/prisma.ts index 0850613b..669d4450 100644 --- a/apps/api/src/prisma.ts +++ b/apps/api/src/prisma.ts @@ -23,38 +23,38 @@ const basePrisma = new PrismaClient({ const prisma = basePrisma.$extends({ query: { account: { - async create({ args, query }) { + async create({ args, query }: any) { args.data = encryptAccountTokens(args.data); const result = await query(args); return decryptAccountTokens(result); }, - async update({ args, query }) { + async update({ args, query }: any) { args.data = encryptAccountTokens(args.data); const result = await query(args); return decryptAccountTokens(result); }, - async upsert({ args, query }) { + async upsert({ args, query }: any) { args.create = encryptAccountTokens(args.create); args.update = encryptAccountTokens(args.update); const result = await query(args); return decryptAccountTokens(result); }, - async findUnique({ args, query }) { + async findUnique({ args, query }: any) { const result = await query(args); return decryptAccountTokens(result); }, - async findFirst({ args, query }) { + async findFirst({ args, query }: any) { const result = await query(args); return decryptAccountTokens(result); }, - async findMany({ args, query }) { + async findMany({ args, query }: any) { const result = await query(args); return result?.map((account: any) => decryptAccountTokens(account)); }, }, user: { // Decrypt nested accounts in user queries - async findUnique({ args, query }) { + async findUnique({ args, query }: any) { const result = await query(args); if (result?.accounts) { result.accounts = Array.isArray(result.accounts) @@ -65,7 +65,7 @@ const prisma = basePrisma.$extends({ } return result; }, - async findFirst({ args, query }) { + async findFirst({ args, query }: any) { const result = await query(args); if (result?.accounts) { result.accounts = Array.isArray(result.accounts) @@ -76,7 +76,7 @@ const prisma = basePrisma.$extends({ } return result; }, - async findMany({ args, query }) { + async findMany({ args, query }: any) { const result = await query(args); return result?.map((user: any) => { if (user?.accounts) { diff --git a/apps/web/src/app/(main)/(landing)/pricing/page.tsx b/apps/web/src/app/(main)/(landing)/pricing/page.tsx index 12ac4dfb..727c0797 100644 --- a/apps/web/src/app/(main)/(landing)/pricing/page.tsx +++ b/apps/web/src/app/(main)/(landing)/pricing/page.tsx @@ -370,8 +370,8 @@ const Pricing = () => { -
-
+
+
{ })}
-
+
@@ -641,7 +644,10 @@ const SecondaryPricingCard = ({ callbackUrl }: { callbackUrl: string }) => { })} -
+
diff --git a/apps/web/src/components/ui/flickering-grid.tsx b/apps/web/src/components/ui/flickering-grid.tsx index cef712de..7c510120 100644 --- a/apps/web/src/components/ui/flickering-grid.tsx +++ b/apps/web/src/components/ui/flickering-grid.tsx @@ -75,11 +75,14 @@ export const FlickeringGrid: React.FC = ({ const updateSquares = useCallback( (squares: Float32Array, deltaTime: number) => { + const updatedIndices: number[] = []; for (let i = 0; i < squares.length; i++) { if (Math.random() < flickerChance * deltaTime) { squares[i] = Math.random() * maxOpacity; + updatedIndices.push(i); } } + return updatedIndices; }, [flickerChance, maxOpacity], ); @@ -114,6 +117,30 @@ export const FlickeringGrid: React.FC = ({ [memoizedColor, squareSize, gridGap], ); + const drawUpdatedSquares = useCallback( + ( + ctx: CanvasRenderingContext2D, + rows: number, + squares: Float32Array, + dpr: number, + updatedIndices: number[], + ) => { + for (const idx of updatedIndices) { + const i = Math.floor(idx / rows); + const j = idx % rows; + const opacity = squares[idx]; + const x = i * (squareSize + gridGap) * dpr; + const y = j * (squareSize + gridGap) * dpr; + const size = squareSize * dpr; + + ctx.clearRect(x, y, size, size); + ctx.fillStyle = `${memoizedColor}${opacity})`; + ctx.fillRect(x, y, size, size); + } + }, + [memoizedColor, squareSize, gridGap], + ); + useEffect(() => { const canvas = canvasRef.current; const container = containerRef.current; @@ -130,6 +157,16 @@ export const FlickeringGrid: React.FC = ({ const newHeight = height || container.clientHeight; setCanvasSize({ width: newWidth, height: newHeight }); gridParams = setupCanvas(canvas, newWidth, newHeight); + + drawGrid( + ctx, + canvas.width, + canvas.height, + gridParams.cols, + gridParams.rows, + gridParams.squares, + gridParams.dpr, + ); }; updateCanvasSize(); @@ -141,15 +178,13 @@ export const FlickeringGrid: React.FC = ({ const deltaTime = (time - lastTime) / 1000; lastTime = time; - updateSquares(gridParams.squares, deltaTime); - drawGrid( + const updatedIndices = updateSquares(gridParams.squares, deltaTime); + drawUpdatedSquares( ctx, - canvas.width, - canvas.height, - gridParams.cols, gridParams.rows, gridParams.squares, gridParams.dpr, + updatedIndices ); animationFrameId = requestAnimationFrame(animate); }; diff --git a/apps/web/src/components/ui/shine-borders.tsx b/apps/web/src/components/ui/shine-borders.tsx index c9ae17c5..0ad0ef75 100644 --- a/apps/web/src/components/ui/shine-borders.tsx +++ b/apps/web/src/components/ui/shine-borders.tsx @@ -35,27 +35,59 @@ export function ShineBorder({ style, ...props }: ShineBorderProps) { + const containerRef = React.useRef(null); + const [isVisible, setIsVisible] = React.useState(true); + + React.useEffect(() => { + const observer = new IntersectionObserver( + ([entry]) => { + setIsVisible(entry.isIntersecting); + }, + { rootMargin: "150px" } + ); + if (containerRef.current) observer.observe(containerRef.current); + return () => observer.disconnect(); + }, []); + + const gradientColor = Array.isArray(shineColor) ? shineColor.join(",") : shineColor; + return ( -
+ <> + +
+
+
+ ); }