- Hero/Final-CTA: 'kostenlos starten' -> '14 Tage kostenlos testen' + Subline 'danach ab 3,99€/Monat, jederzeit kündbar' (löst free-vs-Preis-Verwirrung; Trial existiert bereits Stripe-seitig + Pricing nennt ihn) - useOS()-Composable + OS-aware RebreakMagic-Download: Windows-Besucher -> /download/windows, Mac/sonst -> /download/rebreakmagic Deployed: rebreak.org via deploy-marketing.sh Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
31 lines
966 B
TypeScript
31 lines
966 B
TypeScript
export type DetectedOS = 'windows' | 'mac' | 'ios' | 'android' | 'other';
|
|
|
|
/**
|
|
* Erkennt das Besucher-OS clientseitig (SSR-safe: startet 'other', updated
|
|
* onMounted). Für OS-aware Download-CTAs auf der Landing-Page.
|
|
*/
|
|
export function useOS() {
|
|
const os = ref<DetectedOS>('other');
|
|
|
|
onMounted(() => {
|
|
const ua = (navigator.userAgent || '').toLowerCase();
|
|
const platform = (navigator.platform || '').toLowerCase();
|
|
const touch = navigator.maxTouchPoints || 0;
|
|
|
|
if (/iphone|ipad|ipod/.test(ua) || (platform === 'macintel' && touch > 1)) {
|
|
// iPadOS gibt sich als "MacIntel" mit Touchpoints aus.
|
|
os.value = 'ios';
|
|
} else if (/android/.test(ua)) {
|
|
os.value = 'android';
|
|
} else if (ua.includes('win') || platform.includes('win')) {
|
|
os.value = 'windows';
|
|
} else if (ua.includes('mac') || platform.includes('mac')) {
|
|
os.value = 'mac';
|
|
} else {
|
|
os.value = 'other';
|
|
}
|
|
});
|
|
|
|
return { os };
|
|
}
|