diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 1fd9808b..09c5ac79 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -1,4 +1,4 @@ -name: playright +name: playwright on: push: branches: [main, prod-preview] diff --git a/output.txt b/output.txt deleted file mode 100644 index d395f4cd..00000000 --- a/output.txt +++ /dev/null @@ -1,28 +0,0 @@ -/*@jsxRuntime automatic @jsxImportSource react*/ -const {jsxDEV: _jsxDEV} = arguments[0]; -const {useMDXComponents: _provideComponents} = arguments[0]; -function _createMdxContent(props) { - const _components = Object.assign({ - p: "p" - }, _provideComponents(), props.components); - return _jsxDEV(_components.p, { - children: "Halo pasas" - }, undefined, false, { - fileName: "", - lineNumber: 1, - columnNumber: 1 - }, this); -} -function MDXContent(props = {}) { - const {wrapper: MDXLayout} = Object.assign({}, _provideComponents(), props.components); - return MDXLayout ? _jsxDEV(MDXLayout, Object.assign({}, props, { - children: _jsxDEV(_createMdxContent, props, undefined, false, { - fileName: "" - }, this) - }), undefined, false, { - fileName: "" - }, this) : _createMdxContent(props); -} -return { - default: MDXContent -}; diff --git a/public/blogs/simple.mdx b/public/blogs/simple.mdx index 418ce295..e7da366b 100644 --- a/public/blogs/simple.mdx +++ b/public/blogs/simple.mdx @@ -21,4 +21,67 @@ tags: To test that you've removed this entirely you can use curl: + + If youd like to preserve the default values for a theme option but + also add new values, add your extensions under the theme.extend key in + your configuration file. Values under this key are merged with + existing theme values and automatically become available as new + classes that you can use. As an example, here we extend the fontFamily + property to add the font-display class that can change the font used + on an element: If youd like to preserve the default values for a theme + option but also add new values, add your extensions under the + theme.extend key in your configuration file. Values under this key are + merged with existing theme values and automatically become available + as new classes that you can use. As an example, here we extend the + fontFamily property to add the font-display class that can change the + font used on an element: If youd like to preserve the default values + for a theme option but also add new values, add your extensions under + the theme.extend key in your configuration file. + + Values under this key + are merged with existing theme values and automatically become + available as new classes that you can use. As an example, here we + extend the fontFamily property to add the font-display class that can + change the font used on an element: If youd like to preserve the + default values for a theme option but also add new values, add your + extensions under the theme.extend key in your configuration file. + Values under this key are merged with existing theme values and + automatically become available as new classes that you can use. As an + example, here we extend the fontFamily property to add the + font-display class that can change the font used on an element: If + youd like to preserve the default values for a theme option but also + add new values, add your extensions under the theme.extend key in your + configuration file. Values under this key are merged with existing + theme values and automatically become available as new classes that + you can use. As an example, here we extend the fontFamily property to + add the font-display class that can change the font used on an + element: If youd like to preserve the default values for a theme + option but also add new values, add your extensions under the + theme.extend key in your configuration file. Values under this key are + merged with existing theme values and automatically become available + as new classes that you can use. As an example, here we extend the + fontFamily property to add the font-display class that can change the + font used on an element: If youd like to preserve the default values + for a theme option but also add new values, add your extensions under + the theme.extend key in your configuration file. + + + Values under this key + are merged with existing theme values and automatically become + available as new classes that you can use. As an example, here we + extend the fontFamily property to add the font-display class that can + change the font used on an element: If youd like to preserve the + default values for a theme option but also add new values, add your + extensions under the theme.extend key in your configuration file. + Values under this key are merged with existing theme values and + automatically become available as new classes that you can use. As an + example, here we extend the fontFamily property to add the + font-display class that can change the font used on an element: If + youd like to preserve the default values for a theme option but also + add new values, add your extensions under the theme.extend key in your + configuration file. Values under this key are merged with existing + theme values and automatically become available as new classes that + you can use. As an example, here we extend the fontFamily property to + add the font-display class that can change the font used on an + diff --git a/public/blogs/tester.mdx b/public/blogs/tester.mdx index 0f20eb39..72776adc 100644 --- a/public/blogs/tester.mdx +++ b/public/blogs/tester.mdx @@ -80,7 +80,7 @@ language="python" showLineNumbers={true} > -
+ All data is encrypted via SSL/TLS when transmitted from our servers to your browser. diff --git a/src/app/(pages)/blog/[slug]/page.tsx b/src/app/(pages)/blog/[slug]/page.tsx index 90d151b2..66ac34b9 100644 --- a/src/app/(pages)/blog/[slug]/page.tsx +++ b/src/app/(pages)/blog/[slug]/page.tsx @@ -1,5 +1,7 @@ -import StyledMDX, { Heading as H1 } from '@/app/components/mdx/styled-mdx'; +import StyledMDX from '@/app/components/mdx/styled-mdx'; +import { Heading1 as H1 } from '@/app/components/reusables/headers'; import { formatDate, isSameMonthAndYear } from '@/lib/funcs/dates'; +import { MediumSection } from '@/app/components/reusables/sections'; import type { Metadata, ResolvingMetadata } from 'next'; import { notFound } from 'next/navigation'; @@ -12,7 +14,7 @@ export default function Blog({ params }: { params: { slug: string } }) { if (!post) { notFound(); } - // TODO: use NEXT-SEO + // TODO: configure metadata return (
@@ -35,7 +37,7 @@ export default function Blog({ params }: { params: { slug: string } }) { }), }} /> -
+

{post.parsedContent.attributes.title}

@@ -43,7 +45,10 @@ export default function Blog({ params }: { params: { slug: string } }) {

{isSameMonthAndYear(post.parsedContent.attributes.firstModDate) ? ( - New + // TODO: replace with views + + New + ) : ( New @@ -54,7 +59,7 @@ export default function Blog({ params }: { params: { slug: string } }) {
-
+
); } diff --git a/src/app/(pages)/blog/layout.tsx b/src/app/(pages)/blog/layout.tsx index 829e45c4..a5abd100 100644 --- a/src/app/(pages)/blog/layout.tsx +++ b/src/app/(pages)/blog/layout.tsx @@ -1,5 +1,5 @@ import { Navbar } from '@/app/components/reusables/nav'; - +import Nav from '@/app/components/nav/nav'; export default async function BlogsLayout({ children, }: { @@ -7,7 +7,7 @@ export default async function BlogsLayout({ }) { return ( <> - +
{children}
); diff --git a/src/app/(pages)/blog/page.tsx b/src/app/(pages)/blog/page.tsx index 7018d5fa..8dd4e7dc 100644 --- a/src/app/(pages)/blog/page.tsx +++ b/src/app/(pages)/blog/page.tsx @@ -11,7 +11,7 @@ export default function BlogPage() { let allBlogs = getBlogPosts(); return (
-

+

Unclassified, raw

{allBlogs diff --git a/src/app/(pages)/x/page.tsx b/src/app/(pages)/x/page.tsx new file mode 100644 index 00000000..4499b639 --- /dev/null +++ b/src/app/(pages)/x/page.tsx @@ -0,0 +1,10 @@ +import LoadingScreen from '@/app/loading'; +import Nav from '@/app/components/nav/nav'; +export default function Fun() { + return ( + <> + + + + ); +} diff --git a/src/app/components/mdx/styled-mdx.tsx b/src/app/components/mdx/styled-mdx.tsx index f6054372..9e6e2520 100644 --- a/src/app/components/mdx/styled-mdx.tsx +++ b/src/app/components/mdx/styled-mdx.tsx @@ -1,12 +1,16 @@ -import { ArrowUpRightSquare } from 'lucide-react'; import { MDXRemote, MDXRemoteProps } from 'next-mdx-remote/rsc'; -import { Image as _Image, Skeleton } from '@nextui-org/react'; -import { Navbar } from '@/app/components/reusables/nav'; +import { Link } from '@/app/components/reusables/link'; +import { Image, Skeleton } from '@nextui-org/react'; import { cn } from '@/lib/utils'; -import NextLink from 'next/link'; import NextImage from 'next/image'; import CodeBlock from '@/app/components/reusables/code-block'; -import React from 'react'; +import { + Heading2, + Heading3, + Heading1, +} from '@/app/components/reusables/headers'; +import { Spacer1, Spacer2, Spacer3 } from '@/app/components/reusables/spacers'; +import { TextContent } from '@/app/components/reusables/content'; export default function StyledMDX({ source }: { source: string }) { return ( @@ -14,34 +18,34 @@ export default function StyledMDX({ source }: { source: string }) { source={source} components={{ Code: CodeBlock, - Nav: Navbar, - Image: BlogImage, - H: Heading, + Image: MDXImage, + H: Heading1, H2: Heading2, H3: Heading3, - S: Spacer, + S: Spacer1, S2: Spacer2, S3: Spacer3, - C: Content, + C: TextContent, L: Link, }} > ); } +function _StyledMDX({ components, ...props }: MDXRemoteProps) { + return ; +} -type BlogImageProps = { +type MDXImageProps = { alt: string; width: string; height: string; src: string; className?: string; }; -export function BlogImage(props: BlogImageProps) { +export function MDXImage(props: MDXImageProps) { return ( - <_Image - isLoading - isBlurred + ); } - -export function Link({ - href, - ...props -}: { - href: string; - children: React.ReactNode; -}) { - if (href.startsWith('#') || href.startsWith('/')) { - return ( - - {props.children} - - ); - } - - return ( - - {props.children} - - - ); -} - -type HeaderProps = { - children: React.ReactNode; - id?: string; -}; -export function Heading({ children, id }: HeaderProps) { - return ( -

- {children} -

- ); -} -export function Heading2({ children, id }: HeaderProps) { - return ( -

- {children} -

- ); -} -export function Heading3({ children, id }: HeaderProps) { - return ( -

- {children} -

- ); -} - -export function Content({ children }: { children: React.ReactNode }) { - return

{children}

; -} -export function Spacer({ children }: { children: React.ReactNode }) { - return
{children}
; -} -export function Spacer2({ children }: { children: React.ReactNode }) { - return
{children}
; -} -export function Spacer3({ children }: { children: React.ReactNode }) { - return
{children}
; -} - -function _StyledMDX({ components, ...props }: MDXRemoteProps) { - return ; -} diff --git a/src/app/components/nav/buttons.tsx b/src/app/components/nav/buttons.tsx new file mode 100644 index 00000000..179e1b0c --- /dev/null +++ b/src/app/components/nav/buttons.tsx @@ -0,0 +1,34 @@ +import { GitBranch } from 'lucide-react'; +import { Image as _Image } from '@nextui-org/react'; +import NextLink from 'next/link'; +import { Button } from '../ui/button'; + +export function OutLineButton({ + href, + ...props +}: { + href: string; + children: React.ReactNode; +}) { + return ( + + ); +} diff --git a/src/app/components/nav/nav.tsx b/src/app/components/nav/nav.tsx new file mode 100644 index 00000000..2d0c74c1 --- /dev/null +++ b/src/app/components/nav/nav.tsx @@ -0,0 +1,49 @@ +import { Button } from '../ui/button'; +import { OutLineButton } from './buttons'; +import Link from 'next/link'; +import clsx from 'clsx'; + +const Nav = () => { + return ( + + ); +}; + +export default Nav; diff --git a/src/app/components/reusables/blog-frame.tsx b/src/app/components/reusables/blog-frame.tsx deleted file mode 100644 index 8994d29a..00000000 --- a/src/app/components/reusables/blog-frame.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import React, { ReactNode } from 'react'; - -const BlogFrameContainer: React.FC<{ children?: ReactNode }> = ({ - children, -}) => { - return ( -
- {children} -
- ); -}; - -export default BlogFrameContainer; diff --git a/src/app/components/reusables/code-block.tsx b/src/app/components/reusables/code-block.tsx index 5933437b..44d67e7e 100644 --- a/src/app/components/reusables/code-block.tsx +++ b/src/app/components/reusables/code-block.tsx @@ -8,6 +8,7 @@ import typescript from 'react-syntax-highlighter/dist/cjs/languages/prism/typesc import go from 'react-syntax-highlighter/dist/cjs/languages/prism/go'; import bash from 'react-syntax-highlighter/dist/cjs/languages/prism/bash'; import oneDark from 'react-syntax-highlighter/dist/cjs/styles/prism/one-dark'; +import CopyButton from './copy-code'; SyntaxHighlighter.registerLanguage('rust', rust); SyntaxHighlighter.registerLanguage('python', python); @@ -20,6 +21,7 @@ type Props = { code: string; showLineNumbers?: boolean; className?: string; + copy?: boolean; }; export default function CodeBlock({ @@ -27,6 +29,7 @@ export default function CodeBlock({ language, showLineNumbers, className, + copy = true, }: Props) { return (
+ {copy && ( + + )} {children}

; +} diff --git a/src/app/components/reusables/copy-code.tsx b/src/app/components/reusables/copy-code.tsx new file mode 100644 index 00000000..3904f925 --- /dev/null +++ b/src/app/components/reusables/copy-code.tsx @@ -0,0 +1,29 @@ +'use client'; +import { FC } from 'react'; +import { Copy } from 'lucide-react'; +import clsx from 'clsx'; +import { useCopyToClipboard } from 'react-use'; + +interface CopyButtonProps { + code: string; + className?: string; +} + +const CopyButton: FC = ({ code, className }) => { + const [_, copyToClipboard] = useCopyToClipboard(); + return ( + + ); +}; + +export default CopyButton; diff --git a/src/app/components/reusables/headers.tsx b/src/app/components/reusables/headers.tsx new file mode 100644 index 00000000..aa3f96df --- /dev/null +++ b/src/app/components/reusables/headers.tsx @@ -0,0 +1,27 @@ +import React from 'react'; + +type HeaderProps = { + children: React.ReactNode; + id?: string; +}; +export function Heading1({ children, id }: HeaderProps) { + return ( +

+ {children} +

+ ); +} +export function Heading2({ children, id }: HeaderProps) { + return ( +

+ {children} +

+ ); +} +export function Heading3({ children, id }: HeaderProps) { + return ( +

+ {children} +

+ ); +} diff --git a/src/app/components/reusables/link.tsx b/src/app/components/reusables/link.tsx new file mode 100644 index 00000000..25919f54 --- /dev/null +++ b/src/app/components/reusables/link.tsx @@ -0,0 +1,44 @@ +import { ArrowUpRightSquare } from 'lucide-react'; +import { Image as _Image } from '@nextui-org/react'; +import NextLink from 'next/link'; + +export function Link({ + href, + ...props +}: { + href: string; + children: React.ReactNode; +}) { + if (href.startsWith('#') || href.startsWith('/')) { + return ( + + {props.children} + + ); + } + + return ( + + {props.children} + + + ); +} diff --git a/src/app/components/reusables/nav.tsx b/src/app/components/reusables/nav.tsx deleted file mode 100644 index 7a787ca7..00000000 --- a/src/app/components/reusables/nav.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import Link from 'next/link'; - -import React from 'react'; -import { Button } from '../ui/button'; -const navItems = { - '/': { - name: 'Home', - }, - '/contact': { - name: 'Contact', - }, - '/blog': { - name: 'Blog', - }, - '/about': { - name: 'About', - }, -}; - -export function Navbar() { - return ( - - ); -} diff --git a/src/app/components/reusables/sections.tsx b/src/app/components/reusables/sections.tsx new file mode 100644 index 00000000..c06be2f6 --- /dev/null +++ b/src/app/components/reusables/sections.tsx @@ -0,0 +1,7 @@ +export function MediumSection({ children }: { children: React.ReactNode }) { + return ( +
+ {children} +
+ ); +} diff --git a/src/app/components/reusables/spacers.tsx b/src/app/components/reusables/spacers.tsx new file mode 100644 index 00000000..f9e455c3 --- /dev/null +++ b/src/app/components/reusables/spacers.tsx @@ -0,0 +1,11 @@ +import React from 'react'; + +export function Spacer1({ children }: { children: React.ReactNode }) { + return
{children}
; +} +export function Spacer2({ children }: { children: React.ReactNode }) { + return
{children}
; +} +export function Spacer3({ children }: { children: React.ReactNode }) { + return
{children}
; +} diff --git a/src/app/components/reusables/styles/loader.scss b/src/app/components/reusables/styles/loader.scss index 190eb819..987d2a66 100644 --- a/src/app/components/reusables/styles/loader.scss +++ b/src/app/components/reusables/styles/loader.scss @@ -18,11 +18,11 @@ $animation-duration: 1.5s; background-color: #0ddcf8; } 42% { - background-color: hwb(251 30% 34%); + background-color: hwb(277 0% 0%); } 50% { transform: scale(1); - background-color: #42b58fb8; + background-color: #4fb9ffed; } } diff --git a/src/app/components/ui/button.tsx b/src/app/components/ui/button.tsx index 81e2e6ee..e6dd1fc0 100644 --- a/src/app/components/ui/button.tsx +++ b/src/app/components/ui/button.tsx @@ -5,15 +5,16 @@ import { cva, type VariantProps } from 'class-variance-authority'; import { cn } from '@/lib/utils'; const buttonVariants = cva( - 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', + 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', { variants: { variant: { - default: 'bg-primary text-primary-foreground hover:bg-primary/90', + default: + 'rounded-[1.1rem] bg-primary/95 opacity-95 text-primary-foreground hover:bg-primary hover:opacity-100 transition-all duration-300 ease-in-out', destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90', outline: - 'border border-input bg-background hover:bg-accent hover:text-accent-foreground', + 'rounded-[1.1rem] border border-input bg-transparent hover:text-accent-foreground nav-link-shadow', secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80', ghost: 'hover:bg-accent hover:text-accent-foreground', diff --git a/src/app/globals.css b/src/app/globals.css index 440046c8..d2587e96 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -99,6 +99,40 @@ opacity: 1; } } +.nav-link-shadow { + position: relative; +} + +@media (min-width: 1024px) { + .nav-link-shadow::before { + content: ''; + position: absolute; + height: 33px; + width: 70px; + z-index: -1; + background: linear-gradient( + 86.87deg, + rgba(255, 0, 255, 0.3), + rgba(150, 255, 30, 0.2) + ); + filter: blur(25px); + opacity: 0; + transition: opacity 0.3s ease-out; + } + + .nav-link-shadow:hover::before { + opacity: 0.8; + } +} + +@keyframes nav-link-shadow { + 0% { + opacity: 0; + } + 100% { + opacity: 0.8; + } +} @layer base { * { diff --git a/src/app/page.tsx b/src/app/page.tsx index 1e158c23..f26126e9 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -3,30 +3,78 @@ import ThemeModeToggler from '@/app/components/reusables/theme-toggler'; import CopyRight from '@/app/components/footer/copyright'; import { Button } from '@/app/components/ui/button'; -import { Navbar } from '@/app/components/reusables/nav'; +import Nav from '@/app/components/nav/nav'; import { Badge } from '@/app/components/ui/badge'; +import { TextContent } from './components/reusables/content'; +import { MediumSection } from './components/reusables/sections'; export default function Home() { return ( <> - -
-
- -
- -
-

- New -
-
- + + + + If youd like to preserve the default values for a theme option but + also add new values, add your extensions under the theme.extend key in + your configuration file. Values under this key are merged with + existing theme values and automatically become available as new + classes that you can use. As an example, here we extend the fontFamily + property to add the font-display class that can change the font used + on an element: If youd like to preserve the default values for a theme + option but also add new values, add your extensions under the + theme.extend key in your configuration file. Values under this key are + merged with existing theme values and automatically become available + as new classes that you can use. As an example, here we extend the + fontFamily property to add the font-display class that can change the + font used on an element: If youd like to preserve the default values + for a theme option but also add new values, add your extensions under + the theme.extend key in your configuration file. Values under this key + are merged with existing theme values and automatically become + available as new classes that you can use. As an example, here we + extend the fontFamily property to add the font-display class that can + change the font used on an element: If youd like to preserve the + default values for a theme option but also add new values, add your + extensions under the theme.extend key in your configuration file. + Values under this key are merged with existing theme values and + automatically become available as new classes that you can use. As an + example, here we extend the fontFamily property to add the + font-display class that can change the font used on an element: If + youd like to preserve the default values for a theme option but also + add new values, add your extensions under the theme.extend key in your + configuration file. Values under this key are merged with existing + theme values and automatically become available as new classes that + you can use. As an example, here we extend the fontFamily property to + add the font-display class that can change the font used on an + element: If youd like to preserve the default values for a theme + option but also add new values, add your extensions under the + theme.extend key in your configuration file. Values under this key are + merged with existing theme values and automatically become available + as new classes that you can use. As an example, here we extend the + fontFamily property to add the font-display class that can change the + font used on an element: If youd like to preserve the default values + for a theme option but also add new values, add your extensions under + the theme.extend key in your configuration file. Values under this key + are merged with existing theme values and automatically become + available as new classes that you can use. As an example, here we + extend the fontFamily property to add the font-display class that can + change the font used on an element: If youd like to preserve the + default values for a theme option but also add new values, add your + extensions under the theme.extend key in your configuration file. + Values under this key are merged with existing theme values and + automatically become available as new classes that you can use. As an + example, here we extend the fontFamily property to add the + font-display class that can change the font used on an element: If + youd like to preserve the default values for a theme option but also + add new values, add your extensions under the theme.extend key in your + configuration file. Values under this key are merged with existing + theme values and automatically become available as new classes that + you can use. As an example, here we extend the fontFamily property to + add the font-display class that can change the font used on an + element: + + + + ); } diff --git a/tailwind.config.ts b/tailwind.config.ts index 8deeaa70..86202740 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,4 +1,5 @@ import type { Config } from 'tailwindcss'; +import { nextui } from '@nextui-org/react'; const config = { darkMode: ['class'], @@ -74,7 +75,24 @@ const config = { }, }, }, - plugins: [require('tailwindcss-animate')], + plugins: [ + require('tailwindcss-animate'), + nextui({ + layout: { + disabledOpacity: '0.3', + radius: { + small: '2px', + medium: '4px', + large: '6px', + }, + borderWidth: { + small: '1px', + medium: '1px', + large: '2px', + }, + }, + }), + ], } satisfies Config; export default config;