Skip to content

Instantly share code, notes, and snippets.

@amosgyamfi
Created October 21, 2020 05:32
Show Gist options
  • Save amosgyamfi/e4682bdfa2b41509257a4f64755fc986 to your computer and use it in GitHub Desktop.
Save amosgyamfi/e4682bdfa2b41509257a4f64755fc986 to your computer and use it in GitHub Desktop.
//
// 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