mirror of
https://github.com/cranci1/Sora.git
synced 2026-01-11 20:10:24 +00:00
Changes (#179)
* Fixed episodecells getting stuck sliding
* Enabled device scaling for ipad
not good enough yet, not applied everywhere cuz idk where to apply exactly 💯
* Fixed blur in continue watching cells
* Keyboard controls player
* fixed downloadview buttons
* Reduced tab bar outline opacity
* Increased module selector hitbox
* Fixed module add view
* Fixed mediainfoview issues (description) + changed settingsviewdata footer
medainfoview:
1: no swipe to go back
2: image shadows were fucked
* Fixes
* Splashscreen
* Update Contents.json
* Episodecell getting stuck fix
* Improved blur + pushed items more down
* hihi
* Module selector changes
This commit is contained in:
parent
208827ec78
commit
2beaaf5575
4 changed files with 130 additions and 22 deletions
|
|
@ -276,6 +276,9 @@
|
|||
},
|
||||
"Modules" : {
|
||||
|
||||
},
|
||||
"MODULES" : {
|
||||
|
||||
},
|
||||
"MORE" : {
|
||||
|
||||
|
|
@ -414,6 +417,12 @@
|
|||
},
|
||||
"Tap a title to override the current match." : {
|
||||
|
||||
},
|
||||
"Tap to manage your modules" : {
|
||||
|
||||
},
|
||||
"Tap to select a module" : {
|
||||
|
||||
},
|
||||
"The module provided only a single episode, this is most likely a movie, so we decided to make separate screens for these cases." : {
|
||||
|
||||
|
|
|
|||
|
|
@ -252,7 +252,10 @@ struct MediaInfoView: View {
|
|||
ZStack(alignment: .top) {
|
||||
gradientOverlay
|
||||
|
||||
VStack(alignment: .leading, spacing: 16) {
|
||||
VStack(alignment: .leading, spacing: 24) {
|
||||
Spacer()
|
||||
.frame(height: 100)
|
||||
|
||||
headerSection
|
||||
if !episodeLinks.isEmpty {
|
||||
episodesSection
|
||||
|
|
@ -260,31 +263,34 @@ struct MediaInfoView: View {
|
|||
noEpisodesSection
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.padding(.horizontal)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var gradientOverlay: some View {
|
||||
LinearGradient(
|
||||
gradient: Gradient(stops: [
|
||||
.init(color: (colorScheme == .dark ? Color.black : Color.white).opacity(0.0), location: 0.0),
|
||||
.init(color: (colorScheme == .dark ? Color.black : Color.white).opacity(0.5), location: 0.2),
|
||||
.init(color: (colorScheme == .dark ? Color.black : Color.white).opacity(0.8), location: 0.5),
|
||||
.init(color: (colorScheme == .dark ? Color.black : Color.white), location: 1.0)
|
||||
]),
|
||||
startPoint: .top,
|
||||
endPoint: .bottom
|
||||
)
|
||||
ZStack {
|
||||
ProgressiveBlurView()
|
||||
.opacity(0.8)
|
||||
|
||||
LinearGradient(
|
||||
gradient: Gradient(stops: [
|
||||
.init(color: (colorScheme == .dark ? Color.black : Color.white).opacity(0.0), location: 0.0),
|
||||
.init(color: (colorScheme == .dark ? Color.black : Color.white).opacity(0.5), location: 0.5),
|
||||
.init(color: (colorScheme == .dark ? Color.black : Color.white), location: 1.0)
|
||||
]),
|
||||
startPoint: .top,
|
||||
endPoint: .bottom
|
||||
)
|
||||
}
|
||||
.frame(height: 300)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 0))
|
||||
.shadow(color: (colorScheme == .dark ? Color.black : Color.white).opacity(1), radius: 10, x: 0, y: 10)
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var headerSection: some View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
VStack(alignment: .leading, spacing: 12) {
|
||||
if !airdate.isEmpty && airdate != "N/A" && airdate != "No Data" {
|
||||
HStack(spacing: 4) {
|
||||
Image(systemName: "calendar")
|
||||
|
|
@ -297,7 +303,7 @@ struct MediaInfoView: View {
|
|||
}
|
||||
|
||||
Text(title)
|
||||
.font(.system(size: 28, weight: .bold))
|
||||
.font(.system(size: 32, weight: .bold))
|
||||
.foregroundColor(.primary)
|
||||
.lineLimit(3)
|
||||
.onLongPressGesture {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import NukeUI
|
||||
|
||||
fileprivate struct SettingsNavigationRow: View {
|
||||
let icon: String
|
||||
|
|
@ -43,10 +44,93 @@ fileprivate struct SettingsNavigationRow: View {
|
|||
.padding(.vertical, 12)
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate struct ModulePreviewRow: View {
|
||||
@EnvironmentObject var moduleManager: ModuleManager
|
||||
@AppStorage("selectedModuleId") private var selectedModuleId: String?
|
||||
|
||||
private var selectedModule: ScrapingModule? {
|
||||
guard let id = selectedModuleId else { return nil }
|
||||
return moduleManager.modules.first { $0.id.uuidString == id }
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 16) {
|
||||
if let module = selectedModule {
|
||||
LazyImage(url: URL(string: module.metadata.iconUrl)) { state in
|
||||
if let uiImage = state.imageContainer?.image {
|
||||
Image(uiImage: uiImage)
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 60, height: 60)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 12))
|
||||
} else {
|
||||
Image(systemName: "cube")
|
||||
.font(.system(size: 36))
|
||||
.foregroundStyle(Color.accentColor)
|
||||
}
|
||||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(module.metadata.sourceName)
|
||||
.font(.headline)
|
||||
.foregroundStyle(.primary)
|
||||
|
||||
Text("Tap to manage your modules")
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.gray)
|
||||
.lineLimit(1)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
} else {
|
||||
Image(systemName: "cube")
|
||||
.font(.system(size: 36))
|
||||
.foregroundStyle(Color.accentColor)
|
||||
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text("No Module Selected")
|
||||
.font(.headline)
|
||||
.foregroundStyle(.primary)
|
||||
|
||||
Text("Tap to select a module")
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.gray)
|
||||
.lineLimit(1)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
|
||||
Image(systemName: "chevron.right")
|
||||
.foregroundStyle(.gray)
|
||||
}
|
||||
.padding(.horizontal, 16)
|
||||
.padding(.vertical, 16)
|
||||
.background(.ultraThinMaterial)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 12))
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 12)
|
||||
.strokeBorder(
|
||||
LinearGradient(
|
||||
gradient: Gradient(stops: [
|
||||
.init(color: Color.accentColor.opacity(0.3), location: 0),
|
||||
.init(color: Color.accentColor.opacity(0), location: 1)
|
||||
]),
|
||||
startPoint: .top,
|
||||
endPoint: .bottom
|
||||
),
|
||||
lineWidth: 0.5
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
struct SettingsView: View {
|
||||
let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "ALPHA"
|
||||
@Environment(\.colorScheme) var colorScheme
|
||||
@StateObject var settings = Settings()
|
||||
@EnvironmentObject var moduleManager: ModuleManager
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
|
|
@ -59,6 +143,19 @@ struct SettingsView: View {
|
|||
.padding(.horizontal, 20)
|
||||
.padding(.top, 16)
|
||||
|
||||
// Modules Section at the top
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text("MODULES")
|
||||
.font(.footnote)
|
||||
.foregroundStyle(.gray)
|
||||
.padding(.horizontal, 20)
|
||||
|
||||
NavigationLink(destination: SettingsViewModule()) {
|
||||
ModulePreviewRow()
|
||||
}
|
||||
.padding(.horizontal, 20)
|
||||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text("MAIN")
|
||||
.font(.footnote)
|
||||
|
|
@ -81,11 +178,6 @@ struct SettingsView: View {
|
|||
}
|
||||
Divider().padding(.horizontal, 16)
|
||||
|
||||
NavigationLink(destination: SettingsViewModule()) {
|
||||
SettingsNavigationRow(icon: "cube", title: "Modules")
|
||||
}
|
||||
Divider().padding(.horizontal, 16)
|
||||
|
||||
NavigationLink(destination: SettingsViewTrackers()) {
|
||||
SettingsNavigationRow(icon: "square.stack.3d.up", title: "Trackers")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"originHash" : "07beed18a1a0b5e52eea618e423e9ca1c37c24c4d3d4ec31d68c1664db0f0596",
|
||||
"pins" : [
|
||||
{
|
||||
"identity" : "drops",
|
||||
|
|
@ -33,9 +34,9 @@
|
|||
"location" : "https://github.com/cranci1/SoraCore",
|
||||
"state" : {
|
||||
"branch" : "main",
|
||||
"revision" : "543fe1c8c1d421201aeb10e7d2438a91c90c8ac5"
|
||||
"revision" : "957207dded41b1db9fbfdabde81ffb2e72e71b31"
|
||||
}
|
||||
}
|
||||
],
|
||||
"version" : 2
|
||||
"version" : 3
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue