/*! 6/21/2024, 11:42:51 AM */
/******/ (() => { // webpackBootstrap
var __webpack_exports__ = {};
(() => {
const { EventManager, utils } = ShopbySkin;
const url = new URL(window.location.href);
const searchParams = new URLSearchParams(url.search);
const boardId = searchParams.get('boardId');
const boardNo = searchParams.get('boardNo');
let shopbyCommonData = {};
EventManager.on('PAGE_LOAD_COMPLETED', (commonData) => {
shopbyCommonData = commonData;
var controller = new ScrollMagic.Controller();
// 애니메이션 정의
var tween = gsap.to(".visual2", {
duration: 1, // 애니메이션 시간 (초)
width: "2000px", // 최종 너비
// ease: "power2.inOut" // 이징 적용
});
// ScrollMagic 씬 생성
var scene = new ScrollMagic.Scene({
triggerElement: ".visual2", // 애니메이션 시작 요소
triggerHook: 0.4, // 스크롤 위치 (0.5는 화면 중앙)
duration: 270 // 애니메이션 지속 거리
})
.setTween(tween)
// .addIndicators({name: "Box Animation"}) // 디버그를 위한 인디케이터 추가 (선택 사항)
.addTo(controller);
});
const moduleActionHandler = {
WRITE: ({ target }) => {
const boardName = document.querySelector('[shopby-board-name]')?.getAttribute('shopby-board-name');
const canPostByMember = target.closest('[shopby-can-post-by-member]')?.getAttribute('shopby-can-post-by-member');
const canPostByGuest = target.closest('[shopby-can-post-by-guest]')?.getAttribute('shopby-can-post-by-guest');
const canSecretPosting = target.closest('[shopby-can-secret-posting]')?.getAttribute('shopby-can-secret-posting');
const usesAttachment = target.closest('[shopby-uses-attachment]')?.getAttribute('shopby-uses-attachment');
const isCanPostByMember = canPostByMember === 'true';
const isCanPostByGuest = canPostByGuest === 'true';
if (isCanPostByMember && !utils.isSignedIn()) {
if (!isCanPostByGuest) {
EventManager.fire('MODAL_CONFIRM_OPEN', {
noticeType: 'WARNING',
message: '로그인 하셔야 본 서비스를
이용하실 수 있습니다.',
onConfirm: () => {
const nextUrl = `${location.origin}/pages/sign-in/sign-in.html`;
location.href = `${nextUrl}?from=${encodeURIComponent(location.href)}`;
},
});
return;
}
}
if (!isCanPostByMember && utils.isSignedIn()) {
EventManager.fire('MODAL_ALERT_OPEN', {
noticeType: 'CAUTION',
message: '비회원 전용 게시판 입니다.',
});
return;
}
const { boardConfigs = [] } = shopbyCommonData.allBoardConfig;
EventManager.fire('OPEN_LAYER_MODAL', {
name: 'article-write-form',
title: boardName,
isFull: false,
data: {
boardId,
boardNo,
canSecretPosting,
usesAttachment,
boardConfigs,
isModify: false,
},
onClose: ({ reason }) => {
if (reason === 'DID_SUBMIT') {
location.reload();
}
},
});
},
};
document.querySelector('article-list-info')?.addEventListener('click', ({ target }) => {
const action = target.getAttribute('shopby-action');
const boardName = document.querySelector('[shopby-board-name]')?.getAttribute('shopby-board-name');
moduleActionHandler[action]?.({ boardName });
});
document.querySelector('article-total-count')?.addEventListener('click', ({ target }) => {
const action = target.getAttribute('shopby-action');
moduleActionHandler[action]?.({ target });
});
})();
/******/ })()
;