mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-12 05:46:15 +00:00
remove geometryreader
This commit is contained in:
@@ -11,71 +11,69 @@ struct ShaderTestingView: View {
|
|||||||
@State private var start = Date.now
|
@State private var start = Date.now
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
GeometryReader { geo in
|
TimelineView(.animation) { tl in
|
||||||
TimelineView(.animation) { tl in
|
let time = start.distance(to: tl.date)
|
||||||
ZStack {
|
ZStack {
|
||||||
let time = start.distance(to: tl.date)
|
VStack {
|
||||||
VStack {
|
HStack {
|
||||||
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")
|
Image(systemName: "figure.walk.circle")
|
||||||
.resizable().scaledToFit()
|
.resizable().scaledToFit()
|
||||||
.foregroundStyle(.blue)
|
.foregroundStyle(.blue)
|
||||||
.colorEffect(ShaderLibrary.rainbow(.float(time)))
|
Image(systemName: "arrow.right")
|
||||||
|
.foregroundStyle(.gray)
|
||||||
|
.frame(width: 25, height: 25)
|
||||||
Image(systemName: "figure.walk.circle")
|
Image(systemName: "figure.walk.circle")
|
||||||
.resizable().scaledToFit()
|
.resizable().scaledToFit()
|
||||||
.foregroundStyle(.blue)
|
.foregroundStyle(.blue)
|
||||||
.distortionEffect(
|
.colorEffect(ShaderLibrary.redify())
|
||||||
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))
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
.brightness(0.2)
|
|
||||||
|
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()
|
Rectangle()
|
||||||
.foregroundStyle(.black.opacity(1))
|
.colorEffect(
|
||||||
.visualEffect { content, proxy in
|
ShaderLibrary.sinebow(.float2(300, 200), .float(time))
|
||||||
content
|
)
|
||||||
.colorEffect(
|
|
||||||
ShaderLibrary.crt(
|
|
||||||
.float2(proxy.size),
|
|
||||||
.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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,9 +54,12 @@ struct AboutView: View {
|
|||||||
NavigationLink {
|
NavigationLink {
|
||||||
ShaderTestingView()
|
ShaderTestingView()
|
||||||
} label: {
|
} label: {
|
||||||
Text("Shader Playground")
|
VStack {
|
||||||
.bold()
|
Text("Shader Playground")
|
||||||
Text("This is a collection of all the shaders I made while learning!")
|
.bold()
|
||||||
|
Text("This is a collection of all the shaders I made while learning!")
|
||||||
|
.font(.caption2)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.transition(.scale)
|
.transition(.scale)
|
||||||
|
|||||||
Reference in New Issue
Block a user