re add ios 16 support

shaders only show if 17+
blurReplace transitions are opacity with a white shadow for a short time
This commit is contained in:
neon443
2025-08-31 22:42:43 +01:00
parent 28b92466a5
commit 262411049f
6 changed files with 79 additions and 79 deletions

View File

@@ -81,7 +81,6 @@
A98554632E0587DF009051BD /* HostsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98554622E0587DF009051BD /* HostsView.swift */; };
A98CAB442E4229F7005E4C42 /* HostSymbolPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98CAB432E4229F7005E4C42 /* HostSymbolPicker.swift */; };
A9921DE12E5F5710009F72A8 /* WelcomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9921DE02E5F5710009F72A8 /* WelcomeView.swift */; };
A9921FFF2E61D537009F72A8 /* libssh2.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9921FFE2E61D537009F72A8 /* libssh2.xcframework */; };
A994D64A2E5C94E200672395 /* ShaderTestingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A994D6492E5C94E200672395 /* ShaderTestingView.swift */; };
A99D9F7B2E63513E00259166 /* SwiftTerm in Frameworks */ = {isa = PBXBuildFile; productRef = A99D9F7A2E63513E00259166 /* SwiftTerm */; };
A99D9F7E2E6351D100259166 /* SwiftTerm in Frameworks */ = {isa = PBXBuildFile; productRef = A99D9F7D2E6351D100259166 /* SwiftTerm */; };
@@ -227,7 +226,6 @@
A98554622E0587DF009051BD /* HostsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HostsView.swift; sourceTree = "<group>"; };
A98CAB432E4229F7005E4C42 /* HostSymbolPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HostSymbolPicker.swift; sourceTree = "<group>"; };
A9921DE02E5F5710009F72A8 /* WelcomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeView.swift; sourceTree = "<group>"; };
A9921FFE2E61D537009F72A8 /* libssh2.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libssh2.xcframework; path = ../blink/xcfs/.build/artifacts/xcfs/libssh2/libssh2.xcframework; sourceTree = SOURCE_ROOT; };
A994D6492E5C94E200672395 /* ShaderTestingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShaderTestingView.swift; sourceTree = "<group>"; };
A9A2F4F52E3001D300D0AE9B /* AddSnippetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddSnippetView.swift; sourceTree = "<group>"; };
A9B1E5842E5F8E86009309E5 /* WelcomeChunk.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeChunk.swift; sourceTree = "<group>"; };
@@ -266,7 +264,6 @@
A99D9F7B2E63513E00259166 /* SwiftTerm in Frameworks */,
A95FAA542DF4B62900DE2F5A /* LibSSH.xcframework in Frameworks */,
A93143BE2DF4D0B300FCD5DB /* libpthread.tbd in Frameworks */,
A9921FFF2E61D537009F72A8 /* libssh2.xcframework in Frameworks */,
A9083E402DF2226F0042906E /* libz.tbd in Frameworks */,
A99D9F812E64F45B00259166 /* SwiftTerm in Frameworks */,
A95FAA562DF4B62A00DE2F5A /* openssl.xcframework in Frameworks */,
@@ -637,7 +634,6 @@
A9083E3F2DF2225A0042906E /* libz.tbd */,
A95FAA502DF4B62100DE2F5A /* LibSSH.xcframework */,
A95FAA512DF4B62100DE2F5A /* openssl.xcframework */,
A9921FFE2E61D537009F72A8 /* libssh2.xcframework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -1103,7 +1099,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 17;
IPHONEOS_DEPLOYMENT_TARGET = 16;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -1147,7 +1143,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 17;
IPHONEOS_DEPLOYMENT_TARGET = 16;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",

View File

@@ -7,7 +7,6 @@
import Foundation
import LibSSH
import libssh2
import OSLog
import SwiftUI
import SwiftTerm

View File

@@ -11,69 +11,71 @@ struct ShaderTestingView: View {
@State private var start = Date.now
var body: some View {
TimelineView(.animation) { tl in
let time = start.distance(to: tl.date)
ZStack {
VStack {
HStack {
Image(systemName: "figure.walk.circle")
.resizable().scaledToFit()
.foregroundStyle(.blue)
Image(systemName: "arrow.right")
.foregroundStyle(.gray)
.frame(width: 25, height: 25)
Image(systemName: "figure.walk.circle")
.resizable().scaledToFit()
.foregroundStyle(.blue)
.colorEffect(ShaderLibrary.redify())
}
Image(systemName: "figure.walk.circle")
.resizable().scaledToFit()
.foregroundStyle(.blue)
.colorEffect(ShaderLibrary.rainbow(.float(time)))
Image(systemName: "figure.walk.circle")
.resizable().scaledToFit()
.foregroundStyle(.blue)
.distortionEffect(
ShaderLibrary.wave(.float(time)),
maxSampleOffset: .zero
)
Rectangle()
.padding(.vertical, 20)
.foregroundStyle(.red)
.compositingGroup()
.visualEffect {
content,
proxy in
content.distortionEffect(
ShaderLibrary.waveFlag(.float(time), .float2(proxy.size)),
maxSampleOffset: CGSize(width: 0, height: 40)
)
if #available(iOS 17, *) {
TimelineView(.animation) { tl in
let time = start.distance(to: tl.date)
ZStack {
VStack {
HStack {
Image(systemName: "figure.walk.circle")
.resizable().scaledToFit()
.foregroundStyle(.blue)
Image(systemName: "arrow.right")
.foregroundStyle(.gray)
.frame(width: 25, height: 25)
Image(systemName: "figure.walk.circle")
.resizable().scaledToFit()
.foregroundStyle(.blue)
.colorEffect(ShaderLibrary.redify())
}
Rectangle()
.colorEffect(
ShaderLibrary.sinebow(.float2(300, 200), .float(time))
)
}
.brightness(0.2)
Rectangle()
.foregroundStyle(.black.opacity(1))
.visualEffect { content, proxy in
content
.colorEffect(
ShaderLibrary.crt(
.float2(proxy.size),
.float(time)
Image(systemName: "figure.walk.circle")
.resizable().scaledToFit()
.foregroundStyle(.blue)
.colorEffect(ShaderLibrary.rainbow(.float(time)))
Image(systemName: "figure.walk.circle")
.resizable().scaledToFit()
.foregroundStyle(.blue)
.distortionEffect(
ShaderLibrary.wave(.float(time)),
maxSampleOffset: .zero
)
Rectangle()
.padding(.vertical, 20)
.foregroundStyle(.red)
.compositingGroup()
.visualEffect {
content,
proxy in
content.distortionEffect(
ShaderLibrary.waveFlag(.float(time), .float2(proxy.size)),
maxSampleOffset: CGSize(width: 0, height: 40)
)
}
Rectangle()
.colorEffect(
ShaderLibrary.sinebow(.float2(300, 200), .float(time))
)
}
.opacity(0.75)
.blendMode(.overlay)
.allowsHitTesting(false)
.brightness(0.2)
Rectangle()
.foregroundStyle(.black.opacity(1))
.visualEffect { content, proxy in
content
.colorEffect(
ShaderLibrary.crt(
.float2(proxy.size),
.float(time)
)
)
}
.opacity(0.75)
.blendMode(.overlay)
.allowsHitTesting(false)
}
}
}
}

View File

@@ -31,13 +31,13 @@ struct WelcomeChunk: View {
Text(title)
.bold()
.font(.headline)
.transition(.blurReplace)
.transition(.opacity)
}
if time > delay+0.75 && !para.isEmpty {
Text(para)
.foregroundStyle(.gray)
.font(.footnote)
.transition(.blurReplace)
.transition(.opacity)
.lineLimit(nil)
.multilineTextAlignment(.leading)
}

View File

@@ -29,7 +29,8 @@ struct WelcomeView: View {
.monospaced()
.font(.largeTitle)
.bold()
.transition(.blurReplace)
.transition(.opacity)
.shadow(color: .white, radius: time > 2.25 ? 0 : 5)
}
}
// .padding(.top, time > 3 ? 25 : 0)

View File

@@ -13,17 +13,19 @@ struct CRTView: View {
var body: some View {
TimelineView(.animation) { tl in
let time = tl.date.distance(to: startTime)
Rectangle()
.foregroundStyle(.black.opacity(1))
.visualEffect { content, proxy in
content
.colorEffect(
ShaderLibrary.crt(
.float2(proxy.size),
.float(time)
if #available(iOS 17, *) {
Rectangle()
.foregroundStyle(.black.opacity(1))
.visualEffect { content, proxy in
content
.colorEffect(
ShaderLibrary.crt(
.float2(proxy.size),
.float(time)
)
)
)
}
}
}
}
}
}