mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Various improvements
This commit is contained in:
BIN
submodules/PremiumUI/Resources/flecks.jpg
Normal file
BIN
submodules/PremiumUI/Resources/flecks.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 207 KiB |
BIN
submodules/PremiumUI/Resources/particles.png
Normal file
BIN
submodules/PremiumUI/Resources/particles.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
BIN
submodules/PremiumUI/Resources/texture.jpg
Normal file
BIN
submodules/PremiumUI/Resources/texture.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 38 KiB |
@@ -79,6 +79,10 @@ private class StarComponent: Component {
|
|||||||
var left = true
|
var left = true
|
||||||
if let view = gesture.view {
|
if let view = gesture.view {
|
||||||
let point = gesture.location(in: view)
|
let point = gesture.location(in: view)
|
||||||
|
let distanceFromCenter = abs(point.x - view.frame.size.width / 2.0)
|
||||||
|
if distanceFromCenter > 60.0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
if point.x > view.frame.width / 2.0 {
|
if point.x > view.frame.width / 2.0 {
|
||||||
left = false
|
left = false
|
||||||
}
|
}
|
||||||
@@ -145,7 +149,7 @@ private class StarComponent: Component {
|
|||||||
smallAngle = true
|
smallAngle = true
|
||||||
}
|
}
|
||||||
|
|
||||||
self.playAppearanceAnimation(velocity: velocity.x, smallAngle: smallAngle)
|
self.playAppearanceAnimation(velocity: velocity.x, smallAngle: smallAngle, explode: !smallAngle && velocity.x > 600)
|
||||||
node.rotation = SCNVector4(x: 0.0, y: 1.0, z: 0.0, w: 0.0)
|
node.rotation = SCNVector4(x: 0.0, y: 1.0, z: 0.0, w: 0.0)
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
@@ -229,10 +233,16 @@ private class StarComponent: Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if explode, let node = scene.rootNode.childNode(withName: "swirl", recursively: false), let particles = scene.rootNode.childNode(withName: "particles", recursively: false) {
|
if explode, let node = scene.rootNode.childNode(withName: "swirl", recursively: false), let particles = scene.rootNode.childNode(withName: "particles", recursively: false) {
|
||||||
|
let particleSystem = particles.particleSystems?.first
|
||||||
|
particleSystem?.particleColorVariation = SCNVector4(0.15, 0.2, 0.35, 0.3)
|
||||||
|
particleSystem?.particleVelocity = 2.2
|
||||||
|
particleSystem?.birthRate = 4.5
|
||||||
|
|
||||||
node.physicsField?.isActive = true
|
node.physicsField?.isActive = true
|
||||||
Queue.mainQueue().after(1.0) {
|
Queue.mainQueue().after(1.0) {
|
||||||
node.physicsField?.isActive = false
|
node.physicsField?.isActive = false
|
||||||
particles.particleSystems?.first?.birthRate = 0.8
|
particles.particleSystems?.first?.birthRate = 1.2
|
||||||
|
particleSystem?.particleVelocity = 1.65
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1075,7 +1085,7 @@ private final class PremiumIntroScreenComponent: CombinedComponent {
|
|||||||
|
|
||||||
let star = star.update(
|
let star = star.update(
|
||||||
component: StarComponent(),
|
component: StarComponent(),
|
||||||
availableSize: CGSize(width: 260.0, height: 180.0),
|
availableSize: CGSize(width: min(390.0, context.availableSize.width), height: 180.0),
|
||||||
transition: context.transition
|
transition: context.transition
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1176,7 +1186,7 @@ private final class PremiumIntroScreenComponent: CombinedComponent {
|
|||||||
let titleOffsetDelta = 160.0 - environment.navigationHeight / 2.0
|
let titleOffsetDelta = 160.0 - environment.navigationHeight / 2.0
|
||||||
|
|
||||||
if let topContentOffset = state.topContentOffset {
|
if let topContentOffset = state.topContentOffset {
|
||||||
topPanelAlpha = min(30.0, max(0.0, topContentOffset - 64.0)) / 30.0
|
topPanelAlpha = min(30.0, max(0.0, topContentOffset - 80.0)) / 30.0
|
||||||
titleOffset = topContentOffset
|
titleOffset = topContentOffset
|
||||||
titleScale = 1.0 - max(0.0, min(1.0, titleOffset / titleOffsetDelta)) * 0.36
|
titleScale = 1.0 - max(0.0, min(1.0, titleOffset / titleOffsetDelta)) * 0.36
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user