Skip to content

Commit

Permalink
Clean up assets, align welcome screen
Browse files Browse the repository at this point in the history
  • Loading branch information
BPerlakiH committed Sep 14, 2024
1 parent 1f98231 commit d7b0e7c
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 92 deletions.
2 changes: 1 addition & 1 deletion Model/Brand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ enum AppType {
enum Brand {
static let appName: String = Config.value(for: .displayName) ?? "Kiwix"
static let appStoreId: String = Config.value(for: .appStoreID) ?? "id997079563"
static let welcomeLogoImageName: String = "welcomeLogo"
static let loadingLogoImage: String = "kiwix-full"
static let aboutText: String = Config.value(for: .aboutText) ?? "settings.about.description".localized
static let aboutWebsite: String = Config.value(for: .aboutWebsite) ?? "https://www.kiwix.org"

Expand Down
12 changes: 0 additions & 12 deletions Support/Assets.xcassets/Kiwix_logo_v4.imageset/Contents.json

This file was deleted.

Binary file not shown.
12 changes: 0 additions & 12 deletions Support/Assets.xcassets/welcomeLogo.imageset/Contents.json

This file was deleted.

20 changes: 0 additions & 20 deletions Support/Assets.xcassets/welcomeLogo.imageset/Kiwix_logo_v3.svg

This file was deleted.

2 changes: 1 addition & 1 deletion Support/SplashScreenKiwix.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<constraint firstItem="gOr-0c-AYj" firstAttribute="width" relation="lessThanOrEqual" secondItem="Ze5-6b-2t3" secondAttribute="width" multiplier="0.618" id="G29-6Y-oWb"/>
<constraint firstItem="gOr-0c-AYj" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="MYi-uf-geF"/>
<constraint firstItem="gOr-0c-AYj" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="ohB-Hm-56e"/>
<constraint firstItem="gOr-0c-AYj" firstAttribute="height" relation="lessThanOrEqual" secondItem="Ze5-6b-2t3" secondAttribute="height" multiplier="0.618" id="zTu-F5-CRx"/>
<constraint firstItem="gOr-0c-AYj" firstAttribute="height" relation="lessThanOrEqual" secondItem="Ze5-6b-2t3" secondAttribute="height" multiplier="0.382" id="zTu-F5-CRx"/>
</constraints>
</view>
</viewController>
Expand Down
6 changes: 4 additions & 2 deletions Views/BuildingBlocks/LoadingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ import SwiftUI
struct LogoView: View {
var body: some View {
GeometryReader { geometry in
Image("kiwix-full")
.frame(width: geometry.size.width * 0.618, height: geometry.size.height * 0.618)
Image(Brand.loadingLogoImage)
.frame(
width: geometry.size.width * 0.618,
height: geometry.size.height * 0.3820)
.aspectRatio(contentMode: .fit)
.position(
x: geometry.size.width * 0.5,
Expand Down
79 changes: 35 additions & 44 deletions Views/Welcome.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,42 +36,8 @@ struct Welcome: View {
if zimFiles.isEmpty {
ZStack {
LogoView()
welcomeContent
}.ignoresSafeArea()
// ZStack {
// LoadingView()
// HStack {
// Spacer()
// VStack(spacing: 20) {
// Spacer(minLength: 200)
// Divider()
// actions
// Text("library_refresh_error.retrieve.description".localized)
// .foregroundColor(.red)
// .opacity(library.state == .error ? 1 : 0)
// Spacer()
// }
// #if os(macOS)
// .frame(maxWidth: 300)
// #elseif os(iOS)
// .frame(maxWidth: 600)
// #endif
// Spacer()
// }
// .padding()
// .ignoresSafeArea()
// .onChange(of: library.state) { state in
// guard state == .complete else { return }
// #if os(macOS)
// navigation.currentItem = .categories
// #elseif os(iOS)
// if horizontalSizeClass == .regular {
// navigation.currentItem = .categories
// } else {
// showLibrary?()
// }
// #endif
// }
// }
} else {
LazyVGrid(
columns: ([GridItem(.adaptive(minimum: 250, maximum: 500), spacing: 12)]),
Expand Down Expand Up @@ -106,15 +72,40 @@ struct Welcome: View {
}
}

/// App logo shown in onboarding view
private var logo: some View {
VStack(spacing: 6) {
Image(Brand.welcomeLogoImageName)
.resizable()
.aspectRatio(1, contentMode: .fit)
.frame(width: 60, height: 60)
.background(RoundedRectangle(cornerRadius: 10, style: .continuous).foregroundColor(.white))
// Text(Brand.appName.uppercased()).font(.largeTitle).fontWeight(.bold)
private var welcomeContent: some View {
GeometryReader { geometry in
HStack {
Spacer()
VStack(spacing: 20) {
Spacer()
.frame(height: geometry.size.height * 0.618)
Divider()
actions
Text("library_refresh_error.retrieve.description".localized)
.foregroundColor(.red)
.opacity(library.state == .error ? 1 : 0)
Spacer()
}
.padding()
#if os(macOS)
.frame(maxWidth: 300)
#elseif os(iOS)
.frame(maxWidth: 600)
#endif
.onChange(of: library.state) { state in
guard state == .complete else { return }
#if os(macOS)
navigation.currentItem = .categories
#elseif os(iOS)
if horizontalSizeClass == .regular {
navigation.currentItem = .categories
} else {
showLibrary?()
}
#endif
}
Spacer()
}
}
}

Expand Down

0 comments on commit d7b0e7c

Please sign in to comment.