Logo van Iphone Duo Capacitor

Iphone Duo Capacitor

Community
mirzaaghazadeh
iphone-duo-capacitor

Adapt a Capacitor or Ionic app to iPhone Duo, Apple's first foldable iPhone — why the standard Device Posture and Viewport Segments CSS does not reach a web view, what CSS gives you today, and how to get fold state, hinge angle and bar placement from the native side. Use when a Capacitor, Ionic, Angular, React or Vue app needs foldable iPhone support.

Overzicht

Uitgevermirzaaghazadeh
Repositoryiphone-duo-skills
Skillnaamiphone-duo-capacitor
Sterren
188
Forks
9
Meegeleverde bestanden
Alleen instructies
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door mirzaaghazadeh op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Iphone Duo Capacitor in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/mirzaaghazadeh/iphone-duo-skills/tree/main/skills/iphone-duo-capacitor
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mirzaaghazadeh/iphone-duo-skills.git /tmp/iphone-duo-skills
mkdir -p .claude/skills
cp -r /tmp/iphone-duo-skills/skills/iphone-duo-capacitor .claude/skills/iphone-duo-capacitor
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Iphone Duo Capacitor in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Iphone Duo Capacitor automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Iphone Duo Capacitor niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Capacitor on iPhone Duo

Start here, because it is the thing that will waste your afternoon otherwise:

WebKit 27.1 implements Device Posture and Viewport Segments, but both sit behind an experimental flag that only Safari can set.

A Capacitor app runs in a WKWebView it does not control the flags of, so navigator.devicePosture, the device-posture media query and the env(viewport-segment-*) variables are all absent there, while the same page in Safari on the same device can see them. Feature-detect rather than assume, and plan for both to be missing.

So the web platform gives you no fold awareness on this device out of the box. What it does give you is most of what matters. Work in two tiers.

Tier 1 — works today, no native code

Trust safe areas, and never assume symmetry

This is the one that produces real bugs. iOS moves its bars to one side of the display, and that side depends on the pose and the reading direction.

The bar arrives as a genuine safe-area inset: measured on the 27.1 simulator it is env(safe-area-inset-right) of 84px, and it moves to env(safe-area-inset-top) of 82px if the app opts out of vertical bars, live and without a reload. So most layouts need nothing more than honest env(safe-area-inset-*) padding on all four edges.

Any expression of the form width - env(safe-area-inset-left) * 2 is a defect on this device.

Resize correctly

The window changes size constantly: opening, closing, folding, rotating, Split View. Read sizes when you need them rather than caching, and prefer container queries and %/fr layout over stored pixel values. Anything measured in a useEffect or ngOnInit and kept will be stale within seconds.

Think in size classes, not device checks

iOS reasons about this device in size classes: the outer display is compact width, the inner display is regular width. Branch on the size you were given, never on a user-agent string or an orientation, since the inner display does not honour supported orientations.

Measured on the simulator: inner display 951×669 in landscape, outer display 466×678.

Move navigation to the side on the wide display

When iOS moves its own tab bars and toolbars to a vertical rail, an HTML tab bar pinned to the bottom looks unconverted next to every native app. A side rail on the inner display and a bottom bar on the outer one is the web analogue, and it costs one breakpoint.

Tier 2 — needs the native side

Everything genuinely iPhone Duo-specific is invisible to the web view until something native hands it over.

Native API (iOS 27.1)Why you want it in the web view
reservedRegions(kind:options:) on UIViewWhere the fold and the camera are, so layout can avoid them
UIHingeInteractionContinuous hinge angle, for effects and posture
verticalBarEdge on the trait collectionWhich edge iOS moved the bars to, so your own chrome matches
Size class from traitCollectionThe signal iOS actually uses, rather than your breakpoint guess

Two details worth knowing before you write any of this yourself. A flat phone's fold region is reported inactive, so reading it needs options: .includeInactive or you will conclude the device has no hinge. And UIHinge.status updates lazily, so it disagrees with the angle mid-fold; treat the angle as the truth when both are available.

Use the existing bridge

@erkamyaman/capacitor-foldable is an MIT plugin that already does this, and also fills in Device Posture and Viewport Segments so the standard CSS works in an app today:

bash
npm install @erkamyaman/capacitor-foldable
npx cap sync
typescript
import { Foldable, installFoldablePolyfill } from '@erkamyaman/capacitor-foldable';

await installFoldablePolyfill();

const fold = await Foldable.getFoldState();
await Foldable.addListener('foldStateChange', (state) => layout(state));

The polyfill sets --fold-left, --fold-width and friends on <html>, so a grid can put its gutter exactly on the crease rather than guessing. The same build covers Android foldables through androidx.window.

Deeper material lives in iphone-duo-capacitor-skills: the CSS patterns, the full API, Ionic specifics, and how to test on the simulator and on an Android emulator.

Ionic apps

Ionic's ion-tabs is HTML, so it stays at the bottom while native bars move. Two routes: a stylesheet that turns the tab bar into a side pill on the edge iOS chose, or @rdlabo/ionic-theme-ios27, which repositions existing ion-buttons, ion-button, ion-back-button and ion-tab-bar controls and projects them into native UI. The theme takes device state as input, so the two compose rather than compete.

What to do, in order

  1. Audit every safe-area expression for assumed symmetry. Most bugs die here.
  2. Stop caching sizes, and branch on the size you were handed.
  3. Give the wide display a real layout rather than a stretched phone one.
  4. Add the plugin, and feature-detect the standard APIs so the same build still works in a browser that has them.
  5. Only then reach for hinge angle effects, which are the smallest part of a good port.

Steps 1 to 3 need no native code and improve the app on tablets at the same time. Step 4 is the only iPhone Duo-specific part, and it cannot be tested without the Xcode 27.1 simulator.

For what the native APIs do and why, read ../iphone-duo-adaptive-layout/SKILL.md and ../iphone-duo-vertical-bars/SKILL.md — the design reasoning transfers directly even though the code does not.

Veelgestelde vragen

Wat doet de AI-skill Iphone Duo Capacitor?

Adapt a Capacitor or Ionic app to iPhone Duo, Apple's first foldable iPhone — why the standard Device Posture and Viewport Segments CSS does not reach a web view, what CSS gives you today, and how to get fold state, hinge angle and bar placement from the native side. Use when a Capacitor, Ionic, Angular, React or Vue app needs foldable iPhone support.

Waarom Iphone Duo Capacitor gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Iphone Duo Capacitor bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Iphone Duo Capacitor in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/mirzaaghazadeh/iphone-duo-skills/tree/main/skills/iphone-duo-capacitor. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Iphone Duo Capacitor gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Iphone Duo Capacitor gebruiken?

Zoveel als je wilt. Je kunt Iphone Duo Capacitor gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Iphone Duo Capacitor gratis?

Deze skill is door mirzaaghazadeh op GitHub gepubliceerd. Bekijk de repository voor de licentievoorwaarden. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇