Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions app/globals.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
@import "tailwindcss";
@import "tw-animate-css";
@tailwind utilities;
@tailwind utilities;

/* Tell Tailwind to respect the .dark class */
@custom-variant dark (&:is(.dark *));

/* Register variables that map to CSS custom props */
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
Expand Down Expand Up @@ -44,6 +46,7 @@
--radius-xl: calc(var(--radius) + 4px);
}

/* Light theme defaults */
:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
Expand Down Expand Up @@ -79,6 +82,7 @@
--sidebar-ring: oklch(0.708 0 0);
}

/* Dark theme overrides */
.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
Expand Down Expand Up @@ -118,59 +122,59 @@
@apply border-border outline-ring/50;
}
body {
@apply bg-[#0b0b0f] bg-[linear-gradient(to_right,#8080800a_1px,transparent_1px),linear-gradient(to_bottom,#8080800a_1px,transparent_1px)] bg-[size:14px_24px] text-foreground;
@apply bg-background text-foreground;
}
.gray_border{
.gray_border {
@apply border-1 h-fit rounded-md border-gray-300/5;
}
.btn{
@apply bg-black px-3 py-2 rounded-md text-white text-center w-40 flex items-center justify-center shadow-md cursor-pointer
.btn {
@apply bg-black px-3 py-2 rounded-md text-center w-40 flex items-center justify-center shadow-md cursor-pointer;
}

.property{
@apply p-[1px] px-[3px] text-[12px] rounded-md text-purple-600 bg-gray-100/3 border-gray-500/4 border-1
}
}

.scrollbar-hide::-webkit-scrollbar{
/* Scrollbar utilities untouched */
.scrollbar-hide::-webkit-scrollbar {
display: none;
}
.scroll-dark::-webkit-scrollbar{
.scroll-dark::-webkit-scrollbar {
background: #0b0b0f;
width: 6px;
border-radius: 6px;
}

.scroll-bar::-webkit-scrollbar-button{
.scroll-bar::-webkit-scrollbar-button {
background: #0b0b0f;
opacity: 4;
}
.scroll-button::-webkit-scrollbar-thumb{
.scroll-button::-webkit-scrollbar-thumb {
background-color: gray;
opacity: 4;
width: 4px;
border-radius: 12px;
}

.scrollbar-hide{
.scrollbar-hide {
-ms-overflow-style: none;
scrollbar-width: none;
}
.tc{
.tc {
@apply text-gray-400;
}
.hc{
.hc {
@apply text-gray-200;
}
.blurspot{
.blurspot {
@apply absolute w-50 h-50 rounded-full blur-[18px] -z-10;
}
.instruct{
.instruct {
@apply text-gray-200 flex gap-2 p-1 mx-2 rounded-sm bg-white/4 w-fit items-center;
}
.main{
@apply bg-[#0b0b0f];
.main {
@apply bg-background;
}
.bc{
.bc {
@apply border-gray-300/5;
}
.slider-code{
Expand Down
17 changes: 13 additions & 4 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata } from "next";
import { Poppins } from "next/font/google";
import "./globals.css";

import { ThemeProvider } from "@/components/theme-provider"


const poppins = Poppins({
Expand Down Expand Up @@ -88,7 +88,7 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="en">
<html lang="en" suppressHydrationWarning>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#0b0b0f" />
Expand Down Expand Up @@ -118,10 +118,19 @@ export default function RootLayout({
}}
/>
</head>
<body>
<div className={`${poppins.className} mx-auto relative antialiased`}>
<body
className={`${poppins.className} antialiased`}
>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<div className={`${poppins.className} max-w-7xl mx-auto relative`}>
{children}
</div>
</ThemeProvider>
</body>
</html>
);
Expand Down
180 changes: 100 additions & 80 deletions components/main/animatex.tsx
Original file line number Diff line number Diff line change
@@ -1,92 +1,112 @@
"use client"
import React, { useEffect, useState } from 'react'
import { motion } from 'framer-motion'
import { cn } from '@/lib/utils'
import Swoop from './swoop'
import Link from 'next/link'
import Title from './title'
import Image from 'next/image'
import { Sparkles } from 'lucide-react'
import { useRouter } from 'next/navigation'
import Github from '../buttons/github'


"use client";
import React, { useEffect, useState } from "react";
import { motion } from "framer-motion";
import { cn } from "@/lib/utils";
import Swoop from "./swoop";
import Link from "next/link";
import Title from "./title";
import Image from "next/image";
import { Sparkles } from "lucide-react";
import { useRouter } from "next/navigation";
import Github from "../buttons/github";

const AnimateX = () => {
const [currentItem, setCurrentItem] = useState<number>(0)
const [direction, setDirection] = useState(1)
const router = useRouter()
const max = 2
const arr = [
"green", "red","yellow"
]
const colors = ["#00FF00", "#FF0000", "#FFFF00", "#0000FF"]
const [currentItem, setCurrentItem] = useState<number>(0);
const [direction, setDirection] = useState(1);
const router = useRouter();
const max = 2;
const arr = ["green", "red", "yellow"];
const colors = ["#00FF00", "#FF0000", "#FFFF00", "#0000FF"];

useEffect(() => {
const interval = setInterval(
() => setCurrentItem(prev => {
let next = prev + direction;
if(next >= max){
setDirection(-1)
next = max
}
if(next <= 0){
setDirection(1);
next = 0
}
return next;
})
, 1500)
return () => clearInterval(interval)
}, [direction])

() =>
setCurrentItem((prev) => {
let next = prev + direction;
if (next >= max) {
setDirection(-1);
next = max;
}
if (next <= 0) {
setDirection(1);
next = 0;
}
return next;
}),
1500
);
return () => clearInterval(interval);
}, [direction]);

return (
<div>
<Title icon={<Sparkles size={14}/>} title='Introducing pre-built blocks'/>
<div className='relative px-4 mb-13 mt-12 w-fit h-fit mx-auto'>
<div className="px-4 py-2 rounded-md w-fit mx-auto font-bold bg-white blur-[0.4px] relative z-20">
AnimateX
</div>
<div className='w-full flex absolute top-0 right-0 left-0 z-10 blur-[18px]'>
{
arr.map((item, i) =>
<motion.div key={item}
layoutId='Morph'
animate={{
scale: currentItem === i ? 1.4 : 1,
borderRadius: currentItem === i && i === 0 || 2 ? "8px" : "0",
rotate: currentItem === i ? "360deg" : "0deg",
backgroundColor: currentItem === i ? colors[i] : colors[Math.floor(Math.random() * colors.length)]
}}
transition={{
duration: 3,
}}
className={cn('bg-green-500 w-20 h-15', i === 1 ? "rounded-none" : i === 0 ? "rounded-l-md" : "rounded-r-md" )}></motion.div>
)
}
</div>
</div>
<Swoop id={currentItem}/>
<p className='tc text-center max-w-full md:max-w-[700px] mx-auto'>
This is more than just a library. Its a motion playground. Packed with custom-built,
fully animated UI components, crafted with Framer Motion and styled with Tailwind. Every
component is smooth, responsive and ready to light up your next project.
</p>
<div className='flex gap-8 mt-5 items-center justify-center'>
<Github text='Components' onClick={() => router.push("/components/docs/introduction")}/>
<Link className='bg-gray-100 px-3 py-2 rounded-md text-black text-center w-40 flex items-center justify-center shadow-md cursor-pointer' href="https://github.com/Newtaplix/AnimateX">Star on Github</Link>
</div>
<div className='flex gap-2 tc mx-auto w-fit bg-black/40 text-[14px] items-center justify-center mt-10 px-4 rounded-full py-[3px]'>
<Title
icon={<Sparkles size={14} />}
title="Introducing pre-built blocks"
/>
<div className="relative px-4 mb-13 mt-12 w-fit h-fit mx-auto">
<div className="px-4 py-2 rounded-md w-fit mx-auto font-bold text-black bg-white blur-[0.4px] relative z-20">
AnimateX
</div>
<div className="w-full flex absolute top-0 right-0 left-0 z-10 blur-[18px]">
{arr.map((item, i) => (
<motion.div
key={item}
layoutId="Morph"
animate={{
scale: currentItem === i ? 1.4 : 1,
borderRadius: (currentItem === i && i === 0) || 2 ? "8px" : "0",
rotate: currentItem === i ? "360deg" : "0deg",
backgroundColor:
currentItem === i
? colors[i]
: colors[Math.floor(Math.random() * colors.length)],
}}
transition={{
duration: 3,
}}
className={cn(
"bg-green-500 w-20 h-15",
i === 1
? "rounded-none"
: i === 0
? "rounded-l-md"
: "rounded-r-md"
)}
></motion.div>
))}
</div>
</div>
<Swoop id={currentItem} />
<p className="tc text-center max-w-full md:max-w-[700px] mx-auto">
This is more than just a library. Its a motion playground. Packed with
custom-built, fully animated UI components, crafted with Framer Motion
and styled with Tailwind. Every component is smooth, responsive and
ready to light up your next project.
</p>
<div className="flex gap-8 mt-5 items-center justify-center">
<Github
text="Components"
onClick={() => router.push("/components/docs/introduction")}
/>
<Link
className="bg-gray-100 px-3 py-2 rounded-md text-black text-center w-40 flex items-center justify-center shadow-md cursor-pointer"
href="https://github.com/Newtaplix/AnimateX"
>
Star on Github
</Link>
</div>
<div className="flex gap-2 tc mx-auto w-fit bg-black/40 text-[14px] items-center justify-center mt-10 px-4 rounded-full py-[3px]">
<span>Built with</span>
<div className='flex gap-1'>
<Image src={"/next2.svg"} width={20} height={20} alt='N'/>
<Image src={"/tail.svg"} width={20} height={20} alt='N'/>
<Image src={"/typescript.svg"} width={20} height={20} alt='N'/>
<Image src={"/framer.png"} width={18} height={15} alt='N'/>
<div className="flex gap-1">
<Image src={"/next2.svg"} width={20} height={20} alt="N" />
<Image src={"/tail.svg"} width={20} height={20} alt="N" />
<Image src={"/typescript.svg"} width={20} height={20} alt="N" />
<Image src={"/framer.png"} width={18} height={15} alt="N" />
</div>
</div>
</div>
)
}
);
};

export default AnimateX
export default AnimateX;
Loading