Skip to content

Commit

Permalink
api credit partial completed 👍
Browse files Browse the repository at this point in the history
  • Loading branch information
cranci1 committed Feb 25, 2024
1 parent 0d9547a commit 4f8f5d5
Show file tree
Hide file tree
Showing 20 changed files with 247 additions and 7 deletions.
12 changes: 10 additions & 2 deletions AnimeGen.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -49,6 +51,8 @@
13910EC82B80D5C2009BF17E /* nekos-best.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "nekos-best.swift"; sourceTree = "<group>"; };
13910ECA2B80D5C8009BF17E /* waifu-pics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "waifu-pics.swift"; sourceTree = "<group>"; };
13BE98BF2B828B8000379AB7 /* nekosmoe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = nekosmoe.swift; sourceTree = "<group>"; };
13CC95072B8BA40100B5705E /* ApiPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiPage.swift; sourceTree = "<group>"; };
13CC95092B8BA43600B5705E /* API.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = API.xcassets; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -102,6 +106,8 @@
13877B182B82001800251A60 /* SettingsPage.swift */,
13877B1D2B82024A00251A60 /* AboutPage.swift */,
13877B212B8233B800251A60 /* LicensePage.swift */,
13CC95072B8BA40100B5705E /* ApiPage.swift */,
13CC95092B8BA43600B5705E /* API.xcassets */,
);
path = Settings;
sourceTree = "<group>";
Expand Down Expand Up @@ -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;
Expand All @@ -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;
};
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 = "";
Expand Down
Binary file not shown.
2 changes: 0 additions & 2 deletions AnimeGen/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>The gallery addition is needed to save images.</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
Expand Down
6 changes: 6 additions & 0 deletions AnimeGen/Settings/API.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
21 changes: 21 additions & 0 deletions AnimeGen/Settings/API.xcassets/Hmtai.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions AnimeGen/Settings/API.xcassets/nekos.best.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions AnimeGen/Settings/API.xcassets/nekos.moe.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions AnimeGen/Settings/API.xcassets/nekosapi.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions AnimeGen/Settings/API.xcassets/pic-re.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions AnimeGen/Settings/API.xcassets/waifu.im.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions AnimeGen/Settings/API.xcassets/waifu.pics.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions AnimeGen/Settings/ApiPage.swift
Original file line number Diff line number Diff line change
@@ -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..<apiData.count, id: \.self) { index in
if index % 2 == 0 {
HStack(spacing: 45) {
apiItem(index: index)
if index + 1 < apiData.count {
apiItem(index: index + 1)
}
}
}
}
}
.padding(EdgeInsets(top: 10, leading: 10, bottom: 30, trailing: 10))
.navigationBarHidden(true)
}
}
}

private func apiItem(index: Int) -> 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()
}
}
9 changes: 6 additions & 3 deletions AnimeGen/Settings/SettingsPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 4f8f5d5

Please sign in to comment.