diff --git a/web/src/landing.css b/web/src/landing.css index b245e5c..34cf522 100644 --- a/web/src/landing.css +++ b/web/src/landing.css @@ -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}} diff --git a/web/src/landing.tsx b/web/src/landing.tsx index d364071..df77ba0 100644 --- a/web/src/landing.tsx +++ b/web/src/landing.tsx @@ -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(detectPhoneStyle); const copyDockerCommand = () => { navigator.clipboard?.writeText("docker run -d -p 8080:8080 --name webspeak3 moepchi/webspeak3:latest"); @@ -130,7 +137,7 @@ function Landing() {
{t.architectureKicker}

{t.architectureTitle}

{t.architectureText}

{[["Browser","React + Web Audio"],["Gateway","WebSocket · Node.js"],["Rust Connector","tsclientlib + Opus"],["TeamSpeak Server","TS3 / TS6 Protocol"]].map((x,i)=>
0{i+1}{x[0]}{x[1]}
{i<3&&}
)}
-
{t.screenKicker}

{t.screenTitle[0]}
{t.screenTitle[1]}

{t.screenText}

☾ Dark Mode☀ Light Mode⌁ Responsive
WebSpeak3 Desktop Client
WebSpeak3 Mobile Client
+
{t.screenKicker}

{t.screenTitle[0]}
{t.screenTitle[1]}

{t.screenText}

☾ Dark Mode☀ Light Mode⌁ Responsive
WebSpeak3 Desktop Client
WebSpeak3 Mobile Client
{t.tourKicker}

{t.tourTitle}

{t.tourText}

{t.imageAlt}/{t.tourItems.map((item, index) => )}
0{activeTour + 1}
{t.tourItems[activeTour][1]}

{t.tourItems[activeTour][2]}

{t.tourItems.map((item, index) => )}