🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
refactor: Enhance button accessibility and styling across multiple components
Bill Yangf57519e5da32
diff --git a/client/src/app/subscribe/page.tsx b/client/src/app/subscribe/page.tsxindex dfe16bb69..bc52a6675 100644--- a/client/src/app/subscribe/page.tsx+++ b/client/src/app/subscribe/page.tsx@@ -198,7 +198,7 @@ export default function Subscribe() {<div className="flex gap-3 mb-2 text-sm"><buttononClick={() => setIsAnnual(false)}- className={`px-3 py-1 rounded-full transition-colors ${+ className={`px-3 py-1 rounded-full transition-colors cursor-pointer ${!isAnnual? "bg-emerald-500/20 text-emerald-400 font-medium": "text-neutral-400 hover:text-neutral-200"@@ -208,7 +208,7 @@ export default function Subscribe() {</button><buttononClick={() => setIsAnnual(true)}- className={`px-3 py-1 rounded-full transition-colors ${+ className={`px-3 py-1 rounded-full transition-colors cursor-pointer ${isAnnual? "bg-emerald-500/20 text-emerald-400 font-medium": "text-neutral-400 hover:text-neutral-200"@@ -278,7 +278,7 @@ export default function Subscribe() {<buttononClick={handleSubscribe}- className="w-full bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-5 py-3 rounded-xl shadow-lg shadow-emerald-900/20 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-opacity-50 disabled:opacity-50 disabled:pointer-events-none"+ className="w-full bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-5 py-3 rounded-xl shadow-lg shadow-emerald-900/20 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-opacity-50 disabled:opacity-50 disabled:pointer-events-none cursor-pointer"disabled={isLoading}>{isLoadingdiff --git a/docs/src/app/components/PricingSection.jsx b/docs/src/app/components/PricingSection.jsxindex 647203877..bff220348 100644--- a/docs/src/app/components/PricingSection.jsx+++ b/docs/src/app/components/PricingSection.jsx@@ -7,7 +7,14 @@ import { useState } from "react";// Available event tiers for the sliderconst EVENT_TIERS = [- 100_000, 250_000, 500_000, 1_000_000, 2_000_000, 5_000_000, 10_000_000, "Custom",+ 100_000,+ 250_000,+ 500_000,+ 1_000_000,+ 2_000_000,+ 5_000_000,+ 10_000_000,+ "Custom",];// Define plan features@@ -17,7 +24,7 @@ const PRO_FEATURES = ["Real-time analytics","Custom events","Funnels & user flows",- "All features"+ "All features",];export const formatter = Intl.NumberFormat("en", {@@ -36,27 +43,27 @@ function getFormattedPrice(eventLimit, isAnnual) {else if (eventLimit <= 5_000_000) monthlyPrice = 149;else if (eventLimit <= 10_000_000) monthlyPrice = 249; // 10M eventselse return { custom: true }; // 10M+ events - custom pricing-+// Annual prices are 10x monthly (2 months free)const annualPrice = monthlyPrice * 10;return {monthly: monthlyPrice,- annual: annualPrice+ annual: annualPrice,};}export function PricingSection() {const [eventLimitIndex, setEventLimitIndex] = useState(0); // Default to 100k (index 0)const [isAnnual, setIsAnnual] = useState(true);-+const eventLimit = EVENT_TIERS[eventLimitIndex];const prices = getFormattedPrice(eventLimit, isAnnual);-+// Handle slider changesfunction handleSliderChange(value) {setEventLimitIndex(value[0]);}-+return (<section className="py-16 md:py-24 w-full"><div className="max-w-7xl mx-auto px-4">@@ -64,27 +71,29 @@ export function PricingSection() {<div className="inline-block bg-emerald-900/30 text-emerald-400 px-3 py-1 rounded-full text-sm font-medium mb-4">Simple Pricing</div>- <h2 className="text-3xl md:text-4xl font-bold">Transparent Pricing</h2>+ <h2 className="text-3xl md:text-4xl font-bold">+ Transparent Pricing+ </h2><p className="mt-4 text-neutral-300 max-w-2xl mx-auto">Privacy-friendly analytics with all the features you need to grow</p></div>-+{/* Pricing card with background gradients */}<div className="relative max-w-lg mx-auto mb-10">{/* Background gradients - overlapping circles for organic feel */}<div className="absolute top-0 left-0 w-[400px] h-[400px] bg-emerald-500/30 rounded-full blur-[80px] opacity-60"></div><div className="absolute top-20 left-20 w-[300px] h-[300px] bg-emerald-600/20 rounded-full blur-[70px] opacity-40"></div>-+<div className="absolute bottom-0 right-0 w-[350px] h-[350px] bg-blue-500/30 rounded-full blur-[80px] opacity-50"></div><div className="absolute bottom-40 right-20 w-[250px] h-[250px] bg-indigo-500/20 rounded-full blur-[75px] opacity-40"></div>-+<div className="absolute top-1/4 right-0 w-[200px] h-[200px] bg-purple-500/30 rounded-full blur-[70px] opacity-40"></div>-+<div className="absolute bottom-1/3 left-0 w-[220px] h-[220px] bg-emerald-400/20 rounded-full blur-[70px] opacity-50"></div>-+<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[350px] h-[350px] bg-indigo-400/20 rounded-full blur-[80px] opacity-40"></div>-+{/* Card with relative positioning and higher z-index */}<div className="relative z-10 bg-neutral-800/50 rounded-xl border border-neutral-700 overflow-hidden backdrop-blur-sm shadow-xl"><div className="p-6">@@ -103,33 +112,48 @@ export function PricingSection() {<div className="flex flex-col items-end">{/* Billing toggle */}<div className="flex gap-3 mb-2 text-sm">- <button+ <buttononClick={() => setIsAnnual(false)}- className={`px-3 py-1 rounded-full transition-colors ${!isAnnual- ? "bg-emerald-500/20 text-emerald-400 font-medium"- : "text-neutral-400 hover:text-neutral-200"}`}+ className={`px-3 py-1 rounded-full transition-colors cursor-pointer ${+ !isAnnual+ ? "bg-emerald-500/20 text-emerald-400 font-medium"+ : "text-neutral-400 hover:text-neutral-200"+ } `}>Monthly</button>- <button+ <buttononClick={() => setIsAnnual(true)}- className={`px-3 py-1 rounded-full transition-colors ${isAnnual- ? "bg-emerald-500/20 text-emerald-400 font-medium"- : "text-neutral-400 hover:text-neutral-200"}`}+ className={`px-3 py-1 rounded-full transition-colors cursor-pointer ${+ isAnnual+ ? "bg-emerald-500/20 text-emerald-400 font-medium"+ : "text-neutral-400 hover:text-neutral-200"+ }`}>- Annual- <span className="ml-1 text-xs text-emerald-500">-17%</span>+ Annual+ <span className="ml-1 text-xs text-emerald-500">+ -17%+ </span></button></div><div className="text-right h-10">- {prices.custom ? <></> : <><span className="text-3xl font-bold">${isAnnual ? Math.round(prices.annual / 12) : prices.monthly}</span>- <span className="ml-1 text-neutral-400">- /month- </span></> }+ {prices.custom ? (+ <></>+ ) : (+ <>+ <span className="text-3xl font-bold">+ $+ {isAnnual+ ? Math.round(prices.annual / 12)+ : prices.monthly}+ </span>+ <span className="ml-1 text-neutral-400">/month</span>+ </>+ )}</div></div></div>-+<SliderdefaultValue={[0]}max={EVENT_TIERS.length - 1}@@ -138,19 +162,27 @@ export function PricingSection() {onValueChange={handleSliderChange}className="mb-3"/>-+<div className="flex justify-between text-xs text-neutral-400">{EVENT_TIERS.map((tier, index) => (<spankey={index}- className={eventLimitIndex === index ? "font-bold text-emerald-400" : ""}+ className={+ eventLimitIndex === index+ ? "font-bold text-emerald-400"+ : ""+ }>- {index === EVENT_TIERS.length - 1 ? "10M+" : tier >= 1_000_000 ? `${tier / 1_000_000}M` : `${tier / 1_000}K`}+ {index === EVENT_TIERS.length - 1+ ? "10M+"+ : tier >= 1_000_000+ ? `${tier / 1_000_000}M`+ : `${tier / 1_000}K`}</span>))}</div></div>-+<div className="space-y-4 mb-6">{PRO_FEATURES.map((feature, i) => (<div key={i} className="flex items-center">@@ -159,23 +191,31 @@ export function PricingSection() {</div>))}</div>-+{prices.custom ? (- <Link href="https://www.rybbit.io/contact" className="w-full block">- <button className="w-full bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-5 py-3 rounded-lg shadow-lg shadow-emerald-900/20 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-opacity-50">+ <Link+ href="https://www.rybbit.io/contact"+ className="w-full block"+ >+ <button className="w-full bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-5 py-3 rounded-lg shadow-lg shadow-emerald-900/20 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-opacity-50 cursor-pointer">Contact us</button></Link>) : (- <Link href="https://app.rybbit.io/signup" className="w-full block">- <button className="w-full bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-5 py-3 rounded-lg shadow-lg shadow-emerald-900/20 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-opacity-50">+ <Link+ href="https://app.rybbit.io/signup"+ className="w-full block"+ >+ <button className="w-full bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-5 py-3 rounded-lg shadow-lg shadow-emerald-900/20 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-opacity-50 cursor-pointer">Start your 14 day free trial</button></Link>)}-+<p className="text-center text-sm text-neutral-400 mt-4">- {prices.custom ? "Email us at [email protected] for custom pricing" : "We don't ask for your credit card"}+ {prices.custom+ ? "Email us at [email protected] for custom pricing"+ : "We don't ask for your credit card"}</p></div></div>@@ -183,4 +223,4 @@ export function PricingSection() {</div></section>);-}\ No newline at end of file+}diff --git a/docs/src/app/contact/page.jsx b/docs/src/app/contact/page.jsxindex 22abb08a6..c8972256c 100644--- a/docs/src/app/contact/page.jsx+++ b/docs/src/app/contact/page.jsx@@ -1,31 +1,46 @@import Link from "next/link";export const metadata = {- title: 'Contact',- description: 'Get in touch with the Rybbit team',-}+ title: "Contact",+ description: "Get in touch with the Rybbit team",+};export default function Contact() {return (<div className="max-w-4xl mx-auto px-4 py-12"><h1 className="text-3xl md:text-4xl font-bold mb-8">Contact Us</h1>-+<div className="bg-neutral-800/20 border border-neutral-700/50 rounded-xl p-6 md:p-8 mb-8"><p className="text-lg mb-6">- Have questions about Rybbit? We're here to help! Reach out to us through any of these channels:+ Have questions about Rybbit? We're here to help! Reach out to us+ through any of these channels:</p>-+<div className="space-y-6"><div className="flex items-start md:items-center gap-4 flex-col md:flex-row"><div className="bg-neutral-800 p-3 rounded-lg">- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="text-neutral-300">+ <svg+ xmlns="http://www.w3.org/2000/svg"+ width="24"+ height="24"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ className="text-neutral-300"+ ><rect width="20" height="16" x="2" y="4" rx="2" /><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" /></svg></div><div><h2 className="text-xl font-medium mb-1">Email</h2>- <a href="https://www.rybbit.io/contact" className="text-neutral-300 hover:text-white transition-colors">+ <a+ href="https://www.rybbit.io/contact"+ className="text-neutral-300 hover:text-white transition-colors"+ ></a></div>@@ -33,7 +48,18 @@ export default function Contact() {<div className="flex items-start md:items-center gap-4 flex-col md:flex-row"><div className="bg-neutral-800 p-3 rounded-lg">- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="text-neutral-300">+ <svg+ xmlns="http://www.w3.org/2000/svg"+ width="24"+ height="24"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ className="text-neutral-300"+ ><path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" /><polyline points="14 2 14 8 20 8" /><path d="M16 13H8" />@@ -43,7 +69,12 @@ export default function Contact() {</div><div><h2 className="text-xl font-medium mb-1">GitHub</h2>- <a href="https://github.com/rybbit-io/rybbit" target="_blank" rel="noopener noreferrer" className="text-neutral-300 hover:text-white transition-colors">+ <a+ href="https://github.com/rybbit-io/rybbit"+ target="_blank"+ rel="noopener noreferrer"+ className="text-neutral-300 hover:text-white transition-colors"+ >github.com/rybbit-io/rybbit</a></div>@@ -51,14 +82,30 @@ export default function Contact() {<div className="flex items-start md:items-center gap-4 flex-col md:flex-row"><div className="bg-neutral-800 p-3 rounded-lg">- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="text-neutral-300">+ <svg+ xmlns="http://www.w3.org/2000/svg"+ width="24"+ height="24"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ className="text-neutral-300"+ ><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" /><path d="M13.73 21a2 2 0 0 1-3.46 0" /></svg></div><div><h2 className="text-xl font-medium mb-1">Discord</h2>- <a href="https://discord.gg/DEhGb4hYBj" target="_blank" rel="noopener noreferrer" className="text-neutral-300 hover:text-white transition-colors">+ <a+ href="https://discord.gg/DEhGb4hYBj"+ target="_blank"+ rel="noopener noreferrer"+ className="text-neutral-300 hover:text-white transition-colors"+ >Join our Discord Server</a></div>@@ -66,28 +113,48 @@ export default function Contact() {<div className="flex items-start md:items-center gap-4 flex-col md:flex-row"><div className="bg-neutral-800 p-3 rounded-lg">- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="text-neutral-300">+ <svg+ xmlns="http://www.w3.org/2000/svg"+ width="24"+ height="24"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ className="text-neutral-300"+ ><path d="M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z" /></svg></div><div><h2 className="text-xl font-medium mb-1">X (Twitter)</h2>- <a href="https://x.com/yang_frog" target="_blank" rel="noopener noreferrer" className="text-neutral-300 hover:text-white transition-colors">+ <a+ href="https://x.com/yang_frog"+ target="_blank"+ rel="noopener noreferrer"+ className="text-neutral-300 hover:text-white transition-colors"+ >@yang_frog</a></div></div></div></div>-+<div className="bg-neutral-800/30 border border-neutral-700/50 rounded-xl p-6"><h2 className="text-xl font-medium mb-3">Open Source Contributions</h2><p className="mb-4">- Rybbit is an open-source project. If you'd like to contribute, report issues, or suggest features,- please visit our GitHub repository.+ Rybbit is an open-source project. If you'd like to contribute, report+ issues, or suggest features, please visit our GitHub repository.</p>- <Link href="https://github.com/rybbit-io/rybbit" target="_blank" rel="noopener noreferrer">- <button className="bg-neutral-800 hover:bg-neutral-700 text-white font-medium px-5 py-2 rounded-lg border border-neutral-700 transform hover:-translate-y-0.5 transition-all duration-200 hover:border-neutral-600 focus:outline-none focus:ring-2 focus:ring-neutral-600 focus:ring-opacity-50">+ <Link+ href="https://github.com/rybbit-io/rybbit"+ target="_blank"+ rel="noopener noreferrer"+ >+ <button className="bg-neutral-800 hover:bg-neutral-700 text-white font-medium px-5 py-2 rounded-lg border border-neutral-700 transform hover:-translate-y-0.5 transition-all duration-200 hover:border-neutral-600 focus:outline-none focus:ring-2 focus:ring-neutral-600 focus:ring-opacity-50 cursor-pointer">Visit GitHub Repository</button></Link>diff --git a/docs/src/app/layout.jsx b/docs/src/app/layout.jsxindex 3237e8198..77d1ef49b 100644--- a/docs/src/app/layout.jsx+++ b/docs/src/app/layout.jsx@@ -80,7 +80,7 @@ export default async function RootLayout({ children }) {projectLink="https://github.com/rybbit-io/rybbit"children={<a href="https://app.rybbit.io">- <button className="bg-neutral-800 hover:bg-neutral-700 text-white text-sm font-medium px-3 py-1.5 rounded-md border border-neutral-600 transform hover:-translate-y-0.5 transition-all duration-200 hover:border-neutral-400 focus:outline-none focus:ring-2 focus:ring-neutral-400 focus:ring-opacity-50">+ <button className="bg-neutral-800 hover:bg-neutral-700 text-white text-sm font-medium px-3 py-1.5 rounded-md border border-neutral-600 transform hover:-translate-y-0.5 transition-all duration-200 hover:border-neutral-400 focus:outline-none focus:ring-2 focus:ring-neutral-400 focus:ring-opacity-50 cursor-pointer">Login</button></a>diff --git a/docs/src/app/page.jsx b/docs/src/app/page.jsxindex d476c316f..69b6f5c01 100644--- a/docs/src/app/page.jsx+++ b/docs/src/app/page.jsx@@ -46,12 +46,12 @@ export default function IndexPage() {<div className="flex flex-col sm:flex-row my-8 md:my-10 items-center justify-center gap-4 md:gap-6 text-base md:text-lg px-4"><Link href="https://app.rybbit.io/signup" className="w-full sm:w-auto">- <button className="w-full sm:w-auto bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-5 py-3 rounded-lg shadow-lg shadow-emerald-900/20 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-opacity-50">+ <button className="w-full sm:w-auto bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-5 py-3 rounded-lg shadow-lg shadow-emerald-900/20 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-opacity-50 cursor-pointer">Track your Site</button></Link><Link href="https://demo.rybbit.io/1" className="w-full sm:w-auto">- <button className="w-full sm:w-auto bg-neutral-800 hover:bg-neutral-700 text-white font-medium px-5 py-3 rounded-lg border border-neutral-600 transform hover:-translate-y-0.5 transition-all duration-200 hover:border-neutral-400 focus:outline-none focus:ring-2 focus:ring-neutral-400 focus:ring-opacity-50">+ <button className="w-full sm:w-auto bg-neutral-800 hover:bg-neutral-700 text-white font-medium px-5 py-3 rounded-lg border border-neutral-600 transform hover:-translate-y-0.5 transition-all duration-200 hover:border-neutral-400 focus:outline-none focus:ring-2 focus:ring-neutral-400 focus:ring-opacity-50 cursor-pointer">View Live Demo</button></Link>@@ -348,7 +348,7 @@ export default function IndexPage() {href="https://app.rybbit.io/signup"className="w-full sm:w-auto">- <button className="w-full sm:w-auto bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-6 md:px-8 py-3 md:py-4 rounded-lg shadow-lg shadow-emerald-900/20 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-opacity-50">+ <button className="w-full sm:w-auto bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-6 md:px-8 py-3 md:py-4 rounded-lg shadow-lg shadow-emerald-900/20 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-opacity-50 cursor-pointer">Track your site now</button></Link>