fixes for site

This commit is contained in:
Desktop
2025-11-13 18:42:53 +05:00
parent 86f6886a13
commit a9e8d6fe2d
4 changed files with 59 additions and 37 deletions

View File

@@ -6,6 +6,7 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"build:marketing": "vite build --mode marketing",
"build:check": "tsc -b && vite build", "build:check": "tsc -b && vite build",
"type-check": "tsc -b --noEmit", "type-check": "tsc -b --noEmit",
"lint": "eslint .", "lint": "eslint .",

View File

@@ -16,6 +16,29 @@ const HeroSection: React.FC<HeroSectionProps> = ({
primaryCta, primaryCta,
secondaryCta, secondaryCta,
}) => { }) => {
const renderCta = (cta: { label: string; href: string }, className: string) => {
const isExternal = cta.href.startsWith("http");
if (isExternal) {
return (
<a
href={cta.href}
className={className}
target="_blank"
rel="noreferrer"
>
{cta.label}
</a>
);
}
return (
<Link to={cta.href} className={className}>
{cta.label}
</Link>
);
};
return ( return (
<section className="relative overflow-hidden"> <section className="relative overflow-hidden">
<div className="absolute inset-0 bg-[radial-gradient(circle_at_top,_rgba(66,133,244,0.25),_rgba(9,14,26,0.9))]" /> <div className="absolute inset-0 bg-[radial-gradient(circle_at_top,_rgba(66,133,244,0.25),_rgba(9,14,26,0.9))]" />
@@ -31,19 +54,13 @@ const HeroSection: React.FC<HeroSectionProps> = ({
{subheadline} {subheadline}
</p> </p>
<div className="flex flex-col sm:flex-row gap-4"> <div className="flex flex-col sm:flex-row gap-4">
<Link {renderCta(
to={primaryCta.href} primaryCta,
className="inline-flex items-center justify-center rounded-full bg-brand-500 hover:bg-brand-400 px-6 py-3 text-sm md:text-base font-semibold transition" "inline-flex items-center justify-center rounded-full bg-brand-500 hover:bg-brand-400 px-6 py-3 text-sm md:text-base font-semibold transition"
> )}
{primaryCta.label} {secondaryCta && renderCta(
</Link> secondaryCta,
{secondaryCta && ( "inline-flex items-center justify-center rounded-full border border-white/20 px-6 py-3 text-sm md:text-base font-semibold text-white/80 hover:text-white hover:border-white/40 transition"
<Link
to={secondaryCta.href}
className="inline-flex items-center justify-center rounded-full border border-white/20 px-6 py-3 text-sm md:text-base font-semibold text-white/80 hover:text-white hover:border-white/40 transition"
>
{secondaryCta.label}
</Link>
)} )}
</div> </div>
</div> </div>

View File

@@ -49,16 +49,16 @@ const Tour: React.FC = () => {
{tourSteps.map((step, index) => ( {tourSteps.map((step, index) => (
<div <div
key={step.title} key={step.title}
className={`grid grid-cols-1 lg:grid-cols-2 gap-12 items-center ${index % 2 === 1 ? "lg:flex-row-reverse" : ""}`} className="grid grid-cols-1 lg:grid-cols-2 gap-12 items-center"
> >
<div className="space-y-4"> <div className={`space-y-4 ${index % 2 === 1 ? "lg:order-2" : ""}`}>
<span className="text-xs uppercase tracking-[0.3em] text-white/50"> <span className="text-xs uppercase tracking-[0.3em] text-white/50">
Step {index + 1} Step {index + 1}
</span> </span>
<h3 className="text-2xl font-semibold">{step.title}</h3> <h3 className="text-2xl font-semibold">{step.title}</h3>
<p className="text-sm text-white/70 leading-relaxed">{step.description}</p> <p className="text-sm text-white/70 leading-relaxed">{step.description}</p>
</div> </div>
<div className="rounded-3xl border border-white/10 bg-white/5 overflow-hidden"> <div className={`rounded-3xl border border-white/10 bg-white/5 overflow-hidden ${index % 2 === 1 ? "lg:order-1" : ""}`}>
<img <img
src={`/marketing/images/${step.image}`} src={`/marketing/images/${step.image}`}
alt={step.title} alt={step.title}

View File

@@ -6,6 +6,7 @@ import { resolve } from "path";
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig(({ mode }) => { export default defineConfig(({ mode }) => {
const isDev = mode === "development"; const isDev = mode === "development";
const isMarketingBuild = mode === "marketing";
return { return {
plugins: [ plugins: [
@@ -23,27 +24,26 @@ export default defineConfig(({ mode }) => {
optimizeDeps: { optimizeDeps: {
include: [ include: [
// Only pre-bundle frequently used, small dependencies // Only pre-bundle frequently used, small dependencies
'clsx', "clsx",
'tailwind-merge', "tailwind-merge",
'zustand', "zustand",
// Include apexcharts for proper module resolution // Include apexcharts for proper module resolution (skip during marketing-only build)
'apexcharts', ...(isMarketingBuild ? [] : ["apexcharts", "react-apexcharts"]),
'react-apexcharts',
], ],
// Exclude heavy dependencies that are only used in specific pages // Exclude heavy dependencies that are only used in specific pages
// They will be lazy-loaded when needed // They will be lazy-loaded when needed
exclude: [ exclude: [
'@fullcalendar/core', "@fullcalendar/core",
'@fullcalendar/daygrid', "@fullcalendar/daygrid",
'@fullcalendar/interaction', "@fullcalendar/interaction",
'@fullcalendar/list', "@fullcalendar/list",
'@fullcalendar/react', "@fullcalendar/react",
'@fullcalendar/timegrid', "@fullcalendar/timegrid",
'@react-jvectormap/core', "@react-jvectormap/core",
'@react-jvectormap/world', "@react-jvectormap/world",
'react-dnd', "react-dnd",
'react-dnd-html5-backend', "react-dnd-html5-backend",
'swiper', "swiper",
], ],
esbuildOptions: { esbuildOptions: {
target: 'es2020', target: 'es2020',
@@ -57,10 +57,14 @@ export default defineConfig(({ mode }) => {
cssCodeSplit: true, cssCodeSplit: true,
// Optimize chunk size // Optimize chunk size
rollupOptions: { rollupOptions: {
input: { input: isMarketingBuild
main: resolve(__dirname, "index.html"), ? {
marketing: resolve(__dirname, "marketing.html"), marketing: resolve(__dirname, "marketing.html"),
}, }
: {
main: resolve(__dirname, "index.html"),
marketing: resolve(__dirname, "marketing.html"),
},
output: { output: {
// Manual chunk splitting for better code splitting // Manual chunk splitting for better code splitting
manualChunks: (id) => { manualChunks: (id) => {