İçeriğe geç
Sınırlı süreStarter artık $20 yerine aylık $9.Planları gör
charmotion

Animasyonlu splash ya da yükleme maskotu eklemek için yapay zeka prompt'ları

Yazan: Charmotion ekibi · Güncelleme: · Rehberlerimizi nasıl yazıyoruz

Rehberin kapak illüstrasyonu: Animasyonlu splash ya da yükleme maskotu eklemek için yapay zeka prompt'ları, Charmotion demo karakterleriyle

Cursor, Claude Code, Lovable, Bolt ve v0 gibi yapay zeka kodlama araçları, prompt genellikle yanlış tahmin ettikleri şeyleri açıkça belirttiğinde animasyonlu bir splash ya da yükleme maskotu ekleyebilir: işletim sisteminin splash'i durağan kalır, intro ilk ekranda oynar, state machine'in tam adı, dosya bitiş event'i göndermediği için 2,6 saniyelik bir zamanlayıcı, tek bir arka plan rengi ve azaltılmış hareket için bir yedek.

Önemli noktalar

  • Ortak kurallar bloğunu prompt'a ya da proje kurallarınıza yapıştırın, böylece her araç aynı bilgileri alır.
  • Araca işletim sistemi launch screen'inin durağan kalması gerektiğini söyleyin; aksi halde onu canlandırmaya çalışabilir.
  • Açılış dosyasının bitiş event'i göndermediğini belirtin; yoksa araç hiç tetiklenmeyecek bir callback uydurur.
  • Framework'ü, paketi ve dosya yollarını adıyla belirtin; belirsiz prompt'lar bir .riv dosyası için Lottie kodu üretir.
  • Sonucu kısa bir kontrol listesiyle gözden geçirin: renk eşleşmesi, zamanlayıcı, güvenlik zaman aşımı, azaltılmış hareket.

Zaten bir karakteriniz ya da logonuz mu var? Örnekleri gerçek uygulama ekranlarında görün: splash, onboarding, yükleme ve boş durum ekranları, her birinde oynayan animasyonla birlikte.

Yapay zeka kodlama araçları animasyonlu splash ekranlarını neden yanlış yapar?

Çünkü eğitim verilerindeki en yaygın yanıt, sizin uygulamanız için yanlış olanıdır. Hiçbir detay vermeden “animasyonlu bir splash ekranı” isterseniz çoğu zaman bunlardan birini alırsınız:

  • Yalnızca kod bağlantısı olmayan standart UIKit sınıflarını kullanabilen LaunchScreen.storyboard içine animasyon koyma girişimi (Apple).
  • Bir .riv dosyasını gösteren bir Lottie bileşeni ya da istemediğiniz yeni bir animasyon kütüphanesi.
  • Dosyanın hiç göndermediği bir “animasyon bitti” event'ini bekleyen bir listener; bu yüzden uygulama introda takılı kalır.
  • Native modülleri yükleyemeyen Expo Go'da çalıştırılan Rive kodu (Rive).
  • Splash, root view ve intro farklı renkler kullandığı için beyaz bir parlama.
  • Azaltılmış hareket için hiçbir yol olmaması.

Çözüm, bilgileri araca baştan vermektir. Tekrar etmemek için bunları kalıcı proje talimatlarına koyun: Claude Code CLAUDE.md dosyasını okur ve AGENTS.md dosyasını da okuyabilir (Claude Code Docs), Cursor proje kurallarını .cursor/rules içinde .mdc dosyaları olarak okur ve AGENTS.md dosyasını destekler (Cursor Docs), Lovable'da ise her zaman bağlamda olan çalışma alanı ve proje Knowledge'ı vardır (Lovable Docs). Bolt ve v0 için kuralları sohbetin en başına yapıştırın.

Her splash prompt'u hangi kuralları içermeli?

Bu bloğu aşağıdaki framework prompt'larından herhangi birinin önüne yapıştırın ve köşeli parantez içindeki değerleri değiştirin. Blok bir Charmotion açılış dosyasını varsayar (LaunchStateMachine, 2,6 saniyelik intro, bitiş event'i yok); dosyanız farklıysa bu satırları değiştirin.

Rules for the launch animation (follow exactly):
- The OS launch screen stays static. Do not try to animate
  LaunchScreen.storyboard, UILaunchScreen, the Expo splash config
  or flutter_native_splash. The animation plays on the FIRST SCREEN.
- Asset: [assets/launch.riv]. State machine: "LaunchStateMachine".
  It plays a 2.6 s intro once and settles on the resting icon.
- The file fires NO end event. Do not listen for "introDone",
  "onComplete" or any other event. Wait 2.6 s with a timer, then
  continue. Add a 4 s safety timeout in case the file fails to load.
- Background color [#0E1116] must be identical on the native
  splash, the root view and the intro screen (light and dark).
- Show the intro at the same size and center position as the icon
  on the native splash, so there is no visible jump.
- Reduced motion: if the user has it enabled, skip the intro and
  show the still icon [assets/icon_rest.png], then continue.
- Never block the app longer than the intro. Do not add extra delay.
- Do not add Lottie or any other animation library.

Zamanlayıcı kuralı neden önemli: bir Rive state machine'i yalnızca yazarının eklediği event'leri gönderir. Bir Charmotion açılış dosyası bir kez oynar, dinlenme pozunda durur ve hiçbir şey göndermez; bu yüzden devam etmenin tek doğru yolu süresi kadar beklemektir. Araca bir event adı uydurmamasını söylemek, en yaygın takılma sorununu önler.

Charmotion indirmeleri .riv dosyasının yanında web, React ve SwiftUI kodu da içerir, böylece bir örneği tarif etmek yerine çalışan bir örneği prompt'a ekleyebilirsiniz.

SwiftUI'da animasyonlu splash'i hangi prompt ekler?

Bir Xcode projesinde Cursor ya da Claude Code için:

Add a launch intro to this SwiftUI app.

[paste the rules block]

Details:
- Add the RiveRuntime Swift package (rive-ios) if it is missing.
- Bundle launch.riv in the app target.
- Create LaunchIntroView: full-screen Color("LaunchBackground"),
  centered 160x160 RiveViewModel(fileName: "launch",
  stateMachineName: "LaunchStateMachine").view().
- In the App struct, show LaunchIntroView over ContentView with a
  @State showIntro = true. After 2.6 s (Task.sleep), set it to false
  with a 0.25 s opacity transition.
- Read @Environment(\.accessibilityReduceMotion). If true, do not
  show the intro at all.
- Set UILaunchScreen in Info.plist: UIColorName = LaunchBackground,
  UIImageName = IconRest (same size as the intro's icon).
- Do not modify LaunchScreen.storyboard beyond static views.
Show me the files you changed.

Yeni Rive Apple runtime'ı dahil bunun elle yazılmış tam sürümü SwiftUI'da animasyonlu splash ekranı rehberinde.

Expo ya da React Native'de animasyonlu splash'i hangi prompt ekler?

Add an animated launch intro to this Expo app (Expo Router).

[paste the rules block]

Details:
- Use expo-splash-screen: call SplashScreen.preventAutoHideAsync()
  in global scope in app/_layout.tsx. Call SplashScreen.hideAsync()
  only after the Rive file has loaded.
- In app.json, set the expo-splash-screen plugin backgroundColor,
  image (assets/icon-rest.png), imageWidth 160 and dark options, and
  the same root "backgroundColor". Install expo-system-ui if needed.
- Use @rive-app/react-native with react-native-nitro-modules, installed
  with npx expo install. This needs a development build, not Expo Go.
- Add "riv" to resolver.assetExts in metro.config.js.
- Create components/LaunchIntro.tsx: useRiveFile(require(...)),
  RiveView with stateMachineName="LaunchStateMachine", autoPlay,
  160x160, centered on the background color. Call onDone after
  2600 ms with setTimeout. Add a 4000 ms safety timeout.
- Check AccessibilityInfo.isReduceMotionEnabled(); if true, hide the
  splash and call onDone immediately.
- Do not use Lottie. Do not listen for any Rive event.

Her adımın arka planı: Expo ve React Native'de animasyonlu splash ve Expo'da Rive.

Flutter'da animasyonlu splash'i hangi prompt ekler?

Add an animated launch intro to this Flutter app.

[paste the rules block]

Details:
- Keep flutter_native_splash for the native splash (color [#0E1116],
  image assets/icon_rest.png). It stays static.
- In main(): binding = WidgetsFlutterBinding.ensureInitialized();
  FlutterNativeSplash.preserve(widgetsBinding: binding);
  await RiveNative.init();
- Add the rive package. Create IntroPage (StatefulWidget) as home:
  load File.asset('assets/launch.riv', riveFactory: Factory.rive),
  create RiveWidgetController with
  StateMachineSelector.byName('LaunchStateMachine'), render
  RiveWidget in a 160x160 SizedBox centered on the background color.
- Call FlutterNativeSplash.remove() after the file loads, wait
  2600 ms, then Navigator.pushReplacement to the existing home page.
- If MediaQuery.disableAnimationsOf(context) (or
  platformDispatcher.accessibilityFeatures.disableAnimations) is true,
  show Image.asset('assets/icon_rest.png') and navigate immediately.
- Dispose the controller and the file in dispose().

Aynı kod, açıkça yazılmış ve açıklanmış hali: Flutter'da animasyonlu splash ekranı.

Next.js, Lovable, Bolt ya da v0'da animasyonlu introyu hangi prompt ekler?

Web uygulamalarında işletim sistemi splash'i yoktur, bu yüzden karşılığı bir hero ya da ilk boyamada oynayan bir introdur. Lovable, Bolt ve v0 genellikle React üretir, dolayısıyla tek bir prompt hepsini kapsar:

Add an animated logo intro to the hero of this React / Next.js page.

Assets (in /public):
- logo-intro.webm (VP9 with alpha), logo-intro.mov (HEVC with alpha),
  logo-rest.webp (the still final frame, same size).

Rules:
- Render a <video autoplay muted playsinline> with poster="/logo-rest.webp",
  fixed width and height (no layout shift), and two sources in this
  order: logo-intro.mov with type 'video/mp4; codecs="hvc1"', then
  logo-intro.webm with type "video/webm".
- Do not loop. When it ends, keep the last frame (it matches the poster).
- If play() rejects, keep showing the poster.
- With prefers-reduced-motion: reduce, render only the poster image.
- In Next.js, make the component a client component.
- Do not add Lottie, GSAP or any other animation library.

Web'de video yerine etkileşimli bir maskot için stateMachine: "CharacterViewModelMachine" ve autoBind: true ile @rive-app/react-webgl2 isteyin (Rive). Kaynak sırası ve codec'ler, Jake Archibald'ın tarayıcılar arası yaklaşımını izler (Jake Archibald); web sitesinde şeffaf arka planlı video rehberine bakın.

Splash yerine yükleme maskotunu hangi prompt ekler?

Aynı karakter dosyası yükleme durumlarını da yönetebilir. Bu prompt yukarıdaki kurallardaki dosya yapısını (bir Character view model'i) varsayar; özellik adlarını kendi dosyanıza göre değiştirin:

Show the mascot while [the image generation request] is pending.

- File: [assets/character.riv]. State machine: "CharacterViewModelMachine".
  View model "Character" with a number property "mood". It has
  no triggers.
- Mood values: 0 idle, 1 happy, 4 sad, 5 loading.
- Before the request: set mood = 5. On success: set mood = 1,
  then back to 0 after 1.5 s. On failure: set mood = 4 and show
  the error text.
- Only show the mascot if the request takes longer than 600 ms.
- Keep visible "Loading…" text with role="status" (web) or an
  accessibility label (native). Hide the animation itself from
  screen readers.
- Reduced motion: show the still image and the text, no animation.
- If the file has no "Character" view model, fall back to the
  legacy "CharacterStateMachine" with the same number input "mood".

Yükleme animasyonu zamanlaması ve erişilebilirlik hakkında daha fazlası yükleme animasyonu nasıl eklenir rehberinde.

Yapay zeka aracının yazdığı kodu nasıl kontrol edersiniz?

Merge etmeden önce şunları gözden geçirin:

  1. İşletim sistemi splash'ine dokunulmamış ya da durağan. Launch storyboard'da kod yok, Android'de drawable-v31 dışında animasyonlu drawable yok.
  2. Splash, root ve introda, açık ve karanlık modda tek bir arka plan rengi.
  3. Introyu uydurulmuş bir event değil, bir zamanlayıcı bitiriyor, ayrıca bir güvenlik zaman aşımı var.
  4. Splash dosya yüklendikten sonra gizleniyor, öncesinde değil (boş kare yok).
  5. Azaltılmış hareket introyu atlıyor (işletim sistemi ayarı açıkken, web'de prefers-reduced-motion ile kontrol edin) (MDN).
  6. Sürpriz bağımlılık yok. Aracın kendi kendine eklediği her kütüphaneyi kaldırın.
  7. Expo için bir release build'de test edildi, tüm platformlar için de gerçek bir cihazda.

Sıkça sorulan sorular

Splash animasyonu eklemek için en iyi yapay zeka kodlama aracı hangisi?

Araç, prompt'tan daha az önemlidir. Cursor ve Claude Code mevcut native ya da Expo projenizin içinde çalışır; Lovable, Bolt ve v0 en güçlü web React uygulamalarındadır. State machine adlarını, sabit intro süresini, ortak arka plan rengini ve azaltılmış hareket kuralını verdiğinizde hepsi başarılı olur.

Yapay zekanın ürettiği splash introm neden hiç bitmiyor?

Genellikle kod, animasyon dosyasının göndermediği bir bitiş event'ini beklediği için. Bir Charmotion LaunchStateMachine, 2,6 saniyelik introsu bittiğinde hiçbir event göndermez. Listener'ı 2.600 ms'lik bir zamanlayıcıyla değiştirin ve uygulamanın her zaman devam etmesi için bir güvenlik zaman aşımı ekleyin.

Splash kurallarını CLAUDE.md'ye ya da Cursor kurallarına koymalı mıyım?

Açılış akışına birden fazla kişi ya da oturum dokunacaksa evet. Claude Code her oturumda CLAUDE.md dosyasını yükler (ve AGENTS.md dosyasını da okuyabilir), Cursor da .cursor/rules içindeki .mdc kurallarını uygular; böylece zamanlayıcı, renk ve azaltılmış hareket kuralları her düzenlemede geçerli kalır.

Bu rehberden kısa yanıtlar

Kaynaklar

İlgili rehberler