mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-03 01:42:50 +08:00
Add device-aware phone frames
This commit is contained in:
1 parent
0b76f2e354
commit
bb152a9bda
2 files changed
+12
-1
No files matched your search
+8
-1
@@ -7,6 +7,12 @@ const demo = "https://demo.webspeak3.de/";
|
||||
const client = "https://client.webspeak3.de/";
|
||||
|
||||
type Lang = "de" | "en";
|
||||
type PhoneStyle = "android" | "iphone";
|
||||
|
||||
function detectPhoneStyle(): PhoneStyle {
|
||||
const device = `${navigator.userAgent} ${navigator.platform}`.toLowerCase();
|
||||
return /iphone|ipad|ipod|macintosh|mac os/.test(device) ? "iphone" : "android";
|
||||
}
|
||||
|
||||
const copy = {
|
||||
de: {
|
||||
@@ -61,6 +67,7 @@ function Landing() {
|
||||
const t = copy[lang];
|
||||
const [activeTour, setActiveTour] = useState(0);
|
||||
const [copied, setCopied] = useState(false);
|
||||
const [phoneStyle] = useState<PhoneStyle>(detectPhoneStyle);
|
||||
|
||||
const copyDockerCommand = () => {
|
||||
navigator.clipboard?.writeText("docker run -d -p 8080:8080 --name webspeak3 moepchi/webspeak3:latest");
|
||||
@@ -130,7 +137,7 @@ function Landing() {
|
||||
|
||||
<section className="section shell architecture reveal" id="architecture"><div className="section-head centered"><div><span className="kicker">{t.architectureKicker}</span><h2>{t.architectureTitle}</h2></div><p>{t.architectureText}</p></div><div className="flow">{[["Browser","React + Web Audio"],["Gateway","WebSocket · Node.js"],["Rust Connector","tsclientlib + Opus"],["TeamSpeak Server","TS3 / TS6 Protocol"]].map((x,i)=><div className="flow-wrap" style={{"--delay": `${i * 120}ms`} as React.CSSProperties} key={x[0]}><div className="flow-node"><span>0{i+1}</span><strong>{x[0]}</strong><small>{x[1]}</small></div>{i<3&&<div className="flow-arrow" aria-hidden="true"><i></i></div>}</div>)}</div></section>
|
||||
|
||||
<section className="section shell showcase reveal"><div className="showcase-copy"><span className="kicker">{t.screenKicker}</span><h2>{t.screenTitle[0]}<br/>{t.screenTitle[1]}</h2><p>{t.screenText}</p><div className="theme-pills"><span>☾ Dark Mode</span><span>☀ Light Mode</span><span>⌁ Responsive</span></div></div><div className="screens"><img className="screen-desktop" src="../screenshots/webspeak_current.png" alt="WebSpeak3 Desktop Client"/><div className="phone-frame"><span></span><img src="../screenshots/webspeak_mobile.png" alt="WebSpeak3 Mobile Client"/></div></div></section>
|
||||
<section className="section shell showcase reveal"><div className="showcase-copy"><span className="kicker">{t.screenKicker}</span><h2>{t.screenTitle[0]}<br/>{t.screenTitle[1]}</h2><p>{t.screenText}</p><div className="theme-pills"><span>☾ Dark Mode</span><span>☀ Light Mode</span><span>⌁ Responsive</span></div></div><div className="screens"><img className="screen-desktop" src="../screenshots/webspeak_current.png" alt="WebSpeak3 Desktop Client"/><div className={`phone-frame phone-${phoneStyle}`} data-device-frame={phoneStyle}><i className="phone-button phone-button-left" aria-hidden="true"></i><i className="phone-button phone-button-right" aria-hidden="true"></i><div className="phone-sensor" aria-hidden="true"><span></span><b></b></div><img src="../screenshots/webspeak_mobile.png" alt="WebSpeak3 Mobile Client"/><div className="phone-home" aria-hidden="true"></div></div></div></section>
|
||||
|
||||
<section className="section shell product-tour reveal"><div className="section-head"><div><span className="kicker">{t.tourKicker}</span><h2>{t.tourTitle}</h2></div><p>{t.tourText}</p></div><div className="tour-layout"><div className="tour-screen"><div className="tour-image"><img src="../screenshots/webspeak_current.png" alt={t.imageAlt}/>{t.tourItems.map((item, index) => <button key={item[0]} className={`hotspot hotspot-${item[0]} ${activeTour === index ? "active" : ""}`} onClick={() => setActiveTour(index)} aria-label={item[1]} aria-pressed={activeTour === index}><span>{index + 1}</span></button>)}</div><div className="tour-caption"><span>0{activeTour + 1}</span><div><strong>{t.tourItems[activeTour][1]}</strong><p>{t.tourItems[activeTour][2]}</p></div></div></div><div className="tour-tabs">{t.tourItems.map((item, index) => <button key={item[0]} className={activeTour === index ? "active" : ""} onClick={() => setActiveTour(index)}><span>0{index + 1}</span><div><strong>{item[1]}</strong><small>{item[2]}</small></div></button>)}</div></div></section>
|
||||
|
||||
|
||||
Reference in new issue
Block a user