Created
October 21, 2020 05:32
-
-
Save amosgyamfi/e4682bdfa2b41509257a4f64755fc986 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// homepod | |
// | |
// Created by Amos Gyamfi on 21.10.2020. | |
// | |
import SwiftUI | |
struct ContentView: View { | |
@State private var hueRotate = false | |
var body: some View { | |
VStack(spacing: -255) { | |
Spacer() | |
Image("homepod") | |
Image("gradient") | |
.hueRotation(.degrees(hueRotate ? -400 : .pi * 300)) | |
.animation(Animation.easeInOut(duration: 2).repeatForever(autoreverses: true)) | |
.onAppear() { | |
hueRotate.toggle() | |
} | |
Spacer() | |
Spacer() | |
} | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
.preferredColorScheme(.dark) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment