This commit is contained in:
commit 82cdcdac92
20 changed files with 4775 additions and 0 deletions

41
goauthsocialfrontendtest/.gitignore vendored Normal file
View file

@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# env files (can opt-in for committing if needed)
.env*
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts

View file

@ -0,0 +1,51 @@
## GoAuthSocial Frontend (Next.js)
Пример интерфейса на Next.js для подключения к сервису авторизации **GoAuthSocial** и входа через **Yandex ID**.
### Требования
- Node.js 18+
- Настроенный бэкенд GoAuthSocial с включённым провайдером Yandex
- Зарегистрированное приложение Yandex ID (client_id, redirect_uri)
### Переменные окружения
Создайте файл `.env.local` (см. [`/.env.local.example`](./.env.local.example)) и задайте:
```bash
NEXT_PUBLIC_API_BASE_URL=https://test.ruact.ru # адрес бэкенда GoAuthSocial
NEXT_PUBLIC_YANDEX_CLIENT_ID=xxxxxxxxxxxxxxxxxxxx # client_id из кабинета Yandex
NEXT_PUBLIC_YANDEX_REDIRECT_URI=https://frontend.test.ruact.ru/auth/callback
```
`NEXT_PUBLIC_YANDEX_REDIRECT_URI` должен совпадать с URL, указанный в настройках приложения Yandex ID. На этот адрес вернётся код авторизации, который фронтенд отправит на бэкенд.
### Запуск в разработке
```bash
pnpm install
pnpm dev
```
Откройте [http://localhost:3000](http://localhost:3000). На главной странице расположен брендированный лендинг с официальной кнопкой Yandex ID (через SDK `sdk-suggest`).
### Пользовательский flow
1. Пользователь нажимает кнопку «Войти через Yandex».
2. Yandex SDK перенаправляет на страницу авторизации Yandex ID с указанным `redirect_uri`.
3. После успешного подтверждения Yandex возвращает браузер на `/auth/callback` с `code` и `state`.
4. Страница `/auth/callback` автоматически отправляет `code` на GoAuthSocial (`/api/v1/auth/callback/yandex`).
5. Бэкенд возвращает `AuthCallbackResponse` (access_token, refresh_token, application_token и др.), который отображается пользователю.
Если SDK не загрузился, отображается fallback‑кнопка, которая запрашивает redirect URL у бэкенда (`/api/v1/auth/authorize/yandex`) и вручную выполняет перенаправление.
### Дальнейшая интеграция
- Сохраните `application_token` и токены провайдера в хранилище клиента.
- Организуйте защищённые запросы к вашему API с использованием `application_token`.
- Добавьте обработку ошибок и logout по требованиям продукта.
### Скрипт Yandex ID
Документация: <https://yandex.ru/dev/id/doc/ru/suggest/script-sdk-suggest>
В проекте используется рекомендуемый режим `sdk-suggest` с кнопкой авторизации (`view: "button"`).

View file

@ -0,0 +1,217 @@
'use client';
import Link from "next/link";
import { useEffect, useMemo, useState } from "react";
import { useSearchParams } from "next/navigation";
import { env } from "@/lib/env";
type Status = "loading" | "success" | "error";
interface AuthCallbackResponse {
provider: string;
provider_user_id: string;
access_token: string;
refresh_token?: string | null;
expires_in?: number | null;
application_token?: string | null;
raw?: Record<string, unknown>;
}
export default function YandexCallbackPage() {
const searchParams = useSearchParams();
const [status, setStatus] = useState<Status>("loading");
const [message, setMessage] = useState<string>("Проверяем ответ от Yandex ID…");
const [payload, setPayload] = useState<AuthCallbackResponse | null>(null);
const queryEntries = useMemo(() => {
return Object.fromEntries(searchParams.entries());
}, [searchParams]);
useEffect(() => {
const error = searchParams.get("error");
if (error) {
setStatus("error");
setMessage(
`Яндекс вернул ошибку: ${error}${
searchParams.get("error_description")
? ` (${searchParams.get("error_description")})`
: ""
}`,
);
return;
}
const code = searchParams.get("code");
const state = searchParams.get("state");
if (!code) {
setStatus("error");
setMessage("В ответе отсутствует код авторизации (code).");
return;
}
if (!env.backendBaseUrl) {
setStatus("error");
setMessage("Не указан адрес бэкенда (NEXT_PUBLIC_API_BASE_URL).");
return;
}
const controller = new AbortController();
async function sendCallback() {
try {
setStatus("loading");
setMessage("Передаём код авторизации на бэкенд…");
const response = await fetch(
`${env.backendBaseUrl.replace(/\/$/, "")}/api/v1/auth/callback/yandex`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
credentials: "include",
signal: controller.signal,
body: JSON.stringify({
code,
state,
raw: queryEntries,
}),
},
);
if (!response.ok) {
const text = await response.text();
throw new Error(
`Бэкенд вернул ${response.status}. Тело ответа: ${text || "пусто"}`,
);
}
const data = (await response.json()) as AuthCallbackResponse;
setPayload(data);
setStatus("success");
setMessage("Авторизация завершена успешно.");
} catch (error) {
console.error("Ошибка при обработке ответа от Яндекс.", error);
setStatus("error");
setMessage(
error instanceof Error
? error.message
: "Не удалось обработать ответ от Яндекс.",
);
}
}
void sendCallback();
return () => controller.abort();
}, [queryEntries, searchParams]);
const renderContent = () => {
if (status === "loading") {
return (
<div className="space-y-4 text-center">
<div className="mx-auto h-10 w-10 animate-spin rounded-full border-2 border-white/20 border-t-white/80" />
<p className="text-white/70">{message}</p>
</div>
);
}
if (status === "error") {
return (
<div className="space-y-4 text-center">
<p className="text-lg font-semibold text-red-300">Ошибка авторизации</p>
<p className="text-sm text-red-200/80">{message}</p>
<Link
href="/"
className="inline-flex items-center justify-center rounded-xl bg-white/15 px-6 py-3 text-sm font-semibold text-white transition hover:bg-white/25"
>
Вернуться и попробовать снова
</Link>
</div>
);
}
return (
<div className="space-y-5 text-left">
<div>
<p className="text-sm uppercase tracking-[0.4em] text-white/60">Готово</p>
<h2 className="text-2xl font-semibold text-white">Вход выполнен</h2>
<p className="text-sm text-white/65">
Мы сохранили информацию пользователя и токены в бэкенде и вернули
application_token, который можно использовать для дальнейших запросов.
</p>
</div>
{payload && (
<div className="space-y-3 rounded-2xl bg-black/30 p-5 shadow-inner shadow-white/5">
<Field label="Провайдер" value={payload.provider} />
<Field label="ID пользователя" value={payload.provider_user_id} />
{payload.application_token && (
<Field
label="Application token"
value={payload.application_token}
/>
)}
<Field label="Access token" value={payload.access_token} masked />
{payload.refresh_token && (
<Field label="Refresh token" value={payload.refresh_token} masked />
)}
{typeof payload.expires_in === "number" && (
<Field
label="Истекает через (сек.)"
value={payload.expires_in.toString()}
/>
)}
</div>
)}
<div className="flex flex-col gap-3 text-sm text-white/60">
<p>
Храните токены в безопасном месте и используйте их для обращения к
API вашего сервиса. Для завершения сессии удалите токены на стороне
клиента и выполните логаут на сервере.
</p>
<Link
href="/"
className="inline-flex w-fit items-center justify-center rounded-xl bg-yellow-300 px-6 py-3 font-semibold text-stone-950 transition hover:bg-yellow-200"
>
Вернуться на главную
</Link>
</div>
</div>
);
};
return (
<div className="flex min-h-screen items-center justify-center bg-gradient-to-br from-[#090916] via-[#12122c] to-[#05050b] px-4 py-12 text-white">
<main className="w-full max-w-2xl rounded-[28px] border border-white/10 bg-white/5 p-10 shadow-[0_35px_120px_rgba(2,5,33,0.55)] backdrop-blur-2xl">
{renderContent()}
</main>
</div>
);
}
interface FieldProps {
label: string;
value: string;
masked?: boolean;
}
function Field({ label, value, masked }: FieldProps) {
const displayValue =
masked && value
? `${value.slice(0, 4)}••••${value.slice(-4)}`
: value || "—";
return (
<div className="flex flex-col rounded-xl border border-white/10 bg-black/30 px-4 py-3">
<span className="text-xs uppercase tracking-[0.3em] text-white/50">
{label}
</span>
<span className="mt-1 font-mono text-sm text-white/85">{displayValue}</span>
</div>
);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View file

@ -0,0 +1,27 @@
@import "tailwindcss";
:root {
--background: #ffffff;
--foreground: #171717;
}
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--font-sans: var(--font-geist-sans);
--font-mono: var(--font-geist-mono);
}
@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}
body {
margin: 0;
min-height: 100vh;
background: var(--background);
color: var(--foreground);
}

View file

@ -0,0 +1,35 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = {
title: "GoAuthSocial · Yandex ID Demo",
description:
"Пример фронтенда для подключения Yandex ID к сервису GoAuthSocial.",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="ru">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
</body>
</html>
);
}

View file

@ -0,0 +1,53 @@
import { YandexLoginButton } from "@/components/YandexLoginButton";
export default function Home() {
return (
<div className="flex min-h-screen items-center justify-center bg-gradient-to-br from-[#090916] via-[#12122c] to-[#05050b] px-4 py-12 text-white">
<main className="w-full max-w-xl rounded-[28px] border border-white/10 bg-white/5 p-10 shadow-[0_35px_120px_rgba(2,5,33,0.55)] backdrop-blur-2xl">
<header className="mb-8 flex flex-col gap-2 text-center">
<p className="text-sm uppercase tracking-[0.4em] text-white/70">
GoAuthSocial
</p>
<h1 className="text-3xl font-semibold leading-snug md:text-4xl">
Единая авторизация через Yandex ID
</h1>
<p className="text-base text-white/60">
Подключите социальную авторизацию от Яндекса в один клик. Нажмите
кнопку ниже, чтобы продолжить.
</p>
</header>
<section className="space-y-6 rounded-2xl bg-black/30 p-8 shadow-inner shadow-white/5">
<YandexLoginButton />
<p className="text-center text-xs text-white/45">
Авторизуясь, вы будете перенаправлены на защищённую страницу Yandex
ID. После подтверждения мы вернём вас обратно и завершим вход.
</p>
</section>
<footer className="mt-8 grid gap-3 text-sm text-white/40 md:grid-cols-2">
<div>
<p className="font-medium text-white/70">Обратная связь</p>
<a
href="mailto:support@test.ruact.ru"
className="text-white/60 transition hover:text-white/90"
>
support@test.ruact.ru
</a>
</div>
<div>
<p className="font-medium text-white/70">Документация</p>
<a
href="https://yandex.ru/dev/id/doc/ru/"
target="_blank"
rel="noreferrer"
className="text-white/60 transition hover:text-white/90"
>
Руководство Yandex ID
</a>
</div>
</footer>
</main>
</div>
);
}

View file

@ -0,0 +1,230 @@
'use client';
import type { JSX } from "react";
import { useEffect, useMemo, useRef, useState } from "react";
import { assertClientEnv, env } from "@/lib/env";
type ButtonStatus = "initial" | "ready" | "fallback" | "error";
declare global {
interface Window {
YaAuthSuggest?: {
init: (
config: Record<string, unknown>,
origin: string,
options: Record<string, unknown>,
) => Promise<{
handler: {
on: (event: string, callback: () => void) => void;
redirect: () => void;
};
}>;
};
}
}
const YANDEX_SDK_URL =
"https://yastatic.net/s3/passport-sdk/autofill/v1/sdk-suggest.min.js";
const YANDEX_SDK_ORIGIN =
"https://yastatic.net/s3/passport-sdk/autofill/v1/";
async function requestBackendRedirect(): Promise<string | null> {
if (!env.backendBaseUrl) {
return null;
}
try {
const response = await fetch(
`${env.backendBaseUrl.replace(
/\/$/,
"",
)}/api/v1/auth/authorize/yandex`,
{
method: "GET",
headers: {
Accept: "application/json",
},
credentials: "include",
},
);
if (!response.ok) {
console.error(
"Не удалось получить redirect URL с бэкенда",
response.status,
);
return null;
}
const payload = await response.json();
return payload?.redirect_uri ?? null;
} catch (error) {
console.error("Ошибка при запросе redirect URL", error);
return null;
}
}
export function YandexLoginButton(): JSX.Element {
const containerRef = useRef<HTMLDivElement | null>(null);
const [status, setStatus] = useState<ButtonStatus>("initial");
const [errorMessage, setErrorMessage] = useState<string | null>(null);
const missingEnv = useMemo(() => assertClientEnv(), []);
useEffect(() => {
if (missingEnv.length > 0) {
setErrorMessage(
`Не заданы переменные окружения: ${missingEnv.join(
", ",
)}. Кнопка Яндекс ID будет скрыта.`,
);
setStatus("error");
return;
}
if (!containerRef.current) {
return;
}
const initializeButton = () => {
if (!window.YaAuthSuggest) {
setErrorMessage("Yandex ID SDK недоступен.");
setStatus("fallback");
return;
}
window.YaAuthSuggest.init(
{
client_id: env.yandexClientId,
response_type: "code",
redirect_uri: env.yandexRedirectUri,
},
YANDEX_SDK_ORIGIN,
{
view: "button",
parentId: containerRef.current?.id ?? "",
buttonView: "main",
buttonTheme: "dark",
buttonSize: "l",
buttonBorderRadius: "16",
buttonIcon: "ya",
},
)
.then((result) => {
setStatus("ready");
const { handler } = result;
const host = containerRef.current;
if (handler && typeof handler.on === "function") {
handler.on("click", () => {
try {
handler.redirect();
} catch (error) {
console.error(
"Ошибка redirect через handler, fallback к бэкенду",
error,
);
void handleFallback();
}
});
} else if (host) {
host.addEventListener("click", () => {
if (typeof handler?.redirect === "function") {
handler.redirect();
} else {
void handleFallback();
}
});
}
})
.catch((error) => {
console.error("Ошибка инициализации Yandex ID", error);
setErrorMessage("Не удалось инициализировать кнопку Yandex ID.");
setStatus("fallback");
});
};
const existingScript = document.querySelector<HTMLScriptElement>(
`script[src="${YANDEX_SDK_URL}"]`,
);
if (existingScript?.dataset.loaded === "true") {
initializeButton();
return;
}
const script = existingScript ?? document.createElement("script");
if (!existingScript) {
script.src = YANDEX_SDK_URL;
script.async = true;
script.dataset.loaded = "false";
script.onload = () => {
script.dataset.loaded = "true";
initializeButton();
};
script.onerror = () => {
setErrorMessage("Не удалось загрузить Yandex ID SDK.");
setStatus("fallback");
};
document.body.appendChild(script);
} else if (existingScript.dataset.loaded === "true") {
initializeButton();
} else {
existingScript.addEventListener("load", initializeButton, { once: true });
existingScript.addEventListener(
"error",
() => {
setErrorMessage("Не удалось загрузить Yandex ID SDK.");
setStatus("fallback");
},
{ once: true },
);
}
return () => {
existingScript?.removeEventListener("load", initializeButton);
};
}, [missingEnv]);
const handleFallback = async () => {
setStatus("fallback");
const target = await requestBackendRedirect();
if (target) {
window.location.href = target;
} else {
setErrorMessage(
"Не удалось автоматически перенаправить на авторизацию Яндекс. Попробуйте позже.",
);
setStatus("error");
}
};
return (
<div className="flex flex-col items-center gap-4">
<div
id="ya-oauth-button"
ref={containerRef}
className={
status === "fallback" || status === "error" ? "hidden" : "flex"
}
/>
{(status === "fallback" || status === "error") && (
<button
type="button"
onClick={handleFallback}
className="inline-flex w-full items-center justify-center gap-2 rounded-xl bg-yellow-300 px-5 py-3 text-sm font-semibold text-stone-950 shadow transition hover:bg-yellow-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-yellow-400"
>
Продолжить через Яндекс
</button>
)}
{errorMessage && (
<p className="text-center text-sm text-red-300" role="alert">
{errorMessage}
</p>
)}
</div>
);
}

View file

@ -0,0 +1,18 @@
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
]),
]);
export default eslintConfig;

View file

@ -0,0 +1,19 @@
export const env = {
backendBaseUrl: process.env.NEXT_PUBLIC_API_BASE_URL ?? "",
yandexClientId: process.env.NEXT_PUBLIC_YANDEX_CLIENT_ID ?? "",
yandexRedirectUri: process.env.NEXT_PUBLIC_YANDEX_REDIRECT_URI ?? "",
};
export function assertClientEnv(): string[] {
const missing: string[] = [];
if (!env.backendBaseUrl) {
missing.push("NEXT_PUBLIC_API_BASE_URL");
}
if (!env.yandexClientId) {
missing.push("NEXT_PUBLIC_YANDEX_CLIENT_ID");
}
if (!env.yandexRedirectUri) {
missing.push("NEXT_PUBLIC_YANDEX_REDIRECT_URI");
}
return missing;
}

View file

@ -0,0 +1,7 @@
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
};
export default nextConfig;

View file

@ -0,0 +1,26 @@
{
"name": "goauthsocialfrontendtest",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint"
},
"dependencies": {
"react": "19.2.0",
"react-dom": "19.2.0",
"next": "16.0.0"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"@tailwindcss/postcss": "^4",
"tailwindcss": "^4",
"eslint": "^9",
"eslint-config-next": "16.0.0"
}
}

4005
goauthsocialfrontendtest/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
const config = {
plugins: {
"@tailwindcss/postcss": {},
},
};
export default config;

View file

@ -0,0 +1 @@
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>

After

Width:  |  Height:  |  Size: 391 B

View file

@ -0,0 +1 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -0,0 +1 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>

After

Width:  |  Height:  |  Size: 128 B

View file

@ -0,0 +1 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>

After

Width:  |  Height:  |  Size: 385 B

View file

@ -0,0 +1,34 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts",
"**/*.mts"
],
"exclude": ["node_modules"]
}