feat(live-room-like-heart): 하트가 가득 차면 폭죽처럼 터지는 애니메이션 반영

This commit is contained in:
Yu Sung
2025-11-05 18:01:32 +09:00
parent 95c2e992de
commit 34eed366bd
2 changed files with 197 additions and 7 deletions

View File

@@ -759,11 +759,37 @@ struct LiveRoomViewV2: View {
}
}
.overlay(alignment: .center) {
WaterHeartView(progress: waterProgress, show: showWaterHeart, phase: wavePhase)
.frame(width: 280, height: 210) // 4:3
.allowsHitTesting(false)
.opacity(showWaterHeart ? 1 : 0)
.animation(.easeInOut(duration: 0.2), value: showWaterHeart)
ZStack {
// ( )
WaterHeartView(progress: waterProgress, show: showWaterHeart, phase: wavePhase)
.frame(width: 280, height: 210)
.allowsHitTesting(false)
.opacity(showWaterHeart ? 1 : 0)
.animation(.easeInOut(duration: 0.2), value: showWaterHeart)
// ( ) - 1
WaterHeartView(progress: viewModel.remoteWaterProgress,
show: viewModel.isShowRemoteBigHeart,
phase: viewModel.remoteWavePhase)
.frame(width: 280, height: 210)
.allowsHitTesting(false)
//
.opacity((viewModel.isShowRemoteBigHeart && !showWaterHeart) ? 1 : 0)
.animation(.easeInOut(duration: 0.2), value: viewModel.isShowRemoteBigHeart)
// ( , #ff959a)
ZStack {
ForEach(viewModel.bigHeartParticles) { p in
HeartShape()
.fill(Color(hex: "ff959a"))
.frame(width: p.size * p.scale, height: p.size * p.scale)
.rotationEffect(.degrees(p.rotation))
.offset(x: p.x, y: p.y)
.opacity(p.opacity)
.allowsHitTesting(false)
}
}
}
}
.onReceive(heartWaveTimer) { _ in
guard isLongPressingHeart else { return }