feat: initialize shoplix platform
This commit is contained in:
commit
de2074a43b
277 files changed
+10407
No files matched your search
@@ -0,0 +1,546 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { ArrowRight, ChevronRight, Mail, Menu, Search } from "lucide-react";
|
||||
import "./styles.css";
|
||||
|
||||
const API = "http://localhost:8082/api/site/v1";
|
||||
type ContentType = "NEWS" | "CASE" | "HELP";
|
||||
type Item = {
|
||||
productCode?: string;
|
||||
contentCode?: string;
|
||||
productName?: string;
|
||||
title?: string;
|
||||
slug: string;
|
||||
summary?: string;
|
||||
model?: string;
|
||||
publishTime?: string;
|
||||
coverMediaUrl?: string;
|
||||
};
|
||||
type InquiryField = {
|
||||
fieldCode: string;
|
||||
fieldKey: string;
|
||||
label: string;
|
||||
fieldType: string;
|
||||
placeholder?: string;
|
||||
required: boolean;
|
||||
optionsJson?: string;
|
||||
widthType: string;
|
||||
};
|
||||
type InquiryFormData = {
|
||||
formCode: string;
|
||||
submitButtonText: string;
|
||||
successMessage: string;
|
||||
fields: InquiryField[];
|
||||
};
|
||||
async function post(path: string, body: unknown) {
|
||||
const r = await fetch(API + path, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
if (!r.ok)
|
||||
throw new Error((await r.json()).message || "Unable to load content");
|
||||
return r.json();
|
||||
}
|
||||
const nav = [
|
||||
["Products", "/products"],
|
||||
["Cases", "/cases"],
|
||||
["News", "/news"],
|
||||
["Help", "/help"],
|
||||
["About", "/about-us"],
|
||||
];
|
||||
function route() {
|
||||
const p = location.pathname.split("/").filter(Boolean);
|
||||
const previewPage = new URLSearchParams(location.search).get("previewPage") || undefined;
|
||||
if (!p.length) return { kind: "home", previewPage };
|
||||
if (["products", "news", "cases", "help"].includes(p[0]))
|
||||
return { kind: p[0], slug: p[1], previewPage };
|
||||
return { kind: "page", slug: p[0], previewPage };
|
||||
}
|
||||
function App() {
|
||||
const r = route();
|
||||
const runtime = <CustomCodeRuntime />;
|
||||
if (r.kind === "home") return <>{runtime}<DecoratedPage pageType={r.previewPage || "HOME"} fallback={<><Header /><main><Home /></main><Footer /></>} /></>;
|
||||
if (r.kind === "products") return <>{runtime}<DecoratedPage pageType={r.previewPage || (r.slug ? "PRODUCT_DETAIL" : "PRODUCT_CATEGORY")} fallback={<><Header /><main><Collection title="Products" type="products" slug={r.slug} /></main><Footer /></>} /></>;
|
||||
if (r.kind === "news") return <>{runtime}<DecoratedPage pageType={r.previewPage || (r.slug ? "NEWS_DETAIL" : "NEWS_CATEGORY")} fallback={<><Header /><main><Collection title="News" type="NEWS" slug={r.slug} /></main><Footer /></>} /></>;
|
||||
if (r.kind === "cases") return <>{runtime}<DecoratedPage pageType={r.previewPage || (r.slug ? "CASE_DETAIL" : "CASE_CATEGORY")} fallback={<><Header /><main><Collection title="Case Studies" type="CASE" slug={r.slug} /></main><Footer /></>} /></>;
|
||||
if (r.kind === "help") return <>{runtime}<DecoratedPage pageType={r.previewPage || (r.slug ? "HELP_DETAIL" : "HELP_CATEGORY")} fallback={<><Header /><main><Collection title="Help Center" type="HELP" slug={r.slug} /></main><Footer /></>} /></>;
|
||||
return <>{runtime}<DecoratedPage pageType={r.previewPage || (r.slug === "about-us" ? "ABOUT_US" : "CUSTOM_PAGE")} fallback={<><Header /><main><Page slug={r.slug!} /></main><Footer /></>} /></>;
|
||||
}
|
||||
function CustomCodeRuntime() {
|
||||
useEffect(() => { let nodes: HTMLElement[] = []; post("/custom-codes/list", { siteCode: "SIT0000000000001" }).then(data => { (data.items || []).forEach((item: { content: string; position: string }) => { const container = item.position === "HEAD" ? document.head : document.body; const wrapper = document.createElement("div"); wrapper.innerHTML = item.content; Array.from(wrapper.children).forEach(child => { let node: HTMLElement = child as HTMLElement; if (child.tagName === "SCRIPT") { const script = document.createElement("script"); Array.from(child.attributes).forEach(attribute => script.setAttribute(attribute.name, attribute.value)); script.text = child.textContent || ""; node = script; } container.insertBefore(node, item.position === "BODY_START" ? container.firstChild : null); nodes.push(node); }); }); }).catch(() => undefined); return () => nodes.forEach(node => node.remove()); }, []);
|
||||
return null;
|
||||
}
|
||||
type DecorationSection = { id:string; type:string; title:string; subtitle:string; imageUrl:string; buttonText:string; buttonUrl:string; sourceType:string; limit:number; visible:boolean; background:string; textColor:string };
|
||||
type DecorationSchema = { global:{primaryColor:string;backgroundColor:string;textColor:string;fontFamily:string;contentWidth:number};sections:DecorationSection[] };
|
||||
function DecoratedPage({ pageType, fallback }: { pageType: string; fallback: React.ReactNode }) {
|
||||
const [schema,setSchema]=useState<DecorationSchema|null>(null); const [loaded,setLoaded]=useState(false);
|
||||
useEffect(()=>{setLoaded(false);setSchema(null);post("/decorations/detail",{pageType}).then(data=>{if(data.schema)setSchema(JSON.parse(data.schema));setLoaded(true)}).catch(()=>setLoaded(true))},[pageType]);
|
||||
if(!loaded) return <div className="site-loading">Loading...</div>;
|
||||
if(!schema || !schema.sections?.length) return <>{fallback}</>;
|
||||
return <div className="decorated-site" style={{background:schema.global.backgroundColor,color:schema.global.textColor,fontFamily:schema.global.fontFamily,"--brand":schema.global.primaryColor} as React.CSSProperties}>{schema.sections.filter(section=>section.visible).map(section=><LiveSection key={section.id} section={section}/>)}</div>;
|
||||
}
|
||||
function LiveSection({section}:{section:DecorationSection}) {
|
||||
const style={background:section.background,color:section.textColor};
|
||||
if(section.type==="ANNOUNCEMENT")return <div className="live-announcement" style={style}>{section.title}</div>;
|
||||
if(section.type==="HEADER")return <header className="live-header" style={style}><a href="/" className="live-logo">SHOPLIX</a><nav>{nav.map(([name,url])=><a key={url} href={url}>{name}</a>)}</nav><a className="live-quote" href="/contact-us">Get a quote</a></header>;
|
||||
if(section.type==="HERO")return <section className="live-hero" style={{...style,backgroundImage:section.imageUrl?`linear-gradient(90deg,rgba(0,0,0,.72),rgba(0,0,0,.12)),url(${section.imageUrl})`:undefined}}><div><p>ENGINEERED FOR INDUSTRY</p><h1>{section.title}</h1><span>{section.subtitle}</span>{section.buttonText&&<a href={section.buttonUrl||"#"}>{section.buttonText}<ArrowRight size={17}/></a>}</div></section>;
|
||||
if(section.type==="RICH_TEXT")return <section className="live-rich" style={style}><h2>{section.title}</h2><p>{section.subtitle}</p></section>;
|
||||
if(section.type==="PRODUCTS"||section.type==="CONTENT")return <LiveCollection section={section}/>;
|
||||
if(section.type==="INQUIRY")return <section className="live-inquiry" style={style}><div><p>START A PROJECT</p><h2>{section.title}</h2><span>{section.subtitle}</span></div><InquiryForm scene="GENERAL"/></section>;
|
||||
if(section.type==="FOOTER")return <footer className="live-footer" style={style}><div><b>SHOPLIX</b><p>Industrial Solutions</p></div><div><b>Explore</b><a href="/products">Products</a><a href="/cases">Cases</a><a href="/news">News</a></div><div><b>Company</b><a href="/about-us">About Us</a><a href="/contact-us">Contact Us</a><a href="/privacy-policy">Privacy Policy</a></div><small>{section.subtitle||"Copyright © 2026. All rights reserved."}</small></footer>;
|
||||
return null;
|
||||
}
|
||||
function LiveCollection({section}:{section:DecorationSection}) {
|
||||
const [items,setItems]=useState<Item[]>([]);
|
||||
useEffect(()=>{const path=section.type==="PRODUCTS"?"/products/list":"/contents/list";const body=section.type==="PRODUCTS"?{}:{contentType:section.sourceType||"CASE"};post(path,body).then(data=>setItems((data.items||[]).slice(0,section.limit||3))).catch(()=>setItems([]))},[section.type,section.sourceType,section.limit]);
|
||||
const base=section.type==="PRODUCTS"?"products":(section.sourceType||"CASE").toLowerCase();
|
||||
return <section className="live-collection" style={{background:section.background,color:section.textColor}}><p>FEATURED</p><h2>{section.title}</h2><div>{items.map(item=><a href={`/${base}/${item.slug}`} key={item.productCode||item.contentCode}><div>{item.coverMediaUrl&&<img src={`http://localhost:8082${item.coverMediaUrl}`} alt={item.productName||item.title}/>}</div><span>{section.type==="PRODUCTS"?"PRODUCT":section.sourceType}</span><h3>{item.productName||item.title}</h3><p>{item.summary}</p></a>)}</div></section>;
|
||||
}
|
||||
function Header() {
|
||||
return (
|
||||
<header>
|
||||
<a className="logo" href="/">
|
||||
<b>SHOPLIX</b>
|
||||
<span>Industrial Solutions</span>
|
||||
</a>
|
||||
<nav>
|
||||
{nav.map(([n, h]) => (
|
||||
<a href={h} key={h}>
|
||||
{n}
|
||||
</a>
|
||||
))}
|
||||
</nav>
|
||||
<div className="actions">
|
||||
<Search size={19} />
|
||||
<a className="quote" href="/contact-us">
|
||||
<Mail size={16} />
|
||||
Request a Quote
|
||||
</a>
|
||||
<Menu className="mobile" />
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
function Home() {
|
||||
return (
|
||||
<>
|
||||
<section className="hero">
|
||||
<div className="hero-copy">
|
||||
<p className="eyebrow">ENGINEERED FOR INDUSTRY</p>
|
||||
<h1>Reliable equipment for demanding operations.</h1>
|
||||
<p>
|
||||
Explore industrial products, application expertise and
|
||||
project-proven solutions from a partner built for B2B delivery.
|
||||
</p>
|
||||
<div>
|
||||
<a className="cta" href="/products">
|
||||
Explore Products <ArrowRight size={17} />
|
||||
</a>
|
||||
<a className="text-link" href="/cases">
|
||||
View Case Studies
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div className="hero-visual">
|
||||
<div className="metric">
|
||||
<strong>16+</strong>
|
||||
<span>Industries served</span>
|
||||
</div>
|
||||
<div className="lines" />
|
||||
</div>
|
||||
</section>
|
||||
<section className="intro">
|
||||
<p className="eyebrow">WHAT WE DELIVER</p>
|
||||
<h2>From technical selection to project delivery</h2>
|
||||
<div className="pillars">
|
||||
<article>
|
||||
<b>01</b>
|
||||
<h3>Product expertise</h3>
|
||||
<p>
|
||||
Clear technical parameters and application-focused
|
||||
recommendations.
|
||||
</p>
|
||||
</article>
|
||||
<article>
|
||||
<b>02</b>
|
||||
<h3>Proven applications</h3>
|
||||
<p>
|
||||
Documented case studies for real industrial operating conditions.
|
||||
</p>
|
||||
</article>
|
||||
<article>
|
||||
<b>03</b>
|
||||
<h3>Responsive support</h3>
|
||||
<p>
|
||||
Direct inquiry routing and practical help throughout your project.
|
||||
</p>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
</>
|
||||
);
|
||||
}
|
||||
function Collection({
|
||||
title,
|
||||
type,
|
||||
slug,
|
||||
}: {
|
||||
title: string;
|
||||
type: "products" | ContentType;
|
||||
slug?: string;
|
||||
}) {
|
||||
const [data, setData] = useState<Item[] | Record<string, unknown>>([]);
|
||||
const [error, setError] = useState("");
|
||||
useEffect(() => {
|
||||
const run = async () => {
|
||||
try {
|
||||
if (slug) {
|
||||
setData(
|
||||
await post(
|
||||
type === "products" ? "/products/detail" : "/contents/detail",
|
||||
type === "products" ? { slug } : { contentType: type, slug },
|
||||
),
|
||||
);
|
||||
} else {
|
||||
const x = await post(
|
||||
type === "products" ? "/products/list" : "/contents/list",
|
||||
type === "products" ? {} : { contentType: type },
|
||||
);
|
||||
setData(x.items || []);
|
||||
}
|
||||
} catch (e) {
|
||||
setError(e instanceof Error ? e.message : "Unable to load");
|
||||
}
|
||||
};
|
||||
void run();
|
||||
}, [type, slug]);
|
||||
if (error) return <ErrorState message={error} />;
|
||||
if (slug && !Array.isArray(data)) {
|
||||
const d = data as Record<string, any>;
|
||||
return (
|
||||
<article className="detail">
|
||||
<Crumbs current={String(d.productName || d.title || title)} />
|
||||
<p className="eyebrow">{title.toUpperCase()}</p>
|
||||
<h1>{d.productName || d.title}</h1>
|
||||
<p className="lead">{d.summary}</p>
|
||||
{d.coverMediaUrl && <img className="product-cover" src={`http://localhost:8082${d.coverMediaUrl}`} alt={d.productName || d.title}/>}
|
||||
{d.attributes?.length > 0 && <section className="specs"><h2>Product attributes</h2>{d.attributes.map((a:any,i:number)=><div key={i}><span>{a.name}</span><strong>{a.value} {a.unit}</strong></div>)}</section>}
|
||||
<div
|
||||
className="content"
|
||||
dangerouslySetInnerHTML={{ __html: d.content || "" }}
|
||||
/>
|
||||
{d.specifications?.length > 0 && (
|
||||
<section className="specs">
|
||||
<h2>Technical specifications</h2>
|
||||
{d.specifications.map((s: any, i: number) => (
|
||||
<div key={i}>
|
||||
<span>
|
||||
{s.groupName && `${s.groupName} · `}
|
||||
{s.name}
|
||||
</span>
|
||||
<strong>
|
||||
{s.value} {s.unit}
|
||||
</strong>
|
||||
</div>
|
||||
))}
|
||||
</section>
|
||||
)}
|
||||
{type === "products" && d.inquiryEnabled && (
|
||||
<InquiryForm scene="PRODUCT" sourceCode={d.productCode} />
|
||||
)}
|
||||
</article>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<section className="listing">
|
||||
<Crumbs current={title} />
|
||||
<div className="listing-head">
|
||||
<div>
|
||||
<p className="eyebrow">KNOWLEDGE & SOLUTIONS</p>
|
||||
<h1>{title}</h1>
|
||||
</div>
|
||||
<p>
|
||||
Explore our latest {title.toLowerCase()} and find the information you
|
||||
need for your next project.
|
||||
</p>
|
||||
</div>
|
||||
<div className="cards">
|
||||
{(data as Item[]).map((item) => (
|
||||
<a
|
||||
className="card"
|
||||
href={`/${type === "products" ? "products" : type.toLowerCase()}/${item.slug}`}
|
||||
key={item.productCode || item.contentCode}
|
||||
>
|
||||
<div className="thumb">
|
||||
{item.coverMediaUrl && <img src={`http://localhost:8082${item.coverMediaUrl}`} alt={item.productName || item.title}/>}
|
||||
<span>{type === "products" ? "PRODUCT" : type}</span>
|
||||
</div>
|
||||
<div>
|
||||
<small>
|
||||
{item.model || item.publishTime?.slice(0, 10) || "INSIGHT"}
|
||||
</small>
|
||||
<h2>{item.productName || item.title}</h2>
|
||||
<p>
|
||||
{item.summary || "Explore details and technical information."}
|
||||
</p>
|
||||
<span className="read">
|
||||
Read more <ChevronRight size={15} />
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
function Page({ slug }: { slug: string }) {
|
||||
if (slug === "contact-us")
|
||||
return (
|
||||
<article className="detail">
|
||||
<Crumbs current="Contact Us" />
|
||||
<p className="eyebrow">START A CONVERSATION</p>
|
||||
<h1>Tell us about your project.</h1>
|
||||
<p className="lead">
|
||||
Share your requirements and our team will respond with practical next
|
||||
steps.
|
||||
</p>
|
||||
<InquiryForm scene="CONTACT" />
|
||||
</article>
|
||||
);
|
||||
return <ConfiguredPage slug={slug} />;
|
||||
}
|
||||
function ConfiguredPage({ slug }: { slug: string }) {
|
||||
const [data, setData] = useState<any>();
|
||||
const [error, setError] = useState("");
|
||||
useEffect(() => {
|
||||
post("/pages/detail", { slug })
|
||||
.then(setData)
|
||||
.catch((e) => setError(e.message));
|
||||
}, [slug]);
|
||||
if (error) return <ErrorState message={error} />;
|
||||
if (!data) return <div className="loading">Loading…</div>;
|
||||
return (
|
||||
<article className="detail">
|
||||
<Crumbs current={data.pageName} />
|
||||
<p className="eyebrow">COMPANY INFORMATION</p>
|
||||
<h1>{data.pageName}</h1>
|
||||
<p className="lead">{data.summary}</p>
|
||||
<div
|
||||
className="content"
|
||||
dangerouslySetInnerHTML={{ __html: data.content }}
|
||||
/>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
function InquiryForm({
|
||||
scene,
|
||||
sourceCode,
|
||||
}: {
|
||||
scene: "PRODUCT" | "CONTACT" | "GENERAL";
|
||||
sourceCode?: string;
|
||||
}) {
|
||||
const [definition, setDefinition] = useState<InquiryFormData>();
|
||||
const [form, setForm] = useState({
|
||||
name: "",
|
||||
email: "",
|
||||
phone: "",
|
||||
company: "",
|
||||
countryCode: "",
|
||||
message: "",
|
||||
privacyConsent: false,
|
||||
website: "",
|
||||
});
|
||||
const [custom, setCustom] = useState<Record<string, string>>({});
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [notice, setNotice] = useState("");
|
||||
useEffect(() => {
|
||||
post("/inquiries/form-detail", { scene })
|
||||
.then(setDefinition)
|
||||
.catch((e) => setNotice(e.message));
|
||||
}, [scene]);
|
||||
const submit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
if (!definition) return;
|
||||
try {
|
||||
setBusy(true);
|
||||
setNotice("");
|
||||
const result = await post("/inquiries/submit", {
|
||||
formCode: definition.formCode,
|
||||
sourceType: scene,
|
||||
sourceCode,
|
||||
sourceUrl: location.href,
|
||||
...form,
|
||||
fieldValues: definition.fields.map((x) => ({
|
||||
fieldCode: x.fieldCode,
|
||||
value: custom[x.fieldCode] || "",
|
||||
})),
|
||||
landingUrl: sessionStorage.getItem("landingUrl") || location.href,
|
||||
});
|
||||
setNotice(result.successMessage);
|
||||
} catch (err) {
|
||||
setNotice(
|
||||
err instanceof Error ? err.message : "Unable to submit inquiry",
|
||||
);
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
if (!definition)
|
||||
return (
|
||||
<section className="inquiry-box">
|
||||
<h2>Request information</h2>
|
||||
<p>{notice || "Loading inquiry form…"}</p>
|
||||
</section>
|
||||
);
|
||||
return (
|
||||
<section className="inquiry-box">
|
||||
<p className="eyebrow">REQUEST INFORMATION</p>
|
||||
<h2>Discuss your requirements</h2>
|
||||
<form onSubmit={submit}>
|
||||
<label>
|
||||
<span>Name *</span>
|
||||
<input
|
||||
required
|
||||
value={form.name}
|
||||
onChange={(e) => setForm({ ...form, name: e.target.value })}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
<span>Email *</span>
|
||||
<input
|
||||
type="email"
|
||||
required
|
||||
value={form.email}
|
||||
onChange={(e) => setForm({ ...form, email: e.target.value })}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
<span>Phone</span>
|
||||
<input
|
||||
value={form.phone}
|
||||
onChange={(e) => setForm({ ...form, phone: e.target.value })}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
<span>Company</span>
|
||||
<input
|
||||
value={form.company}
|
||||
onChange={(e) => setForm({ ...form, company: e.target.value })}
|
||||
/>
|
||||
</label>
|
||||
{definition.fields.map((field) => (
|
||||
<label
|
||||
className={field.widthType === "FULL" ? "wide" : ""}
|
||||
key={field.fieldCode}
|
||||
>
|
||||
<span>
|
||||
{field.label}
|
||||
{field.required ? " *" : ""}
|
||||
</span>
|
||||
{field.fieldType === "TEXTAREA" ? (
|
||||
<textarea
|
||||
required={field.required}
|
||||
value={custom[field.fieldCode] || ""}
|
||||
onChange={(e) =>
|
||||
setCustom({ ...custom, [field.fieldCode]: e.target.value })
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<input
|
||||
required={field.required}
|
||||
placeholder={field.placeholder}
|
||||
value={custom[field.fieldCode] || ""}
|
||||
onChange={(e) =>
|
||||
setCustom({ ...custom, [field.fieldCode]: e.target.value })
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</label>
|
||||
))}
|
||||
<label className="wide">
|
||||
<span>Message *</span>
|
||||
<textarea
|
||||
required
|
||||
rows={6}
|
||||
value={form.message}
|
||||
onChange={(e) => setForm({ ...form, message: e.target.value })}
|
||||
/>
|
||||
</label>
|
||||
<input
|
||||
className="honeypot"
|
||||
tabIndex={-1}
|
||||
autoComplete="off"
|
||||
value={form.website}
|
||||
onChange={(e) => setForm({ ...form, website: e.target.value })}
|
||||
/>
|
||||
<label className="consent wide">
|
||||
<input
|
||||
type="checkbox"
|
||||
required
|
||||
checked={form.privacyConsent}
|
||||
onChange={(e) =>
|
||||
setForm({ ...form, privacyConsent: e.target.checked })
|
||||
}
|
||||
/>
|
||||
<span>
|
||||
I agree to the <a href="/privacy-policy">Privacy Policy</a> and
|
||||
consent to the processing of my inquiry.
|
||||
</span>
|
||||
</label>
|
||||
<div className="wide">
|
||||
<button className="cta" disabled={busy}>
|
||||
{busy ? "Submitting…" : definition.submitButtonText}
|
||||
</button>
|
||||
{notice && <p className="form-notice">{notice}</p>}
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
function Crumbs({ current }: { current: string }) {
|
||||
return (
|
||||
<div className="crumbs">
|
||||
<a href="/">Home</a>
|
||||
<ChevronRight size={14} />
|
||||
<span>{current}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
function ErrorState({ message }: { message: string }) {
|
||||
return (
|
||||
<section className="error">
|
||||
<span>CONTENT UNAVAILABLE</span>
|
||||
<h1>We could not load this page.</h1>
|
||||
<p>{message}</p>
|
||||
<a href="/">Return home</a>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
function Footer() {
|
||||
return (
|
||||
<footer>
|
||||
<div>
|
||||
<b>SHOPLIX</b>
|
||||
<p>Industrial products and expertise for global B2B projects.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Company</h3>
|
||||
<a href="/about-us">About Us</a>
|
||||
<a href="/contact-us">Contact</a>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Legal</h3>
|
||||
<a href="/privacy-policy">Privacy Policy</a>
|
||||
<a href="/cookie-policy">Cookie Policy</a>
|
||||
<a href="/terms-of-service">Terms of Service</a>
|
||||
</div>
|
||||
<small>© 2026 Shoplix. All rights reserved.</small>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
createRoot(document.getElementById("root")!).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>,
|
||||
);
|
||||
@@ -0,0 +1,434 @@
|
||||
:root {
|
||||
font-family: Inter, Arial, sans-serif;
|
||||
color: #17242a;
|
||||
background: #fff;
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
/* 已发布页面装修 */
|
||||
.site-loading{min-height:100vh;display:grid;place-items:center}.decorated-site{min-height:100vh}.live-announcement{text-align:center;padding:9px 20px;font-size:13px}.live-header{height:86px;padding:0 max(5vw,24px);display:flex;align-items:center;gap:45px}.live-logo{font-size:25px;font-weight:800;color:inherit;text-decoration:none}.live-header nav{display:flex;justify-content:center;gap:30px;flex:1}.live-header nav a,.live-footer a{color:inherit;text-decoration:none}.live-quote,.live-hero a{background:var(--brand);color:#fff;text-decoration:none;padding:12px 19px;display:inline-flex;gap:8px;align-items:center}.live-hero{min-height:620px;background:#293d45;background-size:cover;background-position:center;display:flex;align-items:center;padding:0 max(7vw,30px);color:#fff}.live-hero>div{max-width:720px}.live-hero h1{font-size:clamp(42px,5vw,72px);line-height:1.05;margin:14px 0;letter-spacing:0}.live-hero span{display:block;font-size:19px;line-height:1.7;margin-bottom:28px}.live-rich,.live-collection,.live-inquiry{padding:90px max(7vw,30px)}.live-rich{text-align:center}.live-rich h2,.live-collection h2,.live-inquiry h2{font-size:40px;letter-spacing:0;margin:10px 0 24px}.live-rich p{max-width:850px;margin:auto;line-height:1.8}.live-collection>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}.live-collection>a{}.live-collection>p,.live-inquiry>div>p{color:var(--brand);font-size:13px;font-weight:800}.live-collection>div>a{color:inherit;text-decoration:none;border:1px solid #dce3e0;padding:14px}.live-collection>div>a>div{aspect-ratio:4/3;background:#e9eeec;overflow:hidden}.live-collection img{width:100%;height:100%;object-fit:cover}.live-collection span{font-size:11px;color:var(--brand);font-weight:800;display:block;margin-top:17px}.live-collection h3{font-size:21px}.live-inquiry{display:grid;grid-template-columns:1fr 1.4fr;gap:70px;background:#eef5f2}.live-inquiry .inquiry-box{margin:0;padding:0;background:transparent}.live-inquiry .inquiry-box>p,.live-inquiry .inquiry-box>h2{display:none}.live-footer{padding:65px max(7vw,30px);display:grid;grid-template-columns:2fr 1fr 1fr;gap:40px}.live-footer>div{display:flex;flex-direction:column;gap:12px}.live-footer>div:first-child b{font-size:26px}.live-footer small{grid-column:1/-1;border-top:1px solid #ffffff33;padding-top:25px;margin-top:15px}@media(max-width:760px){.live-header nav,.live-quote{display:none}.live-header{height:70px}.live-hero{min-height:560px}.live-rich,.live-collection,.live-inquiry{padding:60px 22px}.live-collection>div{grid-template-columns:1fr}.live-inquiry{grid-template-columns:1fr;gap:25px}.live-footer{grid-template-columns:1fr;padding:50px 22px}.live-footer small{grid-column:auto}}
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
header {
|
||||
height: 76px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 max(5vw, 28px);
|
||||
border-bottom: 1px solid #e4e8e7;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background: #fffffff2;
|
||||
backdrop-filter: blur(10px);
|
||||
z-index: 5;
|
||||
}
|
||||
.logo {
|
||||
display: grid;
|
||||
line-height: 1;
|
||||
}
|
||||
.logo b {
|
||||
font-size: 21px;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
.logo span {
|
||||
font-size: 9px;
|
||||
color: #6b787b;
|
||||
margin-top: 7px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
nav {
|
||||
display: flex;
|
||||
gap: 30px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
nav a:hover {
|
||||
color: #16715e;
|
||||
}
|
||||
.actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
}
|
||||
.quote,
|
||||
.cta {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
background: #176b5b;
|
||||
color: white;
|
||||
padding: 11px 17px;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.mobile {
|
||||
display: none;
|
||||
}
|
||||
.hero {
|
||||
min-height: 620px;
|
||||
display: grid;
|
||||
grid-template-columns: 1.05fr 0.95fr;
|
||||
background: #eef2f0;
|
||||
}
|
||||
.hero-copy {
|
||||
padding: 110px 7vw 80px;
|
||||
}
|
||||
.eyebrow {
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
color: #176b5b;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
.hero h1 {
|
||||
font-family: Georgia, serif;
|
||||
font-size: clamp(48px, 5.2vw, 78px);
|
||||
line-height: 1.02;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0;
|
||||
margin: 20px 0 26px;
|
||||
max-width: 800px;
|
||||
}
|
||||
.hero-copy > p:not(.eyebrow) {
|
||||
font-size: 18px;
|
||||
color: #59686b;
|
||||
max-width: 620px;
|
||||
}
|
||||
.hero-copy > div {
|
||||
display: flex;
|
||||
gap: 26px;
|
||||
align-items: center;
|
||||
margin-top: 36px;
|
||||
}
|
||||
.text-link {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
border-bottom: 1px solid;
|
||||
}
|
||||
.hero-visual {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(145deg, #26443d, #172b27);
|
||||
}
|
||||
.hero-visual:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 12% 8%;
|
||||
border: 1px solid #ffffff2e;
|
||||
background: linear-gradient(120deg, transparent 45%, #ffffff0c 45%);
|
||||
transform: skew(-7deg);
|
||||
}
|
||||
.lines {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: repeating-linear-gradient(
|
||||
90deg,
|
||||
transparent 0 70px,
|
||||
#ffffff0a 71px
|
||||
);
|
||||
}
|
||||
.metric {
|
||||
position: absolute;
|
||||
bottom: 50px;
|
||||
left: 45px;
|
||||
color: white;
|
||||
z-index: 2;
|
||||
}
|
||||
.metric strong {
|
||||
font:
|
||||
56px Georgia,
|
||||
serif;
|
||||
display: block;
|
||||
}
|
||||
.metric span {
|
||||
font-size: 12px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
.intro,
|
||||
.listing,
|
||||
.detail {
|
||||
max-width: 1220px;
|
||||
margin: auto;
|
||||
padding: 80px 28px;
|
||||
}
|
||||
.intro h2,
|
||||
.listing h1,
|
||||
.detail h1 {
|
||||
font:
|
||||
500 45px Georgia,
|
||||
serif;
|
||||
letter-spacing: 0;
|
||||
margin: 12px 0 34px;
|
||||
}
|
||||
.pillars {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
border-top: 1px solid #cad3d0;
|
||||
}
|
||||
.pillars article {
|
||||
padding: 28px 30px 15px 0;
|
||||
border-right: 1px solid #cad3d0;
|
||||
}
|
||||
.pillars article + article {
|
||||
padding-left: 30px;
|
||||
}
|
||||
.pillars b {
|
||||
color: #9a6b23;
|
||||
}
|
||||
.pillars h3 {
|
||||
font:
|
||||
500 22px Georgia,
|
||||
serif;
|
||||
}
|
||||
.pillars p {
|
||||
color: #657276;
|
||||
}
|
||||
.crumbs {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
color: #7a8789;
|
||||
font-size: 12px;
|
||||
margin-bottom: 45px;
|
||||
}
|
||||
.listing-head {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
align-items: end;
|
||||
border-bottom: 1px solid #cfd8d5;
|
||||
margin-bottom: 36px;
|
||||
}
|
||||
.listing-head > p {
|
||||
color: #657276;
|
||||
padding-bottom: 36px;
|
||||
}
|
||||
.cards {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 24px;
|
||||
}
|
||||
.card {
|
||||
border: 1px solid #dce2e0;
|
||||
transition: 0.2s;
|
||||
}
|
||||
.card:hover {
|
||||
transform: translateY(-3px);
|
||||
box-shadow: 0 13px 30px #1b302a12;
|
||||
}
|
||||
.thumb {
|
||||
aspect-ratio: 16/10;
|
||||
background: linear-gradient(145deg, #dce5e1, #aabbb4);
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
padding: 18px;
|
||||
color: #fff;
|
||||
font-size: 10px;
|
||||
letter-spacing: 2px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.thumb img {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
.thumb span {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 5px 8px;
|
||||
background: #14231fbb;
|
||||
}
|
||||
.card > div:last-child {
|
||||
padding: 22px;
|
||||
}
|
||||
.card small {
|
||||
font-size: 10px;
|
||||
color: #7f8a8b;
|
||||
}
|
||||
.card h2 {
|
||||
font:
|
||||
500 23px Georgia,
|
||||
serif;
|
||||
margin: 8px 0;
|
||||
}
|
||||
.card p {
|
||||
font-size: 13px;
|
||||
color: #687579;
|
||||
}
|
||||
.read {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
color: #176b5b;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.detail {
|
||||
max-width: 900px;
|
||||
}
|
||||
.detail h1 {
|
||||
font-size: 58px;
|
||||
}
|
||||
.lead {
|
||||
font-size: 20px;
|
||||
color: #5f6d70;
|
||||
border-bottom: 1px solid #d7dfdc;
|
||||
padding-bottom: 32px;
|
||||
}
|
||||
.product-cover { width: 100%; max-height: 560px; object-fit: contain; background: #f4f6f5; margin: 20px 0 35px; }
|
||||
.content {
|
||||
font-size: 17px;
|
||||
margin-top: 35px;
|
||||
}
|
||||
.content h2 {
|
||||
font:
|
||||
500 30px Georgia,
|
||||
serif;
|
||||
margin-top: 40px;
|
||||
}
|
||||
.content h3 {
|
||||
font-size: 20px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
.specs {
|
||||
margin-top: 55px;
|
||||
border-top: 2px solid #203630;
|
||||
}
|
||||
.specs h2 {
|
||||
font:
|
||||
500 30px Georgia,
|
||||
serif;
|
||||
}
|
||||
.specs div {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 13px 0;
|
||||
border-bottom: 1px solid #dbe1df;
|
||||
font-size: 14px;
|
||||
}
|
||||
.error,
|
||||
.loading {
|
||||
max-width: 800px;
|
||||
margin: 100px auto;
|
||||
padding: 50px 28px;
|
||||
}
|
||||
.error span {
|
||||
font-size: 11px;
|
||||
color: #9a6b23;
|
||||
}
|
||||
.error h1 {
|
||||
font:
|
||||
500 45px Georgia,
|
||||
serif;
|
||||
}
|
||||
.error p {
|
||||
color: #657276;
|
||||
}
|
||||
.error a {
|
||||
color: #176b5b;
|
||||
font-weight: 700;
|
||||
}
|
||||
footer {
|
||||
background: #172b27;
|
||||
color: #dce5e1;
|
||||
padding: 60px max(5vw, 28px) 25px;
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr 1fr;
|
||||
gap: 40px;
|
||||
}
|
||||
footer div {
|
||||
display: grid;
|
||||
align-content: start;
|
||||
gap: 9px;
|
||||
}
|
||||
footer b {
|
||||
font-size: 22px;
|
||||
}
|
||||
footer p {
|
||||
max-width: 350px;
|
||||
color: #9daaa6;
|
||||
}
|
||||
footer h3 {
|
||||
font-size: 12px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
footer a {
|
||||
font-size: 13px;
|
||||
color: #b7c1be;
|
||||
}
|
||||
footer small {
|
||||
grid-column: 1/-1;
|
||||
border-top: 1px solid #ffffff1a;
|
||||
padding-top: 22px;
|
||||
margin-top: 20px;
|
||||
color: #899792;
|
||||
}
|
||||
.inquiry-box { margin-top: 65px; padding: 34px; background: #eef2f0; border-top: 3px solid #176b5b; }
|
||||
.inquiry-box h2 { font: 500 32px Georgia, serif; margin: 8px 0 24px; }
|
||||
.inquiry-box form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
|
||||
.inquiry-box label { display: grid; gap: 6px; }
|
||||
.inquiry-box label > span { font-size: 12px; font-weight: 700; }
|
||||
.inquiry-box input, .inquiry-box textarea { width: 100%; border: 1px solid #cbd5d1; background: #fff; padding: 11px 12px; font: inherit; }
|
||||
.inquiry-box .wide { grid-column: 1 / -1; }
|
||||
.consent { display: flex !important; align-items: flex-start; }
|
||||
.consent input { width: auto; margin-top: 4px; }
|
||||
.consent a { color: #176b5b; text-decoration: underline; }
|
||||
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; }
|
||||
.form-notice { font-size: 13px; color: #176b5b; font-weight: 700; }
|
||||
.inquiry-box button:disabled { opacity: .55; }
|
||||
@media (max-width: 800px) {
|
||||
header nav,
|
||||
.quote {
|
||||
display: none;
|
||||
}
|
||||
.mobile {
|
||||
display: block;
|
||||
}
|
||||
.hero {
|
||||
grid-template-columns: 1fr;
|
||||
min-height: auto;
|
||||
}
|
||||
.hero-copy {
|
||||
padding: 70px 28px;
|
||||
}
|
||||
.hero-visual {
|
||||
height: 270px;
|
||||
}
|
||||
.hero h1 {
|
||||
font-size: 48px;
|
||||
}
|
||||
.pillars,
|
||||
.cards {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.pillars article {
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid #cad3d0;
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
.listing-head {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.detail h1 {
|
||||
font-size: 42px;
|
||||
}
|
||||
footer {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
footer > div:first-child {
|
||||
grid-column: 1/-1;
|
||||
}
|
||||
.inquiry-box form { grid-template-columns: 1fr; }
|
||||
.inquiry-box .wide { grid-column: auto; }
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
/// <reference types="vite/client" />
|
||||
Reference in new issue
Block a user