Skip to content

Commit 9594739

Browse files
Tailwind Plugins
1 parent cee666c commit 9594739

File tree

7 files changed

+188
-50
lines changed

7 files changed

+188
-50
lines changed

Twitter.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Twitter https://x.com/DocuBotAI Facebook https://www.facebook.com/DocuBotAI/ Youtube https://www.youtube.com/@DocuBot Discord https://www.docubot.app/sign-up TikTok https://www.tiktok.com/@docubot LinkedIn https://www.linkedin.com/company/docubot/
2+
3+
Smart Notes
4+
5+
Learning flashcards quizzes

src/app/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function RootLayout({
2525
<html lang='en'>
2626
<ClerkProvider>
2727
<body
28-
className={`${inter.className} flex h-screen min-h-screen flex-col overflow-hidden bg-light-500 dark:bg-dark-600`}
28+
className={`${inter.className} flex h-screen min-h-screen flex-col overflow-hidden bg-light-500 dark:bg-dark-500`}
2929
>
3030
{/* <Header /> */}
3131
<ErrorBoundary>

src/app/page.tsx

+11-44
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,35 @@
11
import Image from 'next/image';
22

3-
import { FilePlus2, TextSearch, Binary, DatabaseZap, FileOutput, Eye } from 'lucide-react';
43
import Footer from '@/components/Global/Footer';
5-
import featuresData from '@/l/util/constants.json';
6-
import HeroSection from '@/components/Home/HeroSection';
74

8-
const iconMap = {
9-
FilePlus2,
10-
TextSearch,
11-
Binary,
12-
DatabaseZap,
13-
FileOutput,
14-
Eye,
15-
};
5+
import HeroSection from '@/components/Home/HeroSection';
6+
import FeatureCards from '@/components/Cards/FeatureCards';
167

178
export default function Home() {
18-
const features = featuresData.features.map((feature) => ({
19-
...feature,
20-
icon: iconMap[feature.icon as keyof typeof iconMap],
21-
}));
22-
239
return (
2410
<>
25-
<main className='flex flex-col items-center overflow-scroll overflow-x-hidden bg-gradient-to-bl from-accent3/40 to-accent2/40'>
26-
<div className='flex flex-col items-center justify-center p-2 lg:p-5 xl:p-12'>
11+
<main className='flex flex-col items-center overflow-scroll overflow-x-hidden bg-gradient-to-br from-accent2/40 to-accent/40 dark:from-accent3/30 dark:to-accent4/30'>
12+
<div className='flex flex-col items-center justify-center space-y-15 p-2 lg:p-5 xl:p-12'>
2713
<HeroSection />
2814

29-
<div className='relavtive mb-8 overflow-hidden pt-16 md:mb-12 lg:mb-16'>
30-
<div className='mx-auto max-w-7xl px-6 lg:px-8'>
15+
<div className='relavtive overflow-hidden rounded-xl p-[1px] shadow-2xl'>
16+
<div className='mx-auto max-w-[1500px]'>
3117
<Image
3218
src='/screencap.webp'
3319
alt='illustration'
34-
width={2432}
35-
height={1442}
36-
className='mb-[-0%] rounded-xl shadow-2xl ring-1 ring-accent2'
20+
width={1906}
21+
height={910}
22+
className='rounded-xl ring ring-accent2 dark:ring-accent4/60'
3723
/>
3824
<div aria-hidden='true' className='relative'>
39-
<div className='-x-inset-32 absolute bottom-0 w-full rounded-xl bg-gradient-to-t from-white/95 pt-[5%]' />
25+
<div className='-x-inset-32 absolute bottom-0 mb-[-0%] w-full rounded-xl bg-gradient-to-t from-light-200/85 pt-[5%] dark:from-dark-700/90' />
4026
</div>
4127
</div>
4228
</div>
4329

4430
{/* map thru features */}
4531

46-
<div className='mb-3 md:mb-6 lg:mb-10'>
47-
<dl className='gapy-y-10 mx-auto grid max-w-2xl grid-cols-1 gap-x-6 px-6 text-base text-dark-700 dark:text-light-700 sm:grid-cols-2 lg:mx-0 lg:max-w-7xl lg:grid-cols-3 lg:gap-x-8 lg:gap-y-16 lg:px-8'>
48-
{features.map((feature, i) => (
49-
<div
50-
key={i}
51-
className='relative rounded-lg border border-accent/80 bg-light-500/30 px-2 py-4 shadow-lg shadow-dark-900/30 drop-shadow-md dark:border-accent2/80 dark:bg-dark-700/50'
52-
>
53-
<dt className='inline font-semibold text-dark-800 dark:text-light-600'>
54-
<feature.icon
55-
className='absolute left-3 top-5 h-10 w-10 text-accent2 dark:text-accent'
56-
aria-hidden='true'
57-
/>
58-
59-
<p className='ml-16 text-lg font-medium leading-6'>{feature.title}</p>
60-
</dt>
61-
<dd className='ml-16 mt-2 text-base'>{feature.description}</dd>
62-
</div>
63-
))}
64-
</dl>
65-
</div>
32+
<FeatureCards />
6633
</div>
6734
<Footer />
6835
</main>

src/components/Cards/FeatureCards.tsx

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import React from 'react';
2+
import featuresData from '@/l/util/constants.json';
3+
import { FilePlus2, TextSearch, Binary, DatabaseZap, FileOutput, Eye } from 'lucide-react';
4+
const iconMap = {
5+
FilePlus2,
6+
TextSearch,
7+
Binary,
8+
DatabaseZap,
9+
FileOutput,
10+
Eye,
11+
};
12+
13+
const FeatureCards = () => {
14+
const features = featuresData.features.map((feature) => ({
15+
...feature,
16+
icon: iconMap[feature.icon as keyof typeof iconMap],
17+
}));
18+
return (
19+
<div className='mb-3 md:mb-6 lg:mb-10'>
20+
<dl className='mx-auto grid max-w-2xl grid-cols-1 gap-x-6 gap-y-8 px-6 text-base text-dark-700 dark:text-light-700 sm:grid-cols-2 lg:mx-0 lg:max-w-7xl lg:grid-cols-3 lg:gap-x-8 lg:gap-y-16 lg:px-8'>
21+
{features.map((feature, i) => (
22+
<div
23+
key={i}
24+
className='relative rounded-lg border border-accent2/80 bg-light-500/30 px-2 py-4 shadow-lg shadow-dark-900/30 drop-shadow-md dark:border-accent/80 dark:bg-dark-700/50'
25+
>
26+
<dt className='inline font-semibold text-dark-800 dark:text-light-600'>
27+
<feature.icon
28+
className='absolute left-3 top-5 h-10 w-10 text-accent4 dark:text-accent2'
29+
aria-hidden='true'
30+
/>
31+
32+
<p className='ml-16 text-lg font-medium leading-6'>{feature.title}</p>
33+
</dt>
34+
<dd className='ml-16 mt-2 text-base'>{feature.description}</dd>
35+
</div>
36+
))}
37+
</dl>
38+
</div>
39+
);
40+
};
41+
42+
export default FeatureCards;

src/components/Global/Footer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22

33
const Footer = () => {
44
return (
5-
<footer className='dark:text-cslight-600 text-csdark-700 bottom-0 w-full bg-light-500/30 py-6 dark:bg-dark-800/40'>
5+
<footer className='bottom-0 w-full bg-light-500/30 py-6 text-dark-700 shadow-black inner-glow-light-60 dark:bg-dark-700/50 dark:text-light-600 dark:inner-glow-dark-70'>
66
<div className='container mx-auto flex flex-wrap justify-between'>
77
<div className='mb-4 w-full sm:w-1/2 md:w-1/4 lg:w-1/6'>
88
<h3 className='mb-2 text-lg font-bold'>DocuBot</h3>

src/components/Home/HeroSection.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ import { Button } from '@/components/ui/button';
44

55
function HeroSection() {
66
return (
7-
<div className='mx-auto flex max-w-7xl flex-col items-center justify-center rounded-md bg-light-400 px-6 py-16 drop-shadow-xl dark:bg-dark-700 sm:py-8 lg:px-8'>
7+
<div className='mx-auto flex max-w-7xl flex-col items-center justify-center rounded-xl border border-accent2/60 bg-light-500/70 px-6 py-16 shadow-xl shadow-dark-800/30 drop-shadow-xl dark:border-accent/40 dark:bg-dark-700/85 sm:py-8 lg:px-8'>
88
<div className='mx-auto flex max-w-2xl flex-col items-center justify-center sm:text-center'>
9-
<h4 className='text-base font-semibold leading-7 text-accent'>
10-
<span className='text-xl text-accent2'>DocuBot</span> Interactive Document Companion
9+
<h4 className='text-base font-semibold leading-7 text-accent2 dark:text-accent'>
10+
<span className='text-2xl font-extrabold text-accent text-stroke-2 text-stroke-accent2 dark:text-accent2 dark:text-stroke-accent'>
11+
DocuBot
12+
</span>
13+
{' - '}
14+
Your Interactive Document Companion
1115
</h4>
12-
<h1 className='my-2 text-3xl font-bold tracking-tight text-dark-800 dark:text-light-500 sm:text-4xl'>
16+
<h1 className='my-2 text-3xl font-bold tracking-tight text-gradient-lime-violet sm:text-4xl'>
1317
Transform Your PDFs into Interactive Conversations
1418
</h1>
1519
<Image src='/logo.png' alt='logo' width={124} height={124} />

tailwind.config.ts

+120
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ const config: Config = {
2020
flex: {
2121
full: '0 0 100%',
2222
},
23+
strokeWidth: {
24+
DEFAULT: '1',
25+
'0': '0',
26+
'1': '1',
27+
'2': '2',
28+
},
2329
screens: {
2430
xs: '420px',
2531
sm: '640px',
@@ -42,6 +48,11 @@ const config: Config = {
4248
'14': '14',
4349
'15': '15',
4450
},
51+
gradients: {
52+
'lime-violet': 'linear-gradient(to right, #5029a6 0%, #8db600 100%)',
53+
'red-yellow': 'linear-gradient(to right, #f83600 0%, #f9d423 100%)',
54+
// Add more gradients as needed
55+
},
4556
colors: {
4657
accent: '#8db600',
4758
accent2: '#5029a6',
@@ -599,6 +610,115 @@ const config: Config = {
599610
}
600611
addUtilities(neonUtilities);
601612
}),
613+
plugin(({ theme, addUtilities }: { theme: any; addUtilities: (arg0: any) => void }) => {
614+
const innerGlowUtilities: Record<string, any> = {};
615+
const colors = theme('colors');
616+
const opacities = theme('opacity', {});
617+
618+
for (const colorName in colors) {
619+
if (typeof colors[colorName] === 'object') {
620+
const color1 = colors[colorName][600];
621+
const color2 = colors[colorName][900];
622+
623+
// Add the regular glow without opacity
624+
innerGlowUtilities[`.inner-glow-${colorName}`] = {
625+
boxShadow: `inset 0 0 10px ${color1}, inset 10px 10px 40px ${color2}`,
626+
};
627+
628+
// Add versions with opacity
629+
for (const opacityName in opacities) {
630+
const opacityValue = opacities[opacityName];
631+
632+
innerGlowUtilities[`.inner-glow-${colorName}-${opacityName}`] = {
633+
boxShadow: `inset 0 0 10px ${color1}${Math.round(opacityValue * 255)
634+
.toString(16)
635+
.padStart(2, '0')}, inset 10px 10px 40px ${color2}${Math.round(opacityValue * 255)
636+
.toString(16)
637+
.padStart(2, '0')}`,
638+
};
639+
}
640+
}
641+
}
642+
643+
addUtilities(innerGlowUtilities);
644+
}),
645+
646+
plugin(function ({ addUtilities, theme }) {
647+
const gradients = theme('gradients', {});
648+
const newUtilities: Record<string, any> = Object.keys(gradients).reduce(
649+
(acc, key) => {
650+
acc[`.text-gradient-${key}`] = {
651+
'background-image': gradients[key as keyof typeof gradients],
652+
'background-clip': 'text',
653+
'-webkit-background-clip': 'text',
654+
color: 'transparent',
655+
};
656+
return acc;
657+
},
658+
{} as Record<string, any>
659+
);
660+
addUtilities(newUtilities);
661+
}),
662+
plugin(function ({ addUtilities }) {
663+
const newUtilities = {
664+
'.frosted-glass': {
665+
background: 'rgba(255, 255, 255, 0.25)',
666+
'backdrop-filter': 'blur(10px)',
667+
border: '1px solid rgba(255, 255, 255, 0.18)',
668+
'box-shadow': '0 8px 32px 0 rgba(31, 38, 135, 0.37)',
669+
},
670+
'.frosted-glass-dark': {
671+
background: 'rgba(0, 0, 0, 0.25)',
672+
'backdrop-filter': 'blur(10px)',
673+
border: '1px solid rgba(0, 0, 0, 0.18)',
674+
'box-shadow': '0 8px 32px 0 rgba(0, 0, 0, 0.37)',
675+
},
676+
};
677+
678+
addUtilities(newUtilities);
679+
}),
680+
plugin(function ({ addUtilities, theme }) {
681+
const strokeWidths = theme('strokeWidth', {
682+
DEFAULT: '1',
683+
'0': '0.5',
684+
'1': '1',
685+
'2': '2',
686+
});
687+
688+
const colors = theme('colors', {});
689+
690+
// Define the type of utilities object
691+
const utilities: Record<string, Record<string, string>> = {};
692+
693+
// Generate stroke width utilities
694+
Object.entries(strokeWidths).forEach(([key, value]) => {
695+
utilities[`.text-stroke${key === 'DEFAULT' ? '' : `-${key}`}`] = {
696+
'-webkit-text-stroke-width': `${value}px`,
697+
'paint-order': 'stroke fill',
698+
};
699+
});
700+
701+
// Generate stroke color utilities
702+
Object.entries(colors as Record<string, string | Record<string, string>>).forEach(
703+
([colorName, color]) => {
704+
if (typeof color === 'string') {
705+
utilities[`.text-stroke-${colorName}`] = {
706+
'-webkit-text-stroke-color': color,
707+
'paint-order': 'stroke fill',
708+
};
709+
} else if (typeof color === 'object' && color !== null) {
710+
Object.entries(color).forEach(([shade, shadeColor]) => {
711+
utilities[`.text-stroke-${colorName}-${shade}`] = {
712+
'-webkit-text-stroke-color': shadeColor,
713+
'paint-order': 'stroke fill',
714+
};
715+
});
716+
}
717+
}
718+
);
719+
720+
addUtilities(utilities);
721+
}),
602722
],
603723
};
604724
export default config;

0 commit comments

Comments
 (0)