mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-21 00:22:12 +00:00
splash screen fixes cuz people too pichy
This commit is contained in:
parent
0bd5b37edc
commit
23ecb6f53a
3 changed files with 30 additions and 22 deletions
|
|
@ -31,24 +31,30 @@ struct SoraApp: App {
|
||||||
|
|
||||||
var body: some Scene {
|
var body: some Scene {
|
||||||
WindowGroup {
|
WindowGroup {
|
||||||
SplashScreenView()
|
Group {
|
||||||
.environmentObject(moduleManager)
|
if !UserDefaults.standard.bool(forKey: "hideSplashScreenEnable") {
|
||||||
.environmentObject(settings)
|
SplashScreenView()
|
||||||
.environmentObject(librarykManager)
|
} else {
|
||||||
.environmentObject(downloadManager)
|
ContentView()
|
||||||
.environmentObject(jsController)
|
}
|
||||||
.accentColor(settings.accentColor)
|
}
|
||||||
.onAppear {
|
.environmentObject(moduleManager)
|
||||||
settings.updateAppearance()
|
.environmentObject(settings)
|
||||||
Task {
|
.environmentObject(librarykManager)
|
||||||
if UserDefaults.standard.bool(forKey: "refreshModulesOnLaunch") {
|
.environmentObject(downloadManager)
|
||||||
await moduleManager.refreshModules()
|
.environmentObject(jsController)
|
||||||
}
|
.accentColor(settings.accentColor)
|
||||||
|
.onAppear {
|
||||||
|
settings.updateAppearance()
|
||||||
|
Task {
|
||||||
|
if UserDefaults.standard.bool(forKey: "refreshModulesOnLaunch") {
|
||||||
|
await moduleManager.refreshModules()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.onOpenURL { url in
|
}
|
||||||
handleURL(url)
|
.onOpenURL { url in
|
||||||
}
|
handleURL(url)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,7 @@ struct SettingsViewGeneral: View {
|
||||||
@AppStorage("refreshModulesOnLaunch") private var refreshModulesOnLaunch: Bool = true
|
@AppStorage("refreshModulesOnLaunch") private var refreshModulesOnLaunch: Bool = true
|
||||||
@AppStorage("fetchEpisodeMetadata") private var fetchEpisodeMetadata: Bool = true
|
@AppStorage("fetchEpisodeMetadata") private var fetchEpisodeMetadata: Bool = true
|
||||||
@AppStorage("analyticsEnabled") private var analyticsEnabled: Bool = false
|
@AppStorage("analyticsEnabled") private var analyticsEnabled: Bool = false
|
||||||
|
@AppStorage("hideSplashScreenEnable") private var hideSplashScreenEnable: Bool = false
|
||||||
@AppStorage("metadataProviders") private var metadataProviders: String = "TMDB"
|
@AppStorage("metadataProviders") private var metadataProviders: String = "TMDB"
|
||||||
@AppStorage("tmdbImageWidth") private var TMDBimageWidht: String = "original"
|
@AppStorage("tmdbImageWidth") private var TMDBimageWidht: String = "original"
|
||||||
@AppStorage("mediaColumnsPortrait") private var mediaColumnsPortrait: Int = 2
|
@AppStorage("mediaColumnsPortrait") private var mediaColumnsPortrait: Int = 2
|
||||||
|
|
@ -180,6 +181,12 @@ struct SettingsViewGeneral: View {
|
||||||
},
|
},
|
||||||
selection: $settings.selectedAppearance
|
selection: $settings.selectedAppearance
|
||||||
)
|
)
|
||||||
|
|
||||||
|
SettingsToggleRow(
|
||||||
|
icon: "wand.and.rays.inverse",
|
||||||
|
title: "Hide Splash Screen",
|
||||||
|
isOn: $hideSplashScreenEnable
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsSection(
|
SettingsSection(
|
||||||
|
|
|
||||||
|
|
@ -24,18 +24,13 @@ struct SplashScreenView: View {
|
||||||
.cornerRadius(24)
|
.cornerRadius(24)
|
||||||
.scaleEffect(isAnimating ? 1.2 : 1.0)
|
.scaleEffect(isAnimating ? 1.2 : 1.0)
|
||||||
.opacity(isAnimating ? 1.0 : 0.0)
|
.opacity(isAnimating ? 1.0 : 0.0)
|
||||||
|
|
||||||
Text("Sora")
|
|
||||||
.font(.largeTitle)
|
|
||||||
.fontWeight(.bold)
|
|
||||||
.opacity(isAnimating ? 1.0 : 0.0)
|
|
||||||
}
|
}
|
||||||
.onAppear {
|
.onAppear {
|
||||||
withAnimation(.easeIn(duration: 0.5)) {
|
withAnimation(.easeIn(duration: 0.5)) {
|
||||||
isAnimating = true
|
isAnimating = true
|
||||||
}
|
}
|
||||||
|
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
||||||
withAnimation(.easeOut(duration: 0.5)) {
|
withAnimation(.easeOut(duration: 0.5)) {
|
||||||
showMainApp = true
|
showMainApp = true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue