인앱 미니 블로그(AI 자동 포스트, 이메일 승인)·이용후기(즉시 게시)·예약 요청(메일 발송)을
새로 붙였고, 병행해서 /s/stay 목업과 발행 사이트 공통 렌더러(UnitsSection·FestivalSection·
LocalGuideSection·WeatherSection 등)의 UI 버그를 다수 고쳤다. 범위가 넓지만 한 주 분량
작업을 한 커밋으로 묶어 달라는 요청에 따라 하나로 묶는다.
- solution/backend: post/review/booking_request 라우터·서비스·CRUD 추가, 스케줄러에
블로그 초안 생성(새벽 4:10)·발송(아침 9:00) cron 등록, 마이그레이션 4건 추가
- solution/frontend, admin/frontend: 생성된 API 클라이언트 갱신, 리뷰 모더레이션·
블로그 글 관리 페이지 추가
- solution/site/src: 객실 상세+실시간예약(날짜선택·연락처 폼)을 모달로 통합, 축제·
주변안내 카드 클릭 시 모달 전환, 후기 목록 카드 UI, 공용 Modal 컴포넌트 신설,
날씨 문구 동기화 버그 수정(하늘줄·기온줄 한 타이머로), 시설·편의 가능/불가 아이콘
색상 하이라이트, 헤더 메뉴 순서를 실제 섹션 순서에 맞춤, 하단 탭바 아이콘 정렬 버그
(line-height) 수정, 추천일정 점선 연결+데스크톱 자동펼침/모바일 축소, 채널 라벨에
크롤링 원문("NOL")이 새던 것을 bookingLabel() 로 교체
- solution/site/scripts/mockup: /s/stay 패치 스크립트·주입 CSS·JS 다수 수정, stay4~6
빌드 스크립트 추가(다른 세션 작업)
테스트: solution/site `npx tsc --noEmit` 통과, `npx vitest run` 93 passed,
solution/backend `pytest tests/test_booking_request.py` 6 passed(로컬 DB 대상).
예약 요청 메일은 실제 발송까지 확인(place 66894a1b 소유자 이메일 누락을 DB에서 보정).
341 lines
7.4 KiB
JavaScript
341 lines
7.4 KiB
JavaScript
/*
|
|
Story by HTML5 UP
|
|
html5up.net | @ajlkn
|
|
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
|
*/
|
|
|
|
(function($) {
|
|
|
|
var $window = $(window),
|
|
$body = $('body'),
|
|
$wrapper = $('#wrapper');
|
|
|
|
// Breakpoints.
|
|
breakpoints({
|
|
xlarge: [ '1281px', '1680px' ],
|
|
large: [ '981px', '1280px' ],
|
|
medium: [ '737px', '980px' ],
|
|
small: [ '481px', '736px' ],
|
|
xsmall: [ '361px', '480px' ],
|
|
xxsmall: [ null, '360px' ]
|
|
});
|
|
|
|
// Play initial animations on page load.
|
|
$window.on('load', function() {
|
|
window.setTimeout(function() {
|
|
$body.removeClass('is-preload');
|
|
}, 100);
|
|
});
|
|
|
|
// Browser fixes.
|
|
|
|
// IE: Flexbox min-height bug.
|
|
if (browser.name == 'ie')
|
|
(function() {
|
|
|
|
var flexboxFixTimeoutId;
|
|
|
|
$window.on('resize.flexbox-fix', function() {
|
|
|
|
var $x = $('.fullscreen');
|
|
|
|
clearTimeout(flexboxFixTimeoutId);
|
|
|
|
flexboxFixTimeoutId = setTimeout(function() {
|
|
|
|
if ($x.prop('scrollHeight') > $window.height())
|
|
$x.css('height', 'auto');
|
|
else
|
|
$x.css('height', '100vh');
|
|
|
|
}, 250);
|
|
|
|
}).triggerHandler('resize.flexbox-fix');
|
|
|
|
})();
|
|
|
|
// Object fit workaround.
|
|
if (!browser.canUse('object-fit'))
|
|
(function() {
|
|
|
|
$('.banner .image, .spotlight .image').each(function() {
|
|
|
|
var $this = $(this),
|
|
$img = $this.children('img'),
|
|
positionClass = $this.parent().attr('class').match(/image-position-([a-z]+)/);
|
|
|
|
// Set image.
|
|
$this
|
|
.css('background-image', 'url("' + $img.attr('src') + '")')
|
|
.css('background-repeat', 'no-repeat')
|
|
.css('background-size', 'cover');
|
|
|
|
// Set position.
|
|
switch (positionClass.length > 1 ? positionClass[1] : '') {
|
|
|
|
case 'left':
|
|
$this.css('background-position', 'left');
|
|
break;
|
|
|
|
case 'right':
|
|
$this.css('background-position', 'right');
|
|
break;
|
|
|
|
default:
|
|
case 'center':
|
|
$this.css('background-position', 'center');
|
|
break;
|
|
|
|
}
|
|
|
|
// Hide original.
|
|
$img.css('opacity', '0');
|
|
|
|
});
|
|
|
|
})();
|
|
|
|
// Smooth scroll.
|
|
$('.smooth-scroll').scrolly();
|
|
$('.smooth-scroll-middle').scrolly({ anchor: 'middle' });
|
|
|
|
// Wrapper.
|
|
$wrapper.children()
|
|
.scrollex({
|
|
top: '30vh',
|
|
bottom: '30vh',
|
|
initialize: function() {
|
|
$(this).addClass('is-inactive');
|
|
},
|
|
terminate: function() {
|
|
$(this).removeClass('is-inactive');
|
|
},
|
|
enter: function() {
|
|
$(this).removeClass('is-inactive');
|
|
},
|
|
leave: function() {
|
|
|
|
var $this = $(this);
|
|
|
|
if ($this.hasClass('onscroll-bidirectional'))
|
|
$this.addClass('is-inactive');
|
|
|
|
}
|
|
});
|
|
|
|
// Items.
|
|
$('.items')
|
|
.scrollex({
|
|
top: '30vh',
|
|
bottom: '30vh',
|
|
delay: 50,
|
|
initialize: function() {
|
|
$(this).addClass('is-inactive');
|
|
},
|
|
terminate: function() {
|
|
$(this).removeClass('is-inactive');
|
|
},
|
|
enter: function() {
|
|
$(this).removeClass('is-inactive');
|
|
},
|
|
leave: function() {
|
|
|
|
var $this = $(this);
|
|
|
|
if ($this.hasClass('onscroll-bidirectional'))
|
|
$this.addClass('is-inactive');
|
|
|
|
}
|
|
})
|
|
.children()
|
|
.wrapInner('<div class="inner"></div>');
|
|
|
|
// Gallery.
|
|
$('.gallery')
|
|
.wrapInner('<div class="inner"></div>')
|
|
.prepend(browser.mobile ? '' : '<div class="forward"></div><div class="backward"></div>')
|
|
.scrollex({
|
|
top: '30vh',
|
|
bottom: '30vh',
|
|
delay: 50,
|
|
initialize: function() {
|
|
$(this).addClass('is-inactive');
|
|
},
|
|
terminate: function() {
|
|
$(this).removeClass('is-inactive');
|
|
},
|
|
enter: function() {
|
|
$(this).removeClass('is-inactive');
|
|
},
|
|
leave: function() {
|
|
|
|
var $this = $(this);
|
|
|
|
if ($this.hasClass('onscroll-bidirectional'))
|
|
$this.addClass('is-inactive');
|
|
|
|
}
|
|
})
|
|
.children('.inner')
|
|
//.css('overflow', 'hidden')
|
|
.css('overflow-y', browser.mobile ? 'visible' : 'hidden')
|
|
.css('overflow-x', browser.mobile ? 'scroll' : 'hidden')
|
|
.scrollLeft(0);
|
|
|
|
// Style #1.
|
|
// ...
|
|
|
|
// Style #2.
|
|
$('.gallery')
|
|
.on('wheel', '.inner', function(event) {
|
|
|
|
var $this = $(this),
|
|
delta = (event.originalEvent.deltaX * 10);
|
|
|
|
// Cap delta.
|
|
if (delta > 0)
|
|
delta = Math.min(25, delta);
|
|
else if (delta < 0)
|
|
delta = Math.max(-25, delta);
|
|
|
|
// Scroll.
|
|
$this.scrollLeft( $this.scrollLeft() + delta );
|
|
|
|
})
|
|
.on('mouseenter', '.forward, .backward', function(event) {
|
|
|
|
var $this = $(this),
|
|
$inner = $this.siblings('.inner'),
|
|
direction = ($this.hasClass('forward') ? 1 : -1);
|
|
|
|
// Clear move interval.
|
|
clearInterval(this._gallery_moveIntervalId);
|
|
|
|
// Start interval.
|
|
this._gallery_moveIntervalId = setInterval(function() {
|
|
$inner.scrollLeft( $inner.scrollLeft() + (5 * direction) );
|
|
}, 10);
|
|
|
|
})
|
|
.on('mouseleave', '.forward, .backward', function(event) {
|
|
|
|
// Clear move interval.
|
|
clearInterval(this._gallery_moveIntervalId);
|
|
|
|
});
|
|
|
|
// Lightbox.
|
|
$('.gallery.lightbox')
|
|
.on('click', 'a', function(event) {
|
|
|
|
var $a = $(this),
|
|
$gallery = $a.parents('.gallery'),
|
|
$modal = $gallery.children('.modal'),
|
|
$modalImg = $modal.find('img'),
|
|
href = $a.attr('href');
|
|
|
|
// Not an image? Bail.
|
|
if (!href.match(/\.(jpg|gif|png|mp4)$/))
|
|
return;
|
|
|
|
// Prevent default.
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
|
|
// Locked? Bail.
|
|
if ($modal[0]._locked)
|
|
return;
|
|
|
|
// Lock.
|
|
$modal[0]._locked = true;
|
|
|
|
// Set src.
|
|
$modalImg.attr('src', href);
|
|
|
|
// Set visible.
|
|
$modal.addClass('visible');
|
|
|
|
// Focus.
|
|
$modal.focus();
|
|
|
|
// Delay.
|
|
setTimeout(function() {
|
|
|
|
// Unlock.
|
|
$modal[0]._locked = false;
|
|
|
|
}, 600);
|
|
|
|
})
|
|
.on('click', '.modal', function(event) {
|
|
|
|
var $modal = $(this),
|
|
$modalImg = $modal.find('img');
|
|
|
|
// Locked? Bail.
|
|
if ($modal[0]._locked)
|
|
return;
|
|
|
|
// Already hidden? Bail.
|
|
if (!$modal.hasClass('visible'))
|
|
return;
|
|
|
|
// Lock.
|
|
$modal[0]._locked = true;
|
|
|
|
// Clear visible, loaded.
|
|
$modal
|
|
.removeClass('loaded')
|
|
|
|
// Delay.
|
|
setTimeout(function() {
|
|
|
|
$modal
|
|
.removeClass('visible')
|
|
|
|
setTimeout(function() {
|
|
|
|
// Clear src.
|
|
$modalImg.attr('src', '');
|
|
|
|
// Unlock.
|
|
$modal[0]._locked = false;
|
|
|
|
// Focus.
|
|
$body.focus();
|
|
|
|
}, 475);
|
|
|
|
}, 125);
|
|
|
|
})
|
|
.on('keypress', '.modal', function(event) {
|
|
|
|
var $modal = $(this);
|
|
|
|
// Escape? Hide modal.
|
|
if (event.keyCode == 27)
|
|
$modal.trigger('click');
|
|
|
|
})
|
|
.prepend('<div class="modal" tabIndex="-1"><div class="inner"><img src="" /></div></div>')
|
|
.find('img')
|
|
.on('load', function(event) {
|
|
|
|
var $modalImg = $(this),
|
|
$modal = $modalImg.parents('.modal');
|
|
|
|
setTimeout(function() {
|
|
|
|
// No longer visible? Bail.
|
|
if (!$modal.hasClass('visible'))
|
|
return;
|
|
|
|
// Set loaded.
|
|
$modal.addClass('loaded');
|
|
|
|
}, 275);
|
|
|
|
});
|
|
|
|
})(jQuery); |