feat(live-room-like-heart): 하트가 가득 차면 폭죽처럼 터지는 애니메이션 반영
This commit is contained in:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user