Skip to content

Instantly share code, notes, and snippets.

View juandahurt's full-sized avatar
👋

Juan David Hurtado juandahurt

👋
View GitHub Profile
@dkun7944
dkun7944 / CDView.swift
Last active July 17, 2024 03:27
SwiftUI + Swift.Shader CD
//
// CDView.swift
// CD
//
// Created by Daniel Kuntz on 7/3/23.
//
import SwiftUI
struct ShapeWithHole: Shape {
@nilshoenson
nilshoenson / Shader.metal
Last active June 28, 2024 20:51
A wave animation built with shaders in SwiftUI.
#include <metal_stdlib>
#include <SwiftUI/SwiftUI_Metal.h>
using namespace metal;
// Create a horizontal bar
float bar(vector_float2 uv, float start, float height) {
return step(uv.y, height + start) - step(uv.y, start);
}
// Create waves animation using GLSL
// Author: The SwiftUI-Lab
// This code is part of the tutorial: https://swiftui-lab.com/swiftui-animations-part4/
import SwiftUI
// Sample usage
struct ContentView: View {
var body: some View {
VStack {
GifImage(url: URL(string: "https://media.giphy.com/media/YAlhwn67KT76E/giphy.gif?cid=790b7611b26260b2ad23535a70e343e67443ff80ef623844&rid=giphy.gif&ct=g")!)
.padding(10)