diff --git a/apps/www/app/(blog)/blog/[...slug]/page.tsx b/apps/www/app/(blog)/blog/[...slug]/page.tsx index 59dc89466..5fff4ca24 100644 --- a/apps/www/app/(blog)/blog/[...slug]/page.tsx +++ b/apps/www/app/(blog)/blog/[...slug]/page.tsx @@ -4,14 +4,15 @@ import Link from "next/link" import { notFound } from "next/navigation" import { mdxComponents } from "@/mdx-components" import { ArrowLeftIcon } from "lucide-react" -import { Badge } from "@/components/ui/badge" import type { BlogPosting, BreadcrumbList, WithContext } from "schema-dts" + import { siteConfig } from "@/config/site" import { blogSource } from "@/lib/source" import { absoluteUrl, calculateReadingTime, formatDate } from "@/lib/utils" +import { Badge } from "@/components/ui/badge" import { buttonVariants } from "@/components/ui/button" -import { BlogTableOfContents } from "@/components/blog/table-of-contents" import { MobileTOC } from "@/components/blog/mobile-toc" +import { BlogTableOfContents } from "@/components/blog/table-of-contents" import { SidebarCTA } from "@/components/sidebar-cta" export const revalidate = false @@ -188,7 +189,7 @@ export default async function BlogPage({ params }: PageProps) { {doc.title}
@@ -219,14 +220,16 @@ export default async function BlogPage({ params }: PageProps) { return ( tags.length > 0 && ( -
+
{tags.map((tag) => ( - + {tag} diff --git a/apps/www/app/(blog)/blog/page.tsx b/apps/www/app/(blog)/blog/page.tsx index 658c8c601..6f3164f3c 100644 --- a/apps/www/app/(blog)/blog/page.tsx +++ b/apps/www/app/(blog)/blog/page.tsx @@ -127,7 +127,7 @@ export default async function Page({ __html: serializedBreadcrumbStructuredData, }} /> -
+

Blog

@@ -202,20 +202,20 @@ export default async function Page({ > {post.data?.image && ( -
+
{post.data?.title
)}
-

+

{post.data?.title ?? post.url}

{post.data?.description && ( @@ -239,15 +239,17 @@ export default async function Page({ {normalizeTag(post.data?.tags).length > 0 && (
- {normalizeTag(post.data.tags).slice(0, 3).map((tag) => ( - - {tag} - - ))} + {normalizeTag(post.data.tags) + .slice(0, 3) + .map((tag) => ( + + {tag} + + ))}
)}
diff --git a/apps/www/components/blog/table-of-contents.tsx b/apps/www/components/blog/table-of-contents.tsx index 557b1e62d..6a65bca64 100644 --- a/apps/www/components/blog/table-of-contents.tsx +++ b/apps/www/components/blog/table-of-contents.tsx @@ -16,10 +16,10 @@ const generateHeadingId = (text: string) => { .trim() } -export function BlogTableOfContents({ +export function BlogTableOfContents({ className, onLinkClick, -}: { +}: { className?: string onLinkClick?: () => void }) { diff --git a/apps/www/config/docs.ts b/apps/www/config/docs.ts index 4e3ee6eae..8a40ed792 100644 --- a/apps/www/config/docs.ts +++ b/apps/www/config/docs.ts @@ -244,6 +244,12 @@ export const docsConfig: DocsConfig = { href: `/docs/components/magic-card`, items: [], }, + { + title: "Glare Hover", + href: `/docs/components/glare-hover`, + items: [], + label: "New", + }, { title: "Meteors", href: `/docs/components/meteors`, diff --git a/apps/www/content/blog/typescript-vs-javascript-differences.mdx b/apps/www/content/blog/typescript-vs-javascript-differences.mdx index 04ecda5d5..86d260d31 100644 --- a/apps/www/content/blog/typescript-vs-javascript-differences.mdx +++ b/apps/www/content/blog/typescript-vs-javascript-differences.mdx @@ -39,7 +39,7 @@ This comparison isn't about crowning a winner. It’s about helping you make the
- + - + @@ -73,7 +73,7 @@ This comparison isn't about crowning a winner. It’s about helping you make the maintainability. - + @@ -84,7 +84,7 @@ This comparison isn't about crowning a winner. It’s about helping you make the Catches type-related errors during compilation, before code is run. - + diff --git a/apps/www/content/docs/components/glare-hover.mdx b/apps/www/content/docs/components/glare-hover.mdx new file mode 100644 index 000000000..7bb6685b3 --- /dev/null +++ b/apps/www/content/docs/components/glare-hover.mdx @@ -0,0 +1,124 @@ +--- +title: Glare Hover +date: 2024-12-19 +description: A component that creates a subtle glare effect that animates across the element on hover. +author: magicui +published: true +--- + + + +## Examples + +### Custom Color - Blue + + + +### Custom Color - Purple + + + +## Installation + + + + + CLI + Manual + + + +```bash +npx shadcn@latest add @magicui/glare-hover +``` + + + + + + + +Copy and paste the following code into your project. + + + +Update the import paths to match your project setup. + + + + + + + +## Usage + +```tsx showLineNumbers +import { GlareHover } from "@/registry/magicui/glare-hover" +``` + +```tsx showLineNumbers + + + + Hello World + Hover over this card to see the effect + + + +``` + +```tsx showLineNumbers + + + + Custom Rotation + With custom rotation angle + + + +``` + +### Customizing the Glare Color + +You can customize the glare effect color by using the `glareClassName` prop with Tailwind's `via-` utility classes. The component uses a gradient with `via-black/15` by default (and `via-white/50` in dark mode), which you can override. + +```tsx showLineNumbers + + + + Custom Color + With blue glare effect + + + +``` + +```tsx showLineNumbers + + + + Purple Glare + With purple glare effect + + + +``` + +## Props + +### GlareHover + +| Prop name | Type | Default | Description | +| ---------------- | ----------------- | ------- | ---------------------------------------------------- | +| `children` | `React.ReactNode` | `-` | The content to be wrapped with the glare effect | +| `className` | `string` | `-` | Additional CSS classes for the root container | +| `glareClassName` | `string` | `-` | Additional CSS classes for the glare element. Use `via-` Tailwind classes to customize the glare color (e.g., `via-blue-500/30`) | +| `rotate` | `number` | `45` | Rotation angle in degrees for the glare effect | + +The glare effect uses a gradient that automatically adapts to light and dark themes, creating a subtle shine effect that moves across the element on hover. By default, it uses `via-black/15` in light mode and `via-white/50` in dark mode, but you can customize it using the `glareClassName` prop with Tailwind's `via-` utility classes. diff --git a/apps/www/mdx-components.tsx b/apps/www/mdx-components.tsx index 35f658e7c..94ef6cf06 100644 --- a/apps/www/mdx-components.tsx +++ b/apps/www/mdx-components.tsx @@ -100,10 +100,7 @@ export const mdxComponents = { /> ), p: ({ className, ...props }: React.ComponentProps<"p">) => ( -

+

), strong: ({ className, ...props }: React.HTMLAttributes) => ( @@ -119,7 +116,10 @@ export const mdxComponents = { ), blockquote: ({ className, ...props }: React.ComponentProps<"blockquote">) => (

), @@ -128,40 +128,30 @@ export const mdxComponents = { {alt} ), iframe: ({ className, ...props }: React.ComponentProps<"iframe">) => ( -
Project Scope
Error Detection
Developer Experience