Repository: cyrilzakka/NameDrop Branch: main Commit: 4671ac3aa327 Files: 18 Total size: 35.8 KB Directory structure: gitextract_u_tewwka/ ├── LICENSE ├── NameDrop/ │ ├── Assets.xcassets/ │ │ ├── AccentColor.colorset/ │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset/ │ │ │ └── Contents.json │ │ ├── Contents.json │ │ └── wallpaper.imageset/ │ │ └── Contents.json │ ├── ContentView.swift │ ├── NameDropApp.swift │ ├── Preview Content/ │ │ └── Preview Assets.xcassets/ │ │ └── Contents.json │ └── Ripple.fsh ├── NameDrop.xcodeproj/ │ ├── project.pbxproj │ ├── project.xcworkspace/ │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata/ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata/ │ │ └── cyril.xcuserdatad/ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata/ │ └── cyril.xcuserdatad/ │ └── xcschemes/ │ └── xcschememanagement.plist ├── NameDropTests/ │ └── NameDropTests.swift ├── NameDropUITests/ │ ├── NameDropUITests.swift │ └── NameDropUITestsLaunchTests.swift └── README.md ================================================ FILE CONTENTS ================================================ ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2023 Cyril Zakka, MD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: NameDrop/Assets.xcassets/AccentColor.colorset/Contents.json ================================================ { "colors" : [ { "idiom" : "universal" } ], "info" : { "author" : "xcode", "version" : 1 } } ================================================ FILE: NameDrop/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "platform" : "ios", "size" : "1024x1024" } ], "info" : { "author" : "xcode", "version" : 1 } } ================================================ FILE: NameDrop/Assets.xcassets/Contents.json ================================================ { "info" : { "author" : "xcode", "version" : 1 } } ================================================ FILE: NameDrop/Assets.xcassets/wallpaper.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "filename" : "wallpaper.jpg", "idiom" : "universal", "scale" : "3x" } ], "info" : { "author" : "xcode", "version" : 1 } } ================================================ FILE: NameDrop/ContentView.swift ================================================ // // ContentView.swift // NameDrop // // Created by Cyril Zakka on 6/5/23. // import SwiftUI import SpriteKit extension ContentView { class WaterScene: SKScene { private let spriteNode = SKSpriteNode() var image: UIImage? // Converted from: https://www.shadertoy.com/view/llj3Dz let waterShader = SKShader(source: """ void main() { float offset = (u_time - floor(u_time))/u_time; float currentTime = u_time*offset*0.5; vec3 waveParams = vec3(u_scale, u_sharpness, u_spread); vec2 waveCenter = vec2(0.5, 1.05); vec2 coord = v_tex_coord; float dist = distance(coord, waveCenter); vec4 current_color = texture2D(u_texture, coord); //Only distort the pixels within the parameter distance from the center if ((dist <= ((currentTime) + (waveParams.z))) && (dist >= ((currentTime) - (waveParams.z)))) { float diff = (dist - currentTime); float scaleDiff = (1.0 - pow(abs(diff * waveParams.x), waveParams.y)); float diffTime = (diff * scaleDiff); vec2 diffTexCoord = normalize(coord - waveCenter); coord += ((diffTexCoord * diffTime) / (currentTime * dist * 10)); //40 current_color = texture2D(u_texture, coord); current_color += (current_color * scaleDiff) / (currentTime * dist * 40.0); } gl_FragColor = current_color; } """) override func sceneDidLoad() { backgroundColor = .clear scaleMode = .resizeFill spriteNode.shader = waterShader addChild(spriteNode) } func updateTexture() { guard view != nil else { return } guard let image else { return } let texture = SKTexture(image: image) spriteNode.texture = texture spriteNode.size = texture.size() spriteNode.position.x = frame.midX spriteNode.position.y = frame.midY } override func didMove(to view: SKView) { updateTexture() } } struct WaterEffect: View { @State private var scene = WaterScene() @Environment(\.displayScale) var displayScale var scale: Double var sharpness: Double var spread: Double @ViewBuilder var content: () -> Content var body: some View { let renderer = ImageRenderer(content: content()) renderer.scale = displayScale let image = renderer.uiImage let size = image?.size ?? .zero scene.waterShader.uniforms = [ SKUniform(name: "u_scale", float: Float(scale)), SKUniform(name: "u_sharpness", float: Float(sharpness)), SKUniform(name: "u_spread", float: Float(spread)) ] scene.image = image scene.updateTexture() return SpriteView(scene: scene, options: .allowsTransparency) .frame(width: size.width, height: size.height) } } } struct ContentView: View { @State private var showControls = true @State private var scale = 10.0 @State private var sharpness = 0.8 @State private var spread = 0.1 var body: some View { WaterEffect(scale: scale, sharpness: sharpness, spread: spread) { ZStack(alignment: .top) { Image("wallpaper") .imageScale(.large) .foregroundStyle(.tint) VStack(alignment: .center) { Text("Friday, June 9") .font(.system(size: 20)) .fontWeight(.semibold) Text("11:42") .font(.system(size: 70)) .fontWeight(.semibold) Text("Cyril Zakka") } .padding(.top, 115) .foregroundColor(.white.opacity(0.7)) } }.sheet( isPresented: $showControls, content: { ScrollView { VStack { LabeledContent("Scale") { Slider(value: $scale, in: 1...50, step: 1) } LabeledContent("Sharpness") { Slider(value: $sharpness, in: 0...1, step: 0.1) } LabeledContent("Spread") { Slider(value: $spread, in: 0...1, step: 0.1) } }.padding() }.presentationBackground(.thinMaterial) .padding() .presentationDetents([.fraction(0.3),.medium, .large]) }) } } #Preview { ContentView() } ================================================ FILE: NameDrop/NameDropApp.swift ================================================ // // NameDropApp.swift // NameDrop // // Created by Cyril Zakka on 6/5/23. // import SwiftUI @main struct NameDropApp: App { var body: some Scene { WindowGroup { ContentView() } } } ================================================ FILE: NameDrop/Preview Content/Preview Assets.xcassets/Contents.json ================================================ { "info" : { "author" : "xcode", "version" : 1 } } ================================================ FILE: NameDrop/Ripple.fsh ================================================ // // Ripple.fsh // NameDrop // // Created by Cyril Zakka on 6/8/23. // void main() { float offset = (u_time - floor(u_time))/u_time; float currentTime = (u_time)*(offset); vec2 coord = v_tex_coord; vec3 waveParams = vec3(10.0, 0.8, 0.1); float pixel_distance = distance(coord, u_center); vec4 current_color = SKDefaultShading(); if ((pixel_distance <= ((currentTime) + (waveParams.z))) && (pixel_distance >= ((currentTime) - (waveParams.z)))) { float diff = (pixel_distance - currentTime); float scaleDiff = (1.0 - pow(abs(diff * waveParams.x), waveParams.y)); float diffTime = (Ddiffiff * scaleDiff); vec2 diffTexCoord = normalize(distance(v_tex_coord, u_center)); coord += ((diffTexCoord * diffTime) / (currentTime * pixel_distance * 40.0)); current_color += (current_color * scaleDiff) / (currentTime * pixel_distance * 40.0); } gl_FragColor = current_color; } ================================================ FILE: NameDrop.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 56; objects = { /* Begin PBXBuildFile section */ F16099492A2F06B400F288E0 /* NameDropApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F16099482A2F06B400F288E0 /* NameDropApp.swift */; }; F160994B2A2F06B400F288E0 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F160994A2A2F06B400F288E0 /* ContentView.swift */; }; F160994D2A2F06B500F288E0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F160994C2A2F06B500F288E0 /* Assets.xcassets */; }; F16099502A2F06B500F288E0 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F160994F2A2F06B500F288E0 /* Preview Assets.xcassets */; }; F160995A2A2F06B500F288E0 /* NameDropTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F16099592A2F06B500F288E0 /* NameDropTests.swift */; }; F16099642A2F06B500F288E0 /* NameDropUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F16099632A2F06B500F288E0 /* NameDropUITests.swift */; }; F16099662A2F06B500F288E0 /* NameDropUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F16099652A2F06B500F288E0 /* NameDropUITestsLaunchTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ F16099562A2F06B500F288E0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = F160993D2A2F06B400F288E0 /* Project object */; proxyType = 1; remoteGlobalIDString = F16099442A2F06B400F288E0; remoteInfo = NameDrop; }; F16099602A2F06B500F288E0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = F160993D2A2F06B400F288E0 /* Project object */; proxyType = 1; remoteGlobalIDString = F16099442A2F06B400F288E0; remoteInfo = NameDrop; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ F16099452A2F06B400F288E0 /* NameDrop.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NameDrop.app; sourceTree = BUILT_PRODUCTS_DIR; }; F16099482A2F06B400F288E0 /* NameDropApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NameDropApp.swift; sourceTree = ""; }; F160994A2A2F06B400F288E0 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; F160994C2A2F06B500F288E0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; F160994F2A2F06B500F288E0 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; F16099552A2F06B500F288E0 /* NameDropTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NameDropTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; F16099592A2F06B500F288E0 /* NameDropTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NameDropTests.swift; sourceTree = ""; }; F160995F2A2F06B500F288E0 /* NameDropUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NameDropUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; F16099632A2F06B500F288E0 /* NameDropUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NameDropUITests.swift; sourceTree = ""; }; F16099652A2F06B500F288E0 /* NameDropUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NameDropUITestsLaunchTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ F16099422A2F06B400F288E0 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; F16099522A2F06B500F288E0 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; F160995C2A2F06B500F288E0 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ F160993C2A2F06B400F288E0 = { isa = PBXGroup; children = ( F16099472A2F06B400F288E0 /* NameDrop */, F16099582A2F06B500F288E0 /* NameDropTests */, F16099622A2F06B500F288E0 /* NameDropUITests */, F16099462A2F06B400F288E0 /* Products */, ); sourceTree = ""; }; F16099462A2F06B400F288E0 /* Products */ = { isa = PBXGroup; children = ( F16099452A2F06B400F288E0 /* NameDrop.app */, F16099552A2F06B500F288E0 /* NameDropTests.xctest */, F160995F2A2F06B500F288E0 /* NameDropUITests.xctest */, ); name = Products; sourceTree = ""; }; F16099472A2F06B400F288E0 /* NameDrop */ = { isa = PBXGroup; children = ( F16099482A2F06B400F288E0 /* NameDropApp.swift */, F160994A2A2F06B400F288E0 /* ContentView.swift */, F160994C2A2F06B500F288E0 /* Assets.xcassets */, F160994E2A2F06B500F288E0 /* Preview Content */, ); path = NameDrop; sourceTree = ""; }; F160994E2A2F06B500F288E0 /* Preview Content */ = { isa = PBXGroup; children = ( F160994F2A2F06B500F288E0 /* Preview Assets.xcassets */, ); path = "Preview Content"; sourceTree = ""; }; F16099582A2F06B500F288E0 /* NameDropTests */ = { isa = PBXGroup; children = ( F16099592A2F06B500F288E0 /* NameDropTests.swift */, ); path = NameDropTests; sourceTree = ""; }; F16099622A2F06B500F288E0 /* NameDropUITests */ = { isa = PBXGroup; children = ( F16099632A2F06B500F288E0 /* NameDropUITests.swift */, F16099652A2F06B500F288E0 /* NameDropUITestsLaunchTests.swift */, ); path = NameDropUITests; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ F16099442A2F06B400F288E0 /* NameDrop */ = { isa = PBXNativeTarget; buildConfigurationList = F16099692A2F06B500F288E0 /* Build configuration list for PBXNativeTarget "NameDrop" */; buildPhases = ( F16099412A2F06B400F288E0 /* Sources */, F16099422A2F06B400F288E0 /* Frameworks */, F16099432A2F06B400F288E0 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = NameDrop; productName = NameDrop; productReference = F16099452A2F06B400F288E0 /* NameDrop.app */; productType = "com.apple.product-type.application"; }; F16099542A2F06B500F288E0 /* NameDropTests */ = { isa = PBXNativeTarget; buildConfigurationList = F160996C2A2F06B500F288E0 /* Build configuration list for PBXNativeTarget "NameDropTests" */; buildPhases = ( F16099512A2F06B500F288E0 /* Sources */, F16099522A2F06B500F288E0 /* Frameworks */, F16099532A2F06B500F288E0 /* Resources */, ); buildRules = ( ); dependencies = ( F16099572A2F06B500F288E0 /* PBXTargetDependency */, ); name = NameDropTests; productName = NameDropTests; productReference = F16099552A2F06B500F288E0 /* NameDropTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; F160995E2A2F06B500F288E0 /* NameDropUITests */ = { isa = PBXNativeTarget; buildConfigurationList = F160996F2A2F06B500F288E0 /* Build configuration list for PBXNativeTarget "NameDropUITests" */; buildPhases = ( F160995B2A2F06B500F288E0 /* Sources */, F160995C2A2F06B500F288E0 /* Frameworks */, F160995D2A2F06B500F288E0 /* Resources */, ); buildRules = ( ); dependencies = ( F16099612A2F06B500F288E0 /* PBXTargetDependency */, ); name = NameDropUITests; productName = NameDropUITests; productReference = F160995F2A2F06B500F288E0 /* NameDropUITests.xctest */; productType = "com.apple.product-type.bundle.ui-testing"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ F160993D2A2F06B400F288E0 /* Project object */ = { isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1500; LastUpgradeCheck = 1500; TargetAttributes = { F16099442A2F06B400F288E0 = { CreatedOnToolsVersion = 15.0; }; F16099542A2F06B500F288E0 = { CreatedOnToolsVersion = 15.0; TestTargetID = F16099442A2F06B400F288E0; }; F160995E2A2F06B500F288E0 = { CreatedOnToolsVersion = 15.0; TestTargetID = F16099442A2F06B400F288E0; }; }; }; buildConfigurationList = F16099402A2F06B400F288E0 /* Build configuration list for PBXProject "NameDrop" */; compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = F160993C2A2F06B400F288E0; productRefGroup = F16099462A2F06B400F288E0 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( F16099442A2F06B400F288E0 /* NameDrop */, F16099542A2F06B500F288E0 /* NameDropTests */, F160995E2A2F06B500F288E0 /* NameDropUITests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ F16099432A2F06B400F288E0 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( F16099502A2F06B500F288E0 /* Preview Assets.xcassets in Resources */, F160994D2A2F06B500F288E0 /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; F16099532A2F06B500F288E0 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; F160995D2A2F06B500F288E0 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ F16099412A2F06B400F288E0 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( F160994B2A2F06B400F288E0 /* ContentView.swift in Sources */, F16099492A2F06B400F288E0 /* NameDropApp.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; F16099512A2F06B500F288E0 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( F160995A2A2F06B500F288E0 /* NameDropTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; F160995B2A2F06B500F288E0 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( F16099662A2F06B500F288E0 /* NameDropUITestsLaunchTests.swift in Sources */, F16099642A2F06B500F288E0 /* NameDropUITests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ F16099572A2F06B500F288E0 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = F16099442A2F06B400F288E0 /* NameDrop */; targetProxy = F16099562A2F06B500F288E0 /* PBXContainerItemProxy */; }; F16099612A2F06B500F288E0 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = F16099442A2F06B400F288E0 /* NameDrop */; targetProxy = F16099602A2F06B500F288E0 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ F16099672A2F06B500F288E0 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu17; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 17.0; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; F16099682A2F06B500F288E0 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu17; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 17.0; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; VALIDATE_PRODUCT = YES; }; name = Release; }; F160996A2A2F06B500F288E0 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"NameDrop/Preview Content\""; DEVELOPMENT_TEAM = AG2QJ56KLX; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = cyrilzakka.NameDrop; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; F160996B2A2F06B500F288E0 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"NameDrop/Preview Content\""; DEVELOPMENT_TEAM = AG2QJ56KLX; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = cyrilzakka.NameDrop; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; F160996D2A2F06B500F288E0 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = AG2QJ56KLX; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 17.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = cyrilzakka.NameDropTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NameDrop.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/NameDrop"; }; name = Debug; }; F160996E2A2F06B500F288E0 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = AG2QJ56KLX; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 17.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = cyrilzakka.NameDropTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NameDrop.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/NameDrop"; }; name = Release; }; F16099702A2F06B500F288E0 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = AG2QJ56KLX; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = cyrilzakka.NameDropUITests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_TARGET_NAME = NameDrop; }; name = Debug; }; F16099712A2F06B500F288E0 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = AG2QJ56KLX; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = cyrilzakka.NameDropUITests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_TARGET_NAME = NameDrop; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ F16099402A2F06B400F288E0 /* Build configuration list for PBXProject "NameDrop" */ = { isa = XCConfigurationList; buildConfigurations = ( F16099672A2F06B500F288E0 /* Debug */, F16099682A2F06B500F288E0 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; F16099692A2F06B500F288E0 /* Build configuration list for PBXNativeTarget "NameDrop" */ = { isa = XCConfigurationList; buildConfigurations = ( F160996A2A2F06B500F288E0 /* Debug */, F160996B2A2F06B500F288E0 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; F160996C2A2F06B500F288E0 /* Build configuration list for PBXNativeTarget "NameDropTests" */ = { isa = XCConfigurationList; buildConfigurations = ( F160996D2A2F06B500F288E0 /* Debug */, F160996E2A2F06B500F288E0 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; F160996F2A2F06B500F288E0 /* Build configuration list for PBXNativeTarget "NameDropUITests" */ = { isa = XCConfigurationList; buildConfigurations = ( F16099702A2F06B500F288E0 /* Debug */, F16099712A2F06B500F288E0 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = F160993D2A2F06B400F288E0 /* Project object */; } ================================================ FILE: NameDrop.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: NameDrop.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: NameDrop.xcodeproj/xcuserdata/cyril.xcuserdatad/xcschemes/xcschememanagement.plist ================================================ SchemeUserState NameDrop.xcscheme_^#shared#^_ orderHint 0 ================================================ FILE: NameDropTests/NameDropTests.swift ================================================ // // NameDropTests.swift // NameDropTests // // Created by Cyril Zakka on 6/5/23. // import XCTest @testable import NameDrop final class NameDropTests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. // Any test you write for XCTest can be annotated as throws and async. // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. } func testPerformanceExample() throws { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } } ================================================ FILE: NameDropUITests/NameDropUITests.swift ================================================ // // NameDropUITests.swift // NameDropUITests // // Created by Cyril Zakka on 6/5/23. // import XCTest final class NameDropUITests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // UI tests must launch the application that they test. let app = XCUIApplication() app.launch() // Use XCTAssert and related functions to verify your tests produce the correct results. } func testLaunchPerformance() throws { if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { // This measures how long it takes to launch your application. measure(metrics: [XCTApplicationLaunchMetric()]) { XCUIApplication().launch() } } } } ================================================ FILE: NameDropUITests/NameDropUITestsLaunchTests.swift ================================================ // // NameDropUITestsLaunchTests.swift // NameDropUITests // // Created by Cyril Zakka on 6/5/23. // import XCTest final class NameDropUITestsLaunchTests: XCTestCase { override class var runsForEachTargetApplicationUIConfiguration: Bool { true } override func setUpWithError() throws { continueAfterFailure = false } func testLaunch() throws { let app = XCUIApplication() app.launch() // Insert steps here to perform after app launch but before taking a screenshot, // such as logging into a test account or navigating somewhere in the app let attachment = XCTAttachment(screenshot: app.screenshot()) attachment.name = "Launch Screen" attachment.lifetime = .keepAlways add(attachment) } } ================================================ FILE: README.md ================================================ # NameDrop Water ripple effect written in SwiftUI/GLSL to replicate the NameDrop animation first demoed on iOS 17. Should be easier to add with the new `.layerEffect` modifier. The magic mostly happens in this little block of code: ``` void main() { float offset = (u_time - floor(u_time))/u_time; float currentTime = u_time*offset*0.5; vec3 waveParams = vec3(u_scale, u_sharpness, u_spread); vec2 waveCenter = vec2(0.5, 1.05); vec2 coord = v_tex_coord; float dist = distance(coord, waveCenter); vec4 current_color = texture2D(u_texture, coord); //Only distort the pixels within the parameter distance from the center if ((dist <= ((currentTime) + (waveParams.z))) && (dist >= ((currentTime) - (waveParams.z)))) { float diff = (dist - currentTime); float scaleDiff = (1.0 - pow(abs(diff * waveParams.x), waveParams.y)); float diffTime = (diff * scaleDiff); vec2 diffTexCoord = normalize(coord - waveCenter); coord += ((diffTexCoord * diffTime) / (currentTime * dist * 10)); //40 current_color = texture2D(u_texture, coord); current_color += (current_color * scaleDiff) / (currentTime * dist * 40.0); } gl_FragColor = current_color; ``` Give me a shoutout if you end up using it anywhere! Twitter: [@cyrilzakka](https://twitter.com/cyrilzakka)