Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

small fixes

Steven Tey5e91e20ff456
diff --git a/components/app/modals/archive-link-modal.tsx b/components/app/modals/archive-link-modal.tsx
index 62c1ea0d7f..5660b0149f 100644
--- a/components/app/modals/archive-link-modal.tsx
+++ b/components/app/modals/archive-link-modal.tsx
@@ -43,7 +43,7 @@ function ArchiveLinkModal({
setShowModal={setShowArchiveLinkModal}
>
<div className="inline-block w-full sm:max-w-md overflow-hidden align-middle transition-all transform bg-white sm:border sm:border-gray-200 shadow-xl sm:rounded-2xl">
- <div className="flex flex-col justify-center items-center space-y-3 sm:px-16 px-4 pt-8 py-4 border-b border-gray-200">
+ <div className="flex flex-col justify-center items-center text-center space-y-3 sm:px-16 px-4 pt-8 py-4 border-b border-gray-200">
<BlurImage
src={`https://www.google.com/s2/favicons?sz=64&domain_url=${apexDomain}`}
alt={apexDomain}
@@ -52,7 +52,7 @@ function ArchiveLinkModal({
height={20}
/>
<h3 className="font-medium text-lg">Archive {shortlink}</h3>
- <p className="text-sm text-gray-500 text-center">
+ <p className="text-sm text-gray-500">
Archived links will still work - they just won't show up on your
main dashboard.
</p>
diff --git a/components/home/globe.tsx b/components/home/globe.tsx
index 5cad87ee31..6ad32c82c2 100644
--- a/components/home/globe.tsx
+++ b/components/home/globe.tsx
@@ -85,41 +85,37 @@ const GlobeAnimation = ({
const pointerInteracting = useRef(null);
const pointerInteractionMovement = useRef(0);
- const DPR = 1;
-
const [{ r }, api] = useSpring(() => ({
r: 0,
config: {
mass: 1,
tension: 280,
- friction: 40,
+ friction: 60,
precision: 0.001,
},
}));
useEffect(() => {
- let phi = 0;
+ let phi = -0.5;
let width = 0;
const onResize = () =>
canvasRef.current && (width = canvasRef.current.offsetWidth);
window.addEventListener("resize", onResize);
onResize();
const globe = createGlobe(canvasRef.current, {
- context: {
- antialias: false,
- },
- devicePixelRatio: DPR,
- width: width * DPR,
- height: width * DPR,
- phi: 0,
- theta: 0.3,
+ devicePixelRatio: 1,
+ width,
+ height: width,
+ phi,
+ theta: 0.15,
dark: 0,
- diffuse: 3,
+ diffuse: 1.2,
+ scale: 1,
mapSamples: 20000,
mapBrightness: 4,
baseColor: [1, 1, 1],
markerColor: [249 / 255, 115 / 255, 22 / 255],
- // rgb(249, 115, 22)
+ offset: [0, 0],
glowColor: [0.8, 0.8, 0.8],
markers: markers || [],
onRender: (state) => {
@@ -127,13 +123,14 @@ const GlobeAnimation = ({
// `state` will be an empty object, return updated params.
phi += 0.002;
state.phi = phi + r.get();
- state.width = width * DPR;
- state.height = width * DPR;
+ state.width = width;
+ state.height = width;
},
});
setTimeout(() => (canvasRef.current.style.opacity = "1"));
return () => globe.destroy();
}, [markers]);
+
const [showModal, setShowModal] = useState(true);
return (
@@ -157,7 +154,7 @@ const GlobeAnimation = ({
</button>
<Drag className="h-12 w-12 mx-auto mb-2 sm:mb-4 text-gray-700" />
<p className="text-center text-gray-700 text-sm sm:text-base">
- This map shows the locations of the last 100 clicks on{" "}
+ This map shows the locations of the last 50 clicks on{" "}
<a
className="text-blue-800 font-semibold"
href={domain ? `https://${domain}` : "https://dub.sh/github"}
diff --git a/pages/api/edge/coordinates.ts b/pages/api/edge/coordinates.ts
index e875c24277..70f8287b76 100644
--- a/pages/api/edge/coordinates.ts
+++ b/pages/api/edge/coordinates.ts
@@ -8,7 +8,7 @@ export const config = {
export default async function handler(req: NextRequest) {
if (req.method === "GET") {
- const numPoints = 100;
+ const numPoints = 50;
const domain = req.nextUrl.searchParams.get("domain");
const rawData = await redis.zrange<RawStatsProps[]>(
domain ? `${domain}:root:clicks` : "dub.sh:clicks:github",
@@ -20,7 +20,7 @@ export default async function handler(req: NextRequest) {
const { latitude, longitude } = data.geo;
return {
location: [latitude, longitude],
- size: 0.1 - (0.1 / numPoints) * idx,
+ size: 0.05 - (0.05 / numPoints) * idx,
};
});
return new Response(JSON.stringify(latestCoordinates), { status: 200 });