diff --git a/AnimeGen.xcodeproj/project.pbxproj b/AnimeGen.xcodeproj/project.pbxproj index ba0ac3ab..64c8e9fb 100644 --- a/AnimeGen.xcodeproj/project.pbxproj +++ b/AnimeGen.xcodeproj/project.pbxproj @@ -26,6 +26,8 @@ 13910ECB2B80D5C8009BF17E /* waifu-pics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13910ECA2B80D5C8009BF17E /* waifu-pics.swift */; }; 13910ECF2B80D90D009BF17E /* SDWebImage in Frameworks */ = {isa = PBXBuildFile; productRef = 13910ECE2B80D90D009BF17E /* SDWebImage */; }; 13BE98C02B828B8000379AB7 /* nekosmoe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13BE98BF2B828B8000379AB7 /* nekosmoe.swift */; }; + 13CC95082B8BA40100B5705E /* ApiPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13CC95072B8BA40100B5705E /* ApiPage.swift */; }; + 13CC950A2B8BA43600B5705E /* API.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13CC95092B8BA43600B5705E /* API.xcassets */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -49,6 +51,8 @@ 13910EC82B80D5C2009BF17E /* nekos-best.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "nekos-best.swift"; sourceTree = ""; }; 13910ECA2B80D5C8009BF17E /* waifu-pics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "waifu-pics.swift"; sourceTree = ""; }; 13BE98BF2B828B8000379AB7 /* nekosmoe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = nekosmoe.swift; sourceTree = ""; }; + 13CC95072B8BA40100B5705E /* ApiPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiPage.swift; sourceTree = ""; }; + 13CC95092B8BA43600B5705E /* API.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = API.xcassets; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -102,6 +106,8 @@ 13877B182B82001800251A60 /* SettingsPage.swift */, 13877B1D2B82024A00251A60 /* AboutPage.swift */, 13877B212B8233B800251A60 /* LicensePage.swift */, + 13CC95072B8BA40100B5705E /* ApiPage.swift */, + 13CC95092B8BA43600B5705E /* API.xcassets */, ); path = Settings; sourceTree = ""; @@ -195,6 +201,7 @@ files = ( 130A805F2B78C0300028985F /* LaunchScreen.storyboard in Resources */, 130A805C2B78C0300028985F /* Assets.xcassets in Resources */, + 13CC950A2B8BA43600B5705E /* API.xcassets in Resources */, 130A805A2B78C02E0028985F /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -221,6 +228,7 @@ 138661252B8136DC0062AC91 /* nekosapi.swift in Sources */, 13910EC92B80D5C2009BF17E /* nekos-best.swift in Sources */, 13910EBE2B80D380009BF17E /* ImageExtensions.swift in Sources */, + 13CC95082B8BA40100B5705E /* ApiPage.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -384,7 +392,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2; + MARKETING_VERSION = 1.3; PRODUCT_BUNDLE_IDENTIFIER = me.cranci.AnimeGen; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -416,7 +424,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2; + MARKETING_VERSION = 1.3; PRODUCT_BUNDLE_IDENTIFIER = me.cranci.AnimeGen; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate b/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate index 90f683ec..951249b5 100644 Binary files a/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate and b/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/AnimeGen/Info.plist b/AnimeGen/Info.plist index bad9ff6c..dd3c9afd 100644 --- a/AnimeGen/Info.plist +++ b/AnimeGen/Info.plist @@ -2,8 +2,6 @@ - NSPhotoLibraryAddUsageDescription - The gallery addition is needed to save images. UIApplicationSceneManifest UIApplicationSupportsMultipleScenes diff --git a/AnimeGen/Settings/API.xcassets/Contents.json b/AnimeGen/Settings/API.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/AnimeGen/Settings/API.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AnimeGen/Settings/API.xcassets/Hmtai.imageset/Contents.json b/AnimeGen/Settings/API.xcassets/Hmtai.imageset/Contents.json new file mode 100644 index 00000000..31d409c9 --- /dev/null +++ b/AnimeGen/Settings/API.xcassets/Hmtai.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "pngtree-no-image-available-icon-flatvector-illustration-pic-design-profile-vector-png-image_40966566.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AnimeGen/Settings/API.xcassets/Hmtai.imageset/pngtree-no-image-available-icon-flatvector-illustration-pic-design-profile-vector-png-image_40966566.jpg b/AnimeGen/Settings/API.xcassets/Hmtai.imageset/pngtree-no-image-available-icon-flatvector-illustration-pic-design-profile-vector-png-image_40966566.jpg new file mode 100644 index 00000000..a4ce06ed Binary files /dev/null and b/AnimeGen/Settings/API.xcassets/Hmtai.imageset/pngtree-no-image-available-icon-flatvector-illustration-pic-design-profile-vector-png-image_40966566.jpg differ diff --git a/AnimeGen/Settings/API.xcassets/nekos.best.imageset/Contents.json b/AnimeGen/Settings/API.xcassets/nekos.best.imageset/Contents.json new file mode 100644 index 00000000..e8829e87 --- /dev/null +++ b/AnimeGen/Settings/API.xcassets/nekos.best.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "favicon.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AnimeGen/Settings/API.xcassets/nekos.best.imageset/favicon.png b/AnimeGen/Settings/API.xcassets/nekos.best.imageset/favicon.png new file mode 100644 index 00000000..71c2a287 Binary files /dev/null and b/AnimeGen/Settings/API.xcassets/nekos.best.imageset/favicon.png differ diff --git a/AnimeGen/Settings/API.xcassets/nekos.moe.imageset/Contents.json b/AnimeGen/Settings/API.xcassets/nekos.moe.imageset/Contents.json new file mode 100644 index 00000000..c8a441f2 --- /dev/null +++ b/AnimeGen/Settings/API.xcassets/nekos.moe.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "apple-touch-icon.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AnimeGen/Settings/API.xcassets/nekos.moe.imageset/apple-touch-icon.png b/AnimeGen/Settings/API.xcassets/nekos.moe.imageset/apple-touch-icon.png new file mode 100644 index 00000000..4f4f554d Binary files /dev/null and b/AnimeGen/Settings/API.xcassets/nekos.moe.imageset/apple-touch-icon.png differ diff --git a/AnimeGen/Settings/API.xcassets/nekosapi.imageset/Contents.json b/AnimeGen/Settings/API.xcassets/nekosapi.imageset/Contents.json new file mode 100644 index 00000000..ef1c6517 --- /dev/null +++ b/AnimeGen/Settings/API.xcassets/nekosapi.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "logo-removebg-preview.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AnimeGen/Settings/API.xcassets/nekosapi.imageset/logo-removebg-preview.png b/AnimeGen/Settings/API.xcassets/nekosapi.imageset/logo-removebg-preview.png new file mode 100644 index 00000000..f4f97415 Binary files /dev/null and b/AnimeGen/Settings/API.xcassets/nekosapi.imageset/logo-removebg-preview.png differ diff --git a/AnimeGen/Settings/API.xcassets/pic-re.imageset/Contents.json b/AnimeGen/Settings/API.xcassets/pic-re.imageset/Contents.json new file mode 100644 index 00000000..2eb3ab18 --- /dev/null +++ b/AnimeGen/Settings/API.xcassets/pic-re.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "download.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AnimeGen/Settings/API.xcassets/pic-re.imageset/download.png b/AnimeGen/Settings/API.xcassets/pic-re.imageset/download.png new file mode 100644 index 00000000..9cc6d2d9 Binary files /dev/null and b/AnimeGen/Settings/API.xcassets/pic-re.imageset/download.png differ diff --git a/AnimeGen/Settings/API.xcassets/waifu.im.imageset/Contents.json b/AnimeGen/Settings/API.xcassets/waifu.im.imageset/Contents.json new file mode 100644 index 00000000..ba6074cd --- /dev/null +++ b/AnimeGen/Settings/API.xcassets/waifu.im.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "favicon.ico.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AnimeGen/Settings/API.xcassets/waifu.im.imageset/favicon.ico.png b/AnimeGen/Settings/API.xcassets/waifu.im.imageset/favicon.ico.png new file mode 100644 index 00000000..19e06697 Binary files /dev/null and b/AnimeGen/Settings/API.xcassets/waifu.im.imageset/favicon.ico.png differ diff --git a/AnimeGen/Settings/API.xcassets/waifu.pics.imageset/Contents.json b/AnimeGen/Settings/API.xcassets/waifu.pics.imageset/Contents.json new file mode 100644 index 00000000..3b47d139 --- /dev/null +++ b/AnimeGen/Settings/API.xcassets/waifu.pics.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "favicon-1-_dragged_.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AnimeGen/Settings/API.xcassets/waifu.pics.imageset/favicon-1-_dragged_.png b/AnimeGen/Settings/API.xcassets/waifu.pics.imageset/favicon-1-_dragged_.png new file mode 100644 index 00000000..aeb4d274 Binary files /dev/null and b/AnimeGen/Settings/API.xcassets/waifu.pics.imageset/favicon-1-_dragged_.png differ diff --git a/AnimeGen/Settings/ApiPage.swift b/AnimeGen/Settings/ApiPage.swift new file mode 100644 index 00000000..368018a4 --- /dev/null +++ b/AnimeGen/Settings/ApiPage.swift @@ -0,0 +1,78 @@ +// +// apicredit.swift +// AnimeGen +// +// Created by cranci on 25/02/24. +// + +import SwiftUI + +struct ApiPage: View { + struct APIInfo: Hashable { + let imageName: String + let apiName: String + let url: URL + } + + let apiData: [APIInfo] = [ + APIInfo(imageName: "pic-re", apiName: "pic.re", url: URL(string: "https://pic.re")!), + APIInfo(imageName: "waifu.im", apiName: "waifu.im", url: URL(string: "https://waifu.im")!), + APIInfo(imageName: "waifu.pics", apiName: "waifu.pics", url: URL(string: "https://waifu.pics")!), + APIInfo(imageName: "nekos.best", apiName: "nekos.best", url: URL(string: "https://nekos.best")!), + APIInfo(imageName: "Hmtai", apiName: "Hmtai", url: URL(string: "https://hmtai.hatsunia.cfd/endpoints")!), + APIInfo(imageName: "nekosapi", apiName: "nekosapi.com", url: URL(string: "https://nekosapi.com")!), + APIInfo(imageName: "nekos.moe", apiName: "nekos.moe", url: URL(string: "https://nekos.moe")!) + ] + + var body: some View { + NavigationView { + ScrollView { + VStack(spacing: 10) { + ForEach(0.. some View { + let data = apiData[index] + + return Button(action: { + openURL(data.url) + }) { + VStack { + Image(data.imageName) + .resizable() + .aspectRatio(contentMode: .fit) + .frame(height: 120) + .cornerRadius(10) + + Text(data.apiName) + .padding(.top, 5) + .font(.headline) + } + } + .buttonStyle(PlainButtonStyle()) + } + + private func openURL(_ url: URL) { + UIApplication.shared.open(url) + } +} + +struct ApiPage_Preview: PreviewProvider { + static var previews: some View { + ApiPage() + } +} diff --git a/AnimeGen/Settings/SettingsPage.swift b/AnimeGen/Settings/SettingsPage.swift index 8a779522..35a2b170 100644 --- a/AnimeGen/Settings/SettingsPage.swift +++ b/AnimeGen/Settings/SettingsPage.swift @@ -78,13 +78,16 @@ struct SettingsPage: View { NavigationLink(destination: AboutPage()) { Text("About") } - } - - Section(header: Text("Licence")) { + NavigationLink(destination: LicensePage()) { Text("License") } + + NavigationLink(destination: ApiPage()) { + Text("APIs credits") + } } + } .navigationBarTitle("Settings") }