style(front): 플랫폼별 애니메이션 패널 비율 조정

- 데스크톱/웹: 넓은 비율 (2.5)
- 모바일: 16:9 비율
- HeroVsBossAnimation 레이아웃 Flexible 적용
This commit is contained in:
JiWoong Sul
2026-01-05 19:51:48 +09:00
parent ff24f2bb55
commit be56825ef9
2 changed files with 23 additions and 8 deletions

View File

@@ -1,3 +1,6 @@
import 'dart:io' show Platform;
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:asciineverdie/data/game_text_l10n.dart' as game_l10n; import 'package:asciineverdie/data/game_text_l10n.dart' as game_l10n;
@@ -168,14 +171,23 @@ class _RetroHeader extends StatelessWidget {
class _AnimationPanel extends StatelessWidget { class _AnimationPanel extends StatelessWidget {
const _AnimationPanel(); const _AnimationPanel();
/// 플랫폼별 비율 반환 (데스크톱: 넓게, 모바일: 높게)
double _getAspectRatio() {
if (kIsWeb) return 2.5; // 웹: 넓은 비율
if (Platform.isMacOS || Platform.isWindows || Platform.isLinux) {
return 2.5; // 데스크톱: 넓은 비율
}
return 16 / 9; // 모바일(iOS/Android): 16:9
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return RetroPanel( return RetroPanel(
title: 'BATTLE', title: 'BATTLE',
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: const AspectRatio( child: AspectRatio(
aspectRatio: 16 / 9, aspectRatio: _getAspectRatio(),
child: HeroVsBossAnimation(), child: const HeroVsBossAnimation(),
), ),
); );
} }

View File

@@ -186,14 +186,17 @@ class _HeroVsBossAnimationState extends State<HeroVsBossAnimation> {
], ],
), ),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min,
children: [ children: [
// ASCII 애니메이션 (컬러 적용) // ASCII 애니메이션 (컬러 적용) - 남은 공간 차지
FittedBox( Flexible(
child: FittedBox(
fit: BoxFit.scaleDown, fit: BoxFit.scaleDown,
child: RichText( child: RichText(
text: _buildColoredTextSpan(frame), text: _buildColoredTextSpan(frame),
), ),
), ),
),
const SizedBox(height: 8), const SizedBox(height: 8),
// 하단 효과 바 (컬러) // 하단 효과 바 (컬러)
_buildEffectBar(), _buildEffectBar(),