mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-04 16:49:44 +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 {
|
||||
WindowGroup {
|
||||
SplashScreenView()
|
||||
.environmentObject(moduleManager)
|
||||
.environmentObject(settings)
|
||||
.environmentObject(librarykManager)
|
||||
.environmentObject(downloadManager)
|
||||
.environmentObject(jsController)
|
||||
.accentColor(settings.accentColor)
|
||||
.onAppear {
|
||||
settings.updateAppearance()
|
||||
Task {
|
||||
if UserDefaults.standard.bool(forKey: "refreshModulesOnLaunch") {
|
||||
await moduleManager.refreshModules()
|
||||
}
|
||||
Group {
|
||||
if !UserDefaults.standard.bool(forKey: "hideSplashScreenEnable") {
|
||||
SplashScreenView()
|
||||
} else {
|
||||
ContentView()
|
||||
}
|
||||
}
|
||||
.environmentObject(moduleManager)
|
||||
.environmentObject(settings)
|
||||
.environmentObject(librarykManager)
|
||||
.environmentObject(downloadManager)
|
||||
.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("fetchEpisodeMetadata") private var fetchEpisodeMetadata: Bool = true
|
||||
@AppStorage("analyticsEnabled") private var analyticsEnabled: Bool = false
|
||||
@AppStorage("hideSplashScreenEnable") private var hideSplashScreenEnable: Bool = false
|
||||
@AppStorage("metadataProviders") private var metadataProviders: String = "TMDB"
|
||||
@AppStorage("tmdbImageWidth") private var TMDBimageWidht: String = "original"
|
||||
@AppStorage("mediaColumnsPortrait") private var mediaColumnsPortrait: Int = 2
|
||||
|
|
@ -180,6 +181,12 @@ struct SettingsViewGeneral: View {
|
|||
},
|
||||
selection: $settings.selectedAppearance
|
||||
)
|
||||
|
||||
SettingsToggleRow(
|
||||
icon: "wand.and.rays.inverse",
|
||||
title: "Hide Splash Screen",
|
||||
isOn: $hideSplashScreenEnable
|
||||
)
|
||||
}
|
||||
|
||||
SettingsSection(
|
||||
|
|
|
|||
|
|
@ -24,18 +24,13 @@ struct SplashScreenView: View {
|
|||
.cornerRadius(24)
|
||||
.scaleEffect(isAnimating ? 1.2 : 1.0)
|
||||
.opacity(isAnimating ? 1.0 : 0.0)
|
||||
|
||||
Text("Sora")
|
||||
.font(.largeTitle)
|
||||
.fontWeight(.bold)
|
||||
.opacity(isAnimating ? 1.0 : 0.0)
|
||||
}
|
||||
.onAppear {
|
||||
withAnimation(.easeIn(duration: 0.5)) {
|
||||
isAnimating = true
|
||||
}
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
||||
withAnimation(.easeOut(duration: 0.5)) {
|
||||
showMainApp = true
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue