diff --git a/resources/views/academy/fire-shutter.blade.php b/resources/views/academy/fire-shutter.blade.php index c86ba75a..916d1d07 100644 --- a/resources/views/academy/fire-shutter.blade.php +++ b/resources/views/academy/fire-shutter.blade.php @@ -83,6 +83,20 @@ border-radius: 0.5rem; box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5); } + + /* 셔터 동작 애니메이션 */ + @keyframes shutter-move { + 0%, 5% { transform: translateY(-150px); } + 35%, 45% { transform: translateY(0px); } + 65%, 75% { transform: translateY(45px); } + 95%, 100%{ transform: translateY(-150px); } + } + .shutter-curtain { + animation: shutter-move 8s ease-in-out infinite; + } + .shutter-curtain.paused { + animation-play-state: paused; + } @endpush @@ -202,6 +216,95 @@ class="w-full rounded-lg cursor-pointer academy-img-hover" + + +
+

+ + + + + 셔터 동작 시뮬레이션 +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1차 정지 + + + + + @for ($i = 0; $i < 16; $i++) + + @endfor + + + + + + + 천장 + 케이스 + 가이드 + 레일 + 바닥 + + + + 연기 + 감지 + + + + 감지 + + + + + +
+ + + + 상태: 평상시 + +
+
+
@@ -1234,6 +1337,71 @@ function hidePreview() { } }); })(); + +// 셔터 동작 애니메이션 컨트롤 +(function() { + var shutterStatusTimer = null; + + window.toggleShutterAnim = function() { + var curtain = document.querySelector('.shutter-curtain'); + var btn = document.getElementById('shutter-play-btn'); + if (!curtain || !btn) return; + + curtain.classList.toggle('paused'); + var isPaused = curtain.classList.contains('paused'); + btn.textContent = isPaused ? '▶ 재생' : '⏸ 정지'; + + if (!isPaused) { + startStatusUpdater(); + } else { + clearInterval(shutterStatusTimer); + } + }; + + window.resetShutterAnim = function() { + var curtain = document.querySelector('.shutter-curtain'); + var btn = document.getElementById('shutter-play-btn'); + var status = document.getElementById('shutter-status'); + if (!curtain) return; + + curtain.style.animation = 'none'; + curtain.offsetHeight; // reflow 강제 + curtain.style.animation = ''; + curtain.classList.add('paused'); + if (btn) btn.textContent = '▶ 재생'; + if (status) { + status.textContent = '상태: 평상시'; + status.className = 'text-xs font-medium text-green-600'; + } + clearInterval(shutterStatusTimer); + }; + + function startStatusUpdater() { + clearInterval(shutterStatusTimer); + shutterStatusTimer = setInterval(function() { + var curtain = document.querySelector('.shutter-curtain'); + var status = document.getElementById('shutter-status'); + if (!curtain || !status || curtain.classList.contains('paused')) return; + + try { + var style = window.getComputedStyle(curtain); + var matrix = new DOMMatrix(style.transform); + var ty = matrix.m42; + + if (ty < -80) { + status.textContent = '상태: 평상시'; + status.className = 'text-xs font-medium text-green-600'; + } else if (ty < 20) { + status.textContent = '상태: 1차 하강 (일부폐쇄)'; + status.className = 'text-xs font-medium text-amber-600'; + } else { + status.textContent = '상태: 완전 폐쇄'; + status.className = 'text-xs font-medium text-red-600'; + } + } catch (e) {} + }, 150); + } +})(); @include('components.academy-glossary', ['domain' => 'fire-shutter'])