Skip to content

Commit 3451b20

Browse files
authored
Update README.md
1 parent 297cfa2 commit 3451b20

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

+38
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,44 @@ Button {
244244
```
245245
</details>
246246

247+
<details>
248+
<summary>Fireworks effect</summary>
249+
250+
<p align="left">
251+
<img src="Gifs/fireworks.gif" alt="fireworks">
252+
</p>
253+
254+
Use `.animate(.fireworks(color:),animate:)` where `color` is color of animation, `animate` is flag to start animation.
255+
256+
```swift
257+
@State var animate: Bool = false
258+
...
259+
Button {
260+
animate.toggle()
261+
} label: {
262+
HStack(spacing: 8) {
263+
Image(systemName: animate ? "sun.max.fill" : "sun.max")
264+
.resizable()
265+
.scaledToFit()
266+
.animate(.fireworks(color: .white),
267+
animate: animate)
268+
.frame(width: 24, height: 24)
269+
.foregroundColor(.white)
270+
271+
Text("Weather")
272+
.font(.body)
273+
.fontWeight(.medium)
274+
.foregroundColor(.white)
275+
}
276+
.padding(12)
277+
.background(
278+
Rectangle()
279+
.fill(.blue.opacity(0.8))
280+
.cornerRadius(12)
281+
)
282+
}
283+
```
284+
</details>
247285
## Communication
248286

249287
- If you **found a bug**, open an issue or submit a fix via a pull request.

0 commit comments

Comments
 (0)