diff --git a/lib/styles/colors.dart b/lib/styles/colors.dart index 428644fc..c8de2dfd 100644 --- a/lib/styles/colors.dart +++ b/lib/styles/colors.dart @@ -7,6 +7,7 @@ class AppColors { /// Common final Color accent1 = Color(0xFFE4935D); final Color accent2 = Color(0xFFBEABA1); + final Color accent3 = Color(0xFFC47642); final Color offWhite = Color(0xFFF8ECE5); final Color caption = const Color(0xFF7D7873); final Color body = const Color(0xFF514F4D); diff --git a/lib/ui/common/controls/buttons.dart b/lib/ui/common/controls/buttons.dart index ac27907c..8fca67d3 100644 --- a/lib/ui/common/controls/buttons.dart +++ b/lib/ui/common/controls/buttons.dart @@ -155,7 +155,7 @@ class AppBtn extends StatelessWidget { ), if (focus.hasFocus) Positioned.fill( - child: IgnorePointerWithSemantics( + child: IgnorePointerKeepSemantics( child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular($styles.corners.md), diff --git a/lib/ui/common/controls/scroll_decorator.dart b/lib/ui/common/controls/scroll_decorator.dart index c0c124b8..580c11b3 100644 --- a/lib/ui/common/controls/scroll_decorator.dart +++ b/lib/ui/common/controls/scroll_decorator.dart @@ -65,7 +65,7 @@ class ScrollDecorator extends StatefulWidget { bgBuilder = null; fgBuilder = (controller) { final double ratio = controller.hasClients ? min(1, controller.position.extentBefore / 60) : 0; - return IgnorePointerWithSemantics( + return IgnorePointerKeepSemantics( child: Container( height: 24, decoration: BoxDecoration( diff --git a/lib/ui/common/gradient_container.dart b/lib/ui/common/gradient_container.dart index 869adb44..230a822b 100644 --- a/lib/ui/common/gradient_container.dart +++ b/lib/ui/common/gradient_container.dart @@ -24,25 +24,23 @@ class GradientContainer extends StatelessWidget { final BorderRadius? borderRadius; @override - Widget build(BuildContext context) => ExcludeSemantics( - child: IgnorePointerWithSemantics( - child: Container( - width: width, - height: height, - alignment: alignment, - decoration: BoxDecoration( - gradient: LinearGradient( - begin: begin ?? Alignment.centerLeft, - end: end ?? Alignment.centerRight, - colors: colors, - stops: stops, - ), - backgroundBlendMode: blendMode, - borderRadius: borderRadius, + Widget build(BuildContext context) => IgnorePointerAndSemantics( + child: Container( + width: width, + height: height, + alignment: alignment, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: begin ?? Alignment.centerLeft, + end: end ?? Alignment.centerRight, + colors: colors, + stops: stops, ), - child: child, + backgroundBlendMode: blendMode, + borderRadius: borderRadius, ), - ) + child: child, + ), ); } diff --git a/lib/ui/common/ignore_pointer.dart b/lib/ui/common/ignore_pointer.dart index cc27da96..b53ad555 100644 --- a/lib/ui/common/ignore_pointer.dart +++ b/lib/ui/common/ignore_pointer.dart @@ -1,18 +1,32 @@ import 'package:flutter/rendering.dart'; import 'package:wonders/common_libs.dart'; -class IgnorePointerWithSemantics extends SingleChildRenderObjectWidget { - const IgnorePointerWithSemantics({super.key, super.child}); +class IgnorePointerKeepSemantics extends SingleChildRenderObjectWidget { + const IgnorePointerKeepSemantics({super.key, super.child}); @override - RenderIgnorePointerWithSemantics createRenderObject(BuildContext context) { - return RenderIgnorePointerWithSemantics(); + RenderIgnorePointerKeepSemantics createRenderObject(BuildContext context) { + return RenderIgnorePointerKeepSemantics(); } } -class RenderIgnorePointerWithSemantics extends RenderProxyBox { - RenderIgnorePointerWithSemantics(); +class RenderIgnorePointerKeepSemantics extends RenderProxyBox { + RenderIgnorePointerKeepSemantics(); @override bool hitTest(BoxHitTestResult result, { required Offset position }) => false; +} + +class IgnorePointerAndSemantics extends StatelessWidget { + final Widget child; + const IgnorePointerAndSemantics({super.key, required this.child}); + + @override + Widget build(BuildContext context) { + return ExcludeSemantics( + child: IgnorePointer( + child: child + ) + ); + } } \ No newline at end of file diff --git a/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart b/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart index ebafe135..cd723c91 100644 --- a/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart +++ b/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart @@ -26,7 +26,7 @@ class _BottomTextContent extends StatelessWidget { Gap($styles.insets.md), Column( children: [ - IgnorePointerWithSemantics( + IgnorePointerKeepSemantics( child: Semantics( button: true, onIncrease: () => state._handleArtifactTap(_currentPage + 1), diff --git a/lib/ui/screens/artifact/artifact_search/widgets/_search_input.dart b/lib/ui/screens/artifact/artifact_search/widgets/_search_input.dart index 54044209..238ec7ef 100644 --- a/lib/ui/screens/artifact/artifact_search/widgets/_search_input.dart +++ b/lib/ui/screens/artifact/artifact_search/widgets/_search_input.dart @@ -131,19 +131,19 @@ class _SearchInput extends StatelessWidget { child: Row( children: [ Gap($styles.insets.xs * 1.5), - Icon(Icons.search, color: $styles.colors.caption), + Icon(Icons.search, color: captionColor), Expanded( child: TextField( onSubmitted: onSubmit, controller: textController, focusNode: focusNode, - style: TextStyle(color: captionColor, ), + style: TextStyle(color: $styles.colors.greyStrong), textAlignVertical: TextAlignVertical.top, decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.all($styles.insets.xs), labelStyle: TextStyle(color: captionColor), - hintStyle: TextStyle(color: captionColor.withOpacity(0.5)), + hintStyle: TextStyle(color: $styles.colors.body), prefixStyle: TextStyle(color: captionColor), focusedBorder: OutlineInputBorder(borderSide: BorderSide.none), enabledBorder: UnderlineInputBorder(borderSide: BorderSide.none), diff --git a/lib/ui/screens/editorial/widgets/_circular_title_bar.dart b/lib/ui/screens/editorial/widgets/_circular_title_bar.dart index ec9b3c17..c22eaf31 100644 --- a/lib/ui/screens/editorial/widgets/_circular_title_bar.dart +++ b/lib/ui/screens/editorial/widgets/_circular_title_bar.dart @@ -133,7 +133,7 @@ class _AnimatedCircleWithTextState extends State<_AnimatedCircleWithText> with S Widget _buildCircularText(String title) { final textStyle = $styles.text.monoTitleFont.copyWith( fontSize: 22 * $styles.scale, - color: $styles.colors.accent1, + color: $styles.colors.accent3, ); return CircularText( position: CircularTextPosition.inside, diff --git a/lib/ui/screens/editorial/widgets/_large_simple_quote.dart b/lib/ui/screens/editorial/widgets/_large_simple_quote.dart index b449ebe8..19a0d4d3 100644 --- a/lib/ui/screens/editorial/widgets/_large_simple_quote.dart +++ b/lib/ui/screens/editorial/widgets/_large_simple_quote.dart @@ -18,7 +18,7 @@ class _LargeSimpleQuote extends StatelessWidget { child: Text( '“', style: $styles.text.quote1.copyWith( - color: $styles.colors.accent1, + color: $styles.colors.accent3, fontSize: 90 * $styles.scale, height: .7, ), @@ -32,7 +32,7 @@ class _LargeSimpleQuote extends StatelessWidget { Gap($styles.insets.md), Text( '- $author', - style: $styles.text.quote2Sub.copyWith(color: $styles.colors.accent1), + style: $styles.text.quote2Sub.copyWith(color: $styles.colors.accent3), ), ], ), diff --git a/lib/ui/screens/editorial/widgets/_scrolling_content.dart b/lib/ui/screens/editorial/widgets/_scrolling_content.dart index cd3d4e05..a08a1b1c 100644 --- a/lib/ui/screens/editorial/widgets/_scrolling_content.dart +++ b/lib/ui/screens/editorial/widgets/_scrolling_content.dart @@ -43,7 +43,7 @@ class _ScrollingContent extends StatelessWidget { dropChar, overflow: TextOverflow.visible, style: $styles.text.dropCase.copyWith( - color: $styles.colors.accent1, + color: $styles.colors.accent3, height: 1, ), ), @@ -52,7 +52,7 @@ class _ScrollingContent extends StatelessWidget { style: $styles.text.body, dropCapPadding: EdgeInsets.only(right: 6), dropCapStyle: $styles.text.dropCase.copyWith( - color: $styles.colors.accent1, + color: $styles.colors.accent3, height: 1, ), ) @@ -242,7 +242,7 @@ class _MapsThumbnailState extends State<_MapsThumbnail> { child: Stack( children: [ Positioned.fill(child: ColoredBox(color: Colors.transparent)), - IgnorePointerWithSemantics( + IgnorePointerKeepSemantics( child: GoogleMap( markers: {getMapsMarker(startPos.target)}, zoomControlsEnabled: false, diff --git a/lib/ui/screens/home/wonders_home_screen.dart b/lib/ui/screens/home/wonders_home_screen.dart index 65b4d43c..1ab8309e 100644 --- a/lib/ui/screens/home/wonders_home_screen.dart +++ b/lib/ui/screens/home/wonders_home_screen.dart @@ -213,7 +213,7 @@ class _HomeScreenState extends State with SingleTickerProviderStateM Widget _buildFgAndGradients() { Widget buildSwipeableBgGradient(Color fgColor) { return _swipeController.buildListener(builder: (swipeAmt, isPointerDown, _) { - return IgnorePointerWithSemantics( + return IgnorePointerKeepSemantics( child: FractionallySizedBox( heightFactor: .6, child: Container( @@ -251,7 +251,7 @@ class _HomeScreenState extends State with SingleTickerProviderStateM return Animate( effects: const [FadeEffect()], onPlay: _handleFadeAnimInit, - child: IgnorePointerWithSemantics(child: WonderIllustration(e.type, config: config))); + child: IgnorePointerKeepSemantics(child: WonderIllustration(e.type, config: config))); }); }), @@ -280,7 +280,7 @@ class _HomeScreenState extends State with SingleTickerProviderStateM /// Title Content LightText( - child: IgnorePointerWithSemantics( + child: IgnorePointerKeepSemantics( child: Transform.translate( offset: Offset(0, 30), child: Column( diff --git a/lib/ui/screens/intro/intro_screen.dart b/lib/ui/screens/intro/intro_screen.dart index 3994f1bd..43798a57 100644 --- a/lib/ui/screens/intro/intro_screen.dart +++ b/lib/ui/screens/intro/intro_screen.dart @@ -114,7 +114,7 @@ class _IntroScreenState extends State { ), ), - IgnorePointerWithSemantics( + IgnorePointerKeepSemantics( child: Column(children: [ Spacer(), diff --git a/lib/ui/screens/photo_gallery/photo_gallery.dart b/lib/ui/screens/photo_gallery/photo_gallery.dart index b89751db..3e611a01 100644 --- a/lib/ui/screens/photo_gallery/photo_gallery.dart +++ b/lib/ui/screens/photo_gallery/photo_gallery.dart @@ -292,7 +292,7 @@ class _PhotoGalleryState extends State { Positioned.fill( child: AnimatedOpacity( duration: $styles.times.med, - opacity: isSelected ? 0 : .7, + opacity: isSelected ? 0 : ($styles.highContrast ? 0.4 : 0.7), child: ColoredBox(color: $styles.colors.black), ), ), diff --git a/lib/ui/screens/photo_gallery/widgets/_animated_cutout_overlay.dart b/lib/ui/screens/photo_gallery/widgets/_animated_cutout_overlay.dart index 9f918d51..572dea45 100644 --- a/lib/ui/screens/photo_gallery/widgets/_animated_cutout_overlay.dart +++ b/lib/ui/screens/photo_gallery/widgets/_animated_cutout_overlay.dart @@ -31,7 +31,7 @@ class _AnimatedCutoutOverlay extends StatelessWidget { effects: [CustomEffect(builder: _buildAnimatedCutout, curve: Curves.easeOut, duration: duration)], key: animationKey, onComplete: (c) => c.reverse(), - child: IgnorePointerWithSemantics(child: Container(color: Colors.black.withOpacity(opacity))), + child: IgnorePointerKeepSemantics(child: Container(color: Colors.black.withOpacity(opacity))), ), ], ); diff --git a/lib/ui/screens/timeline/widgets/_event_markers.dart b/lib/ui/screens/timeline/widgets/_event_markers.dart index b9107b0e..5f0c2a0b 100644 --- a/lib/ui/screens/timeline/widgets/_event_markers.dart +++ b/lib/ui/screens/timeline/widgets/_event_markers.dart @@ -54,7 +54,7 @@ class _EventMarkersState extends State<_EventMarkers> { @override Widget build(BuildContext context) { - return IgnorePointerWithSemantics( + return IgnorePointerKeepSemantics( child: LayoutBuilder(builder: (_, constraints) { /// Figure out which event is "selected" _updateSelectedEvent(constraints.maxHeight); diff --git a/lib/ui/screens/timeline/widgets/_event_popups.dart b/lib/ui/screens/timeline/widgets/_event_popups.dart index 71d03682..d09fed11 100644 --- a/lib/ui/screens/timeline/widgets/_event_popups.dart +++ b/lib/ui/screens/timeline/widgets/_event_popups.dart @@ -35,7 +35,7 @@ class _EventPopupsState extends State<_EventPopups> { final evt = _eventToShow; return TopCenter( child: ClipRect( - child: IgnorePointerWithSemantics( + child: IgnorePointerKeepSemantics( child: AnimatedSwitcher( duration: $styles.times.fast, child: evt == null diff --git a/lib/ui/screens/timeline/widgets/_scrolling_viewport.dart b/lib/ui/screens/timeline/widgets/_scrolling_viewport.dart index eaabbffd..802b9f34 100644 --- a/lib/ui/screens/timeline/widgets/_scrolling_viewport.dart +++ b/lib/ui/screens/timeline/widgets/_scrolling_viewport.dart @@ -69,7 +69,7 @@ class _ScalingViewportState extends State<_ScrollingViewport> { _buildScrollingArea(context).maybeAnimate().fadeIn(), // Dashed line with a year that changes as we scroll - IgnorePointerWithSemantics( + IgnorePointerKeepSemantics( child: AnimatedBuilder( animation: controller.scroller, builder: (_, __) { diff --git a/lib/ui/screens/timeline/widgets/_timeline_section.dart b/lib/ui/screens/timeline/widgets/_timeline_section.dart index c6acb68b..ef6c53ef 100644 --- a/lib/ui/screens/timeline/widgets/_timeline_section.dart +++ b/lib/ui/screens/timeline/widgets/_timeline_section.dart @@ -20,7 +20,7 @@ class TimelineSection extends StatelessWidget { StringUtils.formatYr(data.startYr), StringUtils.formatYr(data.endYr), )}', - child: IgnorePointerWithSemantics( + child: IgnorePointerKeepSemantics( child: Container( alignment: Alignment(0, -1 + fraction * 2), padding: EdgeInsets.all($styles.insets.xs), diff --git a/lib/ui/screens/timeline/widgets/_year_markers.dart b/lib/ui/screens/timeline/widgets/_year_markers.dart index 2d34f98a..8468fe8e 100644 --- a/lib/ui/screens/timeline/widgets/_year_markers.dart +++ b/lib/ui/screens/timeline/widgets/_year_markers.dart @@ -13,7 +13,7 @@ class _YearMarkers extends StatelessWidget { @override Widget build(BuildContext context) { - return IgnorePointerWithSemantics( + return IgnorePointerKeepSemantics( child: LayoutBuilder(builder: (_, constraints) { int interval = 100; if (constraints.maxHeight < 800) { diff --git a/lib/ui/screens/wonder_events/widgets/_events_list.dart b/lib/ui/screens/wonder_events/widgets/_events_list.dart index d27c32d6..4b8f8205 100644 --- a/lib/ui/screens/wonder_events/widgets/_events_list.dart +++ b/lib/ui/screens/wonder_events/widgets/_events_list.dart @@ -64,7 +64,7 @@ class _EventsListState extends State<_EventsList> { key: PageStorageKey('eventsList'), child: Column( children: [ - IgnorePointerWithSemantics(child: Gap(widget.topHeight)), + IgnorePointerKeepSemantics(child: Gap(widget.topHeight)), Container( decoration: BoxDecoration( color: $styles.colors.black, @@ -120,7 +120,7 @@ class _EventsListState extends State<_EventsList> { if (showBackdrop) ...[ AppBackdrop( strength: backdropAmt, - child: IgnorePointerWithSemantics( + child: IgnorePointerKeepSemantics( child: Container( color: $styles.colors.black.withOpacity(backdropAmt * .6), ),