mirror of
https://github.com/ThisTine/Snip.git
synced 2026-10-18 02:51:38 +07:00
- Ink-first palette, drop gradients/glow; tabular numbers
- Home: form stays put, results stack below and auto-copy; paste shortens instantly
- Hold-to-delete replaces the delete confirm modal
- Copy buttons morph to a check instead of toasting
- Motion: CSS press feedback, custom ease-out, origin-aware menu, faster exits,
no animation on frequent/keyboard actions, reduced-motion respected
- Fix: scheme-less URLs ("example.com") were blocked by native validation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import { StrictMode } from "react";
|
|
import { createRoot } from "react-dom/client";
|
|
import { BrowserRouter } from "react-router-dom";
|
|
import { MotionConfig } from "framer-motion";
|
|
import App from "./App";
|
|
import { ThemeProvider } from "./context/ThemeContext";
|
|
import { AuthProvider } from "./context/AuthContext";
|
|
import { ToastProvider } from "./components/ui/Toast";
|
|
import { api } from "./lib/api";
|
|
import { setShortDomain } from "./lib/format";
|
|
import "./index.css";
|
|
|
|
function render() {
|
|
createRoot(document.getElementById("root")!).render(
|
|
<StrictMode>
|
|
{/* Honour the OS "reduce motion" setting: framer drops transforms, keeps fades. */}
|
|
<MotionConfig reducedMotion="user">
|
|
<ThemeProvider>
|
|
<AuthProvider>
|
|
<ToastProvider>
|
|
<BrowserRouter>
|
|
<App />
|
|
</BrowserRouter>
|
|
</ToastProvider>
|
|
</AuthProvider>
|
|
</ThemeProvider>
|
|
</MotionConfig>
|
|
</StrictMode>,
|
|
);
|
|
}
|
|
|
|
// Pull the short-link domain from the server so it isn't hardcoded. Don't block
|
|
// first paint on it — render after config resolves or a short timeout.
|
|
const config = api
|
|
.config()
|
|
.then((c) => setShortDomain(c.shortDomain))
|
|
.catch(() => {});
|
|
Promise.race([config, new Promise((r) => setTimeout(r, 800))]).finally(render);
|