mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +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
@@ -59,3 +59,7 @@
|
||||
@media(max-width:900px){.showcase .screens{height:520px;max-width:760px;width:100%;margin-inline:auto}.screens .screen-desktop{width:86%}.phone-frame{width:27%}}
|
||||
@media(max-width:600px){.showcase .screens{height:390px}.screens .screen-desktop{width:88%;top:38px}.phone-frame{left:7px;width:34%;padding:6px 4px 5px;border-radius:14px}.phone-frame:before{border-radius:14px}.phone-frame>span{height:3px;margin-bottom:5px}.screens .phone-frame img{border-radius:8px}}
|
||||
@media(prefers-reduced-motion:reduce){.phone-frame{animation:none}}
|
||||
|
||||
/* Device-aware phone hardware */
|
||||
.phone-frame{padding:7px 6px 12px;background:linear-gradient(145deg,#25323a,#050a0e 28%,#020507 72%,#18242b);border:1px solid #65808c;box-shadow:0 30px 65px #000c,0 0 36px #25caf516,inset 0 0 0 1px #ffffff0c}.phone-frame:after{content:"";position:absolute;inset:3px;border:1px solid #000;border-radius:inherit;pointer-events:none}.phone-sensor{position:relative;z-index:2;display:flex;align-items:center;justify-content:center;height:14px}.phone-sensor span,.phone-sensor b{display:block}.phone-button{position:absolute;z-index:0;width:3px;background:linear-gradient(#70818a,#1b272d);border:1px solid #10171b;box-shadow:0 1px 2px #000}.phone-button-left{left:-4px}.phone-button-right{right:-4px}.phone-home{position:absolute;z-index:4;left:50%;bottom:4px;transform:translateX(-50%);height:3px;border-radius:99px;background:#b8c5ca80}.phone-android{border-radius:17px}.phone-android:before,.phone-android:after{border-radius:17px}.phone-android .phone-sensor span{width:7px;height:7px;border-radius:50%;background:#020405;box-shadow:inset 0 0 0 2px #142933,0 0 0 1px #000}.phone-android .phone-sensor span:after{content:"";display:block;width:2px;height:2px;margin:2px;border-radius:50%;background:#2f86a9}.phone-android .phone-sensor b{display:none}.phone-android .phone-button-left{display:none}.phone-android .phone-button-right{top:56px;height:42px;border-radius:0 3px 3px 0}.phone-android .phone-home{width:24%}.phone-android img{border-radius:10px!important}.phone-iphone{padding:7px 7px 13px;border-radius:27px;border-color:#83939b}.phone-iphone:before,.phone-iphone:after{border-radius:27px}.phone-iphone .phone-sensor{height:17px}.phone-iphone .phone-sensor span{position:relative;width:43px;height:12px;border-radius:99px;background:#010203;box-shadow:inset 0 1px 2px #000}.phone-iphone .phone-sensor span:after{content:"";position:absolute;right:5px;top:4px;width:4px;height:4px;border-radius:50%;background:#071b2b;box-shadow:inset 0 0 0 1px #173c52}.phone-iphone .phone-sensor b{display:none}.phone-iphone .phone-button-left{top:58px;height:34px;border-radius:3px 0 0 3px;box-shadow:0 42px 0 #26353d,0 72px 0 #26353d}.phone-iphone .phone-button-right{top:72px;height:48px;border-radius:0 3px 3px 0}.phone-iphone .phone-home{width:34%;background:#e1e8ebaa}.phone-iphone img{border-radius:19px!important}
|
||||
@media(max-width:600px){.phone-frame{padding:5px 4px 10px}.phone-sensor{height:10px}.phone-android .phone-sensor span{width:5px;height:5px}.phone-android .phone-sensor span:after{width:1px;height:1px;margin:2px}.phone-android .phone-button-right{top:40px;height:30px}.phone-iphone{padding:5px 5px 11px;border-radius:19px}.phone-iphone:before,.phone-iphone:after{border-radius:19px}.phone-iphone .phone-sensor{height:12px}.phone-iphone .phone-sensor span{width:30px;height:8px}.phone-iphone .phone-sensor span:after{right:4px;top:3px;width:3px;height:3px}.phone-iphone .phone-button-left{top:42px;height:24px;box-shadow:0 30px 0 #26353d,0 51px 0 #26353d}.phone-iphone .phone-button-right{top:50px;height:34px}.phone-iphone img{border-radius:13px!important}}
|
||||
+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