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_illustration_builder.dart';
|
|
|
|
import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_config.dart';
|
|
|
|
|
|
|
|
class MachuPicchuIllustration extends StatelessWidget {
|
|
|
|
MachuPicchuIllustration({Key? key, required this.config}) : super(key: key);
|
|
|
|
final WonderIllustrationConfig config;
|
|
|
|
final String assetPath = WonderType.machuPicchu.assetPath;
|
|
|
|
final fgColor = WonderType.machuPicchu.fgColor;
|
|
|
|
final bgColor = WonderType.machuPicchu.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.machuPicchu,
|
2022-08-29 20:38:28 -06:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Widget> _buildBg(BuildContext context, Animation<double> anim) {
|
|
|
|
return [
|
|
|
|
FadeColorTransition(animation: anim, color: fgColor),
|
|
|
|
Positioned.fill(
|
|
|
|
child: IllustrationTexture(
|
|
|
|
ImagePaths.roller1,
|
2022-11-30 01:53:33 -07:00
|
|
|
flipX: false,
|
|
|
|
color: Color(0xff1E736D),
|
|
|
|
opacity: anim.drive(Tween(begin: 0, end: .5)),
|
2022-11-30 11:55:00 -07:00
|
|
|
scale: config.shortMode ? 3 : 1,
|
2022-08-29 20:38:28 -06:00
|
|
|
),
|
|
|
|
),
|
2022-11-28 17:54:11 -07:00
|
|
|
IllustrationPiece(
|
|
|
|
fileName: 'sun.png',
|
2022-11-30 01:53:33 -07:00
|
|
|
initialOffset: Offset(0, 50),
|
2022-11-28 17:54:11 -07:00
|
|
|
enableHero: true,
|
2022-11-30 01:53:33 -07:00
|
|
|
heightFactor: config.shortMode ? .15 : .15,
|
|
|
|
minHeight: 100,
|
|
|
|
offset: config.shortMode ? Offset(150, context.heightPx * -.08) : Offset(150, context.heightPx * -.35),
|
2022-08-29 20:38:28 -06:00
|
|
|
),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Widget> _buildMg(BuildContext context, Animation<double> anim) => [
|
2022-11-28 17:54:11 -07:00
|
|
|
IllustrationPiece(
|
|
|
|
fileName: 'machu-picchu.png',
|
|
|
|
heightFactor: .65,
|
2022-11-30 11:55:00 -07:00
|
|
|
minHeight: 230,
|
2022-11-30 01:53:33 -07:00
|
|
|
zoomAmt: config.shortMode ? .1 : -1,
|
2022-11-28 17:54:11 -07:00
|
|
|
enableHero: true,
|
2022-11-30 11:55:00 -07:00
|
|
|
fractionalOffset: Offset(config.shortMode ? 0 : -.05, config.shortMode ? 0.12 : -.12),
|
2022-11-28 17:54:11 -07:00
|
|
|
),
|
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-back.png',
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
initialScale: .9,
|
|
|
|
initialOffset: Offset(0, 60),
|
|
|
|
heightFactor: .6,
|
2022-11-30 01:53:33 -07:00
|
|
|
fractionalOffset: Offset(0, .2),
|
|
|
|
zoomAmt: .05,
|
2022-11-28 17:54:11 -07:00
|
|
|
dynamicHzOffset: 150,
|
|
|
|
),
|
|
|
|
IllustrationPiece(
|
|
|
|
fileName: 'foreground-front.png',
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
initialOffset: Offset(20, 40),
|
2022-11-30 01:53:33 -07:00
|
|
|
heightFactor: .6,
|
|
|
|
initialScale: 1.2,
|
|
|
|
fractionalOffset: Offset(-.35, .4),
|
|
|
|
zoomAmt: .2,
|
2022-11-28 17:54:11 -07:00
|
|
|
dynamicHzOffset: -50,
|
|
|
|
),
|
2022-08-29 20:38:28 -06:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|