diff --git a/android/app/src/main/res/drawable-hdpi/android12splash.png b/android/app/src/main/res/drawable-hdpi/android12splash.png new file mode 100644 index 000000000..806ce16cc Binary files /dev/null and b/android/app/src/main/res/drawable-hdpi/android12splash.png differ diff --git a/android/app/src/main/res/drawable-hdpi/splash.png b/android/app/src/main/res/drawable-hdpi/splash.png index 734fcbff6..c4653f690 100644 Binary files a/android/app/src/main/res/drawable-hdpi/splash.png and b/android/app/src/main/res/drawable-hdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-mdpi/android12splash.png b/android/app/src/main/res/drawable-mdpi/android12splash.png new file mode 100644 index 000000000..190552bb5 Binary files /dev/null and b/android/app/src/main/res/drawable-mdpi/android12splash.png differ diff --git a/android/app/src/main/res/drawable-mdpi/splash.png b/android/app/src/main/res/drawable-mdpi/splash.png index d773e1330..00322f486 100644 Binary files a/android/app/src/main/res/drawable-mdpi/splash.png and b/android/app/src/main/res/drawable-mdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-night-hdpi/android12splash.png b/android/app/src/main/res/drawable-night-hdpi/android12splash.png new file mode 100644 index 000000000..806ce16cc Binary files /dev/null and b/android/app/src/main/res/drawable-night-hdpi/android12splash.png differ diff --git a/android/app/src/main/res/drawable-night-mdpi/android12splash.png b/android/app/src/main/res/drawable-night-mdpi/android12splash.png new file mode 100644 index 000000000..190552bb5 Binary files /dev/null and b/android/app/src/main/res/drawable-night-mdpi/android12splash.png differ diff --git a/android/app/src/main/res/drawable-night-xhdpi/android12splash.png b/android/app/src/main/res/drawable-night-xhdpi/android12splash.png new file mode 100644 index 000000000..d1ee170ad Binary files /dev/null and b/android/app/src/main/res/drawable-night-xhdpi/android12splash.png differ diff --git a/android/app/src/main/res/drawable-night-xxhdpi/android12splash.png b/android/app/src/main/res/drawable-night-xxhdpi/android12splash.png new file mode 100644 index 000000000..29efcb3e2 Binary files /dev/null and b/android/app/src/main/res/drawable-night-xxhdpi/android12splash.png differ diff --git a/android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png b/android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png new file mode 100644 index 000000000..e2620c2d0 Binary files /dev/null and b/android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png differ diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml index 3fe6b2e88..3cc4948a1 100644 --- a/android/app/src/main/res/drawable-v21/launch_background.xml +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -6,4 +6,4 @@ - \ No newline at end of file + diff --git a/android/app/src/main/res/drawable-xhdpi/android12splash.png b/android/app/src/main/res/drawable-xhdpi/android12splash.png new file mode 100644 index 000000000..d1ee170ad Binary files /dev/null and b/android/app/src/main/res/drawable-xhdpi/android12splash.png differ diff --git a/android/app/src/main/res/drawable-xhdpi/splash.png b/android/app/src/main/res/drawable-xhdpi/splash.png index 9a37ce638..fb3a9978f 100644 Binary files a/android/app/src/main/res/drawable-xhdpi/splash.png and b/android/app/src/main/res/drawable-xhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/android12splash.png b/android/app/src/main/res/drawable-xxhdpi/android12splash.png new file mode 100644 index 000000000..29efcb3e2 Binary files /dev/null and b/android/app/src/main/res/drawable-xxhdpi/android12splash.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/splash.png b/android/app/src/main/res/drawable-xxhdpi/splash.png index 23df0393e..bf6fd3ae2 100644 Binary files a/android/app/src/main/res/drawable-xxhdpi/splash.png and b/android/app/src/main/res/drawable-xxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/android12splash.png b/android/app/src/main/res/drawable-xxxhdpi/android12splash.png new file mode 100644 index 000000000..e2620c2d0 Binary files /dev/null and b/android/app/src/main/res/drawable-xxxhdpi/android12splash.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/splash.png b/android/app/src/main/res/drawable-xxxhdpi/splash.png index 95052dec4..46d7c1852 100644 Binary files a/android/app/src/main/res/drawable-xxxhdpi/splash.png and b/android/app/src/main/res/drawable-xxxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml index 3fe6b2e88..3cc4948a1 100644 --- a/android/app/src/main/res/drawable/launch_background.xml +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -6,4 +6,4 @@ - \ No newline at end of file + diff --git a/android/app/src/main/res/values-night-v31/styles.xml b/android/app/src/main/res/values-night-v31/styles.xml new file mode 100644 index 000000000..5afd8b98f --- /dev/null +++ b/android/app/src/main/res/values-night-v31/styles.xml @@ -0,0 +1,20 @@ + + + + + + + diff --git a/android/app/src/main/res/values-v31/styles.xml b/android/app/src/main/res/values-v31/styles.xml new file mode 100644 index 000000000..989f66908 --- /dev/null +++ b/android/app/src/main/res/values-v31/styles.xml @@ -0,0 +1,20 @@ + + + + + + + diff --git a/assets/splash.png b/assets/splash.png index 1b7678758..7e7f1d046 100644 Binary files a/assets/splash.png and b/assets/splash.png differ diff --git a/assets/splash_android12.png b/assets/splash_android12.png new file mode 100644 index 000000000..1f2e2972f Binary files /dev/null and b/assets/splash_android12.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png index d773e1330..00322f486 100644 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png index 9a37ce638..fb3a9978f 100644 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png index 23df0393e..bf6fd3ae2 100644 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard index 0430c335a..7a0a5ba0c 100644 --- a/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -38,7 +38,7 @@ - + - \ No newline at end of file + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 7f3d1c541..1cabbb421 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -1,105 +1,105 @@ - - NSUserActivityTypes - - com.moffatman.chan.thread - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Chance - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - UIStatusBarHidden - - UIStatusBarStyle - UIStatusBarStyleLightContent - NSPhotoLibraryUsageDescription - Photo library permissions are necessary to select images - NSCameraUsageDescription - Camera permissions are necessary to capture images - NSMicrophoneUsageDescription - Microphone permissions are necessary to capture videos - LSApplicationQueriesSchemes - - https - http - - CADisableMinimumFrameDurationOnPhone - - NSPhotoLibraryAddUsageDescription - Photo library modification permission is needed to save images directly - NSAppTransportSecurity - NSAllowsLocalNetworking + NSUserActivityTypes + + com.moffatman.chan.thread + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Chance + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS - - UIBackgroundModes - - fetch - remote-notification - - CFBundleURLTypes - - - CFBundleTypeRole - Editor - CFBundleURLName - com.moffatman.chan - CFBundleURLSchemes - - chance - - + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + UIStatusBarHidden + + UIStatusBarStyle + UIStatusBarStyleLightContent + NSPhotoLibraryUsageDescription + Photo library permissions are necessary to select images + NSCameraUsageDescription + Camera permissions are necessary to capture images + NSMicrophoneUsageDescription + Microphone permissions are necessary to capture videos + LSApplicationQueriesSchemes + + https + http + + CADisableMinimumFrameDurationOnPhone + + NSPhotoLibraryAddUsageDescription + Photo library modification permission is needed to save images directly + NSAppTransportSecurity - CFBundleTypeRole - Editor - CFBundleURLSchemes - - ShareMedia-com.moffatman.chan - + NSAllowsLocalNetworking + - - FIREBASE_ANALYTICS_COLLECTION_ENABLED - - UIApplicationSupportsIndirectInputEvents - - FirebaseCrashlyticsCollectionEnabled - - + UIBackgroundModes + + fetch + remote-notification + + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLName + com.moffatman.chan + CFBundleURLSchemes + + chance + + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + ShareMedia-com.moffatman.chan + + + + FIREBASE_ANALYTICS_COLLECTION_ENABLED + + UIApplicationSupportsIndirectInputEvents + + FirebaseCrashlyticsCollectionEnabled + + diff --git a/lib/main.dart b/lib/main.dart index b7c786d1c..3e61180ac 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -241,7 +241,7 @@ class _ChanAppState extends State { settings.updateContentSettings(); }); } - }) : const CupertinoActivityIndicator() + }) : const ChanSplashPage() ) ) ); @@ -265,6 +265,37 @@ class _ChanAppState extends State { } } +class ChanSplashPage extends StatelessWidget { + const ChanSplashPage({ + super.key + }); + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + height: double.infinity, + alignment: Alignment.center, + color: context.select((s) => s.theme.backgroundColor), + child: Transform.scale( + scale: 1 / ( + 2.0 * MediaQuery.of(context).devicePixelRatio * + context.select((s) => s.interfaceScale) + ), + child: ColorFiltered( + colorFilter: ColorFilter.mode( + context.select((s) => s.theme.barColor), + BlendMode.srcATop + ), + child: const Image( + image: AssetImage('assets/splash.png') + ) + ) + ) + ); + } +} + final notificationsOverlayKey = GlobalKey(); void clearOverlayNotifications(Notifications notifications, Watch watch) { /*final overlay = notificationsOverlayKey.currentState; @@ -1330,9 +1361,7 @@ class _ChanHomePageState extends State { Widget build(BuildContext context) { final hideTabletLayoutLabels = MediaQuery.of(context).size.height < 600; if (!ImageboardRegistry.instance.initialized) { - return const Center( - child: CupertinoActivityIndicator() - ); + return const ChanSplashPage(); } for (final board in ImageboardRegistry.instance.imageboards) { if (_notificationsSubscriptions[board.key]?.item1 != board.notifications) { @@ -1357,63 +1386,64 @@ class _ChanHomePageState extends State { onWillPop: () async { return ((await _tabletWillPopZones[_tabController.index]?.callback?.call() ?? false) && (await confirmExit())); }, - child: CupertinoPageScaffold( - backgroundColor: CupertinoTheme.of(context).barBackgroundColor, - child: SafeArea( - top: false, - bottom: false, - child: Row( - children: [ - Container( - padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), - width: 85, - child: Column( - children: [ - Expanded( - child: Column( - children: [ - Expanded( - child: AnimatedBuilder( - animation: activeBrowserTab, - builder: (context, _) => _buildTabList(Axis.vertical) - ) - ), - _buildNewTabIcon(hideLabel: hideTabletLayoutLabels) - ] - ) - ), - _buildTabletIcon(1, NotifyingIcon( - icon: const Icon(CupertinoIcons.bookmark), - primaryCount: CombiningValueListenable( - children: ImageboardRegistry.instance.imageboards.map((x) => x.threadWatcher.unseenYouCount).toList(), - combine: (a, b) => a + b, - noChildrenValue: 0 + child: SafeArea( + top: false, + bottom: false, + child: Row( + children: [ + Container( + padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), + color: context.select((s) => s.theme.barColor), + width: 85, + child: Column( + children: [ + Expanded( + child: Column( + children: [ + Expanded( + child: AnimatedBuilder( + animation: activeBrowserTab, + builder: (context, _) => _buildTabList(Axis.vertical) + ) ), - secondaryCount: CombiningValueListenable( - children: ImageboardRegistry.instance.imageboards.map((x) => x.threadWatcher.unseenCount).toList(), - combine: (a, b) => a + b, - noChildrenValue: 0 - ) - ), hideTabletLayoutLabels ? null : 'Saved', - ), - GestureDetector( - onLongPress: _toggleHistory, - child: _buildTabletIcon(2, Persistence.enableHistory ? const Icon(CupertinoIcons.archivebox) : const Icon(CupertinoIcons.eye_slash), hideTabletLayoutLabels ? null : 'History') - ), - _buildTabletIcon(3, const Icon(CupertinoIcons.search), hideTabletLayoutLabels ? null : 'Search'), - GestureDetector( - onLongPress: _runSettingsQuickAction, - child: _buildTabletIcon(4, NotifyingIcon( - icon: Icon(CupertinoIcons.settings, color: settings.filterError != null ? Colors.red : null), - primaryCount: devImageboard?.threadWatcher.unseenYouCount ?? zeroValueNotifier, - secondaryCount: devImageboard?.threadWatcher.unseenCount ?? zeroValueNotifier - ), hideTabletLayoutLabels ? null : 'Settings' + _buildNewTabIcon(hideLabel: hideTabletLayoutLabels) + ] + ) + ), + _buildTabletIcon(1, NotifyingIcon( + icon: const Icon(CupertinoIcons.bookmark), + primaryCount: CombiningValueListenable( + children: ImageboardRegistry.instance.imageboards.map((x) => x.threadWatcher.unseenYouCount).toList(), + combine: (a, b) => a + b, + noChildrenValue: 0 + ), + secondaryCount: CombiningValueListenable( + children: ImageboardRegistry.instance.imageboards.map((x) => x.threadWatcher.unseenCount).toList(), + combine: (a, b) => a + b, + noChildrenValue: 0 ) + ), hideTabletLayoutLabels ? null : 'Saved', + ), + GestureDetector( + onLongPress: _toggleHistory, + child: _buildTabletIcon(2, Persistence.enableHistory ? const Icon(CupertinoIcons.archivebox) : const Icon(CupertinoIcons.eye_slash), hideTabletLayoutLabels ? null : 'History') + ), + _buildTabletIcon(3, const Icon(CupertinoIcons.search), hideTabletLayoutLabels ? null : 'Search'), + GestureDetector( + onLongPress: _runSettingsQuickAction, + child: _buildTabletIcon(4, NotifyingIcon( + icon: Icon(CupertinoIcons.settings, color: settings.filterError != null ? Colors.red : null), + primaryCount: devImageboard?.threadWatcher.unseenYouCount ?? zeroValueNotifier, + secondaryCount: devImageboard?.threadWatcher.unseenCount ?? zeroValueNotifier + ), hideTabletLayoutLabels ? null : 'Settings' ) - ] - ) - ), - Expanded( + ) + ] + ) + ), + Expanded( + child: Container( + color: context.select((s) => s.theme.backgroundColor), child: AnimatedBuilder( animation: _tabController, builder: (context, _) => TabSwitchingView( @@ -1423,8 +1453,8 @@ class _ChanHomePageState extends State { ) ) ) - ] - ) + ) + ] ) ) ) diff --git a/pubspec.yaml b/pubspec.yaml index f18a9bee4..cb8a92f16 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -103,6 +103,8 @@ flutter_icons: flutter_native_splash: color: "#141414" image: "assets/splash.png" + android_12: + image: "assets/splash_android12.png" # The following section is specific to Flutter. flutter: @@ -118,6 +120,7 @@ flutter: # - images/a_dot_ham.jpeg assets: - assets/katex.html + - assets/splash.png # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.io/assets-and-images/#resolution-aware. diff --git a/web/index.html b/web/index.html index 041ee53ae..efa71b692 100644 --- a/web/index.html +++ b/web/index.html @@ -1,16 +1,18 @@ - - - - - + + + + + + + - + - - - + + + @@ -105,5 +107,5 @@ loadMainDartJs(); } - - \ No newline at end of file + + \ No newline at end of file diff --git a/web/splash/img/dark-1x.png b/web/splash/img/dark-1x.png index d773e1330..00322f486 100644 Binary files a/web/splash/img/dark-1x.png and b/web/splash/img/dark-1x.png differ diff --git a/web/splash/img/dark-2x.png b/web/splash/img/dark-2x.png index 9a37ce638..fb3a9978f 100644 Binary files a/web/splash/img/dark-2x.png and b/web/splash/img/dark-2x.png differ diff --git a/web/splash/img/dark-3x.png b/web/splash/img/dark-3x.png index 23df0393e..bf6fd3ae2 100644 Binary files a/web/splash/img/dark-3x.png and b/web/splash/img/dark-3x.png differ diff --git a/web/splash/img/dark-4x.png b/web/splash/img/dark-4x.png index 95052dec4..46d7c1852 100644 Binary files a/web/splash/img/dark-4x.png and b/web/splash/img/dark-4x.png differ diff --git a/web/splash/img/light-1x.png b/web/splash/img/light-1x.png index d773e1330..00322f486 100644 Binary files a/web/splash/img/light-1x.png and b/web/splash/img/light-1x.png differ diff --git a/web/splash/img/light-2x.png b/web/splash/img/light-2x.png index 9a37ce638..fb3a9978f 100644 Binary files a/web/splash/img/light-2x.png and b/web/splash/img/light-2x.png differ diff --git a/web/splash/img/light-3x.png b/web/splash/img/light-3x.png index 23df0393e..bf6fd3ae2 100644 Binary files a/web/splash/img/light-3x.png and b/web/splash/img/light-3x.png differ diff --git a/web/splash/img/light-4x.png b/web/splash/img/light-4x.png index 95052dec4..46d7c1852 100644 Binary files a/web/splash/img/light-4x.png and b/web/splash/img/light-4x.png differ diff --git a/web/splash/splash.js b/web/splash/splash.js new file mode 100644 index 000000000..3b6ed11f3 --- /dev/null +++ b/web/splash/splash.js @@ -0,0 +1,5 @@ +function removeSplashFromWeb() { + document.getElementById("splash")?.remove(); + document.getElementById("splash-branding")?.remove(); + document.body.style.background = "transparent"; +} diff --git a/web/splash/style.css b/web/splash/style.css index 1c0bfc286..31a7c8bf5 100644 --- a/web/splash/style.css +++ b/web/splash/style.css @@ -1,8 +1,8 @@ -body, html { +body { margin:0; height:100%; background: #141414; - background-image: url("img/light-background.png"); + background-size: 100% 100%; } @@ -32,12 +32,32 @@ body, html { object-fit: cover; } +.bottom { + position: absolute; + bottom: 0; + left: 50%; + -ms-transform: translate(-50%, 0); + transform: translate(-50%, 0); +} + +.bottomLeft { + position: absolute; + bottom: 0; + left: 0; +} + +.bottomRight { + position: absolute; + bottom: 0; + right: 0; +} + @media (prefers-color-scheme: dark) { body { margin:0; height:100%; background: #141414; - background-image: url("img/dark-background.png"); + background-size: 100% 100%; } }