/* 버튼과 캡션의 fade 효과 */
.exit-button, .fullscreen-button, .carousel-caption {
transition: opacity 0.3s;
}
// UI 요소 자동 숨김/표시 기능
function hideElements() {
controls.forEach(control => control.style.opacity = '0');
captions.forEach(caption => caption.style.opacity = '0');
buttons.forEach(button => button.style.opacity = '0');
}
// 전체화면 전환 기능
function toggleFullScreen() {
const gallery = document.querySelector('.fullscreen-gallery');
if (!document.fullscreenElement) {
gallery.requestFullscreen();
}
}
# views.py
def fullscreen_gallery(request):
app/templates/app/fullscreen_gallery.html
)<!-- 핵심 스타일 -->
<style>
.fullscreen-gallery {
width: 100vw;
height: 100vh;
background-color: black;
}
.carousel-item img {
width: 100vw;
height: 100vh;
object-fit: contain;
}
</style>
app/views.py
)def fullscreen_gallery(request):
"""전체 화면 갤러리 뷰"""
posts = Post.objects.filter(is_public=True).exclude(
image__isnull=True
).exclude(
image__exact=''
).order_by('-date_posted')
app/urls.py
)path("artwork/fullscreen/", views.fullscreen_gallery, name="fullscreen_gallery"),