mirror of
https://github.com/zzanehip/The-OldOS-Project.git
synced 2025-01-22 17:23:58 -05:00
Fixed 1.0 (15) merge issues
This commit is contained in:
parent
bb80e80fef
commit
3d72d7edbd
4 changed files with 53 additions and 454 deletions
|
@ -92,7 +92,6 @@
|
|||
0DC40DEE2715DA7600BE910C /* ReflectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0DC40DE92715DA7600BE910C /* ReflectionView.m */; };
|
||||
0DD19EEF2675418600A3EEF8 /* unlock.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 0DD19EEE2675418600A3EEF8 /* unlock.aiff */; };
|
||||
0DDBD2142624FF6600106345 /* cities.json in Resources */ = {isa = PBXBuildFile; fileRef = 0DDBD2132624FF6600106345 /* cities.json */; };
|
||||
0DEE57402707D79C005B0F09 /* Crypto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DEE573F2707D79C005B0F09 /* Crypto.swift */; };
|
||||
0DEF66F6260CFBF800341037 /* iTunes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DEF66F5260CFBF800341037 /* iTunes.swift */; };
|
||||
0DEF66FB2610240F00341037 /* style.css in Resources */ = {isa = PBXBuildFile; fileRef = 0DEF66FA2610240F00341037 /* style.css */; };
|
||||
0DEF67072610F50500341037 /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 0DEF67062610F50500341037 /* Alamofire */; };
|
||||
|
@ -217,7 +216,6 @@
|
|||
0DD19EEE2675418600A3EEF8 /* unlock.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = unlock.aiff; sourceTree = "<group>"; };
|
||||
0DDBD2132624FF6600106345 /* cities.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = cities.json; sourceTree = "<group>"; };
|
||||
0DE37D4B267058C9001196E3 /* Camera-SwiftUI-main */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "Camera-SwiftUI-main"; sourceTree = "<group>"; };
|
||||
0DEE573F2707D79C005B0F09 /* Crypto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Crypto.swift; sourceTree = "<group>"; };
|
||||
0DEF66F5260CFBF800341037 /* iTunes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iTunes.swift; sourceTree = "<group>"; };
|
||||
0DEF66FA2610240F00341037 /* style.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = style.css; sourceTree = "<group>"; };
|
||||
0DEF670F261101AE00341037 /* SearchPlistCodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchPlistCodable.swift; sourceTree = "<group>"; };
|
||||
|
@ -348,7 +346,6 @@
|
|||
0D371FD525AB7B6D00E4D723 /* LockScreen.swift */,
|
||||
0D4BBF5225B2105000FCFB2E /* Settings.swift */,
|
||||
0D289FB625B2030900B242EF /* Common.swift */,
|
||||
0DEE573F2707D79C005B0F09 /* Crypto.swift */,
|
||||
0D2D5CBE25C9C48500286707 /* iPod.swift */,
|
||||
0D11D84D25E19F9400AB2F2B /* Safari.swift */,
|
||||
0D11D88225EC009B00AB2F2B /* Mail.swift */,
|
||||
|
@ -668,7 +665,6 @@
|
|||
0DC40DEC2715DA7600BE910C /* UIView+FlipTransition.m in Sources */,
|
||||
0D80443E265C4CC500000171 /* Camera.swift in Sources */,
|
||||
0D0FB49C262A427A008AE4C5 /* Maps.swift in Sources */,
|
||||
0DEE57402707D79C005B0F09 /* Crypto.swift in Sources */,
|
||||
0D0FB4F0262A75EB008AE4C5 /* XBPageCurlView.m in Sources */,
|
||||
0D11D88325EC009B00AB2F2B /* Mail.swift in Sources */,
|
||||
0D371FD625AB7B6D00E4D723 /* LockScreen.swift in Sources */,
|
||||
|
|
|
@ -653,7 +653,7 @@ struct status_bar_in_app: View {
|
|||
Image(systemName: "wifi").gradientForegroundNonDynamic(colors: [Color.init(red: 32/255, green: 157/255, blue: 237/255), Color.init(red: 72/255, green: 118/255, blue: 196/255)]) .opacity(wifi_connected ? 1 : 0).shadowStyle().mask( Image(systemName: "wifi").gradientForegroundNonDynamic(colors: [Color.init(red: 32/255, green: 157/255, blue: 237/255), Color.init(red: 72/255, green: 118/255, blue: 196/255)]) .opacity(wifi_connected ? 1 : 0).shadowStyle().innerShadow2(color: Color.black.opacity(0.8), radius: 1))//Is it messy, yes, does it work, yes
|
||||
}
|
||||
Spacer()
|
||||
Text("\(Int(battery_level))%").foregroundColor(Color.init(red: 74/255, green: 74/255, blue: 74/255)).font(.custom("Helvetica Neue Bold", size: 15)).shadowStyle().offset(x: 10).isHidden(charging)
|
||||
Text("\(Int(battery_level))%").foregroundColor(Color.init(red: 74/255, green: 74/255, blue: 74/255)).font(.custom("Helvetica Neue Bold", fixedSize: 15)).shadowStyle().offset(x: 10).isHidden(charging)
|
||||
battery_in_app(battery: Float(battery_level/100), charging: charging)
|
||||
.onReceive(timer) { input in
|
||||
if (UIDevice.current.batteryState != .unplugged) {
|
||||
|
@ -1024,13 +1024,13 @@ struct tri_segmented_control_youtube: View {
|
|||
GeometryReader{ geometry in
|
||||
HStack(spacing: 0) {
|
||||
Button(action:{selected = 0}) {
|
||||
Text(first_text).font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(.white).shadow(color: Color.black.opacity(0.6), radius: 0, x: 0, y: -0.66)
|
||||
Text(first_text).font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(.white).shadow(color: Color.black.opacity(0.6), radius: 0, x: 0, y: -0.66)
|
||||
}.frame(width: geometry.size.width/3, height: geometry.size.height).ps_innerShadow(.rectangleCustomCorners(selected == 0 ? selected_gradient: unselected_gradient), radius:0.82, offset: CGPoint(0, 0.6), intensity: 0.7).shadow(color: Color.white.opacity(0.28), radius: 0, x: 0, y: 0.8)
|
||||
Button(action:{selected = 1}) {
|
||||
Text(second_text).font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(.white).shadow(color: Color.black.opacity(0.6), radius: 0, x: 0, y: -0.66)
|
||||
Text(second_text).font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(.white).shadow(color: Color.black.opacity(0.6), radius: 0, x: 0, y: -0.66)
|
||||
}.frame(width: geometry.size.width/3, height: geometry.size.height).ps_innerShadow(.rectangle(selected == 1 ? selected_gradient: unselected_gradient), radius:0.82, offset: CGPoint(0, 0.6), intensity: 0.7).shadow(color: Color.white.opacity(0.28), radius: 0, x: 0, y: 0.8)
|
||||
Button(action:{selected = 2}) {
|
||||
Text(third_text).font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(.white).shadow(color: Color.black.opacity(0.6), radius: 0, x: 0, y: -0.66)
|
||||
Text(third_text).font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(.white).shadow(color: Color.black.opacity(0.6), radius: 0, x: 0, y: -0.66)
|
||||
}.frame(width: geometry.size.width/3, height: geometry.size.height).ps_innerShadow(.rectangleCustomCornersRight(selected == 2 ? selected_gradient: unselected_gradient), radius:0.82, offset: CGPoint(0, 0.6), intensity: 0.7).shadow(color: Color.white.opacity(0.28), radius: 0, x: 0, y: 0.8)
|
||||
}.overlay(
|
||||
ZStack {
|
||||
|
@ -1766,7 +1766,7 @@ struct tool_bar_rectangle_button_image_done_size: View { //Is this a bad solutio
|
|||
ZStack {
|
||||
Image(content).resizable().scaledToFit().frame(width: 30)
|
||||
|
||||
Text("Done").font(.custom("Helvetica Neue Bold", size: 13.25)).foregroundColor(.white).shadow(color: Color.black.opacity(0.75), radius: 1, x: 0, y: -0.25).lineLimit(0).padding([.leading, .trailing], 11).opacity(0)
|
||||
Text("Done").font(.custom("Helvetica Neue Bold", fixedSize: 13.25)).foregroundColor(.white).shadow(color: Color.black.opacity(0.75), radius: 1, x: 0, y: -0.25).lineLimit(0).padding([.leading, .trailing], 11).opacity(0)
|
||||
|
||||
}.frame(height: 32 + (height_modifier ?? 0)).ps_innerShadow(.roundedRectangle(5.5, returnLinearGradient(button_type)), radius:0.8, offset: CGPoint(0, 0.6), intensity: 0.7).shadow(color: Color.white.opacity(0.28), radius: 0, x: 0, y: 0.8)
|
||||
}.frame(height: 32 + (height_modifier ?? 0))
|
||||
|
|
|
@ -1,229 +0,0 @@
|
|||
//
|
||||
// Crypto.swift
|
||||
// OldOS
|
||||
//
|
||||
// Created by Zane Kleinberg on 10/1/21.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
struct Crypto: View {
|
||||
@State var current_nav_view: String = "My Wallet"
|
||||
@State var forward_or_backward: Bool = false
|
||||
@State var selectedTab = "Featured"
|
||||
@State var show_alert:Bool = false
|
||||
@State var increase_brightness: Bool = false
|
||||
@State var done_loading: Bool = false
|
||||
var body: some View {
|
||||
GeometryReader { geometry in
|
||||
ZStack {
|
||||
VStack(spacing:0) {
|
||||
status_bar_in_app().frame(minHeight: 24, maxHeight:24).zIndex(1)
|
||||
generic_title_bar(title: "Zane's Wallet").frame(minWidth: geometry.size.width, maxWidth: geometry.size.width, minHeight: 60, maxHeight:60).zIndex(1).disabled(true)
|
||||
CryptoTabView(selectedTab: $selectedTab, current_nav_view: $current_nav_view, forward_or_backward: $forward_or_backward, done_loading: $done_loading).clipped()
|
||||
}
|
||||
}.compositingGroup().clipped()
|
||||
}.onAppear() {
|
||||
UIScrollView.appearance().bounces = true
|
||||
}.onDisappear() {
|
||||
UIScrollView.appearance().bounces = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct crypto_content: View {
|
||||
var up: String
|
||||
var money: String
|
||||
var body: some View {
|
||||
HStack {
|
||||
Spacer()
|
||||
Text(money).font(.custom("Helvetica Neue Regular", fixedSize: 18)).textCase(.uppercase).foregroundColor(.gray).padding(.trailing, 8)
|
||||
crypto_delta_capsule(content: up, color_indicator: 2 % 2 == 0 ? "green" : "red").frame(width: 90, height: 35).padding(.trailing, 8)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct crypto_content_dest: View {
|
||||
var body: some View {
|
||||
HStack {
|
||||
Spacer()
|
||||
Image("UITableNext").padding(.trailing, 12)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var Crypto_tabs = ["My Wallet", "Discover", "Transactions", "Send", "More"]
|
||||
struct CryptoTabView : View {
|
||||
var usage_section = [list_row(title: "ETH", image: "Ethereum-ETH-icon", content: AnyView(crypto_content(up: "4.3%", money: "$142.50")), destination: nil), list_row(title: "BTC", image: "1200px-Bitcoin.svg", content: AnyView(crypto_content(up: "1.2%", money: "$38.75")), destination: nil), list_row(title: "SOL", image: "exchange-black", content: AnyView(crypto_content(up: "6.4%", money: "$82.00")), destination: nil), list_row(title: "Savings", image: nil, content: AnyView(crypto_content_dest()), destination: nil)]
|
||||
@Binding var selectedTab:String
|
||||
@Binding var current_nav_view: String
|
||||
@Binding var forward_or_backward: Bool
|
||||
@Binding var done_loading: Bool
|
||||
var body: some View{
|
||||
GeometryReader {geometry in
|
||||
VStack(spacing:0) {
|
||||
ZStack {
|
||||
settings_main_list()
|
||||
ScrollView(showsIndicators: false) {
|
||||
VStack {
|
||||
Spacer().frame(height: 15)
|
||||
HStack {
|
||||
Text("Wallet ($263.25)").foregroundColor(Color(red: 76/255, green: 86/255, blue: 108/255)).font(.custom("Helvetica Neue Bold", fixedSize: 17)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9).padding([.leading, .trailing], 24)
|
||||
Spacer()
|
||||
}
|
||||
list_section(current_nav_view: $current_nav_view, forward_or_backward: $forward_or_backward, content: usage_section)
|
||||
Spacer().frame(height: 10)
|
||||
HStack {
|
||||
Text("Collectibles").foregroundColor(Color(red: 76/255, green: 86/255, blue: 108/255)).font(.custom("Helvetica Neue Bold", fixedSize: 17)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9).padding([.leading, .trailing], 24)
|
||||
Spacer()
|
||||
}
|
||||
HStack {
|
||||
VStack(spacing: 0) {
|
||||
Image("unnamed").resizable().scaledToFill().frame(width: geometry.size.width/2 - 18, height: geometry.size.height/3 - 45)
|
||||
HStack {
|
||||
Image("unnamed 2").resizable().scaledToFill().frame(width: 32, height: 32).clipCircle().padding(.leading, 8)
|
||||
Text("Pretentious Coffee").font(.custom("Helvetica Neue Bold", fixedSize: 14)).foregroundColor(.black).padding(.leading, 2)
|
||||
Spacer()
|
||||
}.background(Color.white.frame(width: geometry.size.width/2 - 18, height: 45)).frame(width: geometry.size.width/2 - 18, height: 45)
|
||||
}.cornerRadius(10).frame(width: geometry.size.width/2 - 18, height: geometry.size.height/3).strokeRoundedRectangle(10, Color(red: 172/255, green: 172/255, blue: 172/255), lineWidth: 1.25).padding(.leading, 12)
|
||||
Spacer()
|
||||
VStack(spacing: 0) {
|
||||
Image("unnamed (1)").resizable().scaledToFill().frame(width: geometry.size.width/2 - 18, height: geometry.size.height/3 - 45)
|
||||
HStack {
|
||||
Image("unnamed 2").resizable().scaledToFill().frame(width: 32, height: 32).clipCircle().padding(.leading, 8)
|
||||
Text("Pretentious Coffee").font(.custom("Helvetica Neue Bold", fixedSize: 14)).foregroundColor(.black).padding(.leading, 2)
|
||||
Spacer()
|
||||
}.background(Color.white.frame(width: geometry.size.width/2 - 18, height: 45)).frame(width: geometry.size.width/2 - 18, height: 45)
|
||||
}.cornerRadius(10).frame(width: geometry.size.width/2 - 18, height: geometry.size.height/3).strokeRoundedRectangle(10, Color(red: 172/255, green: 172/255, blue: 172/255), lineWidth: 1.25).padding(.trailing, 12)
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// for bottom overflow...
|
||||
ZStack {
|
||||
Rectangle().fill(LinearGradient(gradient: Gradient(stops: [.init(color: Color(red: 0, green: 0, blue: 0), location: 0), .init(color: Color(red: 84/255, green: 84/255, blue: 84/255), location: 0.02), .init(color: Color(red: 59/255, green: 59/255, blue: 59/255), location: 0.04), .init(color: Color(red: 29/255, green: 29/255, blue: 29/255), location: 0.5), .init(color: Color(red: 7.5/255, green: 7.5/255, blue: 7.5/255), location: 0.51), .init(color: Color(red: 7.5/255, green: 7.5/255, blue: 7.5/255), location: 1)]), startPoint: .top, endPoint: .bottom)).frame(height:57)
|
||||
HStack(spacing: 0){
|
||||
|
||||
ForEach(Crypto_tabs,id: \.self){image in
|
||||
TabButton_Crypto(image: image, selectedTab: $selectedTab, geometry: geometry)
|
||||
|
||||
// equal spacing...
|
||||
|
||||
if image != tabs.last{
|
||||
|
||||
Spacer(minLength: 0)
|
||||
}
|
||||
}
|
||||
}.frame(height:55)
|
||||
}.padding(.bottom, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct crypto_delta_capsule: View {
|
||||
var content: String
|
||||
var color_indicator: String
|
||||
var body: some View {
|
||||
GeometryReader { geometry in
|
||||
ZStack {
|
||||
if color_indicator == "green" {
|
||||
RoundedRectangle(3).fill(LinearGradient([Color(red: 147/255, green: 192/255, blue: 107/255), Color(red: 118/255, green: 166/255, blue: 75/255)], from: .top, to: .bottom)).strokeRoundedRectangle(3, LinearGradient([Color(red: 119/255, green: 163/255, blue: 82/255), Color(red: 92/255, green: 139/255, blue: 56/255)], from: .top, to: .bottom), lineWidth: 2.5).frame(width: geometry.size.width, height: geometry.size.height)
|
||||
}
|
||||
if color_indicator == "red" {
|
||||
RoundedRectangle(3).fill(LinearGradient([Color(red: 191/255, green: 91/255, blue: 80/255), Color(red: 168/255, green: 59/255, blue: 48/255)], from: .top, to: .bottom)).strokeRoundedRectangle(3, LinearGradient([Color(red: 164/255, green: 68/255, blue: 59/255), Color(red: 144/255, green: 44/255, blue: 34/255)], from: .top, to: .bottom), lineWidth: 2.5).frame(width: geometry.size.width, height: geometry.size.height)
|
||||
}
|
||||
HStack {
|
||||
if color_indicator == "green" {
|
||||
Image("UITintedCircularButtonPlus")
|
||||
}
|
||||
if color_indicator == "red" {
|
||||
Rectangle().fill(Color.white).frame(width: 13.5, height: 3.5).shadow(color: Color.black.opacity(0.75), radius: 0.25, x: 0, y: -2/3).offset(x: 8.5)
|
||||
}
|
||||
Spacer()
|
||||
Text(content).font(.custom("Helvetica Neue Bold", fixedSize: 20)).textCase(.uppercase).multilineTextAlignment(.trailing).foregroundColor(.white).shadow(color: Color.black.opacity(0.8), radius: 0.25, x: 0, y: -2/3).padding(.trailing, 5).minimumScaleFactor(0.5).lineLimit(0)
|
||||
}.frame(width: geometry.size.width, height: geometry.size.height)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct TabButton_Crypto : View {
|
||||
|
||||
var image : String
|
||||
@Binding var selectedTab : String
|
||||
var geometry: GeometryProxy
|
||||
var body: some View{
|
||||
Button(action: {
|
||||
selectedTab = image
|
||||
}) {
|
||||
ZStack {
|
||||
if selectedTab == image {
|
||||
RoundedRectangle(cornerRadius: 3).fill(Color.white.opacity(0.1)).frame(width: geometry.size.width/5 - 5, height: 51).blendMode(.screen)
|
||||
VStack(spacing: 2) {
|
||||
if image == "Featured" {
|
||||
Image("UITabBarFeaturedSelected2").resizable().aspectRatio(contentMode: .fit).frame(width: image == "Search" ? 25 : image == "Featured" ? 37.5 : image == "Most Viewed" ? 35.5 : 30.5, height: 30.5)
|
||||
} else {
|
||||
ZStack {
|
||||
Image("\(image)_Crypto").renderingMode(.template).resizable().aspectRatio(contentMode: .fit).frame(width: image == "Search" ? 25 : image == "Featured" ? 37.5 : image == "Most Viewed" ? 35.5 : 30.5, height: 30.5).overlay(
|
||||
LinearGradient(gradient: Gradient(colors: [Color(red: 205/255, green: 233/255, blue: 249/255), Color(red: 75/255, green: 220/255, blue: 251/255)]), startPoint: .top, endPoint: .bottom)
|
||||
).mask(Image("\(image)_Crypto").renderingMode(.template).resizable().aspectRatio(contentMode: .fit).frame(width: image == "Search" ? 25 : image == "Featured" ? 37.5 : image == "Most Viewed" ? 35.5 : 30.5, height: 30.5)).offset(y:-0.5)
|
||||
|
||||
Image("\(image)_Crypto").renderingMode(.template).resizable().aspectRatio(contentMode: .fit).frame(width: image == "Search" ? 25 : image == "Featured" ? 37.5 : 30, height: 30).overlay(
|
||||
ZStack {
|
||||
LinearGradient(gradient: Gradient(stops: [.init(color: Color(red: 197/255, green: 210/255, blue: 229/255), location: 0), .init(color: Color(red: 99/255, green: 162/255, blue: 216/255), location: 0.47), .init(color: Color(red: 0/255, green: 145/255, blue: 230/255), location: 0.49), .init(color: Color(red: 21/255, green: 197/255, blue: 252/255), location: 1)]), startPoint: .top, endPoint: .bottom).rotationEffect(Angle(degrees: image == "More" ? 0 : -15)).frame(width: image == "More" ? 40 : 40, height: image == "Search" ? 38 : image == "Contacts" ? 34 : 30).brightness(0.095).offset(y: image == "Artists" ? 2 : 0)
|
||||
if image == "Featured" {
|
||||
VStack(spacing:0) {
|
||||
HStack(spacing:0) {
|
||||
ZStack {
|
||||
Ellipse().fill(LinearGradient(gradient: Gradient(stops:[.init(color: Color(red: 0/255, green: 145/255, blue: 230/255), location: 0), .init(color: Color(red: 21/255, green: 197/255, blue: 252/255), location: 1)]), startPoint: .top, endPoint: .bottom)).frame(width: 16, height: 12).offset(y:-1)
|
||||
}
|
||||
Spacer().frame(width: 7)
|
||||
ZStack {
|
||||
Ellipse().fill(Color(red: 185/255, green: 249/255, blue: 254/255)).frame(width: 16, height: 12).offset(y:-1)
|
||||
Ellipse().fill(LinearGradient(gradient: Gradient(stops:[.init(color: Color(red: 0/255, green: 145/255, blue: 230/255), location: 0), .init(color: Color(red: 21/255, green: 197/255, blue: 252/255), location: 1)]), startPoint: .top, endPoint: .bottom)).frame(width: 16, height: 6).brightness(0.095).offset(y:1.5)
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
).mask(Image("\(image)_Crypto").renderingMode(.template).resizable().aspectRatio(contentMode: .fit).frame(width: image == "Search" ? 25 : image == "Featured" ? 37.5 : image == "Most Viewed" ? 35.5 : 30, height: 30)).shadow(color: Color.black.opacity(0.6), radius:2.5, x: 0, y:2.5)
|
||||
}
|
||||
}
|
||||
HStack {
|
||||
if image != "Most Viewed" {
|
||||
Spacer()
|
||||
}
|
||||
Text(image).foregroundColor(.white).font(.custom("Helvetica Neue Bold", fixedSize: image == "Most Viewed" ? 10.75 : 11)).fixedSize(horizontal: true, vertical: false)
|
||||
if image != "Most Viewed" {
|
||||
Spacer()
|
||||
}
|
||||
}.frame(maxWidth: geometry.size.width/5 - 5)
|
||||
}
|
||||
} else {
|
||||
VStack(spacing: 2) {
|
||||
Image("\(image)_Crypto").renderingMode(.template).resizable().aspectRatio(contentMode: .fit).frame(width: image == "Search" ? 25 : image == "Featured" ? 37.5 : image == "Most Viewed" ? 35.5 : 30, height: 30).overlay(
|
||||
LinearGradient(gradient: Gradient(colors: [Color(red: 157/255, green: 157/255, blue: 157/255), Color(red: 89/255, green: 89/255, blue: 89/255)]), startPoint: .top, endPoint: .bottom)
|
||||
).mask(Image("\(image)_Crypto").renderingMode(.template).resizable().aspectRatio(contentMode: .fit).frame(width: image == "Search" ? 25 : image == "Featured" ? 37.5 : image == "Most Viewed" ? 35.5 : 30, height: 30)).shadow(color: Color.black.opacity(0.75), radius: 0, x: 0, y: -1)
|
||||
HStack {
|
||||
if image != "Most Viewed" {
|
||||
Spacer()
|
||||
}
|
||||
Text(image).foregroundColor(Color(red: 168/255, green: 168/255, blue: 168/255)).font(.custom("Helvetica Neue Bold", fixedSize: image == "Most Viewed" ? 10.75 : 11)).fixedSize(horizontal: true, vertical: false)
|
||||
if image != "Most Viewed" {
|
||||
Spacer()
|
||||
}
|
||||
}.frame(maxWidth: geometry.size.width/5 - 5)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,7 +4,6 @@
|
|||
//
|
||||
// Created by Zane Kleinberg on 5/24/21.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
import Alamofire
|
||||
|
@ -69,178 +68,12 @@ struct Youtube: View {
|
|||
}.onAppear() {
|
||||
UIScrollView.appearance().bounces = true
|
||||
}.onDisappear() {
|
||||
player.pause();
|
||||
UIScrollView.appearance().bounces = false
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class VPUtility: NSObject {
|
||||
|
||||
private static var timeHMSFormatter: DateComponentsFormatter = {
|
||||
let formatter = DateComponentsFormatter()
|
||||
formatter.unitsStyle = .positional
|
||||
formatter.allowedUnits = [.minute, .second]
|
||||
formatter.zeroFormattingBehavior = [.pad]
|
||||
return formatter
|
||||
}()
|
||||
|
||||
static func formatSecondsToHMS(_ seconds: Double) -> String {
|
||||
guard !seconds.isNaN,
|
||||
let text = timeHMSFormatter.string(from: seconds) else {
|
||||
return "00:00"
|
||||
}
|
||||
|
||||
return text
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct video_player_footer: View {
|
||||
@Binding var player: AVPlayer
|
||||
@ObservedObject private var volObserver = VolumeObserver()
|
||||
@ObservedObject var playerObserver: PlayerItemObserver
|
||||
public var back_action: (() -> Void)?
|
||||
var body: some View {
|
||||
GeometryReader {geometry in
|
||||
ZStack {
|
||||
RoundedRectangle(cornerRadius: 8).fill(LinearGradient([(Color(red: 191/255, green: 191/255, blue: 191/255), location: 0), (Color(red: 64/255, green: 64/255, blue: 64/255), location: 0.50), (Color(red: 0/255, green: 0/255, blue: 0/255), location: 0.50), (Color(red: 0/255, green: 0/255, blue: 0/255), location: 1)], from: .top, to: .bottom)).opacity(0.6).strokeRoundedRectangle(8, LinearGradient([(Color(red: 212/255, green: 212/255, blue: 212/255), location: 0), (Color(red: 179/255, green: 179/255, blue: 179/255), location: 0.04), (Color(red: 155/255, green: 155/255, blue: 155/255), location: 1)], from: .top, to: .bottom), lineWidth: 2)
|
||||
VStack(spacing: 0) {
|
||||
HStack {
|
||||
Image("mp_addbookmark").padding(.leading, 12)
|
||||
Spacer()
|
||||
Button(action: {
|
||||
if playerObserver.playerStatus == .readyToPlay && player.status == .readyToPlay && player.currentItem?.duration.seconds.isNaN == false {
|
||||
back_action?()
|
||||
}
|
||||
}) {
|
||||
Image("mp_prevtrack")
|
||||
}.opacity(playerObserver.playerStatus == .readyToPlay && player.status == .readyToPlay && player.currentItem?.duration.seconds.isNaN == false ? 1 : 0.6)
|
||||
Spacer()
|
||||
Button(action: {
|
||||
if playerObserver.playerStatus == .readyToPlay && player.status == .readyToPlay && player.currentItem?.duration.seconds.isNaN == false {
|
||||
if playerObserver.currentStatus != .playing {
|
||||
player.play()
|
||||
} else {
|
||||
player.pause()
|
||||
}
|
||||
}
|
||||
}) {
|
||||
Image(playerObserver.currentStatus != .playing ? "mp_play" : "mp_pause")
|
||||
}.frame(width: 40).opacity(playerObserver.playerStatus == .readyToPlay && player.status == .readyToPlay && player.currentItem?.duration.seconds.isNaN == false ? 1 : 0.6)
|
||||
Spacer()
|
||||
Button(action: {
|
||||
if playerObserver.playerStatus == .readyToPlay && player.status == .readyToPlay && player.currentItem?.duration.seconds.isNaN == false {
|
||||
back_action?()
|
||||
}
|
||||
}) {
|
||||
Image("mp_nexttrack")
|
||||
}.opacity(playerObserver.playerStatus == .readyToPlay && player.status == .readyToPlay && player.currentItem?.duration.seconds.isNaN == false ? 1 : 0.6)
|
||||
Spacer()
|
||||
Image("mp_email").padding(.trailing, 12)
|
||||
}.frame(width: geometry.size.width).padding(.top, 10)
|
||||
CustomSliderVideo(player: $player, type: "Volume", value: $volObserver.volume.double, range: (0, 100)) { modifiers in
|
||||
ZStack {
|
||||
|
||||
LinearGradient(gradient: Gradient(stops: [.init(color: Color(red: 205/255, green: 220/255, blue: 241/255), location: 0), .init(color: Color(red: 125/255, green: 174/255, blue: 245/255), location: 0.5), .init(color: Color(red: 45/255, green: 111/255, blue: 198/255), location: 0.5), .init(color: Color(red: 50/255, green: 151/255, blue: 236/255), location: 1)]), startPoint: .top, endPoint: .bottom).frame(height: 8.5).cornerRadius(4.25).padding(.leading, 4).modifier(modifiers.barLeft)
|
||||
|
||||
LinearGradient(gradient: Gradient(stops: [.init(color: Color(red: 218/255, green: 218/255, blue: 218/255), location: 0), .init(color: Color(red: 166/255, green: 166/255, blue: 166/255), location: 0.19), .init(color: Color(red: 204/255, green: 204/255, blue: 204/255), location: 0.5), .init(color: Color(red: 255/255, green: 255/255, blue: 255/255), location: 0.5), .init(color: Color(red: 255/255, green: 255/255, blue: 255/255), location: 1)]), startPoint: .top, endPoint: .bottom).frame(height: 8.5).cornerRadius(4.25).padding(.trailing, 4).modifier(modifiers.barRight)
|
||||
ZStack {
|
||||
Image("volume-slider-fat-knob").resizable().scaledToFill()
|
||||
|
||||
}.modifier(modifiers.knob)
|
||||
}
|
||||
}.frame(height: 25).padding([.top, .bottom]).padding([.leading, .trailing], 30)
|
||||
}.frame(height: geometry.size.height)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct video_player_title_bar : View {
|
||||
@Binding var player: AVPlayer
|
||||
@Binding var gravity: PlayerGravity
|
||||
@ObservedObject var playerObserver: PlayerItemObserver
|
||||
var title: String
|
||||
var is_loading: Bool
|
||||
public var back_action: (() -> Void)?
|
||||
public var gravity_action: (() -> Void)?
|
||||
var shows_back: Bool?
|
||||
var body :some View {
|
||||
ZStack {
|
||||
LinearGradient(gradient: Gradient(stops: [.init(color: Color(red: 0, green: 0, blue: 0), location: 0), .init(color: Color(red: 84/255, green: 84/255, blue: 84/255), location: 0.005), .init(color: Color(red: 59/255, green: 59/255, blue: 59/255), location: 0.04), .init(color: Color(red: 29/255, green: 29/255, blue: 29/255), location: 0.5), .init(color: Color(red: 7.5/255, green: 7.5/255, blue: 7.5/255), location: 0.51), .init(color: Color(red: 7.5/255, green: 7.5/255, blue: 7.5/255), location: 1)]), startPoint: .top, endPoint: .bottom).border_bottom(width: 0.95, edges: [.bottom], color: Color(red: 45/255, green: 48/255, blue: 51/255)).innerShadowBottom(color: Color(red: 230/255, green: 230/255, blue: 230/255), radius: 0.025).opacity(0.65).shadow(color: Color.black.opacity(0.25), radius: 0.25, x: 0, y: -0.5) //Correct border width for added shadow
|
||||
VStack {
|
||||
Spacer()
|
||||
if is_loading {
|
||||
ZStack {
|
||||
HStack {
|
||||
Text("Loading...").font(.custom("Helvetica Neue Bold", fixedSize: 16)).foregroundColor(.white)
|
||||
Spacer().frame(width: 8)
|
||||
ProgressView().progressViewStyle(CircularProgressViewStyle(tint: Color.white))
|
||||
}
|
||||
HStack {
|
||||
tool_bar_rectangle_button(action: {back_action?()}, button_type: .blue, content: "Done").padding(.leading, 5)
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
HStack(spacing: 0) {
|
||||
tool_bar_rectangle_button(action: {back_action?()}, button_type: .blue, content: "Done").padding(.leading, 5)
|
||||
Spacer()
|
||||
Text("\(VPUtility.formatSecondsToHMS(playerObserver.seekPos * (player.currentItem?.duration.seconds ?? 0)))").font(.custom("Helvetica Neue Bold", fixedSize: 14)).foregroundColor(.white).padding([.leading], 15)
|
||||
CustomSliderVideo(player: $player, type: "Video", value: $playerObserver.seekPos, range: (0, 1)) { modifiers in
|
||||
ZStack {
|
||||
ZStack {
|
||||
LinearGradient(gradient: Gradient(stops: [.init(color: Color(red: 205/255, green: 220/255, blue: 241/255), location: 0), .init(color: Color(red: 125/255, green: 174/255, blue: 245/255), location: 0.5), .init(color: Color(red: 45/255, green: 111/255, blue: 198/255), location: 0.5), .init(color: Color(red: 50/255, green: 151/255, blue: 236/255), location: 1)]), startPoint: .top, endPoint: .bottom).frame(height: 9).cornerRadius(4.25).padding(.leading, 4).modifier(modifiers.barLeft)
|
||||
|
||||
LinearGradient(gradient: Gradient(stops: [.init(color: Color(red: 218/255, green: 218/255, blue: 218/255), location: 0), .init(color: Color(red: 166/255, green: 166/255, blue: 166/255), location: 0.19), .init(color: Color(red: 204/255, green: 204/255, blue: 204/255), location: 0.5), .init(color: Color(red: 255/255, green: 255/255, blue: 255/255), location: 0.5), .init(color: Color(red: 255/255, green: 255/255, blue: 255/255), location: 1)]), startPoint: .top, endPoint: .bottom).frame(height: 9).cornerRadius(4.25).padding(.trailing, 4).modifier(modifiers.barRight)
|
||||
}.overlay(LinearGradient([Color(red: 48/255, green: 50/255, blue: 53/255), Color(red: 87/255, green: 93/255, blue: 97/255)], from: .top, to: .bottom).mask(LinearGradient([(Color.black, location: 0), (Color.black, location: playerObserver.buffer/(player.currentItem?.duration.seconds ?? 1)), (Color.white, location: playerObserver.buffer/(player.currentItem?.duration.seconds ?? 1))], from: .leading, to: .trailing).frame(height: 4.5).cornerRadius(4.25/8.5*4.5).luminanceToAlpha()).frame(height: 4.5).cornerRadius(4.25/8.5*4.5).padding([.leading, .trailing], 7).offset(y: 0.25))
|
||||
ZStack {
|
||||
Image("volume-slider-fat-knob").resizable().scaledToFill()
|
||||
|
||||
}.modifier(modifiers.knob)
|
||||
}
|
||||
}.frame(height: 25)
|
||||
Text("-\(VPUtility.formatSecondsToHMS((player.currentItem?.duration.seconds ?? 0) - playerObserver.seekPos * (player.currentItem?.duration.seconds ?? 0)))").font(.custom("Helvetica Neue Bold", fixedSize: 14)).foregroundColor(.white).padding([.trailing], 15)
|
||||
Spacer()
|
||||
tool_bar_rectangle_button_image_done_size(action: {gravity_action?()}, button_type: .black, content: gravity == .fit ? "mp_zoomout" : "mp_zoomin", use_image: true).padding(.trailing, 5)
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
|
||||
// if show_albums_back == true {
|
||||
// VStack {
|
||||
// Spacer()
|
||||
// HStack {
|
||||
// Button(action:{back_action?()}) {
|
||||
// ZStack {
|
||||
// Image("UINavigationBarBlackTranslucentBack").frame(width: 70, height: 33).scaledToFill().animation(instant_multitasking_change ? .default : .none)
|
||||
// HStack(alignment: .center) {
|
||||
// Text("Albums").foregroundColor(Color.white).font(.custom("Helvetica Neue Bold", fixedSize: 13)).shadow(color: Color.black.opacity(0.45), radius: 0, x: 0, y: -0.6).padding(.leading,5).offset(y:-1.1)
|
||||
// }
|
||||
// }.padding(.leading, 8)
|
||||
// }
|
||||
// Spacer()
|
||||
// }
|
||||
// Spacer()
|
||||
// }.animation(instant_multitasking_change ? .default : .none).if(!instant_multitasking_change){$0.animationsDisabled()}
|
||||
//
|
||||
// VStack {
|
||||
// Spacer()
|
||||
// HStack {
|
||||
// Spacer()
|
||||
// tool_bar_rectangle_button_larger_image_wide(button_type: .black, content: "UIButtonBarAction", use_image: true).padding(.trailing, 8)
|
||||
// }
|
||||
// Spacer()
|
||||
// }.animation(instant_multitasking_change ? .default : .none).if(!instant_multitasking_change){$0.animationsDisabled()}
|
||||
//
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var youtube_tabs = ["Featured", "Most Viewed", "Search", "Favorites", "More"]
|
||||
struct YoutubeTabView : View {
|
||||
@StateObject var youtube_observer: YoutubeObserver
|
||||
|
@ -337,32 +170,32 @@ struct YoutubeVideoInfoView: View {
|
|||
|
||||
Spacer().frame(height:15)
|
||||
VStack {
|
||||
Text(current_video?.description ?? "").font(.custom("Helvetica Neue Regular", size: 13)).fixedSize(horizontal: false, vertical: true).padding([.top, .leading, .trailing]).padding(.bottom, 3)
|
||||
Text(current_video?.description ?? "").font(.custom("Helvetica Neue Regular", fixedSize: 13)).fixedSize(horizontal: false, vertical: true).padding([.top, .leading, .trailing]).padding(.bottom, 3)
|
||||
Rectangle().fill(Color(red: 171/255, green: 171/255, blue: 171/255)).frame(height: 1)
|
||||
HStack(alignment: .top) {
|
||||
HStack(alignment: .top, spacing: 0) {
|
||||
Spacer()
|
||||
Text("Added").multilineTextAlignment(.trailing).font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(Color(red: 128/255, green: 128/255, blue: 128/255))
|
||||
Text("Added").multilineTextAlignment(.trailing).font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(Color(red: 128/255, green: 128/255, blue: 128/255))
|
||||
}.frame(width: geometry.size.width/5)
|
||||
Text(current_video?.uploaded?.text ?? "").font(.custom("Helvetica Neue Regular", size: 13)).foregroundColor(.black)
|
||||
Text(current_video?.uploaded?.text ?? "").font(.custom("Helvetica Neue Regular", fixedSize: 13)).foregroundColor(.black)
|
||||
Spacer()
|
||||
}.padding([.top, .bottom], 3)
|
||||
Rectangle().fill(Color(red: 171/255, green: 171/255, blue: 171/255)).frame(height: 1)
|
||||
HStack(alignment: .top) {
|
||||
HStack(alignment: .top, spacing: 0) {
|
||||
Spacer()
|
||||
Text("Category").multilineTextAlignment(.trailing).font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(Color(red: 128/255, green: 128/255, blue: 128/255))
|
||||
Text("Category").multilineTextAlignment(.trailing).font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(Color(red: 128/255, green: 128/255, blue: 128/255))
|
||||
}.frame(width: geometry.size.width/5)
|
||||
Text(current_video?.category ?? "").font(.custom("Helvetica Neue Regular", size: 13)).foregroundColor(.black)//fix to formated current release version
|
||||
Text(current_video?.category ?? "").font(.custom("Helvetica Neue Regular", fixedSize: 13)).foregroundColor(.black)//fix to formated current release version
|
||||
Spacer()
|
||||
}.padding([.top, .bottom], 3)
|
||||
Rectangle().fill(Color(red: 171/255, green: 171/255, blue: 171/255)).frame(height: 1)
|
||||
HStack(alignment: .top) {
|
||||
HStack(alignment: .top, spacing: 0) {
|
||||
Spacer()
|
||||
Text("Tags").multilineTextAlignment(.trailing).font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(Color(red: 128/255, green: 128/255, blue: 128/255))
|
||||
Text("Tags").multilineTextAlignment(.trailing).font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(Color(red: 128/255, green: 128/255, blue: 128/255))
|
||||
}.frame(width: geometry.size.width/5)
|
||||
Text((current_video?.keywords ?? []).map{String($0)}.joined(separator: ", ")).font(.custom("Helvetica Neue Regular", size: 13)).foregroundColor(.black)//fix to formated current release version
|
||||
Text((current_video?.keywords ?? []).map{String($0)}.joined(separator: ", ")).font(.custom("Helvetica Neue Regular", fixedSize: 13)).foregroundColor(.black)//fix to formated current release version
|
||||
Spacer()
|
||||
}.padding([.top], 3).padding(.bottom)
|
||||
}.background(Color.white.cornerRadius(10)).cornerRadius(10).strokeRoundedRectangle(10, Color(red: 171/255, green: 171/255, blue: 171/255), lineWidth: 1).padding([.leading, .trailing], 12)
|
||||
|
@ -370,7 +203,7 @@ struct YoutubeVideoInfoView: View {
|
|||
Spacer().frame(height: 15)
|
||||
HStack {
|
||||
Spacer()
|
||||
Text("Rate, Comment or Flag").foregroundColor(.black).font(.custom("Helvetica Neue Bold", size: 17)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9)
|
||||
Text("Rate, Comment or Flag").foregroundColor(.black).font(.custom("Helvetica Neue Bold", fixedSize: 17)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9)
|
||||
Spacer()
|
||||
}.frame(height: 50).background(Color.white.cornerRadius(10)).cornerRadius(10).strokeRoundedRectangle(10, Color(red: 171/255, green: 171/255, blue: 171/255), lineWidth: 1).padding([.leading, .trailing], 12)
|
||||
Spacer().frame(height: 10)
|
||||
|
@ -382,12 +215,12 @@ struct YoutubeVideoInfoView: View {
|
|||
VStack(spacing: 0) {
|
||||
Spacer()
|
||||
HStack {
|
||||
Text(comment.author ?? "").font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(Color(red: 165/255, green: 65/255, blue: 35/255)).padding([.leading, .trailing])
|
||||
Text(comment.author ?? "").font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(Color(red: 165/255, green: 65/255, blue: 35/255)).padding([.leading, .trailing])
|
||||
Spacer()
|
||||
Text((comment.time ?? "").startcased()).font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(Color(red: 128/255, green: 128/255, blue: 128/255)).padding([.leading, .trailing])
|
||||
Text((comment.time ?? "").startcased()).font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(Color(red: 128/255, green: 128/255, blue: 128/255)).padding([.leading, .trailing])
|
||||
}
|
||||
Spacer().frame(height: 10)
|
||||
Text(comment.text ?? "").font(.custom("Helvetica Neue Regular", size: 13)).foregroundColor(.black).padding([.leading, .trailing])
|
||||
Text(comment.text ?? "").font(.custom("Helvetica Neue Regular", fixedSize: 13)).foregroundColor(.black).padding([.leading, .trailing])
|
||||
Spacer()
|
||||
if comment.commentID != (comments?.comments ?? []).last?.commentID {
|
||||
Rectangle().fill(Color(red: 171/255, green: 171/255, blue: 171/255)).frame(height: 1)
|
||||
|
@ -439,11 +272,11 @@ struct YoutubeDetailView: View {
|
|||
Image("DefaultThumbnail")
|
||||
}.aspectRatio(contentMode: .fit).frame(width:geometry.size.width/3.75, height: 60).background(Color.black).padding(.leading, 6).cornerRadius(4)
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(current_video?.title ?? "---").font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(.black).lineLimit(2).fixedSize(horizontal: false, vertical: true)
|
||||
Text(current_video?.title ?? "---").font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(.black).lineLimit(2).fixedSize(horizontal: false, vertical: true)
|
||||
HStack(alignment: .top, spacing: 2.5) {
|
||||
Image("thumbsUp").offset(y: -4.5)
|
||||
Text("\(Int(Float(like_count)/(Float(like_count) + Float(dislike_count))*100))%").font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(Color(red: 73/255, green: 128/255, blue: 35/255))
|
||||
Text(view_count + " views").font(.custom("Helvetica Neue Regular", size: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255))
|
||||
Text("\(Int(Float(like_count)/(Float(like_count) + Float(dislike_count))*100))%").font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(Color(red: 73/255, green: 128/255, blue: 35/255))
|
||||
Text(view_count + " views").font(.custom("Helvetica Neue Regular", fixedSize: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255))
|
||||
|
||||
|
||||
Spacer()
|
||||
|
@ -452,11 +285,11 @@ struct YoutubeDetailView: View {
|
|||
|
||||
|
||||
|
||||
Text(duration.asString(style: .positional)).font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(.black).lineLimit(1).onAppear() {
|
||||
Text(duration.asString(style: .positional)).font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(.black).lineLimit(1).onAppear() {
|
||||
|
||||
}
|
||||
|
||||
Text(current_video?.channel?.name ?? "---").font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255)).lineLimit(1)
|
||||
Text(current_video?.channel?.name ?? "---").font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255)).lineLimit(1)
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
|
@ -483,13 +316,13 @@ struct YoutubeDetailView: View {
|
|||
}
|
||||
Spacer().frame(height: 20)
|
||||
HStack {
|
||||
Text("Related Videos").foregroundColor(Color(red: 76/255, green: 86/255, blue: 108/255)).font(.custom("Helvetica Neue Bold", size: 17)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9).padding([.leading, .trailing], 24)
|
||||
Text("Related Videos").foregroundColor(Color(red: 76/255, green: 86/255, blue: 108/255)).font(.custom("Helvetica Neue Bold", fixedSize: 17)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9).padding([.leading, .trailing], 24)
|
||||
Spacer()
|
||||
}
|
||||
Spacer().frame(height: 10)
|
||||
HStack {
|
||||
Spacer()
|
||||
Text("No Related Videos").foregroundColor(Color(red: 56/255, green: 95/255, blue: 210/255)).font(.custom("Helvetica Neue Bold", size: 17))
|
||||
Text("No Related Videos").foregroundColor(Color(red: 56/255, green: 95/255, blue: 210/255)).font(.custom("Helvetica Neue Bold", fixedSize: 17))
|
||||
Spacer()
|
||||
}.frame(height: 90).background(Color.white.cornerRadius(10)).cornerRadius(10).strokeRoundedRectangle(10, Color(red: 171/255, green: 171/255, blue: 171/255), lineWidth: 1).padding([.leading, .trailing], 12)
|
||||
Spacer()
|
||||
|
@ -523,7 +356,7 @@ struct YoutubeFeaturedView: View {
|
|||
Spacer()
|
||||
ProgressView().progressViewStyle(CircularProgressViewStyle())
|
||||
Spacer().frame(width: 8)
|
||||
Text("Loading...").font(.custom("Helvetica Neue Regular", size: 16)).foregroundColor(Color(red: 129/255, green: 129/255, blue: 129/255)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9)
|
||||
Text("Loading...").font(.custom("Helvetica Neue Regular", fixedSize: 16)).foregroundColor(Color(red: 129/255, green: 129/255, blue: 129/255)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9)
|
||||
Spacer()
|
||||
|
||||
}.frame(width: geometry.size.width, height: geometry.size.height)
|
||||
|
@ -549,11 +382,11 @@ struct YoutubeFeaturedView: View {
|
|||
Image("DefaultThumbnail")
|
||||
}.aspectRatio(contentMode: .fit).frame(width:geometry.size.width/3, height: 89).background(Color.black).border_top(width: 1, edges:[.trailing], color: Color(red: 217/255, green: 217/255, blue: 217/255))
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(video.snippet.title ?? "---").font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(.black).lineLimit(2).fixedSize(horizontal: false, vertical: true)
|
||||
Text(video.snippet.title ?? "---").font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(.black).lineLimit(2).fixedSize(horizontal: false, vertical: true)
|
||||
HStack(alignment: .top, spacing: 2.5) {
|
||||
Image("thumbsUp").offset(y: -4.5)
|
||||
Text("\(Int(Float(like_count)/(Float(like_count) + Float(dislike_count))*100))%").font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(Color(red: 73/255, green: 128/255, blue: 35/255))
|
||||
Text(view_count + " views").font(.custom("Helvetica Neue Regular", size: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255))
|
||||
Text("\(Int(Float(like_count)/(Float(like_count) + Float(dislike_count))*100))%").font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(Color(red: 73/255, green: 128/255, blue: 35/255))
|
||||
Text(view_count + " views").font(.custom("Helvetica Neue Regular", fixedSize: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255))
|
||||
|
||||
|
||||
Spacer()
|
||||
|
@ -562,11 +395,11 @@ struct YoutubeFeaturedView: View {
|
|||
|
||||
|
||||
|
||||
Text(duration.getYoutubeFormattedDuration()).font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(.black).lineLimit(1).onAppear() {
|
||||
Text(duration.getYoutubeFormattedDuration()).font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(.black).lineLimit(1).onAppear() {
|
||||
|
||||
}
|
||||
|
||||
Text(video.snippet.channelTitle ?? "---").font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255)).lineLimit(1)
|
||||
Text(video.snippet.channelTitle ?? "---").font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255)).lineLimit(1)
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
|
@ -628,7 +461,7 @@ struct YoutubeMostViewedView: View {
|
|||
Spacer()
|
||||
ProgressView().progressViewStyle(CircularProgressViewStyle())
|
||||
Spacer().frame(width: 8)
|
||||
Text("Loading...").font(.custom("Helvetica Neue Regular", size: 16)).foregroundColor(Color(red: 129/255, green: 129/255, blue: 129/255)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9)
|
||||
Text("Loading...").font(.custom("Helvetica Neue Regular", fixedSize: 16)).foregroundColor(Color(red: 129/255, green: 129/255, blue: 129/255)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9)
|
||||
Spacer()
|
||||
|
||||
}.frame(width: geometry.size.width, height: geometry.size.height)
|
||||
|
@ -670,14 +503,14 @@ struct YoutubeSearchView: View {
|
|||
Spacer()
|
||||
ProgressView().progressViewStyle(CircularProgressViewStyle())
|
||||
Spacer().frame(width: 8)
|
||||
Text("Loading...").font(.custom("Helvetica Neue Regular", size: 16)).foregroundColor(Color(red: 129/255, green: 129/255, blue: 129/255)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9)
|
||||
Text("Loading...").font(.custom("Helvetica Neue Regular", fixedSize: 16)).foregroundColor(Color(red: 129/255, green: 129/255, blue: 129/255)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9)
|
||||
Spacer()
|
||||
|
||||
}.frame(width: geometry.size.width, height: geometry.size.height)
|
||||
} else {
|
||||
HStack {
|
||||
Spacer()
|
||||
Text("No Videos").font(.custom("Helvetica Neue Regular", size: 16)).foregroundColor(Color(red: 129/255, green: 129/255, blue: 129/255)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9)
|
||||
Text("No Videos").font(.custom("Helvetica Neue Regular", fixedSize: 16)).foregroundColor(Color(red: 129/255, green: 129/255, blue: 129/255)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9)
|
||||
Spacer()
|
||||
|
||||
}.frame(width: geometry.size.width, height: geometry.size.height)
|
||||
|
@ -744,11 +577,11 @@ struct result_content_view<PlaceholderContent: View>: View {
|
|||
Image("DefaultThumbnail")
|
||||
}.aspectRatio(contentMode: .fit).frame(width:geometry.size.width/3, height: 89).background(Color.black).border_top(width: 1, edges:[.trailing], color: Color(red: 217/255, green: 217/255, blue: 217/255))
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(video.title ?? "---").font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(.black).lineLimit(2).fixedSize(horizontal: false, vertical: true)
|
||||
Text(video.title ?? "---").font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(.black).lineLimit(2).fixedSize(horizontal: false, vertical: true)
|
||||
HStack(alignment: .top, spacing: 2.5) {
|
||||
Image("thumbsUp").offset(y: -4.5)
|
||||
Text("\(Int(Float(like_count)/(Float(like_count) + Float(dislike_count))*100))%").font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(Color(red: 73/255, green: 128/255, blue: 35/255))
|
||||
Text(view_count + " views").font(.custom("Helvetica Neue Regular", size: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255))
|
||||
Text("\(Int(Float(like_count)/(Float(like_count) + Float(dislike_count))*100))%").font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(Color(red: 73/255, green: 128/255, blue: 35/255))
|
||||
Text(view_count + " views").font(.custom("Helvetica Neue Regular", fixedSize: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255))
|
||||
|
||||
|
||||
Spacer()
|
||||
|
@ -757,11 +590,11 @@ struct result_content_view<PlaceholderContent: View>: View {
|
|||
|
||||
|
||||
|
||||
Text(duration.asString(style: .positional)).font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(.black).lineLimit(1).onAppear() {
|
||||
Text(duration.asString(style: .positional)).font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(.black).lineLimit(1).onAppear() {
|
||||
|
||||
}
|
||||
|
||||
Text(video.channel?.name ?? "---").font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255)).lineLimit(1)
|
||||
Text(video.channel?.name ?? "---").font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255)).lineLimit(1)
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
|
@ -859,11 +692,11 @@ struct result_content_view_favorites<PlaceholderContent: View>: View {
|
|||
Image("DefaultThumbnail")
|
||||
}.aspectRatio(contentMode: .fit).frame(width:geometry.size.width/3, height: 89).background(Color.black).border_top(width: 1, edges:[.trailing], color: Color(red: 217/255, green: 217/255, blue: 217/255))
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(video.title ?? "---").font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(.black).lineLimit(2).fixedSize(horizontal: false, vertical: true)
|
||||
Text(video.title ?? "---").font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(.black).lineLimit(2).fixedSize(horizontal: false, vertical: true)
|
||||
HStack(alignment: .top, spacing: 2.5) {
|
||||
Image("thumbsUp").offset(y: -4.5)
|
||||
Text("\(Int(Float(like_count)/(Float(like_count) + Float(dislike_count))*100))%").font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(Color(red: 73/255, green: 128/255, blue: 35/255))
|
||||
Text(view_count + " views").font(.custom("Helvetica Neue Regular", size: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255)).lineLimit(0)
|
||||
Text("\(Int(Float(like_count)/(Float(like_count) + Float(dislike_count))*100))%").font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(Color(red: 73/255, green: 128/255, blue: 35/255))
|
||||
Text(view_count + " views").font(.custom("Helvetica Neue Regular", fixedSize: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255)).lineLimit(0)
|
||||
|
||||
|
||||
Spacer()
|
||||
|
@ -872,11 +705,11 @@ struct result_content_view_favorites<PlaceholderContent: View>: View {
|
|||
|
||||
|
||||
|
||||
Text(duration.asString(style: .positional)).font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(.black).lineLimit(1).onAppear() {
|
||||
Text(duration.asString(style: .positional)).font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(.black).lineLimit(1).onAppear() {
|
||||
|
||||
}
|
||||
|
||||
Text(video.channel?.name ?? "---").font(.custom("Helvetica Neue Bold", size: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255)).lineLimit(1)
|
||||
Text(video.channel?.name ?? "---").font(.custom("Helvetica Neue Bold", fixedSize: 13)).foregroundColor(Color(red: 103/255, green: 109/255, blue: 115/255)).lineLimit(1)
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
|
@ -939,7 +772,7 @@ struct YoutubeFavoriteView: View {
|
|||
result_content_view_favorites(favorite_observer: _favorite_observer, is_editing_favorites: $is_editing_favorites, current_nav_view: $fv_current_nav_view, current_video: $fv_current_video, forward_or_backward: $forward_or_backward, show_video_player: $show_video_player, instant_video_change: $instant_video_change, selected_video_player: $selected_video_player, content: favorite_observer.videos, geometry: geometry, placeholder_content: {
|
||||
HStack {
|
||||
Spacer()
|
||||
Text("No Videos").font(.custom("Helvetica Neue Regular", size: 16)).foregroundColor(Color(red: 129/255, green: 129/255, blue: 129/255)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9)
|
||||
Text("No Videos").font(.custom("Helvetica Neue Regular", fixedSize: 16)).foregroundColor(Color(red: 129/255, green: 129/255, blue: 129/255)).shadow(color: Color.white.opacity(0.9), radius: 0, x: 0.0, y: 0.9)
|
||||
Spacer()
|
||||
|
||||
}.frame(width: geometry.size.width, height: geometry.size.height)
|
||||
|
@ -1003,7 +836,7 @@ struct youtube_more: View {
|
|||
HStack(alignment: .center) {
|
||||
Spacer().frame(width:1, height: 44-0.95)
|
||||
Image(item.image).frame(width:25, height: 44-0.95)
|
||||
Text(item.name).font(.custom("Helvetica Neue Bold", size: 18)).foregroundColor(.black).lineLimit(1).padding(.leading, 6).padding(.trailing, 40)
|
||||
Text(item.name).font(.custom("Helvetica Neue Bold", fixedSize: 18)).foregroundColor(.black).lineLimit(1).padding(.leading, 6).padding(.trailing, 40)
|
||||
Spacer()
|
||||
Image("UITableNext").padding(.trailing, 12)
|
||||
}.padding(.leading, 15)
|
||||
|
@ -1210,7 +1043,7 @@ struct video_player_title_bar : View {
|
|||
if is_loading {
|
||||
ZStack {
|
||||
HStack {
|
||||
Text("Loading...").font(.custom("Helvetica Neue Bold", size: 16)).foregroundColor(.white)
|
||||
Text("Loading...").font(.custom("Helvetica Neue Bold", fixedSize: 16)).foregroundColor(.white)
|
||||
Spacer().frame(width: 8)
|
||||
ProgressView().progressViewStyle(CircularProgressViewStyle(tint: Color.white))
|
||||
}
|
||||
|
@ -1223,7 +1056,7 @@ struct video_player_title_bar : View {
|
|||
HStack(spacing: 0) {
|
||||
tool_bar_rectangle_button(action: {back_action?()}, button_type: .blue, content: "Done").padding(.leading, 5)
|
||||
Spacer()
|
||||
Text("\(VPUtility.formatSecondsToHMS(playerObserver.seekPos * (player.currentItem?.duration.seconds ?? 0)))").font(.custom("Helvetica Neue Bold", size: 14)).foregroundColor(.white).padding([.leading], 15)
|
||||
Text("\(VPUtility.formatSecondsToHMS(playerObserver.seekPos * (player.currentItem?.duration.seconds ?? 0)))").font(.custom("Helvetica Neue Bold", fixedSize: 14)).foregroundColor(.white).padding([.leading], 15)
|
||||
CustomSliderVideo(player: $player, type: "Video", value: $playerObserver.seekPos, range: (0, 1)) { modifiers in
|
||||
ZStack {
|
||||
ZStack {
|
||||
|
@ -1237,7 +1070,7 @@ struct video_player_title_bar : View {
|
|||
}.modifier(modifiers.knob)
|
||||
}
|
||||
}.frame(height: 25)
|
||||
Text("-\(VPUtility.formatSecondsToHMS((player.currentItem?.duration.seconds ?? 0) - playerObserver.seekPos * (player.currentItem?.duration.seconds ?? 0)))").font(.custom("Helvetica Neue Bold", size: 14)).foregroundColor(.white).padding([.trailing], 15)
|
||||
Text("-\(VPUtility.formatSecondsToHMS((player.currentItem?.duration.seconds ?? 0) - playerObserver.seekPos * (player.currentItem?.duration.seconds ?? 0)))").font(.custom("Helvetica Neue Bold", fixedSize: 14)).foregroundColor(.white).padding([.trailing], 15)
|
||||
Spacer()
|
||||
tool_bar_rectangle_button_image_done_size(action: {gravity_action?()}, button_type: .black, content: gravity == .fit ? "mp_zoomout" : "mp_zoomin", use_image: true).padding(.trailing, 5)
|
||||
}
|
||||
|
@ -1352,7 +1185,7 @@ struct youtube_title_bar : View {
|
|||
HStack {
|
||||
Spacer()
|
||||
if (selectedTab != "Most Viewed" || mv_current_nav_view != "Main"), (selectedTab != "Search" || search_current_nav_view != "Main") {
|
||||
Text(title).ps_innerShadow(Color.white, radius: 0, offset: 1, angle: 180.degrees, intensity: 0.07).font(.custom("Helvetica Neue Bold", size: 22)).shadow(color: Color.black.opacity(0.21), radius: 0, x: 0.0, y: -1).id(title).frame(maxWidth: selectedTab == "Most Viewed" ? 145 : 180)
|
||||
Text(title).ps_innerShadow(Color.white, radius: 0, offset: 1, angle: 180.degrees, intensity: 0.07).font(.custom("Helvetica Neue Bold", fixedSize: 22)).shadow(color: Color.black.opacity(0.21), radius: 0, x: 0.0, y: -1).id(title).frame(maxWidth: selectedTab == "Most Viewed" ? 145 : 180)
|
||||
} else if selectedTab == "Most Viewed" {
|
||||
tri_segmented_control_youtube(selected: $selected_segment, instant_multitasking_change: $instant_multitasking_change, first_text: "Today", second_text: "This week", third_text: "All", should_animate: instant_video_change).frame(width: geometry.size.width-24, height: 30)
|
||||
} else if selectedTab == "Search" {
|
||||
|
@ -1457,7 +1290,7 @@ struct youtube_title_bar : View {
|
|||
ZStack {
|
||||
Image("Button2").resizable().aspectRatio(contentMode: .fit).frame(width:77)
|
||||
HStack(alignment: .center) {
|
||||
Text("Search").foregroundColor(Color.white).font(.custom("Helvetica Neue Bold", size: 13)).shadow(color: Color.black.opacity(0.45), radius: 0, x: 0, y: -0.6).padding(.leading,5).offset(y:-1.1)
|
||||
Text("Search").foregroundColor(Color.white).font(.custom("Helvetica Neue Bold", fixedSize: 13)).shadow(color: Color.black.opacity(0.45), radius: 0, x: 0, y: -0.6).padding(.leading,5).offset(y:-1.1)
|
||||
}
|
||||
}.padding(.leading, 6)
|
||||
}.transition(AnyTransition.asymmetric(insertion: .move(edge:.trailing), removal: .move(edge: .trailing)))
|
||||
|
@ -1477,7 +1310,7 @@ struct youtube_title_bar : View {
|
|||
ZStack {
|
||||
Image("Button_wp5").resizable().scaledToFit().frame(width:200*84/162*(33/34.33783783783784), height: 33)
|
||||
HStack(alignment: .center) {
|
||||
Text("Most Viewed").foregroundColor(Color.white).font(.custom("Helvetica Neue Bold", size: 13)).shadow(color: Color.black.opacity(0.45), radius: 0, x: 0, y: -0.6).padding(.leading,5).offset(y:-1.1).offset(x: 1)
|
||||
Text("Most Viewed").foregroundColor(Color.white).font(.custom("Helvetica Neue Bold", fixedSize: 13)).shadow(color: Color.black.opacity(0.45), radius: 0, x: 0, y: -0.6).padding(.leading,5).offset(y:-1.1).offset(x: 1)
|
||||
}
|
||||
}.padding(.leading, 6)
|
||||
}.transition(AnyTransition.asymmetric(insertion: .move(edge:.trailing), removal: .move(edge: .trailing)))
|
||||
|
@ -1497,7 +1330,7 @@ struct youtube_title_bar : View {
|
|||
ZStack {
|
||||
Image("Button2").resizable().aspectRatio(contentMode: .fit).frame(width:77)
|
||||
HStack(alignment: .center) {
|
||||
Text("Search").foregroundColor(Color.white).font(.custom("Helvetica Neue Bold", size: 13)).shadow(color: Color.black.opacity(0.45), radius: 0, x: 0, y: -0.6).padding(.leading,5).offset(y:-1.1)
|
||||
Text("Search").foregroundColor(Color.white).font(.custom("Helvetica Neue Bold", fixedSize: 13)).shadow(color: Color.black.opacity(0.45), radius: 0, x: 0, y: -0.6).padding(.leading,5).offset(y:-1.1)
|
||||
}
|
||||
}.padding(.leading, 6)
|
||||
}.transition(AnyTransition.asymmetric(insertion: .move(edge:.trailing), removal: .move(edge: .trailing)))
|
||||
|
@ -1517,7 +1350,7 @@ struct youtube_title_bar : View {
|
|||
ZStack {
|
||||
Image("Button2").resizable().aspectRatio(contentMode: .fit).frame(width:77)
|
||||
HStack(alignment: .center) {
|
||||
Text("Favorites").foregroundColor(Color.white).font(.custom("Helvetica Neue Bold", size: 13)).shadow(color: Color.black.opacity(0.45), radius: 0, x: 0, y: -0.6).padding(.leading,5).offset(y:-1.1)
|
||||
Text("Favorites").foregroundColor(Color.white).font(.custom("Helvetica Neue Bold", fixedSize: 13)).shadow(color: Color.black.opacity(0.45), radius: 0, x: 0, y: -0.6).padding(.leading,5).offset(y:-1.1)
|
||||
}
|
||||
}.padding(.leading, 6)
|
||||
}.transition(AnyTransition.asymmetric(insertion: .move(edge:.trailing), removal: .move(edge: .trailing)))
|
||||
|
@ -2529,5 +2362,4 @@ struct BlankButtonStyle: ButtonStyle {
|
|||
configuration.label
|
||||
.background(Color.white)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue