style(front): 플랫폼별 애니메이션 패널 비율 조정
- 데스크톱/웹: 넓은 비율 (2.5) - 모바일: 16:9 비율 - HeroVsBossAnimation 레이아웃 Flexible 적용
This commit is contained in:
@@ -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(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,12 +186,15 @@ class _HeroVsBossAnimationState extends State<HeroVsBossAnimation> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
// ASCII 애니메이션 (컬러 적용)
|
// ASCII 애니메이션 (컬러 적용) - 남은 공간 차지
|
||||||
FittedBox(
|
Flexible(
|
||||||
fit: BoxFit.scaleDown,
|
child: FittedBox(
|
||||||
child: RichText(
|
fit: BoxFit.scaleDown,
|
||||||
text: _buildColoredTextSpan(frame),
|
child: RichText(
|
||||||
|
text: _buildColoredTextSpan(frame),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
|
|||||||
Reference in New Issue
Block a user