From c6859ac980f360011e95528c4ab03b628addf578 Mon Sep 17 00:00:00 2001 From: talksik Date: Fri, 17 Dec 2021 04:31:43 -0800 Subject: [PATCH] fixiing broken animations on waves --- .../Views/HomeView/InnerCircle/InnerCircleView.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nirvana-ios/Views/HomeView/InnerCircle/InnerCircleView.swift b/nirvana-ios/Views/HomeView/InnerCircle/InnerCircleView.swift index 1f9d49d..ac00b86 100644 --- a/nirvana-ios/Views/HomeView/InnerCircle/InnerCircleView.swift +++ b/nirvana-ios/Views/HomeView/InnerCircle/InnerCircleView.swift @@ -36,7 +36,8 @@ struct InnerCircleView: View { .blur(radius:2) .offset(x: self.animateWaves ? -1*universalSize.width : 0) .animation( - Animation.linear(duration: 20).repeatForever(autoreverses: false) + Animation.linear(duration: 20).repeatForever(autoreverses: false), + value: self.animateWaves ) getWave(peakPercentage: 0.2, troughPercentage: 0.75, peakAltercation: baseLineY - 50, troughAltercation: baseLineY + 100) @@ -44,7 +45,8 @@ struct InnerCircleView: View { .blur(radius:2) .offset(x: self.animateWaves ? -1*universalSize.width : 0) .animation( - Animation.linear(duration: 10).repeatForever(autoreverses: false) + Animation.linear(duration: 10).repeatForever(autoreverses: false), + value: self.animateWaves ) getWave(peakPercentage: 0.25, troughPercentage: 0.75, peakAltercation: baseLineY + 70, troughAltercation: baseLineY - 100) @@ -52,7 +54,8 @@ struct InnerCircleView: View { .blur(radius:2) .offset(x: self.animateWaves ? -1*universalSize.width : 0) .animation( - Animation.linear(duration: 12).repeatForever(autoreverses: false) + Animation.linear(duration: 12).repeatForever(autoreverses: false), + value: self.animateWaves ) } @@ -219,7 +222,7 @@ struct InnerCircleView: View { // magic variables for grid // TODO: change the number of columns based on the number of items - private static var numberOfItems: Int = 20 + private static var numberOfItems: Int = 5 private static let size: CGFloat = UIScreen.main.bounds.height*0.15 // scaling with screen size private static let spacingBetweenColumns: CGFloat = 0 private static let spacingBetweenRows: CGFloat = 0