Fix build

This commit is contained in:
Ilya Laktyushin 2022-08-10 15:13:37 +03:00
parent 010ccf5b1e
commit 38c8b7738f
2 changed files with 12 additions and 4 deletions

View file

@ -1829,9 +1829,14 @@ private final class PremiumIntroScreenComponent: CombinedComponent {
if let topContentOffset = state.topContentOffset, topContentOffset >= 123.0 {
starIsVisible = false
}
var isIntro = true
if case .profile = context.component.source {
isIntro = false
}
let star = star.update(
component: PremiumStarComponent(isVisible: starIsVisible, hasIdleAnimations: state.hasIdleAnimations),
component: PremiumStarComponent(isIntro: isIntro, isVisible: starIsVisible, hasIdleAnimations: state.hasIdleAnimations),
availableSize: CGSize(width: min(390.0, context.availableSize.width), height: 220.0),
transition: context.transition
)

View file

@ -375,10 +375,13 @@ class PremiumStarComponent: Component {
return
}
let fromScale: Float = self.isIntro ? 0.1 : 0.08
let toScale: Float = self.isIntro ? 0.115 : 0.092
let animation = CABasicAnimation(keyPath: "scale")
animation.duration = 2.0
animation.fromValue = NSValue(scnVector3: SCNVector3(x: 0.1, y: 0.1, z: 0.1))
animation.toValue = NSValue(scnVector3: SCNVector3(x: 0.115, y: 0.115, z: 0.115))
animation.fromValue = NSValue(scnVector3: SCNVector3(x: fromScale, y: fromScale, z: fromScale))
animation.toValue = NSValue(scnVector3: SCNVector3(x: toScale, y: toScale, z: toScale))
animation.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
animation.autoreverses = true
animation.repeatCount = .infinity