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.

improved globe modal

Steven Teye6a81a1fefbf
diff --git a/components/home/globe.tsx b/components/home/globe.tsx
index 82cb7a0482..61d321033b 100644
--- a/components/home/globe.tsx
+++ b/components/home/globe.tsx
@@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from "react";
import createGlobe from "cobe";
import { useSpring } from "react-spring";
import useSWR from "swr";
-import { X } from "@/components/shared/icons";
+import { Drag, X } from "@/components/shared/icons";
import { fetcher } from "@/lib/utils";
import { motion, AnimatePresence } from "framer-motion";
@@ -79,12 +79,13 @@ export default function Globe() {
className="group absolute left-0 right-0 mx-auto z-10 max-w-sm px-5 py-7 rounded-md bg-white border border-gray-200 shadow-md"
>
<button
- className="visible sm:invisible group-hover:visible absolute top-0 right-0 p-1 m-2 rounded-full float-right group hover:bg-gray-100 focus:outline-none active:scale-75 transition-all duration-75"
+ className="visible sm:invisible group-hover:visible absolute top-0 right-0 p-1 m-3 rounded-full float-right group hover:bg-gray-100 focus:outline-none active:scale-75 transition-all duration-75"
autoFocus={false}
onClick={() => setShowModal(false)}
>
- <X className="w-3 h-3" />
+ <X className="w-4 h-4" />
</button>
+ <Drag className="h-12 w-12 mx-auto mb-4 text-gray-700 animate-wiggle" />
<p className="text-center text-gray-700 text-sm sm:text-base">
This map shows the locations of the last 30 clicks on{" "}
<a
diff --git a/components/shared/icons/drag.tsx b/components/shared/icons/drag.tsx
new file mode 100644
index 0000000000..5277a14504
--- /dev/null
+++ b/components/shared/icons/drag.tsx
@@ -0,0 +1,57 @@
+export default function Drag({ className }: { className: string }) {
+ return (
+ <svg
+ fill="currentColor"
+ shapeRendering="geometricPrecision"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ viewBox="0 0 700 700"
+ width="700"
+ height="700"
+ className={className}
+ >
+ <path d="M449.53 315.65v-36.457c0-13.953-10.734-25.301-23.48-25.301-12.812 0-23.551 11.352-23.551 25.301v38.645a7.656 7.656 0 11-15.312 0v-49.254c0-13.949-9.961-25.77-22.707-25.77h-.723c-12.418 0-22.508 11.246-23.602 24.703v55.453a7.656 7.656 0 11-15.312 0v-53.84c0-.184-.02-.371-.02-.559 0-.437.02-.875.02-1.312v-125.9c0-13.953-10.113-25.301-22.86-25.301s-22.882 11.344-22.894 25.28l-.13 208.8a7.649 7.649 0 01-13.562 4.856l-24.926-30.344h-.004a37.44 37.44 0 00-26.414-13.973 36.629 36.629 0 00-27.512 9.883c-.094.086-.191.203-.293.285l-4.55 3.828 86.241 165.66c13.555 26.043 39.176 42.328 66.863 42.328h99.914c42.23 0 76.621-37.148 76.664-82.688.024-24.18.047-42.367.067-57 .05-39.266.07-54.156-.031-97.395-.032-13.91-10.402-25.422-23.113-25.422h-.684c-12.742.004-22.777 11.801-22.777 25.754v19.742a7.656 7.656 0 11-15.312 0zM157.66 83.723l42.238 42.242v-.004a7.648 7.648 0 0010.828 0 7.802 7.802 0 000-10.945l-30.68-30.797h277.14V68.907h-275.43l28.97-28.852a7.62 7.62 0 00-.048-10.78 7.624 7.624 0 00-10.78.042L160.048 69.18a7.659 7.659 0 00-2.39 14.543zM521.51 39.887c20.859 8.64 30.766 32.555 22.125 53.414-8.64 20.859-32.555 30.766-53.414 22.125s-30.766-32.555-22.125-53.414 32.555-30.766 53.414-22.125"></path>
+ <use x="70" y="576.406"></use>
+ <use x="74.012" y="576.406"></use>
+ <use x="76.711" y="576.406"></use>
+ <use x="80.418" y="576.406"></use>
+ <use x="84.109" y="576.406"></use>
+ <use x="86.723" y="576.406"></use>
+ <use x="90.434" y="576.406"></use>
+ <use x="96.25" y="576.406"></use>
+ <use x="100.168" y="576.406"></use>
+ <use x="105.637" y="576.406"></use>
+ <use x="109.871" y="576.406"></use>
+ <use x="111.746" y="576.406"></use>
+ <use x="114.445" y="576.406"></use>
+ <use x="118.133" y="576.406"></use>
+ <use x="123.934" y="576.406"></use>
+ <use x="127.871" y="576.406"></use>
+ <use x="131.766" y="576.406"></use>
+ <use x="135.453" y="576.406"></use>
+ <use x="138.711" y="576.406"></use>
+ <use x="141.324" y="576.406"></use>
+ <use x="144.02" y="576.406"></use>
+ <use x="70" y="581.875"></use>
+ <use x="72.379" y="581.875"></use>
+ <use x="75.078" y="581.875"></use>
+ <use x="78.832" y="581.875"></use>
+ <use x="86.438" y="581.875"></use>
+ <use x="89.051" y="581.875"></use>
+ <use x="92.941" y="581.875"></use>
+ <use x="98.555" y="581.875"></use>
+ <use x="103.133" y="581.875"></use>
+ <use x="106.891" y="581.875"></use>
+ <use x="110.785" y="581.875"></use>
+ <use x="116.582" y="581.875"></use>
+ <use x="120.59" y="581.875"></use>
+ <use x="123.285" y="581.875"></use>
+ <use x="127.043" y="581.875"></use>
+ <use x="128.918" y="581.875"></use>
+ <use x="132.625" y="581.875"></use>
+ <use x="135.867" y="581.875"></use>
+ </svg>
+ );
+}
diff --git a/components/shared/icons/index.tsx b/components/shared/icons/index.tsx
index 20d59cac29..ccf61b70a1 100644
--- a/components/shared/icons/index.tsx
+++ b/components/shared/icons/index.tsx
@@ -21,3 +21,4 @@ export { default as CheckCircleFill } from "./check-circle-fill";
export { default as PlusCircle } from "./plus-circle";
export { default as Link } from "./link";
export { default as Infinity } from "./infinity";
+export { default as Drag } from "./drag";
diff --git a/pages/index.tsx b/pages/index.tsx
index 78d385d4c4..32cd66b3f7 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -190,7 +190,7 @@ const Demo = () => {
const Features = () => {
return (
- <div>
+ <div className="h-96 bg-blue-600">
{/* <h2 className="text-3xl font-display font-semibold text-black mt-10">
Features
</h2> */}
diff --git a/tailwind.config.js b/tailwind.config.js
index d792b27e41..9686cc394b 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -16,6 +16,8 @@ module.exports = {
"slide-right-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)",
"slide-down-fade": "slide-down-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)",
"slide-left-fade": "slide-left-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)",
+ // Custom wiggle animation
+ wiggle: "wiggle 1.5s infinite",
},
keyframes: {
// Tooltip
@@ -35,6 +37,18 @@ module.exports = {
"0%": { opacity: 0, transform: "translateX(2px)" },
"100%": { opacity: 1, transform: "translateX(0)" },
},
+ // Custom wiggle animation
+ wiggle: {
+ "0%, 100%": {
+ transform: "translateX(0%)",
+ transformOrigin: "50% 50%",
+ },
+ "15%": { transform: "translateX(-6px) rotate(-6deg)" },
+ "30%": { transform: "translateX(9px) rotate(6deg)" },
+ "45%": { transform: "translateX(-9px) rotate(-3.6deg)" },
+ "60%": { transform: "translateX(3px) rotate(2.4deg)" },
+ "75%": { transform: "translateX(-2px) rotate(-1.2deg)" },
+ },
},
},
},