2022-08-29 20:38:28 -06:00
|
|
|
import 'package:wonders/common_libs.dart';
|
|
|
|
import 'package:wonders/ui/common/fade_color_transition.dart';
|
2022-11-28 17:54:11 -07:00
|
|
|
import 'package:wonders/ui/wonder_illustrations/common/illustration_piece.dart';
|
2022-08-29 20:38:28 -06:00
|
|
|
import 'package:wonders/ui/wonder_illustrations/common/paint_textures.dart';
|
|
|
|
import 'package:wonders/ui/wonder_illustrations/common/wonder_hero.dart';
|
|
|
|
import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_builder.dart';
|
|
|
|
import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_config.dart';
|
|
|
|
|
|
|
|
class ColosseumIllustration extends StatelessWidget {
|
|
|
|
ColosseumIllustration({Key? key, required this.config}) : super(key: key);
|
|
|
|
final WonderIllustrationConfig config;
|
|
|
|
final String assetPath = WonderType.colosseum.assetPath;
|
|
|
|
final bgColor = WonderType.colosseum.bgColor;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return WonderIllustrationBuilder(
|
|
|
|
config: config,
|
|
|
|
bgBuilder: _buildBg,
|
|
|
|
mgBuilder: _buildMg,
|
|
|
|
fgBuilder: _buildFg,
|
2022-11-28 17:54:11 -07:00
|
|
|
wonderType: WonderType.colosseum,
|
2022-08-29 20:38:28 -06:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Widget> _buildBg(BuildContext context, Animation<double> anim) {
|
|
|
|
return [
|
|
|
|
FadeColorTransition(animation: anim, color: $styles.colors.shift(bgColor, .15)),
|
|
|
|
Positioned.fill(
|
|
|
|
child: IllustrationTexture(
|
|
|
|
ImagePaths.roller1,
|
|
|
|
color: Colors.white,
|
2022-11-30 01:53:33 -07:00
|
|
|
opacity: anim.drive(Tween(begin: 0, end: .75)),
|
|
|
|
scale: config.shortMode ? 4 : 1,
|
2022-08-29 20:38:28 -06:00
|
|
|
),
|
|
|
|
),
|
2022-11-29 11:34:15 -07:00
|
|
|
IllustrationPiece(
|
|
|
|
fileName: 'sun.png',
|
2022-11-30 01:53:33 -07:00
|
|
|
initialOffset: Offset(0, 50),
|
2022-11-29 11:34:15 -07:00
|
|
|
enableHero: true,
|
2022-11-30 01:53:33 -07:00
|
|
|
heightFactor: config.shortMode ? .25 : .25,
|
|
|
|
minHeight: 100,
|
|
|
|
offset: config.shortMode ? Offset(50, context.heightPx * -.07) : Offset(80, context.heightPx * -.28),
|
2022-08-29 20:38:28 -06:00
|
|
|
),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Widget> _buildMg(BuildContext context, Animation<double> anim) {
|
|
|
|
return [
|
2022-11-28 17:54:11 -07:00
|
|
|
IllustrationPiece(
|
|
|
|
fileName: 'colosseum.png',
|
2022-11-29 11:34:15 -07:00
|
|
|
enableHero: true,
|
2022-11-30 01:53:33 -07:00
|
|
|
heightFactor: .6,
|
|
|
|
minHeight: 200,
|
2022-11-28 17:54:11 -07:00
|
|
|
zoomAmt: .15,
|
2022-11-30 01:53:33 -07:00
|
|
|
fractionalOffset: Offset(0, config.shortMode ? .10: -.1),
|
2022-08-29 20:38:28 -06:00
|
|
|
)
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Widget> _buildFg(BuildContext context, Animation<double> anim) {
|
|
|
|
return [
|
2022-11-28 17:54:11 -07:00
|
|
|
IllustrationPiece(
|
|
|
|
fileName: 'foreground-left.png',
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
initialScale: .9,
|
|
|
|
initialOffset: Offset(-40, 60),
|
|
|
|
heightFactor: .65,
|
2022-11-29 09:44:35 -07:00
|
|
|
offset: Offset.zero,
|
2022-11-28 17:54:11 -07:00
|
|
|
fractionalOffset: Offset(-.5, .1),
|
2022-11-30 01:53:33 -07:00
|
|
|
zoomAmt: .05,
|
2022-11-28 17:54:11 -07:00
|
|
|
dynamicHzOffset: -150,
|
|
|
|
),
|
|
|
|
IllustrationPiece(
|
|
|
|
fileName: 'foreground-right.png',
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
initialOffset: Offset(20, 40),
|
|
|
|
initialScale: .95,
|
|
|
|
heightFactor: .75,
|
|
|
|
fractionalOffset: Offset(.5, .25),
|
2022-11-30 01:53:33 -07:00
|
|
|
zoomAmt: .05,
|
2022-11-28 17:54:11 -07:00
|
|
|
dynamicHzOffset: 150,
|
|
|
|
),
|
2022-08-29 20:38:28 -06:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|