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 PyramidsGizaIllustration extends StatelessWidget {
|
|
|
|
PyramidsGizaIllustration({Key? key, required this.config}) : super(key: key);
|
|
|
|
final WonderIllustrationConfig config;
|
|
|
|
final String assetPath = WonderType.pyramidsGiza.assetPath;
|
|
|
|
final fgColor = WonderType.pyramidsGiza.fgColor;
|
|
|
|
final bgColor = WonderType.pyramidsGiza.bgColor;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return WonderIllustrationBuilder(
|
2022-11-28 17:54:11 -07:00
|
|
|
wonderType: WonderType.pyramidsGiza,
|
2022-08-29 20:38:28 -06:00
|
|
|
config: config,
|
|
|
|
bgBuilder: _buildBg,
|
|
|
|
mgBuilder: _buildMg,
|
|
|
|
fgBuilder: _buildFg,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Widget> _buildBg(BuildContext context, Animation<double> anim) {
|
|
|
|
return [
|
|
|
|
FadeColorTransition(animation: anim, color: fgColor),
|
|
|
|
Positioned.fill(
|
|
|
|
child: IllustrationTexture(
|
|
|
|
ImagePaths.roller2,
|
|
|
|
color: Colors.white,
|
|
|
|
opacity: anim.drive(Tween(begin: 0, end: .3)),
|
|
|
|
flipY: true,
|
|
|
|
),
|
|
|
|
),
|
2022-11-28 17:54:11 -07:00
|
|
|
IllustrationPiece(
|
|
|
|
fileName: 'moon.png',
|
|
|
|
initialOffset: Offset(0, 20),
|
|
|
|
enableHero: true,
|
|
|
|
heightFactor: .15,
|
|
|
|
minHeight: 100,
|
|
|
|
offset: config.shortMode ? Offset(100, context.heightPx * -.1) : Offset(150, context.heightPx * -.15),
|
|
|
|
zoomAmt: .05,
|
|
|
|
),
|
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: 'pyramids.png',
|
|
|
|
enableHero: true,
|
|
|
|
heightFactor: .5,
|
|
|
|
minHeight: 300,
|
|
|
|
zoomAmt: .1,
|
|
|
|
)
|
2022-08-29 20:38:28 -06:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Widget> _buildFg(BuildContext context, Animation<double> anim) {
|
|
|
|
return [
|
2022-11-24 14:06:44 -07:00
|
|
|
IllustrationPiece(
|
|
|
|
fileName: 'foreground-back.png',
|
|
|
|
alignment: Alignment.bottomCenter,
|
2022-11-28 17:54:11 -07:00
|
|
|
initialOffset: Offset(20, 40),
|
|
|
|
initialScale: .95,
|
|
|
|
heightFactor: .55,
|
|
|
|
fractionalOffset: Offset(.1, .06),
|
|
|
|
zoomAmt: .1,
|
|
|
|
dynamicHzOffset: 150,
|
2022-11-24 14:06:44 -07:00
|
|
|
),
|
|
|
|
IllustrationPiece(
|
|
|
|
fileName: 'foreground-front.png',
|
|
|
|
alignment: Alignment.bottomCenter,
|
2022-11-28 17:54:11 -07:00
|
|
|
initialScale: .9,
|
|
|
|
initialOffset: Offset(-40, 60),
|
|
|
|
heightFactor: .55,
|
|
|
|
fractionalOffset: Offset(-.1, .1),
|
|
|
|
zoomAmt: .25,
|
|
|
|
dynamicHzOffset: -150,
|
|
|
|
),
|
2022-08-29 20:38:28 -06:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|