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 ChichenItzaIllustration extends StatelessWidget {
|
2024-02-20 13:56:39 -08:00
|
|
|
ChichenItzaIllustration({super.key, required this.config});
|
2022-08-29 20:38:28 -06:00
|
|
|
final WonderIllustrationConfig config;
|
|
|
|
final assetPath = WonderType.chichenItza.assetPath;
|
|
|
|
final fgColor = WonderType.chichenItza.fgColor;
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-11-28 17:54:11 -07:00
|
|
|
return WonderIllustrationBuilder(
|
|
|
|
config: config,
|
|
|
|
bgBuilder: _buildBg,
|
|
|
|
mgBuilder: _buildMg,
|
|
|
|
fgBuilder: _buildFg,
|
|
|
|
wonderType: WonderType.chichenItza,
|
|
|
|
);
|
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.roller2,
|
2022-11-30 01:53:33 -07:00
|
|
|
color: Color(0xffDC762A),
|
2022-08-29 20:38:28 -06:00
|
|
|
opacity: anim.drive(Tween(begin: 0, end: .5)),
|
|
|
|
flipY: true,
|
2022-11-30 01:53:33 -07:00
|
|
|
scale: config.shortMode ? 4 : 1.15,
|
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: .4,
|
2022-11-28 17:54:11 -07:00
|
|
|
minHeight: 200,
|
2022-11-30 11:55:00 -07:00
|
|
|
fractionalOffset: Offset(.55, config.shortMode ? .2 : -.35),
|
2022-08-29 20:38:28 -06:00
|
|
|
),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Widget> _buildMg(BuildContext context, Animation<double> anim) {
|
2022-10-24 15:42:27 -06:00
|
|
|
// We want to size to the shortest side
|
2022-08-29 20:38:28 -06:00
|
|
|
return [
|
2022-11-28 17:54:11 -07:00
|
|
|
Transform.translate(
|
2022-11-30 11:55:00 -07:00
|
|
|
offset: Offset(0, config.shortMode ? 70 : -30),
|
2022-11-28 17:54:11 -07:00
|
|
|
child: IllustrationPiece(
|
|
|
|
fileName: 'chichen.png',
|
2022-11-30 11:55:00 -07:00
|
|
|
heightFactor: .4,
|
|
|
|
minHeight: 180,
|
2022-11-30 01:53:33 -07:00
|
|
|
zoomAmt: -.1,
|
2022-11-28 17:54:11 -07:00
|
|
|
enableHero: true,
|
2022-08-29 20:38:28 -06:00
|
|
|
),
|
|
|
|
),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Widget> _buildFg(BuildContext context, Animation<double> anim) {
|
|
|
|
return [
|
2022-11-29 12:37:04 -07:00
|
|
|
IllustrationPiece(
|
|
|
|
fileName: 'foreground-right.png',
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
initialOffset: Offset(20, 40),
|
|
|
|
initialScale: .95,
|
|
|
|
heightFactor: .4,
|
2022-11-30 01:53:33 -07:00
|
|
|
fractionalOffset: Offset(.5, -.1),
|
2022-11-29 12:37:04 -07:00
|
|
|
zoomAmt: .1,
|
|
|
|
dynamicHzOffset: 250,
|
|
|
|
),
|
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-30 01:53:33 -07:00
|
|
|
fractionalOffset: Offset(-.4, .2),
|
2022-11-28 17:54:11 -07:00
|
|
|
zoomAmt: .25,
|
|
|
|
dynamicHzOffset: -250,
|
|
|
|
),
|
|
|
|
IllustrationPiece(
|
|
|
|
fileName: 'top-left.png',
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
initialScale: .9,
|
|
|
|
initialOffset: Offset(-40, 60),
|
2022-11-30 01:53:33 -07:00
|
|
|
heightFactor: .65,
|
|
|
|
fractionalOffset: Offset(-.4, -.4),
|
|
|
|
zoomAmt: .05,
|
2022-11-28 17:54:11 -07:00
|
|
|
dynamicHzOffset: 100,
|
2022-08-29 20:38:28 -06:00
|
|
|
),
|
2022-11-28 17:54:11 -07:00
|
|
|
IllustrationPiece(
|
|
|
|
fileName: 'top-right.png',
|
|
|
|
alignment: Alignment.topRight,
|
|
|
|
initialOffset: Offset(20, 40),
|
|
|
|
initialScale: .95,
|
2022-11-30 01:53:33 -07:00
|
|
|
heightFactor: .65,
|
2022-11-29 12:37:04 -07:00
|
|
|
fractionalOffset: Offset(.35, -.4),
|
2022-11-30 01:53:33 -07:00
|
|
|
zoomAmt: .05,
|
2022-11-28 17:54:11 -07:00
|
|
|
dynamicHzOffset: -100,
|
|
|
|
),
|
2022-08-29 20:38:28 -06:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|