@sbaiahmed1/react-native-blur 4.5.8-beta.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -68,16 +68,24 @@ import UIKit
|
|
|
68
68
|
let blurEffect = UIBlurEffect(style: style)
|
|
69
69
|
let vibrancyEffect = UIVibrancyEffect(blurEffect: blurEffect)
|
|
70
70
|
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
// Set effects directly first to ensure they are visible
|
|
72
|
+
// Animating them from nil often causes issues with UIVibrancyEffect
|
|
73
|
+
blurEffectView.effect = blurEffect
|
|
74
|
+
vibrancyEffectView.effect = vibrancyEffect
|
|
75
|
+
|
|
76
|
+
// Create animator to adjust intensity
|
|
77
|
+
blurAnimator = UIViewPropertyAnimator(duration: 1, curve: .linear) { [weak self] in
|
|
78
|
+
self?.blurEffectView.effect = nil
|
|
79
|
+
self?.vibrancyEffectView.effect = nil
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
// Convert blurAmount (0-100) to intensity (0.0-1.0)
|
|
83
|
+
// We reverse the logic:
|
|
84
|
+
// fractionComplete = 0.0 -> effects are fully applied (start state)
|
|
85
|
+
// fractionComplete = 1.0 -> effects are removed (end state)
|
|
86
|
+
// So to get desired intensity X, we set fractionComplete to (1 - X)
|
|
79
87
|
let intensity = min(max(blurAmount / 100.0, 0.0), 1.0)
|
|
80
|
-
blurAnimator?.fractionComplete = intensity
|
|
88
|
+
blurAnimator?.fractionComplete = 1.0 - intensity
|
|
81
89
|
|
|
82
90
|
// Stop the animation at the current state
|
|
83
91
|
DispatchQueue.main.async { [weak self, weak blurAnimator] in
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sbaiahmed1/react-native-blur",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "React native modern blur view",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -176,4 +176,4 @@
|
|
|
176
176
|
"type": "fabric-view",
|
|
177
177
|
"version": "0.50.3"
|
|
178
178
|
}
|
|
179
|
-
}
|
|
179
|
+
}
|