jhleem / egov star

이다솜 이다솜 2022-02-14 @34

[20220214 이다솜] tiles 수정 코밋
Index: base3.10/src/main/java/egovframework/com/cmm/web/EgovComIndexController.java =================================================================== --- base3.10/src/main/java/egovframework/com/cmm/web/EgovComIndexController.java (revision 33) +++ base3.10/src/main/java/egovframework/com/cmm/web/EgovComIndexController.java (revision 34) @@ -64,23 +64,25 @@ /** 메뉴서비스 */ @Resource(name = "MenuService") private MenuService menuService; - + private ApplicationContext applicationContext; private static final Logger LOGGER = LoggerFactory.getLogger(EgovComIndexController.class); + @Override public void afterPropertiesSet() throws Exception {} + @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; - + LOGGER.info("EgovComIndexController setApplicationContext method has called!"); } /** EgovLoginService */ @Resource(name = "loginService") private EgovLoginService loginService; - + /** * 관리자 메인 페이지 * @Author : 임종호 @@ -116,12 +118,25 @@ } } - + + /** + * 사용자 메인 페이지 + * @Author : 이다솜 + * @Date : 2022. 2. 14 + * @Method Name : userIndex + * @return : String + */ + @RequestMapping("/user/index.do") + public String userIndex(ModelMap model) { +// return ".defaultLayout/com/cmm/EgovUnitMain"; + return ".defaultLayout/com/cmm/userIndex"; + } + @RequestMapping("/index.do") public String index(ModelMap model) { return "index"; } - + @RequestMapping("/EgovUnitMain.do") public String egovUnitMain(ModelMap model) { return "egovframework/com/cmm/EgovUnitMain"; @@ -140,7 +155,7 @@ @RequestMapping("/EgovContent.do") public String setContent(ModelMap model) throws Exception { - // 설정된 비밀번호 유효기간을 가져온다. ex) 180이면 비밀번호 변경후 만료일이 앞으로 180일 + // 설정된 비밀번호 유효기간을 가져온다. ex) 180이면 비밀번호 변경후 만료일이 앞으로 180일 String propertyExpirePwdDay = EgovProperties.getProperty("Globals.ExpirePwdDay"); int expirePwdDay = 0 ; try { @@ -148,7 +163,7 @@ } catch (Exception e) { LOGGER.debug("convert expirePwdDay Err : "+e.getMessage()); } - + model.addAttribute("expirePwdDay", expirePwdDay); // 비밀번호 설정일로부터 몇일이 지났는지 확인한다. ex) 3이면 비빌번호 설정후 3일 경과 @@ -164,10 +179,10 @@ LOGGER.debug("===>>> passedDayChangePWD = "+passedDayChangePWD); model.addAttribute("passedDay", passedDayChangePWD); } - + // 만료일자로부터 경과한 일수 => ex)1이면 만료일에서 1일 경과 model.addAttribute("elapsedTimeExpiration", passedDayChangePWD - expirePwdDay); - + return "egovframework/com/cmm/EgovUnitContent"; } @@ -242,7 +257,7 @@ } model.addAttribute("resultList", map.values()); - + LOGGER.debug("EgovComIndexController index is called "); return "egovframework/com/cmm/EgovUnitLeft"; Index: base3.10/src/main/java/egovframework/com/cop/bbs/web/EgovArticleController.java =================================================================== --- base3.10/src/main/java/egovframework/com/cop/bbs/web/EgovArticleController.java (revision 33) +++ base3.10/src/main/java/egovframework/com/cop/bbs/web/EgovArticleController.java (revision 34) @@ -14,29 +14,26 @@ import org.springframework.ui.ModelMap; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; import org.springmodules.validation.commons.DefaultBeanValidator; import egovframework.com.cmm.EgovMessageSource; -import egovframework.com.cmm.EgovWebUtil; import egovframework.com.cmm.LoginVO; import egovframework.com.cmm.service.FileVO; import egovframework.com.cmm.util.EgovUserDetailsHelper; import egovframework.com.cmm.util.EgovXssChecker; -import egovframework.com.cop.bbs.service.BlogVO; import egovframework.com.cop.bbs.service.Board; import egovframework.com.cop.bbs.service.BoardMaster; import egovframework.com.cop.bbs.service.BoardMasterVO; import egovframework.com.cop.bbs.service.BoardVO; import egovframework.com.cop.bbs.service.EgovArticleService; import egovframework.com.cop.bbs.service.EgovBBSMasterService; -import egovframework.com.cop.cmt.service.CommentVO; import egovframework.com.cop.cmt.service.EgovArticleCommentService; -import egovframework.rte.fdl.property.EgovPropertyService; import egovframework.com.utl.fcc.service.EgovStringUtil; +import egovframework.rte.fdl.property.EgovPropertyService; import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; /** @@ -48,7 +45,7 @@ * * <pre> * << 개정이력(Modification Information) >> - * + * * 수정일 수정자 수정내용 * ---------- ------- --------------------------- * 2009.03.19 이삼섭 최초 생성 @@ -59,7 +56,7 @@ * 2016.06.13 김연호 표준프레임워크 3.6 개선 * 2019.05.17 신용호 KISA 취약점 조치 및 보완 * 2020.10.27 신용호 파일 업로드 수정 (multiRequest.getFiles) - * + * * </pre> */ @@ -67,7 +64,7 @@ public class EgovArticleController { private static final Logger LOGGER = LoggerFactory.getLogger(EgovArticleController.class); - + @Resource(name = "EgovArticleService") private EgovArticleService egovArticleService; @@ -76,21 +73,21 @@ @Resource(name = "propertiesService") protected EgovPropertyService propertyService; - + @Resource(name="egovMessageSource") EgovMessageSource egovMessageSource; - + @Resource(name = "EgovArticleCommentService") protected EgovArticleCommentService egovArticleCommentService; - + @Autowired private DefaultBeanValidator beanValidator; //protected Logger log = Logger.getLogger(this.getClass()); - + /** * XSS 방지 처리. - * + * * @param data * @return */ @@ -98,21 +95,21 @@ if (data == null || data.trim().equals("")) { return ""; } - + String ret = data; - + ret = ret.replaceAll("<(S|s)(C|c)(R|r)(I|i)(P|p)(T|t)", "&lt;script"); ret = ret.replaceAll("</(S|s)(C|c)(R|r)(I|i)(P|p)(T|t)", "&lt;/script"); - + ret = ret.replaceAll("<(O|o)(B|b)(J|j)(E|e)(C|c)(T|t)", "&lt;object"); ret = ret.replaceAll("</(O|o)(B|b)(J|j)(E|e)(C|c)(T|t)", "&lt;/object"); - + ret = ret.replaceAll("<(A|a)(P|p)(P|p)(L|l)(E|e)(T|t)", "&lt;applet"); ret = ret.replaceAll("</(A|a)(P|p)(P|p)(L|l)(E|e)(T|t)", "&lt;/applet"); - + ret = ret.replaceAll("<(E|e)(M|m)(B|b)(E|e)(D|d)", "&lt;embed"); ret = ret.replaceAll("</(E|e)(M|m)(B|b)(E|e)(D|d)", "&lt;embed"); - + ret = ret.replaceAll("<(F|f)(O|o)(R|r)(M|m)", "&lt;form"); ret = ret.replaceAll("</(F|f)(O|o)(R|r)(M|m)", "&lt;form"); @@ -121,82 +118,83 @@ /** * 게시물에 대한 목록을 조회한다. - * + * * @param boardVO * @param sessionVO * @param model * @return * @throws Exception */ - @RequestMapping("/cop/bbs/selectArticleList.do") - public String selectArticleList(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model) throws Exception { + @RequestMapping("/cop/bbs/{bbsId}/selectArticleList.do") + public String selectArticleList(@ModelAttribute("searchVO") BoardVO boardVO, @PathVariable String bbsId, ModelMap model) throws Exception { + boardVO.setBbsId("BBSMSTR_".concat(bbsId)); LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); - + Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); //KISA 보안취약점 조치 (2018-12-10, 이정은) if(!isAuthenticated) { - return "egovframework/com/uat/uia/EgovLoginUsr"; + return ".defaultSubLayout/com/uat/uia/EgovLoginUsr"; } - + BoardMasterVO vo = new BoardMasterVO(); - + vo.setBbsId(boardVO.getBbsId()); vo.setUniqId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); BoardMasterVO master = egovBBSMasterService.selectBBSMasterInf(vo); - + //방명록은 방명록 게시판으로 이동 if(master.getBbsTyCode().equals("BBST03")){ return "forward:/cop/bbs/selectGuestArticleList.do"; } - - + + boardVO.setPageUnit(propertyService.getInt("pageUnit")); boardVO.setPageSize(propertyService.getInt("pageSize")); - + PaginationInfo paginationInfo = new PaginationInfo(); - + paginationInfo.setCurrentPageNo(boardVO.getPageIndex()); paginationInfo.setRecordCountPerPage(boardVO.getPageUnit()); paginationInfo.setPageSize(boardVO.getPageSize()); - + boardVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); boardVO.setLastIndex(paginationInfo.getLastRecordIndex()); boardVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - + Map<String, Object> map = egovArticleService.selectArticleList(boardVO); int totCnt = Integer.parseInt((String)map.get("resultCnt")); - + //공지사항 추출 List<BoardVO> noticeList = egovArticleService.selectNoticeArticleList(boardVO); - + paginationInfo.setTotalRecordCount(totCnt); - + //------------------------------- - // 기본 BBS template 지정 + // 기본 BBS template 지정 //------------------------------- if (master.getTmplatCours() == null || master.getTmplatCours().equals("")) { master.setTmplatCours("/css/egovframework/com/cop/tpl/egovBaseTemplate.css"); } ////----------------------------- - + if(user != null) { model.addAttribute("sessionUniqId", user.getUniqId()); } - + model.addAttribute("resultList", map.get("resultList")); model.addAttribute("resultCnt", map.get("resultCnt")); model.addAttribute("articleVO", boardVO); model.addAttribute("boardMasterVO", master); model.addAttribute("paginationInfo", paginationInfo); model.addAttribute("noticeList", noticeList); - return "egovframework/com/cop/bbs/EgovArticleList"; - } - - - + return ".defaultSubLayout/com/cop/bbs/EgovArticleList"; + } + + + /** * 게시물에 대한 상세 정보를 조회한다. - * + * * @param boardVO * @param sessionVO * @param model @@ -206,40 +204,40 @@ @RequestMapping("/cop/bbs/selectArticleDetail.do") public String selectArticleDetail(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model) throws Exception { LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); - + Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); //KISA 보안취약점 조치 (2018-12-10, 이정은) if(!isAuthenticated) { return "egovframework/com/uat/uia/EgovLoginUsr"; } - + boardVO.setLastUpdusrId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); BoardVO vo = egovArticleService.selectArticleDetail(boardVO); - + model.addAttribute("result", vo); model.addAttribute("sessionUniqId", (user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - - //비밀글은 작성자만 볼수 있음 + + //비밀글은 작성자만 볼수 있음 if(!EgovStringUtil.isEmpty(vo.getSecretAt()) && vo.getSecretAt().equals("Y") && !((user == null || user.getUniqId() == null) ? "" : user.getUniqId()).equals(vo.getFrstRegisterId())) return"forward:/cop/bbs/selectArticleList.do"; - + //---------------------------- // template 처리 (기본 BBS template 지정 포함) //---------------------------- BoardMasterVO master = new BoardMasterVO(); - + master.setBbsId(boardVO.getBbsId()); master.setUniqId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + BoardMasterVO masterVo = egovBBSMasterService.selectBBSMasterInf(master); - + if (masterVo.getTmplatCours() == null || masterVo.getTmplatCours().equals("")) { masterVo.setTmplatCours("/css/egovframework/com/cop/tpl/egovBaseTemplate.css"); } - + ////----------------------------- - + //---------------------------- // 2009.06.29 : 2단계 기능 추가 // 2011.07.01 : 댓글, 만족도 조사 기능의 종속성 제거 @@ -250,15 +248,15 @@ } } ////-------------------------- - + model.addAttribute("boardMasterVO", masterVo); - + return "egovframework/com/cop/bbs/EgovArticleDetail"; } /** * 게시물 등록을 위한 등록페이지로 이동한다. - * + * * @param boardVO * @param model * @return @@ -268,35 +266,35 @@ public String insertArticleView(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model) throws Exception { LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); - + BoardMasterVO bdMstr = new BoardMasterVO(); BoardVO board = new BoardVO(); if (isAuthenticated) { - + BoardMasterVO vo = new BoardMasterVO(); vo.setBbsId(boardVO.getBbsId()); vo.setUniqId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + bdMstr = egovBBSMasterService.selectBBSMasterInf(vo); } - + //---------------------------- - // 기본 BBS template 지정 + // 기본 BBS template 지정 //---------------------------- if (bdMstr.getTmplatCours() == null || bdMstr.getTmplatCours().equals("")) { bdMstr.setTmplatCours("/css/egovframework/com/cop/tpl/egovBaseTemplate.css"); } - + model.addAttribute("articleVO", boardVO); model.addAttribute("boardMasterVO", bdMstr); ////----------------------------- - + return "egovframework/com/cop/bbs/EgovArticleRegist"; } /** * 게시물을 등록한다. - * + * * @param boardVO * @param board * @param model @@ -305,44 +303,44 @@ */ @RequestMapping("/cop/bbs/insertArticle.do") public String insertArticle(final MultipartHttpServletRequest multiRequest, @ModelAttribute("searchVO") BoardVO boardVO, - @ModelAttribute("bdMstr") BoardMaster bdMstr, @ModelAttribute("board") BoardVO board, BindingResult bindingResult, + @ModelAttribute("bdMstr") BoardMaster bdMstr, @ModelAttribute("board") BoardVO board, BindingResult bindingResult, ModelMap model) throws Exception { LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); - + if(!isAuthenticated) { //KISA 보안취약점 조치 (2018-12-10, 이정은) return "egovframework/com/uat/uia/EgovLoginUsr"; } - + beanValidator.validate(board, bindingResult); if (bindingResult.hasErrors()) { - + BoardMasterVO master = new BoardMasterVO(); - + master.setBbsId(boardVO.getBbsId()); master.setUniqId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + master = egovBBSMasterService.selectBBSMasterInf(master); - - + + //---------------------------- - // 기본 BBS template 지정 + // 기본 BBS template 지정 //---------------------------- if (master.getTmplatCours() == null || master.getTmplatCours().equals("")) { master.setTmplatCours("css/egovframework/com/cop/tpl/egovBaseTemplate.css"); } - + model.addAttribute("boardMasterVO", master); ////----------------------------- - + return "egovframework/com/cop/bbs/EgovArticleRegist"; } - + if (isAuthenticated) { List<FileVO> result = null; String atchFileId = ""; - + //final Map<String, MultipartFile> files = multiRequest.getFileMap(); final List<MultipartFile> files = multiRequest.getFiles("file_1"); if (!files.isEmpty()) { @@ -353,20 +351,20 @@ board.setFrstRegisterId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); board.setBbsId(boardVO.getBbsId()); board.setBlogId(boardVO.getBlogId()); - - - //익명등록 처리 + + + //익명등록 처리 if(board.getAnonymousAt() != null && board.getAnonymousAt().equals("Y")){ board.setNtcrId("anonymous"); //게시물 통계 집계를 위해 등록자 ID 저장 board.setNtcrNm("익명"); //게시물 통계 집계를 위해 등록자 Name 저장 board.setFrstRegisterId("anonymous"); - + } else { board.setNtcrId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); //게시물 통계 집계를 위해 등록자 ID 저장 board.setNtcrNm((user == null || user.getName() == null) ? "" : user.getName()); //게시물 통계 집계를 위해 등록자 Name 저장 - + } - + board.setNttCn(unscript(board.getNttCn())); // XSS 방지 egovArticleService.insertArticle(board); } @@ -376,12 +374,12 @@ }else{ return "forward:/cop/bbs/selectArticleList.do"; } - + } /** * 게시물에 대한 답변 등록을 위한 등록페이지로 이동한다. - * + * * @param boardVO * @param model * @return @@ -390,33 +388,33 @@ @RequestMapping("/cop/bbs/replyArticleView.do") public String addReplyBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model) throws Exception { LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); - + Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();//KISA 보안취약점 조치 (2018-12-10, 이정은) if(!isAuthenticated) { return "egovframework/com/uat/uia/EgovLoginUsr"; } - + BoardMasterVO master = new BoardMasterVO(); BoardVO articleVO = new BoardVO(); master.setBbsId(boardVO.getBbsId()); master.setUniqId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + master = egovBBSMasterService.selectBBSMasterInf(master); boardVO = egovArticleService.selectArticleDetail(boardVO); - + //---------------------------- - // 기본 BBS template 지정 + // 기본 BBS template 지정 //---------------------------- if (master.getTmplatCours() == null || master.getTmplatCours().equals("")) { master.setTmplatCours("/css/egovframework/com/cop/tpl/egovBaseTemplate.css"); } - + model.addAttribute("boardMasterVO", master); model.addAttribute("result", boardVO); - + model.addAttribute("articleVO", articleVO); - + if(boardVO.getBlogAt().equals("chkBlog")){ return "egovframework/com/cop/bbs/EgovArticleBlogReply"; }else{ @@ -426,7 +424,7 @@ /** * 게시물에 대한 답변을 등록한다. - * + * * @param boardVO * @param board * @param model @@ -440,45 +438,45 @@ LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); - + if(!isAuthenticated) { //KISA 보안취약점 조치 (2018-12-10, 이정은) return "egovframework/com/uat/uia/EgovLoginUsr"; } - + beanValidator.validate(board, bindingResult); if (bindingResult.hasErrors()) { BoardMasterVO master = new BoardMasterVO(); - + master.setBbsId(boardVO.getBbsId()); master.setUniqId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + master = egovBBSMasterService.selectBBSMasterInf(master); - - + + //---------------------------- - // 기본 BBS template 지정 + // 기본 BBS template 지정 //---------------------------- if (master.getTmplatCours() == null || master.getTmplatCours().equals("")) { master.setTmplatCours("/css/egovframework/com/cop/tpl/egovBaseTemplate.css"); } - + model.addAttribute("articleVO", boardVO); model.addAttribute("boardMasterVO", master); ////----------------------------- - + return "egovframework/com/cop/bbs/EgovArticleReply"; } - + if (isAuthenticated) { //final Map<String, MultipartFile> files = multiRequest.getFileMap(); final List<MultipartFile> files = multiRequest.getFiles("file_1"); String atchFileId = ""; - + if (!files.isEmpty()) { // List<FileVO> result = fileUtil.parseFileInf(files, "BBS_", 0, "", ""); // atchFileId = fileMngService.insertFileInfs(result); } - + board.setAtchFileId(atchFileId); board.setReplyAt("Y"); board.setFrstRegisterId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); @@ -486,29 +484,29 @@ board.setParnts(Long.toString(boardVO.getNttId())); board.setSortOrdr(boardVO.getSortOrdr()); board.setReplyLc(Integer.toString(Integer.parseInt(boardVO.getReplyLc()) + 1)); - - //익명등록 처리 + + //익명등록 처리 if(board.getAnonymousAt() != null && board.getAnonymousAt().equals("Y")){ board.setNtcrId("anonymous"); //게시물 통계 집계를 위해 등록자 ID 저장 board.setNtcrNm("익명"); //게시물 통계 집계를 위해 등록자 Name 저장 board.setFrstRegisterId("anonymous"); - + } else { board.setNtcrId((user == null || user.getId() == null) ? "" : user.getId()); //게시물 통계 집계를 위해 등록자 ID 저장 board.setNtcrNm((user == null || user.getName() == null) ? "" : user.getName()); //게시물 통계 집계를 위해 등록자 Name 저장 - + } board.setNttCn(unscript(board.getNttCn())); // XSS 방지 - + egovArticleService.insertArticle(board); } - + return "forward:/cop/bbs/selectArticleList.do"; } /** * 게시물 수정을 위한 수정페이지로 이동한다. - * + * * @param boardVO * @param vo * @param model @@ -521,50 +519,50 @@ LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); - + boardVO.setFrstRegisterId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + BoardMasterVO bmvo = new BoardMasterVO(); BoardVO bdvo = new BoardVO(); - + vo.setBbsId(boardVO.getBbsId()); - + bmvo.setBbsId(boardVO.getBbsId()); bmvo.setUniqId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + if (isAuthenticated) { bmvo = egovBBSMasterService.selectBBSMasterInf(bmvo); bdvo = egovArticleService.selectArticleDetail(boardVO); } - + //---------------------------- - // 기본 BBS template 지정 + // 기본 BBS template 지정 //---------------------------- if (bmvo.getTmplatCours() == null || bmvo.getTmplatCours().equals("")) { bmvo.setTmplatCours("/css/egovframework/com/cop/tpl/egovBaseTemplate.css"); } - - //익명 등록글인 경우 수정 불가 + + //익명 등록글인 경우 수정 불가 if(bdvo.getNtcrId().equals("anonymous")){ model.addAttribute("result", bdvo); model.addAttribute("boardMasterVO", bmvo); return "egovframework/com/cop/bbs/EgovArticleDetail"; } - + model.addAttribute("articleVO", bdvo); model.addAttribute("boardMasterVO", bmvo); - + if(boardVO.getBlogAt().equals("chkBlog")){ return "egovframework/com/cop/bbs/EgovArticleBlogUpdt"; }else{ return "egovframework/com/cop/bbs/EgovArticleUpdt"; } - + } /** * 게시물에 대한 내용을 수정한다. - * + * * @param boardVO * @param board * @param model @@ -577,11 +575,11 @@ LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); - + if(!isAuthenticated) { //KISA 보안취약점 조치 (2018-12-10, 이정은) return "egovframework/com/uat/uia/EgovLoginUsr"; } - + //-------------------------------------------------------------------------------------------- // @ XSS 대응 권한체크 체크 START // param1 : 사용자고유ID(uniqId,esntlId) @@ -589,38 +587,38 @@ LOGGER.debug("@ XSS 권한체크 START ----------------------------------------------"); //step1 DB에서 해당 게시물의 uniqId 조회 BoardVO vo = egovArticleService.selectArticleDetail(boardVO); - + //step2 EgovXssChecker 공통모듈을 이용한 권한체크 - EgovXssChecker.checkerUserXss(multiRequest, vo.getFrstRegisterId()); + EgovXssChecker.checkerUserXss(multiRequest, vo.getFrstRegisterId()); LOGGER.debug("@ XSS 권한체크 END ------------------------------------------------"); //-------------------------------------------------------- // @ XSS 대응 권한체크 체크 END //-------------------------------------------------------------------------------------------- - + String atchFileId = boardVO.getAtchFileId(); - + beanValidator.validate(board, bindingResult); if (bindingResult.hasErrors()) { - + boardVO.setFrstRegisterId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + BoardMasterVO bmvo = new BoardMasterVO(); BoardVO bdvo = new BoardVO(); - + bmvo.setBbsId(boardVO.getBbsId()); bmvo.setUniqId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + bmvo = egovBBSMasterService.selectBBSMasterInf(bmvo); bdvo = egovArticleService.selectArticleDetail(boardVO); - + model.addAttribute("articleVO", bdvo); model.addAttribute("boardMasterVO", bmvo); - + return "egovframework/com/cop/bbs/EgovArticleUpdt"; } - + if (isAuthenticated) { - + //final Map<String, MultipartFile> files = multiRequest.getFileMap(); final List<MultipartFile> files = multiRequest.getFiles("file_1"); if (!files.isEmpty()) { @@ -636,23 +634,23 @@ // fileMngService.updateFileInfs(_result); } } - + board.setLastUpdusrId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + board.setNtcrNm(""); // dummy 오류 수정 (익명이 아닌 경우 validator 처리를 위해 dummy로 지정됨) board.setPassword(""); // dummy 오류 수정 (익명이 아닌 경우 validator 처리를 위해 dummy로 지정됨) - + board.setNttCn(unscript(board.getNttCn())); // XSS 방지 - + egovArticleService.updateArticle(board); } - + return "forward:/cop/bbs/selectArticleList.do"; } /** * 게시물에 대한 내용을 삭제한다. - * + * * @param boardVO * @param board * @param model @@ -662,10 +660,10 @@ @RequestMapping("/cop/bbs/deleteArticle.do") public String deleteBoardArticle(HttpServletRequest request, @ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("board") Board board, @ModelAttribute("bdMstr") BoardMaster bdMstr, ModelMap model) throws Exception { - + LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); - + //-------------------------------------------------------------------------------------------- // @ XSS 대응 권한체크 체크 START // param1 : 사용자고유ID(uniqId,esntlId) @@ -673,38 +671,38 @@ LOGGER.debug("@ XSS 권한체크 START ----------------------------------------------"); //step1 DB에서 해당 게시물의 uniqId 조회 BoardVO vo = egovArticleService.selectArticleDetail(boardVO); - + //step2 EgovXssChecker 공통모듈을 이용한 권한체크 - EgovXssChecker.checkerUserXss(request, vo.getFrstRegisterId()); + EgovXssChecker.checkerUserXss(request, vo.getFrstRegisterId()); LOGGER.debug("@ XSS 권한체크 END ------------------------------------------------"); //-------------------------------------------------------- // @ XSS 대응 권한체크 체크 END //-------------------------------------------------------------------------------------------- - + BoardVO bdvo = egovArticleService.selectArticleDetail(boardVO); - //익명 등록글인 경우 수정 불가 + //익명 등록글인 경우 수정 불가 if(bdvo.getNtcrId().equals("anonymous")){ model.addAttribute("result", bdvo); model.addAttribute("boardMasterVO", bdMstr); return "egovframework/com/cop/bbs/EgovArticleDetail"; } - + if (isAuthenticated) { board.setLastUpdusrId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + egovArticleService.deleteArticle(board); } - + if(boardVO.getBlogAt().equals("chkBlog")){ return "forward:/cop/bbs/selectArticleBlogList.do"; }else{ return "forward:/cop/bbs/selectArticleList.do"; } } - + /** * 방명록에 대한 목록을 조회한다. - * + * * @param boardVO * @param sessionVO * @param model @@ -716,60 +714,60 @@ LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); - + if(!isAuthenticated) { //KISA 보안취약점 조치 (2018-12-10, 이정은) return "egovframework/com/uat/uia/EgovLoginUsr"; } - + // 수정 및 삭제 기능 제어를 위한 처리 model.addAttribute("sessionUniqId", (user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + BoardVO vo = new BoardVO(); - + vo.setBbsId(boardVO.getBbsId()); vo.setBbsNm(boardVO.getBbsNm()); vo.setNtcrNm((user == null || user.getName() == null) ? "" : user.getName()); vo.setNtcrId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + BoardMasterVO masterVo = new BoardMasterVO(); - + masterVo.setBbsId(vo.getBbsId()); masterVo.setUniqId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + BoardMasterVO mstrVO = egovBBSMasterService.selectBBSMasterInf(masterVo); - + vo.setPageIndex(boardVO.getPageIndex()); vo.setPageUnit(propertyService.getInt("pageUnit")); vo.setPageSize(propertyService.getInt("pageSize")); - + PaginationInfo paginationInfo = new PaginationInfo(); paginationInfo.setCurrentPageNo(vo.getPageIndex()); paginationInfo.setRecordCountPerPage(vo.getPageUnit()); paginationInfo.setPageSize(vo.getPageSize()); - + vo.setFirstIndex(paginationInfo.getFirstRecordIndex()); vo.setLastIndex(paginationInfo.getLastRecordIndex()); vo.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - + Map<String, Object> map = egovArticleService.selectGuestArticleList(vo); int totCnt = Integer.parseInt((String)map.get("resultCnt")); - + paginationInfo.setTotalRecordCount(totCnt); - + model.addAttribute("user", user); model.addAttribute("resultList", map.get("resultList")); model.addAttribute("resultCnt", map.get("resultCnt")); model.addAttribute("boardMasterVO", mstrVO); model.addAttribute("articleVO", vo); model.addAttribute("paginationInfo", paginationInfo); - + return "egovframework/com/cop/bbs/EgovGuestArticleList"; } - - + + /** * 방명록에 대한 내용을 등록한다. - * + * * @param boardVO * @param board * @param sessionVO @@ -783,72 +781,72 @@ LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); - + if(!isAuthenticated) { //KISA 보안취약점 조치 (2018-12-10, 이정은) return "egovframework/com/uat/uia/EgovLoginUsr"; } - + beanValidator.validate(board, bindingResult); if (bindingResult.hasErrors()) { - + BoardVO vo = new BoardVO(); - + vo.setBbsId(boardVO.getBbsId()); vo.setBbsNm(boardVO.getBbsNm()); vo.setNtcrNm(user == null ? "" : EgovStringUtil.isNullToString(user.getName())); vo.setNtcrId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + BoardMasterVO masterVo = new BoardMasterVO(); - + masterVo.setBbsId(vo.getBbsId()); masterVo.setUniqId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + BoardMasterVO mstrVO = egovBBSMasterService.selectBBSMasterInf(masterVo); - + vo.setPageUnit(propertyService.getInt("pageUnit")); vo.setPageSize(propertyService.getInt("pageSize")); - + PaginationInfo paginationInfo = new PaginationInfo(); paginationInfo.setCurrentPageNo(vo.getPageIndex()); paginationInfo.setRecordCountPerPage(vo.getPageUnit()); paginationInfo.setPageSize(vo.getPageSize()); - + vo.setFirstIndex(paginationInfo.getFirstRecordIndex()); vo.setLastIndex(paginationInfo.getLastRecordIndex()); vo.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - + Map<String, Object> map = egovArticleService.selectGuestArticleList(vo); int totCnt = Integer.parseInt((String)map.get("resultCnt")); - + paginationInfo.setTotalRecordCount(totCnt); - + model.addAttribute("resultList", map.get("resultList")); model.addAttribute("resultCnt", map.get("resultCnt")); model.addAttribute("boardMasterVO", mstrVO); - model.addAttribute("articleVO", vo); + model.addAttribute("articleVO", vo); model.addAttribute("paginationInfo", paginationInfo); - + return "egovframework/com/cop/bbs/EgovGuestArticleList"; - + } - + if (isAuthenticated) { board.setFrstRegisterId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + egovArticleService.insertArticle(board); - + boardVO.setNttCn(""); boardVO.setPassword(""); boardVO.setNtcrId(""); boardVO.setNttId(0); } - + return "forward:/cop/bbs/selectGuestArticleList.do"; } - + /** * 방명록에 대한 내용을 삭제한다. - * + * * @param boardVO * @param sessionVO * @param model @@ -860,17 +858,17 @@ @SuppressWarnings("unused") LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); - + if (isAuthenticated) { egovArticleService.deleteArticle(boardVO); } - + return "forward:/cop/bbs/selectGuestArticleList.do"; } - + /** * 방명록 수정을 위한 특정 내용을 조회한다. - * + * * @param boardVO * @param sessionVO * @param model @@ -883,48 +881,48 @@ LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); - + if(!isAuthenticated) { //KISA 보안취약점 조치 (2018-12-10, 이정은) return "egovframework/com/uat/uia/EgovLoginUsr"; } - + // 수정 및 삭제 기능 제어를 위한 처리 model.addAttribute("sessionUniqId", (user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + BoardVO vo = egovArticleService.selectArticleDetail(boardVO); - + boardVO.setBbsId(boardVO.getBbsId()); boardVO.setBbsNm(boardVO.getBbsNm()); boardVO.setNtcrNm((user == null || user.getName() == null) ? "" : user.getName()); - + boardVO.setPageUnit(propertyService.getInt("pageUnit")); boardVO.setPageSize(propertyService.getInt("pageSize")); - + PaginationInfo paginationInfo = new PaginationInfo(); paginationInfo.setCurrentPageNo(boardVO.getPageIndex()); paginationInfo.setRecordCountPerPage(boardVO.getPageUnit()); paginationInfo.setPageSize(boardVO.getPageSize()); - + boardVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); boardVO.setLastIndex(paginationInfo.getLastRecordIndex()); boardVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - + Map<String, Object> map = egovArticleService.selectGuestArticleList(boardVO); int totCnt = Integer.parseInt((String)map.get("resultCnt")); - + paginationInfo.setTotalRecordCount(totCnt); - + model.addAttribute("resultList", map.get("resultList")); model.addAttribute("resultCnt", map.get("resultCnt")); model.addAttribute("articleVO", vo); model.addAttribute("paginationInfo", paginationInfo); - + return "egovframework/com/cop/bbs/EgovGuestArticleList"; } - + /** * 방명록을 수정하고 게시판 메인페이지를 조회한다. - * + * * @param boardVO * @param sessionVO * @param model @@ -938,54 +936,54 @@ //BBST02, BBST04 LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); - + if(!isAuthenticated) { //KISA 보안취약점 조치 (2018-12-10, 이정은) return "egovframework/com/uat/uia/EgovLoginUsr"; } - + beanValidator.validate(board, bindingResult); if (bindingResult.hasErrors()) { - + BoardVO vo = new BoardVO(); - + vo.setBbsId(boardVO.getBbsId()); vo.setBbsNm(boardVO.getBbsNm()); vo.setNtcrNm((user == null || user.getName() == null) ? "" : user.getName()); vo.setNtcrId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + BoardMasterVO masterVo = new BoardMasterVO(); - + masterVo.setBbsId(vo.getBbsId()); masterVo.setUniqId((user == null || user.getUniqId() == null) ? "" : user.getUniqId()); - + BoardMasterVO mstrVO = egovBBSMasterService.selectBBSMasterInf(masterVo); - + vo.setPageUnit(propertyService.getInt("pageUnit")); vo.setPageSize(propertyService.getInt("pageSize")); - + PaginationInfo paginationInfo = new PaginationInfo(); paginationInfo.setCurrentPageNo(vo.getPageIndex()); paginationInfo.setRecordCountPerPage(vo.getPageUnit()); paginationInfo.setPageSize(vo.getPageSize()); - + vo.setFirstIndex(paginationInfo.getFirstRecordIndex()); vo.setLastIndex(paginationInfo.getLastRecordIndex()); vo.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - + Map<String, Object> map = egovArticleService.selectGuestArticleList(vo); int totCnt = Integer.parseInt((String)map.get("resultCnt")); - + paginationInfo.setTotalRecordCount(totCnt); - + model.addAttribute("resultList", map.get("resultList")); model.addAttribute("resultCnt", map.get("resultCnt")); model.addAttribute("boardMasterVO", mstrVO); model.addAttribute("articleVO", vo); model.addAttribute("paginationInfo", paginationInfo); - + return "egovframework/com/cop/bbs/EgovGuestArticleList"; } - + if (isAuthenticated) { egovArticleService.updateArticle(board); boardVO.setNttCn(""); @@ -993,13 +991,13 @@ boardVO.setNtcrId(""); boardVO.setNttId(0); } - + return "forward:/cop/bbs/selectGuestArticleList.do"; } - + /** * 템플릿에 대한 미리보기용 게시물 목록을 조회한다. - * + * * @param boardVO * @param sessionVO * @param model @@ -1009,29 +1007,29 @@ @RequestMapping("/cop/bbs/previewBoardList.do") public String previewBoardArticles(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model) throws Exception { //LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); - + String template = boardVO.getSearchWrd(); // 템플릿 URL - + BoardMasterVO master = new BoardMasterVO(); - + master.setBbsNm("미리보기 게시판"); - + boardVO.setPageUnit(propertyService.getInt("pageUnit")); boardVO.setPageSize(propertyService.getInt("pageSize")); - + PaginationInfo paginationInfo = new PaginationInfo(); - + paginationInfo.setCurrentPageNo(boardVO.getPageIndex()); paginationInfo.setRecordCountPerPage(boardVO.getPageUnit()); paginationInfo.setPageSize(boardVO.getPageSize()); - + boardVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); boardVO.setLastIndex(paginationInfo.getLastRecordIndex()); boardVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - + BoardVO target = null; List<BoardVO> list = new ArrayList<BoardVO>(); - + target = new BoardVO(); target.setNttSj("게시판 기능 설명"); target.setFrstRegisterId("ID"); @@ -1042,9 +1040,9 @@ target.setReplyAt("N"); target.setReplyLc("0"); target.setUseAt("Y"); - + list.add(target); - + target = new BoardVO(); target.setNttSj("게시판 부가 기능 설명"); target.setFrstRegisterId("ID"); @@ -1055,29 +1053,29 @@ target.setReplyAt("N"); target.setReplyLc("0"); target.setUseAt("Y"); - + list.add(target); - + boardVO.setSearchWrd(""); - + int totCnt = list.size(); - + //공지사항 추출 List<BoardVO> noticeList = egovArticleService.selectNoticeArticleList(boardVO); - + paginationInfo.setTotalRecordCount(totCnt); - + master.setTmplatCours(template); - + model.addAttribute("resultList", list); model.addAttribute("resultCnt", Integer.toString(totCnt)); model.addAttribute("articleVO", boardVO); model.addAttribute("boardMasterVO", master); model.addAttribute("paginationInfo", paginationInfo); model.addAttribute("noticeList", noticeList); - + model.addAttribute("preview", "true"); - + return "egovframework/com/cop/bbs/EgovArticleList"; } } Index: base3.10/src/main/webapp/css/user/common.css =================================================================== --- base3.10/src/main/webapp/css/user/common.css (nonexistent) +++ base3.10/src/main/webapp/css/user/common.css (revision 34) @@ -0,0 +1,416 @@ +@charset "UTF-8"; + +/*본문바로가기*/ +.skip a { position:absolute; background:rgba(0,0,0,0.7); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#90000000,endColorstr=#90000000); width:100%; height:40px; text-align:center; font-size:0.9em; color:#fff; z-index:100; line-height:40px; top:-40px; opacity:0; } +.inner { width:1400px; margin:0 auto; } + +/*header*/ +.header { width:100%; height:115px; z-index:99; color:#333; background:rgba(255,255,255,0.8); border-bottom:1px solid #ededed; box-shadow:0 0 15px 0 rgba(0,0,0,0.08); padding:20px 0; } +.header .inner { position:relative; height:100%; } +.header h1 { text-transform:uppercase; font-weight:900; position:absolute; top:50%; left:50%; transform:translate(-50%, -70%); } +.header h1 a { width:300px; height:16px; display:inline-block; background:url(/images/user/logo.svg) 50% 50% no-repeat; background-size:contain; } +.header h1 a img { display:none; } +.header ul { display:flex; } +.header ul li { } +.header ul li a { color:#777; font-size:0.9em; position:relative;transition:all 0.3s; } +.header ul li a:hover { color:#333; } +.header ul li a::before { content:''; width:0; height:1px; background:#333; display:inline-block; transition:all 0.3s; position:absolute; bottom:0; left:50%; transform:translateX(-50%); } +.header ul li a:hover::before { width:100%; } +.header ul li::after { content:''; width:2px; height:2px; background:#333; display:inline-block; border-radius:5px; margin:0 13px 3px; } +.header ul li:last-child::after { display:none; } +.header_list { width:100%; display:flex; justify-content:space-between; } +.header .header_bottom { float:right; margin-top:15px; display:flex; } +.header .info { border:1px solid #ccc; padding:3px 15px; height:32px; border-radius:100px; font-size:0.9em; color:#333; margin-right:5px; transition:all 0.3s;} +.header .info:hover { background:#333; color:#fff; border:1px solid #0916b2; } +.header .total_search { border:1px solid #ccc; width:32px; height:32px; border-radius:50px !important; font-size:1.1em; transition:all 0.3s; } +.header .total_search:hover { border:1px solid #333; } + +/*main container*/ +.main_container { width:100%; height:100%; } +.main_container .header { position:absolute; top:0; left:0; background:transparent; color:#fff; transition:background 0.5s; border-bottom:1px solid rgba(255,255,255,.2); box-shadow:none; } +.main_container .header h1 a { background:url(/images/user/logo_fff.svg) 50% 50% no-repeat; background-size:contain; } +.main_container .header ul li a { color:#fff; } +.main_container .header ul li::after { background:#fff;} +.main_container .header .info { color:#fff; border:1px solid #fff;} +.main_container .header:hover { background-color:rgba(255,255,255,1); backdrop-filter:blur(10px); } +.main_container .header:hover h1 a { background:url(/images/user/logo.svg) 50% 50% no-repeat; background-size:contain; } +.main_container .header:hover ul li a { color:#727272; } +.main_container .header:hover ul li a:hover { color:#333; } +.main_container .header:hover ul li::after { background:#333;} +.main_container .header:hover .info { color:#333; border:1px solid #333;} +.main_container .header .info:hover { background:#333; color:#fff; border:1px solid #333; } +.main_container .header .total_search { background:transparent; color:#fff; } +.main_container .header:hover .total_search { border:1px solid #333; color:#333;} +.main_container .header:hover .total_search:hover { background:#333; color:#fff; } + +/*main top slide*/ +.main_slide { width:100%; height:100vh; } +.main_slide .swiper-slide { width:100%; height:100vh; color:#fff; position:relative; } +.main_slide .swiper-slide .inner { position:relative; z-index:1; } +.main_slide .swiper-slide .bg_box { position:absolute; top:0; left:0; width:100%; height:100%; background-position:50% 50%; background-repeat:no-repeat; background-size:cover; z-index:0; } +.main_slide .swiper-pagination { bottom:5em; animation: fadeup 0.5s cubic-bezier(0.215, 0.610, 0.355, 1.000) both; animation-delay:1.2s; } +.main_slide .swiper-pagination span { background: #fff; opacity:0.5; border:1px solid #333; width:10px; height:10px; } +.main_slide .swiper-pagination .swiper-pagination-bullet-active { width:80px; border-radius:50px; opacity:1;} +.main_slide .inner { height:100%; display: flex; flex-direction:column; align-items:center; justify-content:center; } +.main_slide .swiper-slide em { display:block; font-size:1.3em; text-transform: capitalize; font-weight:900;} +.main_slide .swiper-slide strong {display:block; margin:40px 0; font-size:2.3em;} +.main_slide .swiper-slide p {display:block; text-align:center; font-size:1.3em; line-height:1.8em; margin-bottom:40px; } +.main_slide .swiper-slide button { padding:13px 40px; border-radius:50px; font-weight:600;transition:background 0.3s !important; } +.main_slide .swiper-slide button:hover { background:#1524cc; color:#fff; } +.main_slide .swiper-slide-active em { animation:textshow 1.5s cubic-bezier(0.215, 0.610, 0.355, 1.000) both; } +.main_slide .swiper-slide-active strong {animation:textup 1s ease-in-out both; animation-delay: .3s;} +.main_slide .swiper-slide-active p {animation:textup 1s ease-in-out both;animation-delay: .6s;} +.main_slide .swiper-slide-active button { animation:textup 1s ease-in-out both; animation-delay: .9s; } +.main_slide .slide_wrap { width:100%; height:100%; } +.main_slide .swiper-wrapper { width:100%; height:100%; } +.main_slide .swiper-slide { width:100%; height:100%; } +.swiper-button-prev, .swiper-button-next { color:#fff; } + +@-webkit-keyframes textup { + 0% { opacity:0; } 100% { opacity:1; } +} + +@keyframes textshow { + 0% { letter-spacing:1em; opacity:0; } + 40% { opacity:0.6; } + 100% { letter-spacing:0; opacity:1; } +} + +/*main content*/ +.main_content { position:relative; z-index:9; } +.main_content > .bg_box { position:absolute; bottom:0; background-size:contain; width:100%; height:50%; z-index:-1; } +.main_content h2 { font-size:2em; text-transform:capitalize; font-weight:900; line-height:1.6em; letter-spacing:-1px; } +.main_wrap { margin-top:0; } +.main_content .title_wrap { display: flex; align-items: center; justify-content: space-between; margin-bottom:40px; } +.main_content .title_wrap .showmore { color:#1524cc; font-weight:900; border:none; padding:0; font-size:1.1em; display: flex; align-items: center; background:none; } +.main_content .title_wrap .showmore span { margin-left:5px; margin-top:5px; font-size:0.7em; display:inline-block; transition:all 0.3s;} +.main_content .title_wrap .showmore:hover span { transform:translateX(10px); } + +/*article*/ +.article_list ul { width:calc(100% + 80px); display: flex; flex-wrap:wrap; margin:0 -40px; } +.article_list ul li { width:calc(33.333% - 80px); margin:40px; } +.article_list ul li .bg_box { width:100%; height:0; padding-bottom:60%; margin-bottom:30px; border-radius:15px; display:block; transition:box-shadow 0.5s, transform 0.5s;} +.article_list ul li .bg_box:hover { box-shadow:0 0 30px 0 rgba(34,86,203,0.5); transform:scale(1.01); } +.article_list ul li .category { color:#052c9b; font-weight:900; margin:0 0 15px; display: block; } +.article_list ul li .title { width:100%; display:block; font-size:1.2em; font-weight:600; margin-bottom:20px; } +.article_list ul li .by { color:#727272; } +.article_list ul li .text { margin-top:15px; } +.article_list ul li .text a { -webkit-line-clamp:3; } +.article_list ul li.on { opacity:0.3 ;} +.article_list ul li .time { color:#727272; background:url(/images/user/icon_time.svg) 0% 50% no-repeat; background-size:15px 15px; padding-left:20px; } +a.writer { padding:0 4px; line-height:1.5em; color:#000; position:relative; border:1px solid #333; border-radius:4px; font-size:0.9em; margin-right:5px; transition:all 0.3s; } +a.writer:hover { background:#052c9b; color:#fff; border:1px solid #052c9b; } + +/* hot click */ +.hotClick { background:#fff; z-index:9; width:100%; position:relative; padding:40px; box-shadow:0 0 40px 0 rgba(1,7,144,0.2); border-radius:15px; } +.hotClick .title_wrap { margin-bottom:20px; } +.hotClick .title_wrap h2 { animation:fadeup 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) both; animation-delay:1.2s;} +.hotClick ol { display:flex; flex-wrap:wrap; margin:-3px; } +.hotClick ol li { margin:3px; } +.hotClick ol li a { padding:7px 16px; font-weight:600; font-size:1em; border:2px solid #0916b2; border-radius:50px; color:#0916b2; transition:all 0.3s; display: inline-block;box-shadow:0 0 10px 0 rgba(9,22,178,0.2); } +.hotClick ol li a:hover { background:#0916b2; color:#fff; box-shadow:0 0 15px 0 rgba(9,22,178,0.5); } +.hotClick ol li a::before { content:'#'; } + +/* banner */ +.banner.main_wrap { } +.banner ul { display: flex; justify-content: space-between; } +.banner ul li { width:calc(50% - 30px); } +.banner ul li a { width:100%; color:#fff; font-size:1.8em; line-height:1.4em; font-weight:600; display:block; border-radius:15px; position:relative;} +.banner ul li a .bg_box { padding:1.5em; height:170px; border-radius:15px; } +.banner ul li a > img { position:absolute; right:1em; z-index:3; } +.banner ul li:nth-child(1) img { bottom:-1em; } +.banner ul li:nth-child(2) img { bottom:-1em; } + +/* news */ +.notice.main_wrap { margin-bottom:120px; } +.news_slide { width:100%; padding-bottom:150px; } +.news_slide .swiper-slide { width:calc(25% - 30px); } +.news_slide .swiper-slide a { width:100%; display:block; font-weight:600; font-size:1.2em; line-height: 1.6em; margin-bottom:30px; } +.news_slide .swiper-slide em { color:#727272; } +.news_slide .swiper-button-prev, .news_slide .swiper-button-next { top:auto; bottom:5px; color:#333; } +.news_slide .swiper-button-prev::after, .news_slide .swiper-button-next::after { font-size:1.2em; } +.news_slide .swiper-button-prev { transform:translateX(-200%); left:auto; } +.news_slide .swiper-button-next { } +.news_slide .swiper-pagination-progressbar { top:auto; bottom:80px; height:2px; background:#ddd; width:1400px; } +.news_slide .swiper-pagination-progressbar .swiper-pagination-progressbar-fill { background:#333; } + +/* footer */ +.footer { width:100%; padding:50px 0; background:#fafafa; } +.footer_content { display:flex; justify-content:space-between; } +.footer_left { width:calc(100% - 250px); } +.footer_logo { display: flex; align-items: center; border-bottom:1px solid #ddd; margin-bottom:20px; padding-bottom:20px; } +.footer_logo a { text-transform:uppercase; font-weight:900; margin-right:15px; } +.footer_logo a img { height:15px; } +.footer_logo a:last-child img { height:31px; } +.footer_text { color:#727272; font-size:0.9em; line-height:1.7em; } +.footer_text strong { margin-bottom:5px; display: block; color:#333; } + +/* skip top */ +.skip_top { width:60px; height:60px; border-radius:100px; background:#0032c3; position:relative;float:right;border:none; transform: translateY(-80px); overflow:hidden;z-index:9; } +.skip_top::before { content:''; width:14px; height:2px; background:#fff; display:inline-block; position:absolute; top:-15px; left:50%; transform: translateX(-50%); pointer-events:none;} +.skip_top:hover::before { top:20px; transition:all 0.8s; } +.skip_top::after { content:''; width:14px; height:15px; background:url(/images/user/skip_top.svg) 50% 50% no-repeat; background-size:contain;position:absolute; display:inline-block; top:50%; left:50%; transform: translate(-50%, -50%); pointer-events: none; } +.skip_top:hover::after { animation:skip 1s both ease-in-out;} +.skip_top:hover { box-shadow: 0 0 30px 0 rgb(34 86 203 / 80%); border:1px solid #001d70; } + +@keyframes skip { from { opacity:0; transform: translate(-50%, -50%); } 20% { opacity:0; transform: translate(-50%, 250%); } 50% { opacity:1; transform: translate(-50%, -50%); } to { transform: translate(-50%, -50%); } } + +/* sns */ +.sns { margin-top:43px; } +.sns ul { display:flex; } +.sns li { width:30px; height:30px; overflow:hidden; margin-left:15px; transition:transform 0.3s; background-image:url(/images/user/sns_logo.svg); background-size:180px 60px !important; background-repeat:no-repeat;} +.sns li:hover { transform:scale(1.1);} +.sns li a { width:100%; height:100%; text-indent:-5000px; display: inline-block; } +.sns .insta { background-position: 0 100%; } +.sns .facebook { background-position:20% 100%; } +.sns .naver { background-position:40% 100%; } +.sns .youtube { background-position:60% 100%; } +.sns .rss { background-position:80% 100%; } +.sns .insta:hover { background-position:0 0%; } +.sns .facebook:hover { background-position:20% 0%; } +.sns .naver:hover { background-position:40% 0%; } +.sns .youtube:hover { background-position:60% 0%; } +.sns .rss:hover { background-position:80% 0%; } + + +.share button { width:30px; height:30px; border:none; transition:transform 0.3s; margin-left:10px; } +.share button:hover { transform:scale(1.1);} +.share .btn_print { background-image:url(/images/user/icon_print.svg); background-position:50% 100%; background-repeat:no-repeat; background-size:60px 60px; } +.share .btn_print:hover { background-position:50% 0%; } +.share .twitter, .share .facebook { background-image:url(/images/user/sns_logo.svg); background-size:180px 60px !important; background-repeat:no-repeat; } +.share .twitter { background-position:100% 100%; } +.share .twitter:hover { background-position:100% 0%; } +.share .facebook { background-position:20% 100%; } +.share .facebook:hover { background-position:20% 0%; } + + +/*******************************************************************************************************************************************/ +/*************************************************************** subpage ***************************************************************/ +/*******************************************************************************************************************************************/ + +.sub_container { margin-bottom:100px; } +.sub_title_top { display:flex; justify-content: space-between; padding:20px 0; } + +/* breadcrumb */ +.breadcrumb { } +.breadcrumb ul { display:flex; justify-content:flex-start; } +.breadcrumb li { display:flex; align-items:center; font-size:0.9em; } +.breadcrumb li a { color:#777;line-height: 1.4em; } +.breadcrumb li img { width:8px; height:8px; } +.breadcrumb li.next { margin:0 10px; opacity:0.6; font-size:0.6em; margin-top:2px; } +.breadcrumb li:last-child strong { color:#333; font-weight:900; max-width:150px; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; } + +/* sub_title */ +.sub_title { text-align:center; margin:20px 0 70px; } +.sub_title .title { margin-top:20px; } +.sub_title em { color:#727272; font-size:1em; font-weight:900; text-transform:capitalize; } +.sub_title h2 { font-size:2.4em; font-weight:900; margin-bottom:20px; } + +/*bg img type sub title*/ +.sub_title.visual_type { padding:20px 0 80px; margin:0 0 70px; position:relative; } +.sub_title.visual_type em { color:#ccc; } +.sub_title.visual_type em img { display:inline-block; margin:20px 0 80px; height:12px; } /*ablout 로고 이미지*/ +.sub_title.visual_type h2 { color:#fff; } +.sub_title.visual_type .breadcrumb li:last-child strong, .sub_title.visual_type .breadcrumb li a, .sub_title.visual_type .breadcrumb li.next { color:#fff; } +.sub_title.visual_type .breadcrumb li { opacity:0.6; } +.sub_title.visual_type .breadcrumb li:last-child { opacity:1; } +.sub_title.visual_type .breadcrumb li a:hover { color:#fff !important; } +.sub_title.visual_type .breadcrumb li a::after { background:#fff; } +.sub_title.visual_type .inner { position:relative; z-index:1; } +.sub_title.visual_type::after { content:''; display:block; width:100%; height:100%; background:rgba(0,0,0,0.5); -webkit-backdrop-filter: saturate(180%) blur(15px); + backdrop-filter: saturate(180%) blur(15px); position:absolute; top:0; left:0;} + +/*작가정보 type*/ +.sub_title.gray_type { background:#f4f4f4; margin:0 0 70px; padding-bottom:70px; } +.sub_title.gray_type h2 { margin-top:30px; display:block; } +.sub_title.gray_type .title { display:flex; justify-content:center; margin-top:0; flex-direction:column; align-items: center; } +.sub_title.gray_type .writer_info { flex-direction:row; width:auto; } +.sub_title.gray_type .writer_info .writer_pic { margin-bottom:0; } +.sub_title.gray_type .writer_info .writer_text { margin-left:30px; text-align:left; } +.sub_title.gray_type .writer_info .writer_text strong { display:inline-block; } +.sub_title.gray_type .writer_info .writer_text em { display:block; } +.sub_title.gray_type .title strong { padding:5px 15px; border:1px solid #333; border-radius:50px; display:inline-block; font-weight:900; font-size:1.2em; margin-top:10px; } + +/*게시판 하단*/ +.bottom_wrap { display:flex; padding-top:50px; } +.bottom_wrap.center { justify-content: center; } +.bottom_wrap.between { justify-content:space-between; } +.bottom_wrap.right { justify-content:flex-end; } + +/*article detail view*/ +.article_header { text-align:center; } +.article_header strong { font-size:1.3em; display:block; } +.article_header strong a { color:#0032c3; text-transform:capitalize; font-weight:900; } +.article_header h2 { font-size:2.4em; font-weight:900; margin:30px 0; } +.article_header em { font-weight:400; display:block;} +.article_header .header_img { width:100%; margin-top:50px; } +.article_header .header_img img { width:100%; } + +/*기사컨텐츠*/ +.article_view { position:relative; display:flex; flex-direction:row-reverse; justify-content:space-between; padding:50px 0; } +.writer_info { width:200px; display:flex; flex-direction:column; align-items:center; } +.writer_info .writer_pic { width:130px; height:130px; border-radius:130px; margin-bottom:30px; overflow:hidden; box-shadow:5px 5px 15px 0 rgba(0,0,0,0.5); } +.writer_info strong { font-size:1.8em; } +.writer_info em { color:#727272; font-weight:500; margin-top:10px; } +.writer_info button { margin-top:20px; } + +/*기사내용*/ +.article_content { width:calc(100% - 300px); font-size:1.2em; line-height:2em; } +.article_content .share { margin-top:50px; } +.article_content figcaption { font-size:0.8em; line-height:1.6em; } + +.related { background:#222; margin:70px 0 -100px; padding:100px 0; position:relative; text-align:center; } +.related h2 { color:#fff; margin-bottom:50px; font-size:2em; font-weight:900; text-align:left; } +.related ul { width:calc(100% + 80px); display: flex; flex-wrap:wrap; margin:-40px; text-align:left; } +.related ul li { width:calc(25% - 80px); margin:40px; } +.related ul li .bg_box { width:100%; height:0; padding-bottom:60%; margin-bottom:30px; border-radius:15px; display:block; transition:box-shadow 0.5s;} +.related ul li .bg_box:hover { box-shadow:0 0 30px 0 rgba(0,0,0,0.8); } +.related ul li .category { color:#ff6a30; font-weight:900; margin:0 0 10px; display: block; } +.related ul li .title { width:100%; display:block; color:#fff; font-size:1.2em; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } +.related ul li.on { opacity:0.3 ;} +.related .btn_list { position:absolute; top:-40px; text-transform:uppercase; width:80px; height:80px; border:1px solid #222; border-radius:100px; box-shadow:5px 5px 10px 0 rgba(0,0,0,0.6); transition:all 0.3s; font-weight:900;} +.related .btn_list:hover { box-shadow:0 0 20px 0 rgba(0,0,0,0.8); } + +.article_wrap { padding:40px 0; display:inline-block; } +.article_wrap:last-child { margin-bottom:0; } +.article_wrap .title_wrap { position:relative; margin-bottom:0;} +.article_wrap .title_wrap .title { padding-right:20px; background:#fff; position:relative; z-index:1; display:inline-block;} +.article_wrap .title_wrap .category { font-size:2em; font-weight:900; display:inline-block; color:#0032c3; padding-bottom:2px;} +.article_wrap .title_wrap::after { width:100%; height:1px; background:#ddd; content:''; display:block; position:absolute; top:13px; left:0; z-index:0; } + +.move { width:100%; height:60px; display:flex; align-items:center; justify-content:center; margin-bottom:50px;} +.move .swiper-wrapper { display:flex; width:1400px; } +.move .swiper-slide { width:auto; height:100%; } +.move .swiper-slide:last-child { margin-right:0; } +.move .swiper-slide.active a { color:#0032c3; } +.move .swiper-slide a { font-weight:900; font-size:1.3em; line-height:60px; transition:all 0.3s; position:relative; } +.move .swiper-slide a:hover { color:#0032c3; } +.move .swiper-slide a::after { content:''; width:0; height:1px; background:#0032c3; display:inline-block; transition:all 0.3s; position:absolute; bottom:0; left:50%; transform:translateX(-50%); } +.move .swiper-slide a:hover::after { width:100%; } +.move.fix { border-bottom:1px solid #222; position:fixed; top:0; left:0; background:rgba(0,0,0,0.8); -webkit-backdrop-filter: saturate(180%) blur(15px); + backdrop-filter: saturate(180%) blur(15px); box-shadow:0 5px 5px 0 rgba(0,0,0,0.1); z-index:9; margin-bottom:0; transition:background 0.3s; } +.move.fix .swiper-slide a { color:#999; } +.move.fix .swiper-slide a:hover { color:#0032c3; } +.move.fix .swiper-slide.active a { color:#fff; } +.move.fix .swiper-slide.active a::after { background:#fff; } +.move.fix .swiper-slide a:hover { color:#fff; } +.move.fix .swiper-slide a::after { background:#fff; } +.fixed-menu { margin-top:-30px; } +.fixed-menu.fix .article_list { padding-top:110px; } + + + + + +/*add dot*/ +.dot li::after, .dot > div::after { width:3px; height:3px; border-radius:3px; display:inline-block; content:''; background:#666; margin:0 15px 5px; } +.dot li:last-child::after, .dot > div:last-child::after { display:none; } + +/*tab*/ +.wrap-tab-container { width:100%; } + +.wrap-tab-list { display:flex; justify-content:center; align-items:center; margin-bottom:50px; } +.wrap-tab-list li { } +.wrap-tab-list li::after { width:3px; height:3px; border-radius:3px; display:inline-block; content:''; background:#666; margin:0 15px 5px; } +.wrap-tab-list li:last-child::after { display:none; } +.wrap-tab-list button { border:none; background:none; padding:0; font-size:1.2em; font-weight:600; border-radius:0; transition:0.3s; position:relative; } +.wrap-tab-list button::after { width:0; height:1px; background:#333; content:''; display:inline-block; position:absolute; bottom:0; left:50%; transform:translateX(-50%); transition:all 0.3s; } +.wrap-tab-list li.active button::after { width:100%; } +.wrap-tab-list button:hover::after { width:100% } + +/*tab 내용이 두개일 경우*/ +.round_tab { display:flex; justify-content:center; align-items:center; } +.round_tab .wrap-tab-list { padding:3px; border-radius:50px; border:1px solid #dbdbdb; box-shadow:inset 0 0 8px -1px rgb(0 0 0 / 20%); } +.round_tab .wrap-tab-list li::after, .round_tab .wrap-tab-list button::after { display:none; } +.round_tab .wrap-tab-list li { display:inline-block; } +.round_tab .wrap-tab-list li button { padding:8px 40px; border-radius:50px; } +.round_tab .wrap-tab-list li:last-child button { } +.round_tab .wrap-tab-list li.active button { background:#0032c3; color:#fff; } + +.wrap-tab-contents { width:100%; } + +/*toggle*/ +.toggle { border-top:2px solid #333; } +.toggle > li { border-bottom:1px solid #ededed; } +.toggle_tit a { padding:35px 25px; display:block; font-size:1.5em; font-weight:900; position:relative; transition:all 0.5s;} +.toggle_tit a:hover { background:#e5e5e5; } +.toggle_tit a::after, .toggle_tit a::before { content:''; display:block; width:15px; height:2px; background:#333; position:absolute; right:25px; top:50%; transform:translateY(-50%) rotate(0deg); transition:all 0.3s; } +.toggle_tit a::before { transform:translateY(-50%) rotate(90deg); } +.toggle_tit.active a::before { transform:translateY(-50%) rotate(0deg); } +.toggle_tit.active a { background:#f4f4f4; font-size:2.2em; padding:35px 25px 0 30px; } +.toggle_box { display:none; background:#f4f4f4; padding:30px; } + +/*Archive*/ +/*년도별*/ +.list_year ul { display:flex; flex-wrap:wrap; margin:-15px; } +.list_year li { width:calc(16.6666% - 30px); margin:15px; background:#fff; text-align:center; box-shadow:10px 10px 20px 0 rgba(0,0,0,0.1); transition:all 0.5s; border-radius:10px;} +.list_year li:hover { box-shadow:10px 10px 30px 0 rgba(0,0,0,0.3); } +.list_year li a { width:100%; height:100%; display: block; padding:20px; position:relative; } +.list_year li .cover { width:100%; padding-bottom:8em;border-radius:5px; } +.list_year li .text { margin-top:20px; } +.list_year li strong { display:block; font-size:1.1em; font-weight:600; } +.list_year li p { display:inline-block; font-size:0.9em; font-weight:400; padding:0px 10px; border-radius:50px; background:#0032c3; color:#fff; margin:10px 0;} +.list_year li em { display:block; font-size:0.8em; color:#727272; letter-spacing:1px; } +/*주제별*/ +.list_topic ul { display:flex; flex-wrap: wrap; margin:-10px; } +.list_topic li { margin:10px; width:calc(33.333% - 20px); } +.list_topic li a { font-size:1.6em; font-weight:900; transition:all 0.3s; padding:40px 0 40px 30px; border:1px solid #dfdfdf; display:block; border-radius:15px; box-shadow:5px 5px 20px 0 rgba(0,0,0,0.2); position:relative; background:#fff; } +.list_topic li a span { font-size:0.6em; position:absolute; top:50%; right:30px; transform:translateY(-50%); transition:all 0.3s; } +.list_topic li a:hover { background:#0032c3; color:#fff; border:1px solid #0032c3; box-shadow:0 0 20px 0 rgba(0,0,0,0.5); } +.list_topic li a:hover span { transform:translate(10px, -50%); } + +/*about*/ +.content_wrap { margin-bottom:100px; padding:0 70px;} +.content_wrap h3 { font-size:2.4em; font-weight:900; margin-bottom:50px; transform:translateY(100%); opacity:0; transition:all 0.5s; } +.content_wrap h3.visible { opacity:1; transform: translateY(0); } +.about_text { padding-top:20px; font-size:1.2em; margin-bottom:10px; line-height:1.8em; display:flex; } +.about_text .logo { width:40%; display: flex; justify-content: center; align-items: center; background:#f4f4f4; } +.about_text img { height:50px; } +.about_text .text { padding-left:70px; width:calc(60% - 70px); } +.about_text .text p { margin-bottom:15px; } +.about_text .text p:last-child { margin-bottom:0; } + +.about_container { background:#fff; position:relative; z-index:2; } +.about_container p { } + +/*연혁*/ +.history { background:#f4f4f4; padding:100px 0; } +.history h3 { text-align:center; } +.history ul { position:relative; padding:30px 0; } +.history ul::after { width:3px; height:100%; content:''; display:inline-block; background:#0032c3; position:absolute; top:0; left:50%; transform:translateX(-50%); z-index:1; } +.history ul li { width:100%; position:relative; padding:0 calc(50% + 50px) 0 0; text-align:right; margin:30px 0; z-index:3; transform: translateY(50%); opacity:0; transition:all 0.3s; } +.history ul li.visible { opacity:1; transform: translateY(0); } +.history ul li:nth-child(2n) { padding:0 0 0 calc(50% + 50px); text-align:left; } +.history ul li::after { width:10px; height:10px; content:''; display:inline-block; border:3px solid #0032c3; border-radius:50px; background:#fff; position:absolute; top:5px; left:50%; transform: translateX(-50%); } +.history .date { color:#0032c3; font-weight:900; letter-spacing:-1px; font-size:1.8em; display:block; margin-bottom:15px; } +.history .date::after { } +.history ul li p { font-size:1.1em; } + +/*편집인*/ +.editor_info ul { display:flex; flex-wrap:wrap; margin:0 -30px; } +.editor_info ul li { width:calc(50% - 60px); display:flex; justify-content:flex-start; align-items:center; margin:50px 30px; transform:translateY(50%); opacity:0; transition:all 0.5s;} +.editor_info ul li.visible { opacity:1; transform: translateY(0); } +.editor_info ul li strong { font-size:1.5em; font-weight:600; display:block; margin-bottom:20px; } +.editor_info ul li p { display:flex; flex-direction:column; font-size:1.1em; line-height:1.8em; } +.editor_info ul li p em::before { content:''; display:inline-block; width:4px; height:4px; background:#333; border-radius:4px; margin:0 10px 4px 0; } +.editor_pic { width:200px; height:200px; border-radius:200px; margin-right:30px; } + +/*지도*/ +.about_map { background:#f4f4f4; margin-bottom:-100px; padding:100px; } +.about_map .inner { padding:0 70px; } +.office_box { margin-bottom:50px; transform:translateY(50%); opacity:0; transition:all 0.5s; } +.office_box.visible { opacity:1; transform: translateY(0); } +.office_box:last-child { margin-bottom:0; } +.office { width:100%; display:flex; justify-content:space-between; border:1px solid #f1f1f1; background:#fff; transition:box-shadow 0.3s; } +.office:hover { border:1px solid #ddd; box-shadow:0 0 40px 0 rgba(0,0,0,0.2); } +.office_map { width:50%; height:400px; } +.office_map .map { width:100%; height:100%; } +.office_text { width:50%; padding:50px; } +.office_text strong { font-size:1.5em; display:inline-block; border-radius:50px; padding:8px 15px; margin-bottom:20px; color:#fff; background:#0032c3; } +.office_text p { font-size:1.1em; } +.office_text dl { display:flex; justify-content:space-between; flex-wrap:wrap; margin-top:15px; } +.office_text dl dt { width:50px; font-weight:600; padding:3px 0; } +.office_text dl dd { width:calc(100% - 50px); padding:3px 0; } + +#mapP { background:url(/images/user/map1.jpg) 50% 50% no-repeat; } +#mapS { background:url(/images/user/map2.jpg) 50% 50% no-repeat; } \ No newline at end of file Property changes on: base3.10/src/main/webapp/css/user/common.css ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/css/user/popup.css =================================================================== --- base3.10/src/main/webapp/css/user/popup.css (nonexistent) +++ base3.10/src/main/webapp/css/user/popup.css (revision 34) @@ -0,0 +1,43 @@ +@charset "UTF-8"; +/* CSS Document */ + +.wrap-layer-popup { display:none; align-items:center; justify-content:center; position:fixed; z-index:991;left:0; top:0; width:100%; height:100%; } +.wrap-layer-popup.popup-open { display: flex;} +.wrap-layer-popup.popup-open > .inner-layer-popup { animation:innerPpopup 0.3s both; } +.wrap-layer-popup.prev-popup { z-index: 989;} +.wrap-layer-popup > .inner-layer-popup { position:relative; display:flex; flex-wrap:wrap; align-content:stretch; width:400px; max-height:100%; height:auto; opacity:0; border-radius:20px; overflow:hidden; } +.wrap-layer-popup .wrap-layer-popup-title { width:100%; padding:1em 2em; background:#fff;} +.wrap-layer-popup .wrap-layer-popup-title h1 { margin:0; font-size:18px; font-weight:700; line-height:30px;} + +@keyframes innerPpopup { from { opacity:0; transform:translateY(-30%) } to { opacity:1; transform:translateY(0px); } } + +.wrap-layer-popup .layer-popup-contents { position:relative; width:100%; max-height:calc(100% - 50px); overflow-y:auto; background:#fff; padding:1em 2em 2em;} +.wrap-layer-popup .layer-popup-bottom { display:flex; border-top:1px solid #ededed; width:100%; padding:10px; background:#fff; } +.popup-dimmed { position: fixed; z-index: 990; left: 0; top: 0; width: 100%; height: 100%; background-color:rgba(0,0,0,.5); backdrop-filter:blur(10px); transition: opacity .2s;} +.scroll-lock { overflow: hidden;} +.wrapper { width: 900px; margin: 0 auto;} +.hidden { position:relative; z-index:-1; display:inline-block; overflow:hidden; height:1px; width:1px; border:0; clip:rect(1px,1px,1px,1px); clip-path:inset(50%); word-break:initial; word-wrap: initial;} + +.btn-layer-close { position: absolute; right:18px; top:20px; width: 26px; height: 26px; padding: 0; border: 0; background: transparent; border-radius:0;transform:rotate(0deg);} +.btn-layer-close::before, .btn-layer-close::after { position: absolute; content: ''; top:50%; left:50%; width: 20px; height: 1px; background: #999; transition:all 0.3s;} +.btn-layer-close::before { transform:translate(-50%, -50%) rotate(45deg); } +.btn-layer-close::after { transform: translate(-50%, -50%) rotate(-45deg); } + +.btn-layer-close:hover { transform:rotate(90deg);transition:all 0.3s;} +.btn-layer-close:hover::before, .btn-layer-close:hover::after { background:#000; } + +/*로그인*/ +.login li { width:100%; margin-bottom:7px; } +.login li:last-child { margin-bottom:0; } + + +/*통합검색*/ +.wrap-layer-popup.search_popup { align-items:flex-start; } +.wrap-layer-popup.search_popup > .inner-layer-popup { width:100%; border-radius:0; } +.int_search { display:block; width:100%; } +.int_search .inner { width:1000px; padding:30px 0; } +.int_search .search_wrap { border-bottom:2px solid #333; position:relative; } +.int_search .search_wrap .inputText { height:60px; float:left; width:calc(100% - 60px); border:none; border-radius:0; font-size:1.5em; font-weight:600; } +.int_search .search_wrap .inputText:hover { box-shadow:none; } +.int_search .search_wrap .btn_search { width:60px; height:60px; border-radius:0 !important; border:none; font-size:2em; color:#727272; transition:all 0.3s; } +.int_search .search_wrap .btn_search:hover { box-shadow:none; color:#333; } \ No newline at end of file Property changes on: base3.10/src/main/webapp/css/user/popup.css ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/css/user/font.css =================================================================== --- base3.10/src/main/webapp/css/user/font.css (nonexistent) +++ base3.10/src/main/webapp/css/user/font.css (revision 34) @@ -0,0 +1,65 @@ +@charset "UTF-8"; +/* CSS Document */ + +/*font*/ +@font-face{font-family:notoSans;src:url(/fonts/NotoSansKR-Thin.woff);font-style:normal;font-weight:100;} +@font-face{font-family:notoSans;src:url(/fonts/NotoSansKR-Light.woff);font-style:normal;font-weight:300;} +@font-face{font-family:notoSans;src:url(/fonts/NotoSansKR-Regular.woff);font-style:normal;font-weight:400;} +@font-face{font-family:notoSans;src:url(/fonts/NotoSansKR-Medium.woff);font-style:normal;font-weight:500;} +@font-face{font-family:notoSans;src:url(/fonts/NotoSansKR-Bold.woff);font-style:normal;font-weight:700;} +@font-face{font-family:notoSans;src:url(/fonts/NotoSansKR-Black.woff);font-style:normal;font-weight:900;} + +@font-face { + font-family: 'icomoon'; + src: url('/fonts/icomoon.eot?jsc8cs'); + src: url('/fonts/icomoon.eot?jsc8cs#iefix') format('embedded-opentype'), + url('/fonts/icomoon.ttf?jsc8cs') format('truetype'), + url('/fonts/icomoon.woff?jsc8cs') format('woff'), + url('/fonts/icomoon.svg?jsc8cs#icomoon') format('svg'); + font-weight: normal; + font-style: normal; + font-display: block; +} + +[class^="icon-"], [class*=" icon-"] { + /* use !important to prevent issues with browser extensions that change fonts */ + font-family: 'icomoon' !important; + speak: never; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-blank:before { + content: "\e906"; +} +.icon-close:before { + content: "\e908"; +} +.icon-search:before { + content: "\e909"; +} +.icon-arrow-dl:before { + content: "\e900"; +} +.icon-arrow-dr:before { + content: "\e901"; +} +.icon-arrow-l:before { + content: "\e902"; +} +.icon-arrow-r:before { + content: "\e903"; +} +.icon-arrow-t:before { + content: "\e904"; +} +.icon-arrow-b:before { + content: "\e905"; +} \ No newline at end of file Property changes on: base3.10/src/main/webapp/css/user/font.css ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/css/user/style.css =================================================================== --- base3.10/src/main/webapp/css/user/style.css (nonexistent) +++ base3.10/src/main/webapp/css/user/style.css (revision 34) @@ -0,0 +1,1061 @@ +@charset "UTF-8"; +/* CSS Document */ + +/* css reset */ +html, body { margin:0; width:100%; min-width:280px; padding:0; font-family:'notoSans', sans-serif; font-weight:400; font-size:14px; color:#000; line-height:1.7em; overflow-x:hidden; -webkit-overflow-scrolling:touch; scroll-behavior:smooth; box-sizing:border-box;position:relative; background:#fff; } +html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin:0; padding:0; border:0; vertical-align:baseline;} +a:link, a:hover, a:visited { text-decoration:none;} +h1, h2, h3, h4, h5, h6 { font-weight:normal;} +ol, ul { list-style:none;} +article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display:block;} +blockquote, q { quotes:none;} +blockquote:before, blockquote:after, q:before, q:after { content:none; } +em { font-style:normal; } +table { border-spacing:0; word-break:break-all; } +a, a:hover { color:#3c3c3c; } +a:hover { } +hr { border:none; border-top:1px dashed #ccc; height:0px; } +* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; word-break:break-all; } +*:focus { /*outline:2px dashed #007dc3;*/ } +/*table title, form title 숨기기*/ +legend, caption, .hidden, .blind { position:absolute; left:-9999em; width:1px;height:1px;margin:0;padding:0;background:none;font-size:0;line-height:0;text-indent:-9999em } +.vh { visibility:hidden; } +input[type='hidden'] { visibility:hidden; } +::selection { background:#666; color:#FFF; text-shadow:none;} + +.bg_box { background-repeat:no-repeat; background-size:cover; background-position: 50% 50%; overflow:hidden; } +.bg_box img { display:none; } + +.relative { position:relative; } +.vertical_m { position:relative; top:50%; transform:translateY(-50%);} +.autoY { overflow-y:auto !important; } +.autoX { overflow-x:auto !important; } +.pointer { cursor:pointer;} + +.square { height:0; padding-bottom:99.13% !important; } + +.flex_start { display: -webkit-box; display: -webkit-flex; display: -moz-box; display: -ms-flexbox; display:flex; justify-content:flex-start; align-items: center; } +.flex_between { display: -webkit-box; display: -webkit-flex; display: -moz-box; display: -ms-flexbox; display:flex; justify-content:space-between; align-items: center; } +.column { flex-direction:column; } + +.blockUI.blockMsg.blockPage img { display:none; } +.blockUI.blockMsg.blockPage { opacity:1 !important; } + +/*border 속성****************************************************************************************************************************************/ +.bd0 { border:none !important; } +.bt0 { border-top:none !important; } +.bb0 { border-bottom:none !important; } +.bl0 { border-left:none !important; } +.br0 { border-right:none !important; } + +/*데코 속성****************************************************************************************************************************************/ +/*텍스트 데코*/ +.underline { text-decoration:underline; } +.bold { font-weight:600; } +.narrow { letter-spacing:-1px; } +.ellipsis {overflow:hidden; text-overflow:ellipsis; white-space:nowrap;word-wrap:break-word;} +.textover { text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:normal; word-wrap:break-word; display:-webkit-box !important; -webkit-line-clamp:2; -webkit-box-orient: vertical; } +/* .must .board_label::after, .must .tit::after, em.must::after { content:'*'; display:inline-block; margin-left:5px; color:#e21818; } */ + +.must .board_label b, .must .tit b, em.must b { display:inline-block; margin-left:5px; color:#e21818; } + +.must_text { color:#333; margin-top:15px; font-size:0.9em; word-break:break-word; } +.must_text em { margin-right:5px; font-size:1em; color:#d70000; font-weight:900; } +.must_wrap { display: -webkit-box; display: -webkit-flex; display: -moz-box; display: -ms-flexbox; display:flex; justify-content:flex-end; margin-bottom:15px; } +.must_wrap .must_text { margin-top:0; } + +.ls_narrow { letter-spacing:-1px; } +.blank, .blank_w { display:inline-block; transition:all 0.3s; height:auto;} +.blank::after, .blank_w::after { content: ''; margin-left:10px; display:inline-block; width:13px; height:13px; transform:translateY(2px); transition:all 0.3s; } +.blank::after { background:url(../../images/custom/icon_blank.svg) 50% 50% no-repeat; background-size:contain;} +.blank_w::after { background:url(../../images/custom/icon_blank_w.svg) 50% 50% no-repeat; background-size:contain; } + +a.link { transition:all 0.3s; position:relative; } +a.link:hover { color:#0032c3 !important; } +a.link::after { content:''; width:0; height:1px; background:#0032c3; display:inline-block; transition:all 0.3s; position:absolute; bottom:0; left:50%; transform:translateX(-50%); } +a.link:hover::after { width:100%; } + + +/*색상속성****************************************************************************************************************************************/ +/*font color*/ +.color_orange { color:#e47916 !important; } +.color_lightgreen {color:#71bd3e !important; } +.color_black { color:#3c3c3c !important; } +.color_deepblue { color:#317fa4 !important; } +.color_purple { color:#d26bca !important; } +.color_gray { color:#888 !important; } +.color_lightgray { color:#ccc !important; } +.color_blue { color:#055c9a !important; } +.color_red { color:#990000 !important; } +.color_navy { color:#133467 !important; } +.color_white { color:#fff !important; } + +/*그라데이션*/ +.orange { background:rgb(232,75,96); background: -moz-linear-gradient(90deg, rgba(232,75,96,1) 0%, rgba(254,206,168,1) 100%); background: -webkit-linear-gradient(90deg, rgba(232,75,96,1) 0%, rgba(254,206,168,1) 100%); background: linear-gradient(90deg, rgba(232,75,96,1) 0%, rgba(254,206,168,1) 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#e84b60",endColorstr="#fecea8",GradientType=1); } +.purple { background:rgb(181,14,147); background: -moz-linear-gradient(90deg, rgba(181,14,147,1) 0%, rgba(232,137,178,1) 100%); background: -webkit-linear-gradient(90deg, rgba(181,14,147,1) 0%, rgba(232,137,178,1) 100%); background: linear-gradient(90deg, rgba(181,14,147,1) 0%, rgba(232,137,178,1) 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#b50e93",endColorstr="#e889b2",GradientType=1); } + +/*button****************************************************************************************************************************************/ +/* button */ +button { cursor:pointer; border:1px solid #ddd; background-color:#fff; color:#333; border-radius:5px; transition:border .2s ease-in-out, box-shadow .2s ease-in-out; font-family:'notoSans', sans-serif; box-shadow:none; } +button:disabled { background:#f1f1f1; } +button:disabled:hover { box-shadow:none; border-color:#ddd; } +.btn_full { width:100%; height:60px; font-size:15px; font-weight:600; transition:all .2s ease-in-out;} +.btn_round { border-radius:100px; padding:0 50px;transition:all .2s ease-in-out; } +.disabled { cursor:not-allowed; background:#ededed; } + +.btn_sq_s { width:20px; height:20px; border:1px solid #bbb; transition:border .2s ease-in-out, box-shadow .2s ease-in-out;} +.btn_sq_m { width:32px; height:32px; border:1px solid #bbb; transition:border .2s ease-in-out, box-shadow .2s ease-in-out;} +.btn_sq_l { width:40px; height:40px; border:1px solid #bbb; transition:border .2s ease-in-out, box-shadow .2s ease-in-out;} + +a.btn_sq_s { width:20px; height:20px; border:1px solid #bbb; transition:border .2s ease-in-out, box-shadow .2s ease-in-out;border-radius:3px;cursor:pointer; display:inline-block;} +a.btn_sq_m { width:32px; height:32px; border:1px solid #bbb; transition:border .2s ease-in-out, box-shadow .2s ease-in-out;border-radius:3px;cursor:pointer; display:inline-block;} +a.btn_sq_l { width:40px; height:40px; border:1px solid #bbb; transition:border .2s ease-in-out, box-shadow .2s ease-in-out;border-radius:3px;cursor:pointer; display:inline-block;} + +.btn_img { background-size:40% !important;background-repeat:no-repeat!important; background-position:50% 50%!important;transition:border .2s ease-in-out, box-shadow .2s ease-in-out; } +.btn_img img { display:none; } +.btn_circleSS { width:20px; height:20px; border-radius:20px; transition:border .2s ease-in-out, box-shadow .2s ease-in-out;} +.btn_circleS { width:30px; height:30px; border-radius:30px; transition:border .2s ease-in-out, box-shadow .2s ease-in-out; } +.btn_circleM { width:40px; height:40px; border-radius:40px; transition:border .2s ease-in-out, box-shadow .2s ease-in-out; } +.btn_circleL { width:50px; height:50px; border-radius:50px; transition:border .2s ease-in-out, box-shadow .2s ease-in-out; } + +.btn_ss { font-size:0.9em; text-align:center; padding:0 10px; height:27px; border-radius:3px;transition:border .2s ease-in-out, box-shadow .2s ease-in-out;} +.btn_s { font-size:1em; text-align:center; padding:0 15px; height:32px; letter-spacing:-.5px;transition:border .2s ease-in-out, box-shadow .2s ease-in-out;} +.btn_m { font-size:1em; text-align:center; padding:0 20px; height:45px;transition:border .2s ease-in-out, box-shadow .2s ease-in-out; } +.btn_l { text-align:center; height:50px; padding:0 50px; font-weight:600; transition:border .2s ease-in-out, box-shadow .2s ease-in-out;} + +.btn_delete { background:url(../../images/custom/icon_trash.svg) 50% 50% no-repeat #fff; background-size:12px; text-indent:-5000px; display:inline-block; transition:background 0s;} +.btn_delete:hover { background:url(../../images/custom/icon_trash_on.svg) 50% 50% no-repeat #fff; background-size:12px; } +.btn_delete.noline { border:none; } +.btn_delete.noline:hover { box-shadow:none !important; opacity:1; } +.btn_plus { background:url(../../images/custom/icon_plus.svg) 50% 50% no-repeat #fff; background-size:50%; text-indent:-5000px;display:inline-block; } +.btn_plus:hover { border-color:#666; } +.btn_update { background:url(../../images/custom/icon_update.svg) 50% 50% no-repeat #fff; background-size:15px; text-indent:-5000px;display:inline-block; } +.btn_update:hover { border-color:#666; background:url(../../images/custom/icon_update_on.svg) 50% 50% no-repeat #fff; background-size:15px; } +.btn_wrap .btn_delete { margin-left:0px; } + +.btn_arrow::after { width:10px; height:10px; background:url(/images/custom/arrow_right.svg) 50% 50% no-repeat; background-size:10px 10px; content:''; margin-left:10px; display:inline-block; } + +/*파일다운*/ +.btn_filedown { width:24px; height:24px; display:inline-block; border:1px solid #bbb; border-radius:3px; text-indent:-5000px; background:url(../../images/custom/icon_filedown.svg) 50% 50% no-repeat; background-size:15px !important; transition:all .2s, background 0s; } +.btn_filedown:hover { box-shadow:0 0 5px 0 rgba(0,0,0,0.3); border-color:#666; background:url(../../images/custom/icon_filedown_on.svg) 50% 50% no-repeat; background-size:15px !important;} + +a.btn_s , a.btn_m, a.btn_l { border-radius:5px; } +a.btn_s { padding:2px 10px; font-size:0.9em; } +a.btn_m { padding:5px 10px; } +a.btn_l { padding:10px 50px; } + +.btn_m:hover, .btn_l:hover, .btn_full:hover, .btn_round:hover, .btn_circleM:hover, .btn_circleL:hover { box-shadow:0 0 10px 0 rgba(0,0,0,0.3); } +.btn_ss:hover, .btn_s:hover, .btn_sq_s:hover, .btn_sq_m:hover, .btn_img:hover, .btn_circleSS:hover, .btn_circleS:hover { box-shadow:0 0 5px 0 rgba(0,0,0,0.3); border-color:#666; } + +.clickmore { padding:3px 10px; font-size:0.9em; border-radius:50px; color:#007dc3; border:1px solid #007dc3; } + +/*닫기버튼*/ +.btn_close { width:100%; height:100%; cursor:pointer; z-index:99; border:none; display:inline-block; } +.btn_close:hover { transform:rotate(90deg); transition:all 0.3s; } + +.btn_toggle { width:32px; height:32px; display:block; position:relative; } +.btn_toggle::before, .btn_toggle::after { content:''; position:absolute; top:50%; left:50%; width:50%; height:2px; background:#333; display:inline-block; transition:all 0.3s;} +.btn_toggle::before { transform: translate(-50%,-50%) rotate(90deg); } +.btn_toggle::after { transform: translate(-50%,-50%) rotate(0deg); } +.btn_toggle.active::before { transform:translate(-50%,-50%) rotate(0deg); } +.btn_toggle.active::after { transform:translate(-50%,-50%) rotate(0deg); } + +.btn_arrow_down::after { content:''; width:10px; height:10px; transition:all 0.3s; display:inline-block; margin-left:15px; background:url(../../images/custom/arrow_down.svg) 50% 50% no-repeat; background-size:contain; } +.btn_arrow_down.active { border:1px solid #666; box-shadow:0 0 10px 0 rgba(0,0,0,.3); } +.btn_arrow_down.active::after { transform:rotate(180deg); } + +/* bgcolor */ +.bg_gray {background-color:#f4f5f7 !important;} /* 결제대기 */ +.bg_lightgray {background-color:#f8f8f8 !important;} +.bg_white {background-color:#fff !important; color:#333; border:1px solid #ccc;} +.bg_white:hover { border:1px solid #666; } +.bg_navy { background:#143b84; color:#fff; border-color:#0d3071; transition:all 0.3s; } +.bg_navy:hover { background-color:#032b54 !important; } +.bg_blue { background:#1524cc; color:#fff; border-color:#0016b1; transition:all 0.3s; } +.bg_blue:hover { background-color:#0016b1 !important; } + +.bg_basic { border:1px solid #ccc; background:none; color:#333; } +.bg_basic:hover { border-color:#666; } + +.line_blue { border:1px solid #1265cc; color:#1265cc; } +.line_blue:hover { background:#1265cc; color:#fff; } + +.line_white { background:transparent; border:1px solid #fff; color:#fff; } +.line_white:hover { background:#fff; color:#333; } + +.bg_line { background:transparent; border:1px solid #333; } +.bg_line:hover { background-color:#fff; } + +/*정렬속성****************************************************************************************************************************************/ +.alignL {text-align:left !important;} +.alignC {text-align:center !important;} +.alignR {text-align:right !important;} + +.verticalT { vertical-align:top !important;} +.verticalM { vertical-align:middle !important;} +.verticalB { vertical-align:bottom !important;} + +.fl {float:left !important;} +.fr {float:right !important;} +.fn {float:none !important;} +.clear {clear:both !important;} +.clear::after { clear:both; display:block; content:''; } +.inline { display:inline-block !important; } +.block { display:block !important; } +.none { display:none; } +.width_center{ margin:0 auto;} + +/*input 디자인****************************************************************************************************************************************/ +.inputText, .selectText, .textArea { font-family: 'notoSans', sans-serif; z-index:1; height:45px; color:#333; font-weight:400; border:1px solid #ccc; box-sizing:border-box;padding:10px; border-radius:5px; display:inline-block; box-shadow:none; -webkit-appearance: none; transition:0.3s ease-in-out;} /* 익스 9부터 적용가능, 아이폰 둥근 모서리 설정빼기 */ +.textArea { padding:15px; resize:none; } +label { cursor:pointer; } +.inputText[readonly], .selectText[readonly], .textArea[readonly], +.inputText[disabled], .selectText[disabled], .textArea[disabled]{ background:#f9f9f9; border-color:#e4e4e4; } +.inputText::placeholder { color:#999; } +.inputText[readonly]:hover, .selectText[readonly]:hover, .textArea[readonly]:hover, +.inputText[disabled]:hover, .selectText[disabled]:hover, .textArea[disabled]:hover { border:1px solid #e4e4e4; box-shadow:none; } +.inputText:hover, .selectText:hover, .textArea:hover, .textArea:focus, .inputFile:hover { box-shadow:0 0 10px 0 rgba(0,0,0,0.2); border-color:#999; } + +.file_up { display: -webkit-box; display: -webkit-flex; display: -moz-box; display: -ms-flexbox; display:flex; flex-direction:column; } +.file_up input[type="file"] { position: absolute; width:110px; height:45px; padding:0; margin:0; border:0; z-index:0; } +.file_up label, .file_up .inputFile {border:1px solid #ccc; padding:10px; background:#fff; border-radius:5px; position:relative; z-index:1; box-shadow:none; display:inline-block; transition:0.3s ease-in-out; } +.file_up label:hover, .file_up .inputFile:hover { box-shadow:0 0 5px 0 rgba(0,0,0,0.3); border-color:#666; } +.file_up label::after, .file_up .inputFile::after { width:13px; height:13px; content:''; transform: translateY(1px); display:inline-block; background:url(../../images/custom/icon_fileup.svg) 50% 50% no-repeat #fff; margin-left:10px; background-size:contain;} + + +/* .file_list_wrap { } +.file_list_wrap.show { } +.file_list_wrap .space5 { display:none; } */ +.file_list { margin:5px -2.5px 0; display:inline-block; display: -webkit-box; display: -webkit-flex; display: -moz-box; display: -ms-flexbox; display:flex; align-items:flex-start; flex-direction:column; flex-direction:row; flex-wrap:wrap; } +.file_list li:first-child { } +.file_list li { margin:2.5px; } +.board_view .file_list { margin-top:0; } + +/*일반파일*/ +.file_list .file_wrap { display: -webkit-box; display: -webkit-flex; display: -moz-box; display: -ms-flexbox; display:flex; width:auto; align-items:center; padding:5px 7px 5px 7px; border:1px solid #ccc; border-radius:5px; background:#fff; transition:border .2s ease-in-out, box-shadow .2s ease-in-out;} +.file_list .file_wrap:hover { box-shadow:0 0 10px 0 rgba(0,0,0,0.1); border-color:#666; } +.file_list .file_wrap p { display:inline-block; min-width:100px; max-width:300px; font-size:0.9em; letter-spacint:-0.5em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding-right:20px; position:relative; } +.file_list .file_wrap p::after { width:1px; height:15px; content:''; display:inline-block; background:#ccc; position:absolute; top:5px; right:6px; } +.file_list .file_wrap .btn_sq_s { width:24px; height:27px; display:inline-block; } +.file_list .file_wrap .btn_ss { padding:0 4px; } +.file_list .file_wrap .btn_ss:hover { color:#007dc3; } +.file_list .file_wrap .btn_ss, .file_list .btn_sq_s { height:25px; border-radius:2px; border-color:transparent; display:inline-block;} +.file_list .file_wrap .btn_sq_s:hover, .file_list .file_wrap .btn_s:hover, .file_list .file_wrap .btn_ss:hover { border-color:transparent; box-shadow:none; } + + +.file_img .file_wrap::before, +.file_ppt .file_wrap::before, +.file_pdf .file_wrap::before, +.file_word .file_wrap::before, +.file_reg .file_wrap::before, +.file_excel .file_wrap::before, +.file_zip .file_wrap::before, +.file_hwp .file_wrap::before { content:''; width:15px; height:15px; display:inline-block; margin-right:5px; } + +.file_img .file_wrap::before { background:url(../../images/custom/file_img.svg) 50% 50% no-repeat; background-size:contain; } +.file_ppt .file_wrap::before { background:url(../../images/custom/file_ppt.svg) 50% 50% no-repeat; background-size:contain; } +.file_pdf .file_wrap::before { background:url(../../images/custom/file_pdf.svg) 50% 50% no-repeat; background-size:contain; } +.file_word .file_wrap::before { background:url(../../images/custom/file_word.svg) 50% 50% no-repeat; background-size:contain; } +.file_reg .file_wrap::before { background:url(../../images/custom/file_reg.svg) 50% 50% no-repeat; background-size:contain; } +.file_excel .file_wrap::before { background:url(../../images/custom/file_excel.svg) 50% 50% no-repeat; background-size:contain; } +.file_zip .file_wrap::before { background:url(../../images/custom/file_zip.svg) 50% 50% no-repeat; background-size:contain; } +.file_hwp .file_wrap::before { background:url(../../images/custom/file_hwp.svg) 50% 50% no-repeat; background-size:contain; } + +/*업로드파일이 이미지일 경우*/ +.file_img { display: -webkit-box; display: -webkit-flex; display: -moz-box; display: -ms-flexbox; display:flex; justify-content:flex-start; } +.file_img li { width:80px;height:80px; background-size:cover !important; position:relative; overflow:hidden; margin:10px 10px 0 0; border-radius:10px; border:1px solid #eaeaea; transition:border .2s ease-in-out, box-shadow .2s ease-in-out; } +.file_img li:last-child { margin-right:0; } +.file_img li:hover { box-shadow:0 0 10px 0 rgba(0,0,0,0.1);} +.file_img li .btn { width:100%; position:absolute; text-align:center; z-index:1; bottom:-100%; right:0; padding:5px 0; background:#fff; line-height:1em;transition:bottom .1s ease-in-out; } +.file_img li:hover .btn { bottom:0; } +.file_img li .btn .btn_sq_s { width:24px; height:24px; border-color:transparent; margin:0 2px; } +.file_img li .btn .btn_sq_s:hover { box-shadow:none; } +.file_img li::after { position:absolute; top:0; left:0; pointer-events:none; content:''; background:#333; display:block; width:100%; height:100%; opacity:0; z-index:0; transition:opacity .1s ease-in-out;} +.file_img li:hover::after { opacity:0.5; } +.file_img li img { width:100%; height:auto; position:absolute; top:50%; left:50%; transform:translate(-50%, -50%); pointer-events:none; } + + +/*select 디자인****************************************************************************************************************************************/ +select { padding-left:5px; padding-right:25px !important; background:url(../../images/custom/arrow_down.svg) calc(100% - 10px) 50% no-repeat #fff; background-size:10px; cursor:pointer;transition:all .5s ease-in-out; overflow:hidden !important; text-overflow: ellipsis; white-space:nowrap; + -webkit-appearance: none;/* 화살표 없애기 for chrome */ -moz-appearance: none; /* 화살표 없애기 for firefox */ appearance: none;/* 화살표 없애기 공통 */ } +select::-ms-expand { display: none;/* 화살표 없애기 for firefox */} + +/*scrollbar 디자인****************************************************************************************************************************************/ +::-webkit-scrollbar {width: 8px; height: 8px; } +::-webkit-scrollbar-track {background: transparent; } +::-webkit-scrollbar-thumb {height: 50px; width: 50px; background: rgba(25,25,25,0.5); -webkit-border-radius: 8px; border-radius: 8px; } + +.overX { -ms-overflow-style:none; scrollbar-width:none; touch-action:pan-x; } +.overX::-webkit-scrollbar { display:none; } + +input[type='checkbox'] { width:18px; height:18px; opacity:1; margin:0 10px 0 0; z-index:0; position:relative; cursor:pointer; } +input[type='checkbox']::before { content:''; pointer-events:none; background:url(../../images/custom/check_on.svg) 50% 50% no-repeat #fff; background-size:contain; border:1px solid #333; width:calc(100% - 2px); height:calc(100% - 2px); display:inline-block; border-radius:2px; opacity:0; top:0; left:0; position:absolute; } +input[type='checkbox']:checked::before { opacity:1; z-index:1; } +input[type='checkbox']:checked + label { font-weight:600; } + +/* input[type='checkbox'] + label {cursor:pointer; font-size:1em; font-weight:400; color:#999; position:relative; z-index:1; } +input[type='checkbox'] + label::before { content:''; display:inline-block;width:18px;height:18px; opacity:0; vertical-align:middle;margin-right:10px; border:1px solid #999; cursor:pointer; background:#fff;margin-top:-2px; transition:all .2s ease-in-out; } +input[type='checkbox']:hover + label::before { border:1px solid #666; font-weight:500; } +input[type='checkbox']:checked + label::before { border:1px solid #333; opacity:1; z-index:1;} +input[type='checkbox']:disabled + label::before { border:1px solid #d8d8d8; background:#f1f1f1; } +input[type='checkbox'] + label::after { content:'';display:inline-block; position:absolute; transition:all .2s ease-in-out; opacity:0; } +input[type='checkbox']:checked + label::after { opacity:1; } +input[type='checkbox'] + label::before { border-radius:2px; } +input[type='checkbox'] + label::after { width:18px; height:18px;left:2px; top:3px; background:url(../../images/custom/check_on.svg) 50% 50% no-repeat; background-size:contain; } +input[type='checkbox']:checked + label, input[type='checkbox']:disabled + label { color:#000; } +input[type='checkbox']:checked + label { font-weight:500; } */ + +input[type='radio'] { width:18px; height:18px; opacity:1; margin:0 10px 0 0; z-index:1; position:relative; cursor:pointer; } +input[type='radio']::before { content:''; pointer-events:none; background:url(../../images/custom/radio_on.svg) 50% 50% no-repeat #fff; background-size:10px; width:calc(100% - 2px); height:calc(100% - 2px); border:1px solid #333; display:inline-block; border-radius:30px; opacity:0; top:0; left:0; position:absolute; } +input[type='radio']:checked::before { opacity:1; z-index:1; } +input[type='radio']:checked + label { font-weight:600; } + +/* input[type='radio'] + label {cursor:pointer; font-size:1em; font-weight:400; color:#999;position:relative; z-index:1; } +input[type='radio'] + label::before { content:''; display:inline-block;width:18px;height:18px;opacity:0;vertical-align:middle;margin-right:10px; border:1px solid #999; cursor:pointer; background:url(../../images/custom/radio_on.svg) 50% 50% no-repeat #fff; background-size:0; margin-top:-2px; transition:all .2s ease-in-out; } +input[type='radio']:hover + label::before { border:1px solid #666; font-weight:500; } +input[type='radio']:checked + label::before { border:1px solid #333; z-index:1; opacity:1;} +input[type='radio']:disabled + label::before { border:1px solid #d8d8d8; background:#f1f1f1; } +input[type='radio']:checked + label::before { background:url(../../images/custom/radio_on.svg) 50% 50% no-repeat #fff; background-size:10px; } +input[type='radio'] + label::before { border-radius:10px; } +input[type='radio']:hover + label, input[type='radio']:checked + label, input[type='radio']:disabled + label { color:#333; } +input[type='radio']:checked + label { font-weight:500; } */ + +/*가로,세로,마진,패딩 설정****************************************************************************************************************************************/ +/* 가로사이즈% (테이블 col class로 사용 필요할 경우 class 추가) */ +.widthauto { width:auto !important;} +.width5p { width:5% !important; } +.width10p { width:10% !important; } +.width12_5p { width:12.5% !important; } +.width16_3p { width:16.3% !important; } +.width16_6p { width:16.666666% !important; } +.width15p { width:15% !important; } +.width19p { width:19% !important;} +.width20p { width:20% !important; } +.width25p { width:25% !important; } +.width27p { width:27% !important; } +.width30p { width:30% !important; } +.width33p { width:33.333% !important; } +.width35p { width:35% !important; } +.width37p { width:37% !important; } +.width40p { width:40% !important; } +.width45p { width:45% !important; } +.width50p { width:50% !important; } +.width55p { width:55% !important; } +.width60p { width:60% !important; } +.width65p { width:65% !important; } +.width70p { width:70% !important; } +.width75p { width:75% !important; } +.width80p { width:80% !important; } +.width85p { width:85% !important; } +.width90p { width:90% !important; } +.width95p { width:95% !important; } +.width96p { width:96% !important; } +.width99p { width:99% !important; } +.width100p { width:100% !important; } + +.height50p { height:50% !important; } +.height55p { height:55% !important; } +.height60p { height:60% !important; } +.height65p { height:65% !important; } +.height70p { height:70% !important; } +.height75p { height:75% !important; } +.height80p { height:80% !important; } +.height85p { height:85% !important; } +.height90p { height:90% !important; } +.height95p { height:95% !important; } +.height100p { height:100% !important; } + +.h_calc270 { height:calc(100% - 270px) !important; } +.hcalc10 { height:calc(100% - 10px) !important; } +.hcalc20 { height:calc(100% - 20px) !important; } +.hcalc30 { height:calc(100% - 30px) !important; } +.hcalc40 { height:calc(100% - 40px) !important; } +.hcalc50 { height:calc(100% - 50px) !important; } +.hcalc56 { height:calc(100% - 56px) !important; } +.hcalc60 { height:calc(100% - 60px) !important; } +.hcalc100 { height:calc(100% - 100px) !important; } +.hcalc200 { height:calc(100% - 200px) !important; } + +.calc6 { width:calc(100% - 6px) !important; } +.calc10 { width:calc(100% - 10px); } +.calc20 { width:calc(100% - 20px); } +.calc30 { width:calc(100% - 30px); } +.calc35 { width:calc(100% - 35px); } +.calc40 { width:calc(100% - 40px); } +.calc50 { width:calc(100% - 50px); } +.calc55 { width:calc(100% - 55px); } +.calc56 { width:calc(100% - 56px); } +.calc57 { width:calc(100% - 57px); } +.calc58 { width:calc(100% - 58px); } +.calc59 { width:calc(100% - 59px); } +.calc60 { width:calc(100% - 60px); } +.calc61 { width:calc(100% - 61px); } +.calc62 { width:calc(100% - 62px); } +.calc63 { width:calc(100% - 63px); } +.calc64 { width:calc(100% - 64px); } +.calc65 { width:calc(100% - 65px); } +.calc66 { width:calc(100% - 66px); } +.calc67 { width:calc(100% - 67px); } +.calc68 { width:calc(100% - 68px); } +.calc68 { width:calc(100% - 69px); } +.calc68 { width:calc(100% - 68px); } +.calc70 { width:calc(100% - 70px); } +.calc80 { width:calc(100% - 80px); } +.calc84 { width:calc(100% - 84px); } +.calc85 { width:calc(100% - 85px); } +.calc88 { width:calc(100% - 88px); } +.calc90 { width:calc(100% - 90px); } +.calc100 { width:calc(100% - 100px); } +.calc105 { width:calc(100% - 105px); } +.calc108 { width:calc(100% - 108px); } +.calc110 { width:calc(100% - 110px); } +.calc118 { width:calc(100% - 118px); } +.calc119 { width:calc(100% - 119px); } +.calc120 { width:calc(100% - 120px); } +.calc122 { width:calc(100% - 122px); } +.calc130 { width:calc(100% - 130px); } +.calc135 { width:calc(100% - 135px); } +.calc140 { width:calc(100% - 140px); } +.calc142 { width:calc(100% - 142px); } +.calc143 { width:calc(100% - 143px); } +.calc144 { width:calc(100% - 144px); } +.calc146 {width: calc(100% - 146px);} +.calc150 { width:calc(100% - 150px); } +.calc160 { width:calc(100% - 160px); } +.calc165 { width:calc(100% - 165px); } +.calc178 { width:calc(100% - 178px); } +.calc192 { width:calc(100% - 192px); } +.calc195 { width:calc(100% - 195px); } +.calc200 { width:calc(100% - 200px); } +.calc203 { width:calc(100% - 203px); } +.calc204 { width:calc(100% - 204px); } +.calc210 { width:calc(100% - 210px); } +.calc216 { width:calc(100% - 216px); } +.calc230 { width:calc(100% - 230px); } +.calc250 { width:calc(100% - 250px); } +.calc260 { width:calc(100% - 260px); } +.calc264 { width:calc(100% - 264px); } +.calc300 { width:calc(100% - 300px); } +.calc310 { width:calc(100% - 310px); } +.calc100-100 { width:calc(100% - 100px); } +.calc25-5 { width:calc(25% - 8px); } +.calc25-90 { width:calc(25% - 90px); } +.calc25-100 { width:calc(25% - 100px); } +.calc25-150 { width:calc(25% - 150px); } +.calc50-130 { width:calc(50% - 130px); } +.calc30-10 { width:calc(30% - 10px) !important; } +.calc20-10 { width:calc(20% - 10px) !important; } +.calc10-10 { width:calc(10% - 10px) !important; } +.calc430 { width:calc(100% - 430px) !important; } +.calc435 { width:calc(100% - 435px) !important; } +.calc50-5 { width:calc(50% - 5px) !important; } +.calc50-3 { width:calc(50% - 3px) !important; } +.calc40-3 { width:calc(40% - 3px) !important; } +.calc50-10 { width:calc(50% - 10px) !important; } +.calc70-10 { width:calc(70% - 10px) !important; } + + +/* 가로사이즈px (테이블 col class로 사용 필요할 경우 class 추가) */ +.width5 { width:5px !important;} +.width10 { width:10px !important;} +.width15 { width:15px !important;} +.width20 { width:20px !important;} +.width25 { width:25px !important;} +.width30 { width:30px !important;} +.width35 { width:35px !important;} +.width40 { width:40px !important;} +.width45 { width:45px !important;} +.width46 { width:46px !important;} +.width50 { width:50px !important;} +.width55 { width:55px !important;} +.width60 { width:60px !important;} +.width65 { width:65px !important;} +.width70 { width:70px !important;} +.width75 { width:75px !important;} +.width80 { width:80px !important;} +.width85 { width:85px !important;} +.width89 { width:89px !important;} +.width90 { width:90px !important;} +.width95 { width:95px !important;} +.width100 { width:100px !important;} +.width110 { width:110px !important;} +.width120 { width:120px !important;} +.width130 { width:130px !important;} +.width140 { width:140px !important;} +.width150 { width:150px !important;} +.width160 { width:160px !important;} +.width170 { width:170px !important;} +.width180 { width:180px !important;} +.width190 { width:190px !important;} +.width200 { width:200px !important;} +.width210 { width:210px !important;} +.width220 { width:220px !important;} +.width230 { width:230px !important;} +.width240 { width:240px !important;} +.width250 { width:250px !important;} +.width260 { width:260px !important;} +.width270 { width:270px !important;} +.width280 { width:280px !important;} +.width290 { width:290px !important;} +.width300 { width:300px !important;} +.width310 { width:310px !important;} +.width320 { width:320px !important;} +.width323 { width:323px !important;} +.width330 { width:330px !important;} +.width340 { width:340px !important;} +.width350 { width:350px !important;} +.width360 { width:360px !important;} +.width370 { width:370px !important;} +.width380 { width:380px !important;} +.width390 { width:390px !important;} +.width400 { width:400px !important;} +.width420 { width:420px !important;} +.width422 { width:422px !important;} +.width450 { width:450px !important;} +.width480 { width:480px !important;} +.width500 { width:500px !important;} +.width505 { width:505px !important;} +.width550 { width:550px !important;} +.width600 { width:600px !important;} +.width650 { width:650px !important;} +.width700 { width:700px !important;} +.width750 { width:750px !important;} +.width800 { width:800px !important;} +.width850 { width:850px !important;} +.width900 { width:900px !important;} +.width950 { width:950px !important;} +.width1000 { width:1000px !important;} +.width1100 { width:1100px !important;} +.width1200 { width:1200px !important;} +.width1300 { width:1300px !important;} +.width1400 { width:1400px !important;} +.width1500 { width:1500px !important;} +.width1600 { width:1600px !important;} +.width1700 { width:1700px !important;} + +/* 세로사이즈px (테이블 row class로 사용 필요할 경우 class 추가) */ +.heightauto { height:auto !important; } +.height100p { height:100% !important;} +.height5 { height:5px !important;} +.height10 { height:10px !important;} +.height15 { height:15px !important;} +.height20 { height:20px !important;} +.height23 { height:23px !important;} +.height25 { height:25px !important;} +.height30 { height:30px !important;} +.height32 { height:32px !important;} +.height35 { height:35px !important;} +.height37 { height:37px !important;} +.height38 { height:38px !important;} +.height40 { height:40px !important;} +.height45 { height:45px !important;} +.height50 { height:50px !important;} +.height53 { height:53px !important;} +.height55 { height:55px !important;} +.height60 { height:60px !important;} +.height65 { height:65px !important;} +.height70 { height:70px !important;} +.height75 { height:75px !important;} +.height76 { height:76px !important;} +.height77 { height:77px !important;} +.height78 { height:78px !important;} +.height79 { height:79px !important;} +.height80 { height:80px !important;} +.height81 { height:81px !important;} +.height82 { height:82px !important;} +.height83 { height:83px !important;} +.height84 { height:84px !important;} +.height85 { height:85px !important;} +.height86 { height:86px !important;} +.height87 { height:87px !important;} +.height88 { height:88px !important;} +.height89 { height:89px !important;} +.height90 { height:90px !important;} +.height95 { height:95px !important;} +.height100 { height:100px !important;} +.height110 { height:110px !important;} +.height112 { height:112px !important;} +.height120 { height:120px !important;} +.height121{ height:121px !important;} +.height122{ height:122px !important;} +.height123{ height:123px !important;} +.height124{ height:124px !important;} +.height125{ height:125px !important;} +.height126{ height:126px !important;} +.height127{ height:127px !important;} +.height128{ height:128px !important;} +.height129{ height:129px !important;} +.height130 { height:130px !important;} +.height140 { height:140px !important;} +.height150 { height:150px !important;} +.height160 { height:160px !important;} +.height170 { height:170px !important;} +.height180 { height:180px !important;} +.height190 { height:190px !important;} +.height200 { height:200px !important;} +.height210 { height:210px !important;} +.height217 { height:217px !important;} +.height220 { height:220px !important;} +.height230 { height:230px !important;} +.height240 { height:240px !important;} +.height250 { height:250px !important;} +.height253 { height:253px !important;} +.height255 { height:255px !important;} +.height260 { height:260px !important;} +.height270 { height:270px !important;} +.height280 { height:280px !important;} +.height290 { height:290px !important;} +.height300 { height:300px !important;} +.height310 { height:310px !important;} +.height320 { height:320px !important;} +.height330 { height:330px !important;} +.height340 { height:340px !important;} +.height350 { height:350px !important;} +.height360 { height:360px !important;} +.height370 { height:370px !important;} +.height380 { height:380px !important;} +.height390 { height:390px !important;} +.height400 { height:400px !important;} +.height410 { height:410px !important;} +.height420 { height:420px !important;} +.height430 { height:430px !important;} +.height440 { height:440px !important;} +.height450 { height:450px !important;} +.height460 { height:460px !important;} +.height470 { height:470px !important;} +.height480 { height:480px !important;} +.height490 { height:490px !important;} +.height500 { height:500px !important;} +.height510 { height:510px !important;} +.height515 {height:515px !important;} +.height520 { height:520px !important;} +.height530 { height:530px !important;} +.height540 { height:540px !important;} +.height550 { height:550px !important;} +.height560 { height:560px !important;} +.height570 { height:570px !important;} +.height580 { height:580px !important;} +.height590 { height:590px !important;} +.height600 { height:600px !important;} +.height610 { height:610px !important;} +.height620 { height:620px !important;} +.height630 { height:630px !important;} +.height640 { height:640px !important;} +.height650 { height:650px !important;} +.height660 { height:660px !important;} +.height670 { height:670px !important;} +.height680 { height:680px !important;} +.height690 { height:690px !important;} +.height700 { height:700px !important;} +.height710 { height:710px !important;} +.height720 { height:720px !important;} +.height730 { height:730px !important;} +.height740 { height:740px !important;} +.height750 { height:750px !important;} +.height760 { height:760px !important;} +.height770 { height:770px !important;} +.height780 { height:780px !important;} +.height790 { height:790px !important;} +.height800 { height:800px !important;} +.height810 { height:810px !important;} +.height820 { height:820px !important;} +.height830 { height:830px !important;} +.height840 { height:840px !important;} +.height850 { height:850px !important;} +.height860 { height:860px !important;} +.height870 { height:870px !important;} +.height880 { height:880px !important;} +.height890 { height:890px !important;} +.height900 { height:900px !important;} +.height910 { height:910px !important;} +.height920 { height:920px !important;} +.height930 { height:930px !important;} +.height940 { height:940px !important;} +.height950 { height:950px !important;} +.height960 { height:960px !important;} +.height970 { height:970px !important;} +.height980 { height:980px !important;} +.height990 { height:990px !important;} +.height1000 { height:1000px !important;} + +/*공간주기*/ +.space5 { clear:both; width:100%; height:5px !important;} +.space10 { clear:both; width:100%; height:10px !important;} +.space15 { clear:both; width:100%; height:15px !important;} +.space20 { clear:both; width:100%; height:20px !important;} +.space25 { clear:both; width:100%; height:25px !important;} +.space30 { clear:both; width:100%; height:30px !important;} +.space35 { clear:both; width:100%; height:35px !important;} +.space40 { clear:both; width:100%; height:40px !important;} +.space45 { clear:both; width:100%; height:45px !important;} +.space50 { clear:both; width:100%; height:50px !important;} +.space55 { clear:both; width:100%; height:55px !important;} +.space60 { clear:both; width:100%; height:60px !important;} +.space65 { clear:both; width:100%; height:65px !important;} +.space70 { clear:both; width:100%; height:70px !important;} +.space75 { clear:both; width:100%; height:75px !important;} +.space80 { clear:both; width:100%; height:80px !important;} +.space85 { clear:both; width:100%; height:85px !important;} +.space90 { clear:both; width:100%; height:95px !important;} +.space100 { clear:both; width:100%; height:100px !important;} +.space110 { clear:both; width:100%; height:110px !important;} +.space120 { clear:both; width:100%; height:120px !important;} +.space130 { clear:both; width:100%; height:130px !important;} +.space140 { clear:both; width:100%; height:140px !important;} +.space150 { clear:both; width:100%; height:150px !important;} +.space200 { clear:both; width:100%; height:200px !important;} +.space250 { clear:both; width:100%; height:250px !important;} +.space300 { clear:both; width:100%; height:300px !important;} +.space350 { clear:both; width:100%; height:350px !important;} +.space400 { clear:both; width:100%; height:400px !important;} +.space450 { clear:both; width:100%; height:450px !important;} +.space500 { clear:both; width:100%; height:500px !important;} + +/*마진top 설정*/ +.mt0 { margin-top:0px !important;} +.mt1 { margin-top:1px !important;} +.mt2 { margin-top:2px !important;} +.mt3 { margin-top:3px !important;} +.mt4 { margin-top:4px !important;} +.mt5 { margin-top:5px !important;} +.mt6 { margin-top:6px !important;} +.mt7 { margin-top:7px !important;} +.mt8 { margin-top:8px !important;} +.mt9 { margin-top:9px !important;} +.mt10 { margin-top:10px !important;} +.mt15 { margin-top:15px !important;} +.mt20 { margin-top:20px !important;} +.mt25 { margin-top:25px !important;} +.mt30 { margin-top:30px !important;} +.mt35 { margin-top:35px !important;} +.mt40 { margin-top:40px !important;} +.mt45 { margin-top:45px !important;} +.mt50 { margin-top:50px !important;} +.mt55 { margin-top:55px !important;} +.mt60 { margin-top:60px !important;} +.mt65 { margin-top:65px !important;} +.mt70 { margin-top:70px !important;} +.mt75 { margin-top:75px !important;} +.mt80 { margin-top:80px !important;} +.mt85 { margin-top:85px !important;} +.mt90 { margin-top:90px !important;} +.mt95 { margin-top:95px !important;} +.mt100 { margin-top:100px !important;} +.mt150 { margin-top:150px !important;} +.mt200 { margin-top:200px !important;} +.mt250 { margin-top:250px !important;} +.mt300 { margin-top:300px !important;} + +/*마진right 설정*/ +.mr0 { margin-right:0px !important;} +.mr1 { margin-right:1px !important;} +.mr2 { margin-right:2px !important;} +.mr3 { margin-right:3px !important;} +.mr4 { margin-right:4px !important;} +.mr5 { margin-right:5px !important;} +.mr6 { margin-right:6px !important;} +.mr7 { margin-right:7px !important;} +.mr8 { margin-right:8px !important;} +.mr9 { margin-right:9px !important;} +.mr10 { margin-right:10px !important;} +.mr12 { margin-right:12px !important;} +.mr15 { margin-right:15px !important;} +.mr20 { margin-right:20px !important;} +.mr25 { margin-right:25px !important;} +.mr30 { margin-right:30px !important;} +.mr35 { margin-right:35px !important;} +.mr40 { margin-right:40px !important;} +.mr45 { margin-right:45px !important;} +.mr46 { margin-right:46px !important;} +.mr50 { margin-right:50px !important;} +.mr55 { margin-right:55px !important;} +.mr60 { margin-right:60px !important;} +.mr65 { margin-right:65px !important;} +.mr70 { margin-right:70px !important;} +.mr75 { margin-right:75px !important;} +.mr80 { margin-right:80px !important;} +.mr85 { margin-right:85px !important;} +.mr90 { margin-right:90px !important;} +.mr95 { margin-right:95px !important;} +.mr100 { margin-right:100px !important;} +.mr150 { margin-right:150px !important;} +.mr200 { margin-right:200px !important;} +.mr250 { margin-right:250px !important;} +.mr300 { margin-right:300px !important;} + + +/*마진bottm 설정*/ +.mb0 { margin-bottom:0px !important;} +.mb1 { margin-bottom:1px !important;} +.mb2 { margin-bottom:2px !important;} +.mb3 { margin-bottom:3px !important;} +.mb4 { margin-bottom:4px !important;} +.mb5 { margin-bottom:5px !important;} +.mb6 { margin-bottom:6px !important;} +.mb7 { margin-bottom:7px !important;} +.mb8 { margin-bottom:8px !important;} +.mb9 { margin-bottom:9px !important;} +.mb10 { margin-bottom:10px !important;} +.mb15 { margin-bottom:15px !important;} +.mb20 { margin-bottom:20px !important;} +.mb25 { margin-bottom:25px !important;} +.mb30 { margin-bottom:30px !important;} +.mb35 { margin-bottom:35px !important;} +.mb40 { margin-bottom:40px !important;} + +.mb45 { margin-bottom:45px !important;} +.mb50 { margin-bottom:50px !important;} +.mb55 { margin-bottom:55px !important;} +.mb60 { margin-bottom:60px !important;} +.mb65 { margin-bottom:65px !important;} +.mb70 { margin-bottom:70px !important;} +.mb75 { margin-bottom:75px !important;} +.mb80 { margin-bottom:80px !important;} +.mb85 { margin-bottom:85px !important;} +.mb90 { margin-bottom:90px !important;} +.mb95 { margin-bottom:95px !important;} +.mb100 { margin-bottom:100px !important;} +.mb150 { margin-bottom:150px !important;} +.mb200 { margin-bottom:200px !important;} +.mb250 { margin-bottom:250px !important;} +.mb300 { margin-bottom:300px !important;} + +/*마진left 설정*/ +.ml0 { margin-left:0px !important;} +.ml1 { margin-left:1px !important;} +.ml2 { margin-left:2px !important;} +.ml3 { margin-left:3px !important;} +.ml4 { margin-left:4px !important;} +.ml5 { margin-left:5px !important;} +.ml6 { margin-left:6px !important;} +.ml7 { margin-left:7px !important;} +.ml8 { margin-left:8px !important;} +.ml9 { margin-left:9px !important;} +.ml10 { margin-left:10px !important;} +.ml15 { margin-left:15px !important;} +.ml20 { margin-left:20px !important;} +.ml25 { margin-left:25px !important;} +.ml30 { margin-left:30px !important;} +.ml35 { margin-left:35px !important;} +.ml40 { margin-left:40px !important;} +.ml45 { margin-left:45px !important;} +.ml50 { margin-left:50px !important;} +.ml55 { margin-left:55px !important;} +.ml60 { margin-left:60px !important;} +.ml65 { margin-left:65px !important;} +.ml70 { margin-left:70px !important;} +.ml75 { margin-left:75px !important;} +.ml80 { margin-left:80px !important;} +.ml85 { margin-left:85px !important;} +.ml90 { margin-left:90px !important;} +.ml95 { margin-left:95px !important;} +.ml100 { margin-left:100px !important;} +.ml116{ margin-left:116px !important;} +.ml150 { margin-left:150px !important;} +.ml200 { margin-left:200px !important;} +.ml250 { margin-left:250px !important;} +.ml300 { margin-left:300px !important;} + +/*padding*/ +.pd0 { padding:0px !important; box-sizing:border-box; } +.pd1 { padding:1px !important; box-sizing:border-box; } +.pd2 { padding:2px !important; box-sizing:border-box; } +.pd3 { padding:3px !important; box-sizing:border-box; } +.pd4 { padding:4px !important; box-sizing:border-box; } +.pd5 { padding:5px !important; box-sizing:border-box; } +.pd6 { padding:6px !important; box-sizing:border-box; } +.pd7 { padding:7px !important; box-sizing:border-box; } +.pd8 { padding:8px !important; box-sizing:border-box; } +.pd9 { padding:9px !important; box-sizing:border-box; } +.pd10 { padding:10px !important; box-sizing:border-box; } +.pd15 { padding:15px !important; box-sizing:border-box; } +.pd20 { padding:20px !important; box-sizing:border-box; } +.pd25 { padding:25px !important; box-sizing:border-box; } +.pd30 { padding:30px !important; box-sizing:border-box; } + +/*padding top 설정*/ +.pt0 { padding-top:0px !important;} +.pt1 { padding-top:1px !important;} +.pt2 { padding-top:2px !important;} +.pt3 { padding-top:3px !important;} +.pt4 { padding-top:4px !important;} +.pt5 { padding-top:5px !important;} +.pt6 { padding-top:6px !important;} +.pt7 { padding-top:7px !important;} +.pt8 { padding-top:8px !important;} +.pt9 { padding-top:9px !important;} +.pt10 { padding-top:10px !important;} +.pt15 { padding-top:15px !important;} +.pt20 { padding-top:20px !important;} +.pt25 { padding-top:25px !important;} +.pt30 { padding-top:30px !important;} +.pt35 { padding-top:35px !important;} +.pt40 { padding-top:40px !important;} +.pt45 { padding-top:45px !important;} +.pt50 { padding-top:50px !important;} +.pt55 { padding-top:55px !important;} +.pt60 { padding-top:60px !important;} +.pt65 { padding-top:65px !important;} +.pt70 { padding-top:70px !important;} +.pt75 { padding-top:75px !important;} +.pt80 { padding-top:80px !important;} +.pt85 { padding-top:85px !important;} +.pt90 { padding-top:90px !important;} +.pt95 { padding-top:95px !important;} +.pt100 { padding-top:100px !important;} +.pt150 { padding-top:150px !important;} +.pt200 { padding-top:200px !important;} +.pt250 { padding-top:250px !important;} +.pt300 { padding-top:300px !important;} +.pd1em { padding:1em !important; } + +/*padding right 설정*/ +.pr0 { padding-right:0px !important;} +.pr1 { padding-right:1px !important;} +.pr2 { padding-right:2px !important;} +.pr3 { padding-right:3px !important;} +.pr4 { padding-right:4px !important;} +.pr5 { padding-right:5px !important;} +.pr6 { padding-right:6px !important;} +.pr7 { padding-right:7px !important;} +.pr8 { padding-right:8px !important;} +.pr9 { padding-right:9px !important;} +.pr10 { padding-right:10px !important;} +.pr15 { padding-right:15px !important;} +.pr20 { padding-right:20px !important;} +.pr25 { padding-right:25px !important;} +.pr30 { padding-right:30px !important;} +.pr35 { padding-right:35px !important;} +.pr40 { padding-right:40px !important;} +.pr45 { padding-right:45px !important;} +.pr50 { padding-right:50px !important;} +.pr55 { padding-right:55px !important;} +.pr60 { padding-right:60px !important;} +.pr65 { padding-right:65px !important;} +.pr70 { padding-right:70px !important;} +.pr75 { padding-right:75px !important;} +.pr80 { padding-right:80px !important;} +.pr85 { padding-right:85px !important;} +.pr90 { padding-right:90px !important;} +.pr95 { padding-right:95px !important;} +.pr100 { padding-right:100px !important;} +.pr150 { padding-right:150px !important;} +.pr200 { padding-right:200px !important;} +.pr250 { padding-right:250px !important;} +.pr300 { padding-right:300px !important;} + + +/*padding bottm 설정*/ +.pb0 { padding-bottom:0px !important;} +.pb1 { padding-bottom:1px !important;} +.pb2 { padding-bottom:2px !important;} +.pb3 { padding-bottom:3px !important;} +.pb4 { padding-bottom:4px !important;} +.pb5 { padding-bottom:5px !important;} +.pb6 { padding-bottom:6px !important;} +.pb7 { padding-bottom:7px !important;} +.pb8 { padding-bottom:8px !important;} +.pb9 { padding-bottom:9px !important;} +.pb10 { padding-bottom:10px !important;} +.pb13 { padding-bottom:13px !important;} +.pb15 { padding-bottom:15px !important;} +.pb20 { padding-bottom:20px !important;} +.pb25 { padding-bottom:25px !important;} +.pb30 { padding-bottom:30px !important;} +.pb35 { padding-bottom:35px !important;} +.pb40 { padding-bottom:40px !important;} +.pb45 { padding-bottom:45px !important;} +.pb50 { padding-bottom:50px !important;} +.pb55 { padding-bottom:55px !important;} +.pb60 { padding-bottom:60px !important;} +.pb65 { padding-bottom:65px !important;} +.pb70 { padding-bottom:70px !important;} +.pb75 { padding-bottom:75px !important;} +.pb80 { padding-bottom:80px !important;} +.pb85 { padding-bottom:85px !important;} +.pb90 { padding-bottom:90px !important;} +.pb95 { padding-bottom:95px !important;} +.pb100 { padding-bottom:100px !important;} +.pb150 { padding-bottom:150px !important;} +.pb200 { padding-bottom:200px !important;} +.pb250 { padding-bottom:250px !important;} +.pb300 { padding-bottom:300px !important;} + +/*padding left 설정*/ +.pl0 { padding-left:0px !important;} +.pl1 { padding-left:1px !important;} +.pl2 { padding-left:2px !important;} +.pl3 { padding-left:3px !important;} +.pl4 { padding-left:4px !important;} +.pl5 { padding-left:5px !important;} +.pl6 { padding-left:6px !important;} +.pl7 { padding-left:7px !important;} +.pl8 { padding-left:8px !important;} +.pl9 { padding-left:9px !important;} +.pl10 { padding-left:10px !important;} +.pl15 { padding-left:15px !important;} +.pl20 { padding-left:20px !important;} +.pl25 { padding-left:25px !important;} +.pl30 { padding-left:30px !important;} +.pl35 { padding-left:35px !important;} +.pl40 { padding-left:40px !important;} +.pl45 { padding-left:45px !important;} +.pl50 { padding-left:50px !important;} +.pl55 { padding-left:55px !important;} +.pl60 { padding-left:60px !important;} +.pl65 { padding-left:65px !important;} +.pl70 { padding-left:70px !important;} +.pl75 { padding-left:75px !important;} +.pl80 { padding-left:80px !important;} +.pl85 { padding-left:85px !important;} +.pl90 { padding-left:90px !important;} +.pl95 { padding-left:95px !important;} +.pl100 { padding-left:100px !important;} +.pl150 { padding-left:150px !important;} +.pl200 { padding-left:200px !important;} +.pl250 { padding-left:250px !important;} +.pl300 { padding-left:300px !important;} + +/*line-heihgt 설정*/ +.lh10p { line-height:10% !important; } +.lh20p { line-height:20% !important; } +.lh30p { line-height:30% !important; } +.lh38 { line-height:38px !important; } +.lh40p { line-height:40% !important; } +.lh50p { line-height:50% !important; } +.lh60p { line-height:60% !important; } +.lh70p { line-height:70% !important; } +.lh80p { line-height:80% !important; } +.lh90p { line-height:90% !important; } +.lh100p { line-height:100% !important; } + +.lh0 { line-height:0 !important; } +.lh1 { line-height:1em !important; } +.lh1_1 { line-height:1.1em !important; } +.lh1_2 { line-height:1.2em !important; } +.lh1_3 { line-height:1.3em !important; } +.lh1_4 { line-height:1.4em !important; } +.lh1_5 { line-height:1.5em !important; } +.lh1_6 { line-height:1.6em !important; } +.lh1_7 { line-height:1.7em !important; } +.lh1_8 { line-height:1.8em !important; } +.lh1_9 { line-height:1.9em !important; } +.lh2 { line-height:2em !important; } + +.lh20 { line-height:20px !important; } +.lh24 { line-height:24px !important; } +.lh25 { line-height:25px !important; } +.lh26 { line-height:26px !important; } +.lh29 { line-height:29px !important; } +.lh30 { line-height:30px !important; } +.lh32 { line-height:32px !important; } +.lh35 { line-height:35px !important; } +.lh40 { line-height:40px !important; } +.lh45 { line-height:45px !important; } +.lh50 { line-height:50px !important; } +.lh55 { line-height:55px !important; } +.lh56 { line-height:56px !important; } +.lh58 { line-height:58px !important; } +.lh60 { line-height:60px !important; } +.lh65 { line-height:65px !important; } +.lh70 { line-height:70px !important; } \ No newline at end of file Property changes on: base3.10/src/main/webapp/css/user/style.css ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/css/user/responsive.css =================================================================== --- base3.10/src/main/webapp/css/user/responsive.css (nonexistent) +++ base3.10/src/main/webapp/css/user/responsive.css (revision 34) @@ -0,0 +1,6 @@ +@charset "UTF-8"; +/* CSS Document */ + +@media all and (max-width: 1610px) { + +} \ No newline at end of file Property changes on: base3.10/src/main/webapp/css/user/responsive.css ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/css/user/aos.css =================================================================== --- base3.10/src/main/webapp/css/user/aos.css (nonexistent) +++ base3.10/src/main/webapp/css/user/aos.css (revision 34) @@ -0,0 +1,82 @@ +/* Palette generated by Material Palette - materialpalette.com/indigo/pink */ +/* Base16 Atelier Sulphurpool Dark - Theme */ +/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/sulphurpool) */ +/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ +/* Atelier-Sulphurpool Comment */ + +/** + * Sections + */ + +.code { + width: 100%; + clear: both; + margin: 0 0 50px;} + .code pre, .code code { + height: 100%; + margin: 0; } + .code code { + padding: 20px 0 0 20px; } + .code--small code { + padding-top: 75px; } + .code--left { + float: left; } + .code--right { + float: right; } + .code--wider { + width: 100%; } + .code--wider code { + padding-top: 60px; } + +.section--more { + color: #FFF; + background: #0E0F34; + padding: 20px 0 40px 0; } + +.section-group { + border-bottom: 1px solid rgba(255, 255, 255, 0.2); + padding: 30px 0; } + .section-group h3 { + margin: 0 0 20px 0; + text-transform: uppercase; } + .section-group h4 { + font-weight: normal; + color: rgba(255, 255, 255, 0.6); } + .section-group code { + padding: 20px; + font-size: 1.2em; } + .section-group .btn { + margin-right: 20px; } + +.btn { + padding: 10px 20px; + border: 1px solid #FF4081; + display: inline-block; + position: relative; + -webkit-transition: all 0.2s ease; + transition: all 0.2s ease; + overflow: hidden; } + .btn:before { + content: ''; + position: absolute; + left: 0; + right: 0; + width: 1px; + top: 0; + bottom: 0; + margin: auto; + background: #FF4081; + -webkit-transition: -webkit-transform 0.2s ease; + transition: transform 0.2s ease; + z-index: 0; + opacity: 0; } + .btn span { + position: relative; + z-index: 5; } + .btn:hover { + color: #FFF; } + .btn:hover:before { + -webkit-transform: scaleX(200); + -ms-transform: scaleX(200); + transform: scaleX(200); + opacity: 1; } \ No newline at end of file Property changes on: base3.10/src/main/webapp/css/user/aos.css ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/css/user/board.css =================================================================== --- base3.10/src/main/webapp/css/user/board.css (nonexistent) +++ base3.10/src/main/webapp/css/user/board.css (revision 34) @@ -0,0 +1,82 @@ +@charset "UTF-8"; +/* CSS Document */ + +/***************************************************************************************************************************************** +생성일: 2018/10/08 +수정일: +수정자: hello@dx2.kr +주석간 간격 두줄 구분은 한줄사용 +*****************************************************************************************************************************************/ + + +/*basic list*/ +.board_list { width:100%; table-layout:fixed; border-top:2px solid #333; } +.board_list tr { transition:all 0.3s; } +.board_list tr:hover td { background:#f9f9f9; } +.board_list th { padding:20px 0; border-bottom:1px solid #333; } +.board_list td { padding:25px 0; border-bottom:1px solid #ededed; } +.board_list th, .board_list td { transition:all 0.3s; vertical-align:middle; text-align:center; } +.board_list td a { width:100%; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600;} +.board_list td.board_tit { text-align:left; } +.board_list .board_num strong { font-weight:600; color:#1524cc; } + +/*basic view*/ +.board_header { border-top:2px solid #333;border-bottom:1px solid #ededed; padding:30px 0; } +.board_header .info { display:flex; justify-content: space-between; } +.board_header strong { font-size:1.5em; line-height:1.6em; margin-bottom:20px; display: block; font-weight:900; } +.board_header .by { display: flex; justify-content:flex-start; align-items:center; } +.board_header .by p { color:#666; display:inline-block; } +.board_header .by p::after { content:''; width:2px; height:2px; background:#666; display:inline-block; border-radius:5px; margin:0 10px 4px; } +.board_header .by p a { display:inline-block; position:relative; } +.board_header .by p:last-child::after { display:none; } +.board_content { padding:50px 0; border-bottom:1px solid #ededed; } + +/*basic write*/ +.board_write { width:100%; border-top:1px solid #666; } +.board_write ul > li { width:100%; border-bottom: 1px solid #ededed; padding:15px 0; position:relative; transition:all 0.3s;} +.board_write ul > li::after { content:''; display:block; clear:both; } +.board_write ul > li .item_text .board_title { display:block; font-weight:500; font-size:1.3em; margin-bottom:15px; color:#000; letter-spacing: -.5px; } +.board_write ul > li .item_text { width:100%; } + +/*페이지수*/ +.sorting_wrap { margin-bottom:30px; color:#666; } +.sorting_wrap::after { content:''; clear:both; display:block; } +.sorting_wrap .total { float:left; margin-top:15px; font-weight:500; } +.sorting_wrap .total .count { color:#1524cc; font-weight:900; } + +/*검색*/ +.search_box { float:right; width:300px; height:40px; position:relative; border:1px solid #d9d9d9; border-radius:50px; box-shadow:0 0 15px 0 rgba(0,0,0,0.2); transition:all 0.3s; } +.search_box:hover { border:1px solid #333; } +.search_box .inputText { width:calc(100% - 40px); font-weight:600; height:100%; float:left; border:none; padding-left:15px; border-radius:40px 0 0 40px !important; } +.search_box .btn_search { width:40px; height:100%; font-size:1.2em; border:none; border-radius:0 40px 40px 0 !important; color:#ccc; transition:all 0.3s; } +.search_box button:hover, .search_box .inputText:hover { box-shadow:none; } +.search_box .btn_search:hover { color:#000; } + +/*pagenation*/ +.pagination { margin:0 auto 0; text-align:center; position:relative; } +.pagination ul {display:flex; justify-content:center; padding-left:0; border-radius:4px; } +.pagination li { box-sizing:border-box; position:relative; cursor:pointer; display:inline-block; margin:0 5px; } +.pagination li a { display:inline-block; cursor:pointer; border-radius:50px; width:30px; height:30px; line-height:30px; color:#333; font-size:1em; transition:background-color 0.3s;} +.pagination li a:hover { background-color:#ededed; } +.pagination li.active a { font-weight:bold; color:#fff; background:#333; } +.pagination .first, .pagination .last, .pagination .next, .pagination .prev { margin:0 2px; } +/*.pagination .first a, .pagination .last a, .pagination .next a, .pagination .prev a { text-indent: -5000px; } +.pagination .prev, .pagination .prev a:hover { background:url(/images/custom/arrow_left.svg) 50% 50% no-repeat; background-size:6px; } +.pagination .next, .pagination .next a:hover { background:url(/images/custom/arrow_right.svg) 50% 50% no-repeat; background-size:6px; } +.pagination .first, .pagination .first a:hover { background:url(/images/custom/arrow_double_left.svg) 50% 50% no-repeat; background-size:9px; } +.pagination .last, .pagination .last a:hover { background:url(/images/custom/arrow_double_right.svg) 50% 50% no-repeat; background-size:9px; }*/ + +/* input text show */ +.text_show { position:relative; transition:all 0.3s; } +.text_show label { position:absolute; top:16px; left:8px; transition:all 0.3s; line-height:1em; pointer-events:none; font-weight:400; color:#666; font-size:.9em; padding:0 5px; } +.text_show .inputText + label { top:50%; transform:translateY(-50%); } +.text_show .textArea + label { top:20px; transform:translateY(-50%); } +.text_show.focus label { background:#fff; color:#666; top:-5px; font-size:0.7em; } +.text_show.focus .inputText + label, .text_show.focus .textArea + label { transform:translateY(0); } +.text_show .inputText[disabled] + label, .text_show .textArea[disabled] + label, .text_show .inputText[readonly] + label, .text_show .textArea[readonly] + label { visibility:hidden; } +.text_show.active label { opacity:0; } + +@media all and (max-width: 1000px) { + + +} Property changes on: base3.10/src/main/webapp/css/user/board.css ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/css/user/swiper-bundle.css =================================================================== --- base3.10/src/main/webapp/css/user/swiper-bundle.css (nonexistent) +++ base3.10/src/main/webapp/css/user/swiper-bundle.css (revision 34) @@ -0,0 +1,613 @@ +/** + * Swiper 7.4.1 + * Most modern mobile touch slider and framework with hardware accelerated transitions + * https://swiperjs.com + * + * Copyright 2014-2021 Vladimir Kharlampidi + * + * Released under the MIT License + * + * Released on: December 24, 2021 + */ + +@font-face { + font-family: 'swiper-icons'; + src: url('data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA'); + font-weight: 400; + font-style: normal; +} +:root { + --swiper-theme-color: #007aff; +} +.swiper { + margin-left: auto; + margin-right: auto; + position: relative; + overflow: hidden; + list-style: none; + padding: 0; + /* Fix of Webkit flickering */ + z-index: 1; +} +.swiper-vertical > .swiper-wrapper { + flex-direction: column; +} +.swiper-wrapper { + position: relative; + width: 100%; + height: 100%; + z-index: 1; + display: flex; + transition-property: transform; + box-sizing: content-box; +} +.swiper-android .swiper-slide, +.swiper-wrapper { + transform: translate3d(0px, 0, 0); +} +.swiper-pointer-events { + touch-action: pan-y; +} +.swiper-pointer-events.swiper-vertical { + touch-action: pan-x; +} +.swiper-slide { + flex-shrink: 0; + width: 100%; + height: 100%; + position: relative; + transition-property: transform; +} +.swiper-slide-invisible-blank { + visibility: hidden; +} +/* Auto Height */ +.swiper-autoheight, +.swiper-autoheight .swiper-slide { + height: auto; +} +.swiper-autoheight .swiper-wrapper { + align-items: flex-start; + transition-property: transform, height; +} +/* 3D Effects */ +.swiper-3d, +.swiper-3d.swiper-css-mode .swiper-wrapper { + perspective: 1200px; +} +.swiper-3d .swiper-wrapper, +.swiper-3d .swiper-slide, +.swiper-3d .swiper-slide-shadow, +.swiper-3d .swiper-slide-shadow-left, +.swiper-3d .swiper-slide-shadow-right, +.swiper-3d .swiper-slide-shadow-top, +.swiper-3d .swiper-slide-shadow-bottom, +.swiper-3d .swiper-cube-shadow { + transform-style: preserve-3d; +} +.swiper-3d .swiper-slide-shadow, +.swiper-3d .swiper-slide-shadow-left, +.swiper-3d .swiper-slide-shadow-right, +.swiper-3d .swiper-slide-shadow-top, +.swiper-3d .swiper-slide-shadow-bottom { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + pointer-events: none; + z-index: 10; +} +.swiper-3d .swiper-slide-shadow { + background: rgba(0, 0, 0, 0.15); +} +.swiper-3d .swiper-slide-shadow-left { + background-image: linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); +} +.swiper-3d .swiper-slide-shadow-right { + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); +} +.swiper-3d .swiper-slide-shadow-top { + background-image: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); +} +.swiper-3d .swiper-slide-shadow-bottom { + background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); +} +/* CSS Mode */ +.swiper-css-mode > .swiper-wrapper { + overflow: auto; + scrollbar-width: none; + /* For Firefox */ + -ms-overflow-style: none; + /* For Internet Explorer and Edge */ +} +.swiper-css-mode > .swiper-wrapper::-webkit-scrollbar { + display: none; +} +.swiper-css-mode > .swiper-wrapper > .swiper-slide { + scroll-snap-align: start start; +} +.swiper-horizontal.swiper-css-mode > .swiper-wrapper { + scroll-snap-type: x mandatory; +} +.swiper-vertical.swiper-css-mode > .swiper-wrapper { + scroll-snap-type: y mandatory; +} +.swiper-centered > .swiper-wrapper::before { + content: ''; + flex-shrink: 0; + order: 9999; +} +.swiper-centered.swiper-horizontal > .swiper-wrapper > .swiper-slide:first-child { + margin-inline-start: var(--swiper-centered-offset-before); +} +.swiper-centered.swiper-horizontal > .swiper-wrapper::before { + height: 100%; + min-height: 1px; + width: var(--swiper-centered-offset-after); +} +.swiper-centered.swiper-vertical > .swiper-wrapper > .swiper-slide:first-child { + margin-block-start: var(--swiper-centered-offset-before); +} +.swiper-centered.swiper-vertical > .swiper-wrapper::before { + width: 100%; + min-width: 1px; + height: var(--swiper-centered-offset-after); +} +.swiper-centered > .swiper-wrapper > .swiper-slide { + scroll-snap-align: center center; +} +.swiper-virtual.swiper-css-mode .swiper-wrapper::after { + content: ''; + position: absolute; + left: 0; + top: 0; + pointer-events: none; +} +.swiper-virtual.swiper-css-mode.swiper-horizontal .swiper-wrapper::after { + height: 1px; + width: var(--swiper-virtual-size); +} +.swiper-virtual.swiper-css-mode.swiper-vertical .swiper-wrapper::after { + width: 1px; + height: var(--swiper-virtual-size); +} +:root { + --swiper-navigation-size: 44px; + /* + --swiper-navigation-color: var(--swiper-theme-color); + */ +} +.swiper-button-prev, +.swiper-button-next { + position: absolute; + top: 50%; + width: calc(var(--swiper-navigation-size) / 44 * 27); + height: var(--swiper-navigation-size); + margin-top: calc(0px - (var(--swiper-navigation-size) / 2)); + z-index: 10; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + color: var(--swiper-navigation-color, var(--swiper-theme-color)); +} +.swiper-button-prev.swiper-button-disabled, +.swiper-button-next.swiper-button-disabled { + opacity: 0.35; + cursor: auto; + pointer-events: none; +} +.swiper-button-prev:after, +.swiper-button-next:after { + font-family: swiper-icons; + font-size: var(--swiper-navigation-size); + text-transform: none !important; + letter-spacing: 0; + text-transform: none; + font-variant: initial; + line-height: 1; +} +.swiper-button-prev, +.swiper-rtl .swiper-button-next { + left: 5em; + right: auto; +} +.swiper-button-prev:after, +.swiper-rtl .swiper-button-next:after { + content: 'prev'; +} +.swiper-button-next, +.swiper-rtl .swiper-button-prev { + right: 5em; + left: auto; +} +.swiper-button-next:after, +.swiper-rtl .swiper-button-prev:after { + content: 'next'; +} +.swiper-button-lock { + display: none; +} +:root { + /* + --swiper-pagination-color: var(--swiper-theme-color); + --swiper-pagination-bullet-size: 8px; + --swiper-pagination-bullet-width: 8px; + --swiper-pagination-bullet-height: 8px; + --swiper-pagination-bullet-inactive-color: #000; + --swiper-pagination-bullet-inactive-opacity: 0.2; + --swiper-pagination-bullet-opacity: 1; + --swiper-pagination-bullet-horizontal-gap: 4px; + --swiper-pagination-bullet-vertical-gap: 6px; + */ +} +.swiper-pagination { + position: absolute; + text-align: center; + transition: 300ms opacity; + transform: translate3d(0, 0, 0); + z-index: 10; +} +.swiper-pagination.swiper-pagination-hidden { + opacity: 0; +} +/* Common Styles */ +.swiper-pagination-fraction, +.swiper-pagination-custom, +.swiper-horizontal > .swiper-pagination-bullets, +.swiper-pagination-bullets.swiper-pagination-horizontal { + bottom: 10px; + left: 0; + width: 100%; +} +/* Bullets */ +.swiper-pagination-bullets-dynamic { + overflow: hidden; + font-size: 0; +} +.swiper-pagination-bullets-dynamic .swiper-pagination-bullet { + transform: scale(0.33); + position: relative; +} +.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active { + transform: scale(1); +} +.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main { + transform: scale(1); +} +.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev { + transform: scale(0.66); +} +.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev { + transform: scale(0.33); +} +.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next { + transform: scale(0.66); +} +.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next { + transform: scale(0.33); +} +.swiper-pagination-bullet { + width: var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px)); + height: var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px)); + display: inline-block; + border-radius: 50%; + background: var(--swiper-pagination-bullet-inactive-color, #000); + opacity: var(--swiper-pagination-bullet-inactive-opacity, 0.2); +} +button.swiper-pagination-bullet { + border: none; + margin: 0; + padding: 0; + box-shadow: none; + -webkit-appearance: none; + appearance: none; +} +.swiper-pagination-clickable .swiper-pagination-bullet { + cursor: pointer; +} +.swiper-pagination-bullet:only-child { + display: none !important; +} +.swiper-pagination-bullet-active { + opacity: var(--swiper-pagination-bullet-opacity, 1); + background: var(--swiper-pagination-color, var(--swiper-theme-color)); +} +.swiper-vertical > .swiper-pagination-bullets, +.swiper-pagination-vertical.swiper-pagination-bullets { + right: 10px; + top: 50%; + transform: translate3d(0px, -50%, 0); +} +.swiper-vertical > .swiper-pagination-bullets .swiper-pagination-bullet, +.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet { + margin: var(--swiper-pagination-bullet-vertical-gap, 6px) 0; + display: block; +} +.swiper-vertical > .swiper-pagination-bullets.swiper-pagination-bullets-dynamic, +.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic { + top: 50%; + transform: translateY(-50%); + width: 8px; +} +.swiper-vertical > .swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet, +.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet { + display: inline-block; + transition: 200ms transform, 200ms top; +} +.swiper-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet, +.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet { + margin: 0 var(--swiper-pagination-bullet-horizontal-gap, 4px); +} +.swiper-horizontal > .swiper-pagination-bullets.swiper-pagination-bullets-dynamic, +.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic { + left: 50%; + transform: translateX(-50%); + white-space: nowrap; +} +.swiper-horizontal > .swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet, +.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet { + transition: 200ms transform, 200ms left; +} +.swiper-horizontal.swiper-rtl > .swiper-pagination-bullets-dynamic .swiper-pagination-bullet { + transition: 200ms transform, 200ms right; +} +/* Progress */ +.swiper-pagination-progressbar { + background: rgba(0, 0, 0, 0.25); + position: absolute; +} +.swiper-pagination-progressbar .swiper-pagination-progressbar-fill { + background: var(--swiper-pagination-color, var(--swiper-theme-color)); + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + transform: scale(0); + transform-origin: left top; +} +.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill { + transform-origin: right top; +} +.swiper-horizontal > .swiper-pagination-progressbar, +.swiper-pagination-progressbar.swiper-pagination-horizontal, +.swiper-vertical > .swiper-pagination-progressbar.swiper-pagination-progressbar-opposite, +.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite { + width: 100%; + height: 4px; + left: 0; + top: 0; +} +.swiper-vertical > .swiper-pagination-progressbar, +.swiper-pagination-progressbar.swiper-pagination-vertical, +.swiper-horizontal > .swiper-pagination-progressbar.swiper-pagination-progressbar-opposite, +.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite { + width: 4px; + height: 100%; + left: 0; + top: 0; +} +.swiper-pagination-lock { + display: none; +} +/* Scrollbar */ +.swiper-scrollbar { + border-radius: 10px; + position: relative; + -ms-touch-action: none; + background: rgba(0, 0, 0, 0.1); +} +.swiper-horizontal > .swiper-scrollbar { + position: absolute; + left: 1%; + bottom: 3px; + z-index: 50; + height: 5px; + width: 98%; +} +.swiper-vertical > .swiper-scrollbar { + position: absolute; + right: 3px; + top: 1%; + z-index: 50; + width: 5px; + height: 98%; +} +.swiper-scrollbar-drag { + height: 100%; + width: 100%; + position: relative; + background: rgba(0, 0, 0, 0.5); + border-radius: 10px; + left: 0; + top: 0; +} +.swiper-scrollbar-cursor-drag { + cursor: move; +} +.swiper-scrollbar-lock { + display: none; +} +.swiper-zoom-container { + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + text-align: center; +} +.swiper-zoom-container > img, +.swiper-zoom-container > svg, +.swiper-zoom-container > canvas { + max-width: 100%; + max-height: 100%; + object-fit: contain; +} +.swiper-slide-zoomed { + cursor: move; +} +/* Preloader */ +:root { + /* + --swiper-preloader-color: var(--swiper-theme-color); + */ +} +.swiper-lazy-preloader { + width: 42px; + height: 42px; + position: absolute; + left: 50%; + top: 50%; + margin-left: -21px; + margin-top: -21px; + z-index: 10; + transform-origin: 50%; + animation: swiper-preloader-spin 1s infinite linear; + box-sizing: border-box; + border: 4px solid var(--swiper-preloader-color, var(--swiper-theme-color)); + border-radius: 50%; + border-top-color: transparent; +} +.swiper-lazy-preloader-white { + --swiper-preloader-color: #fff; +} +.swiper-lazy-preloader-black { + --swiper-preloader-color: #000; +} +@keyframes swiper-preloader-spin { + 100% { + transform: rotate(360deg); + } +} +/* a11y */ +.swiper .swiper-notification { + position: absolute; + left: 0; + top: 0; + pointer-events: none; + opacity: 0; + z-index: -1000; +} +.swiper-free-mode > .swiper-wrapper { + transition-timing-function: ease-out; + margin: 0 auto; +} +.swiper-grid > .swiper-wrapper { + flex-wrap: wrap; +} +.swiper-grid-column > .swiper-wrapper { + flex-wrap: wrap; + flex-direction: column; +} +.swiper-fade.swiper-free-mode .swiper-slide { + transition-timing-function: ease-out; +} +.swiper-fade .swiper-slide { + pointer-events: none; + transition-property: opacity; +} +.swiper-fade .swiper-slide .swiper-slide { + pointer-events: none; +} +.swiper-fade .swiper-slide-active, +.swiper-fade .swiper-slide-active .swiper-slide-active { + pointer-events: auto; +} +.swiper-cube { + overflow: visible; +} +.swiper-cube .swiper-slide { + pointer-events: none; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + z-index: 1; + visibility: hidden; + transform-origin: 0 0; + width: 100%; + height: 100%; +} +.swiper-cube .swiper-slide .swiper-slide { + pointer-events: none; +} +.swiper-cube.swiper-rtl .swiper-slide { + transform-origin: 100% 0; +} +.swiper-cube .swiper-slide-active, +.swiper-cube .swiper-slide-active .swiper-slide-active { + pointer-events: auto; +} +.swiper-cube .swiper-slide-active, +.swiper-cube .swiper-slide-next, +.swiper-cube .swiper-slide-prev, +.swiper-cube .swiper-slide-next + .swiper-slide { + pointer-events: auto; + visibility: visible; +} +.swiper-cube .swiper-slide-shadow-top, +.swiper-cube .swiper-slide-shadow-bottom, +.swiper-cube .swiper-slide-shadow-left, +.swiper-cube .swiper-slide-shadow-right { + z-index: 0; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} +.swiper-cube .swiper-cube-shadow { + position: absolute; + left: 0; + bottom: 0px; + width: 100%; + height: 100%; + opacity: 0.6; + z-index: 0; +} +.swiper-cube .swiper-cube-shadow:before { + content: ''; + background: #000; + position: absolute; + left: 0; + top: 0; + bottom: 0; + right: 0; + filter: blur(50px); +} +.swiper-flip { + overflow: visible; +} +.swiper-flip .swiper-slide { + pointer-events: none; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + z-index: 1; +} +.swiper-flip .swiper-slide .swiper-slide { + pointer-events: none; +} +.swiper-flip .swiper-slide-active, +.swiper-flip .swiper-slide-active .swiper-slide-active { + pointer-events: auto; +} +.swiper-flip .swiper-slide-shadow-top, +.swiper-flip .swiper-slide-shadow-bottom, +.swiper-flip .swiper-slide-shadow-left, +.swiper-flip .swiper-slide-shadow-right { + z-index: 0; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} +.swiper-creative .swiper-slide { + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + overflow: hidden; + transition-property: transform, opacity, height; +} +.swiper-cards { + overflow: visible; +} +.swiper-cards .swiper-slide { + transform-origin: center bottom; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + overflow: hidden; +} Property changes on: base3.10/src/main/webapp/css/user/swiper-bundle.css ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/fonts/NotoSansKR-Regular.woff =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: base3.10/src/main/webapp/fonts/icomoon.svg =================================================================== --- base3.10/src/main/webapp/fonts/icomoon.svg (nonexistent) +++ base3.10/src/main/webapp/fonts/icomoon.svg (revision 34) @@ -0,0 +1,19 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > +<svg xmlns="http://www.w3.org/2000/svg"> +<metadata>Generated by IcoMoon</metadata> +<defs> +<font id="icomoon" horiz-adv-x="1024"> +<font-face units-per-em="1024" ascent="960" descent="-64" /> +<missing-glyph horiz-adv-x="1024" /> +<glyph unicode="&#x20;" horiz-adv-x="512" d="" /> +<glyph unicode="&#xe900;" glyph-name="arrow-dl" horiz-adv-x="938" d="M868.709-64c-18.45 0-35.363 6.15-49.201 19.988l-442.811 442.811c-27.676 27.676-27.676 70.727 0 98.402l442.811 442.811c27.676 27.676 70.727 27.676 98.402 0s27.676-70.727 0-98.402l-393.61-393.61 393.61-393.61c27.676-27.676 27.676-70.727 0-98.402-13.838-13.838-30.751-19.988-49.201-19.988zM512-64c-18.45 0-35.363 6.15-49.201 19.988l-442.811 442.811c-27.676 27.676-27.676 70.727 0 98.402l442.811 442.811c27.676 27.676 70.727 27.676 98.402 0s27.676-70.727 0-98.402l-393.61-393.61 393.61-393.61c27.676-27.676 27.676-70.727 0-98.402-13.838-13.838-30.751-19.988-49.201-19.988z" /> +<glyph unicode="&#xe901;" glyph-name="arrow-dr" horiz-adv-x="938" d="M69.189-64c-18.45 0-35.363 6.15-49.201 19.988-27.676 27.676-27.676 70.727 0 98.402l393.61 393.61-393.61 393.61c-27.676 27.676-27.676 70.727 0 98.402s70.727 27.676 98.402 0l442.811-442.811c27.676-27.676 27.676-70.727 0-98.402l-442.811-442.811c-13.838-13.838-30.751-19.988-49.201-19.988zM425.898-64c-18.45 0-35.363 6.15-49.201 19.988-27.676 27.676-27.676 70.727 0 98.402l393.61 393.61-393.61 393.61c-27.676 27.676-27.676 70.727 0 98.402s70.727 27.676 98.402 0l442.811-442.811c27.676-27.676 27.676-70.727 0-98.402l-442.811-442.811c-13.838-13.838-30.751-19.988-49.201-19.988z" /> +<glyph unicode="&#xe902;" glyph-name="arrow-l" horiz-adv-x="581" d="M512-64c-18.45 0-35.363 6.15-49.201 19.988l-442.811 442.811c-27.676 27.676-27.676 70.727 0 98.402l442.811 442.811c27.676 27.676 70.727 27.676 98.402 0s27.676-70.727 0-98.402l-393.61-393.61 393.61-393.61c27.676-27.676 27.676-70.727 0-98.402-13.838-13.838-30.751-19.988-49.201-19.988z" /> +<glyph unicode="&#xe903;" glyph-name="arrow-r" horiz-adv-x="581" d="M69.189-64c-18.45 0-35.363 6.15-49.201 19.988-27.676 27.676-27.676 70.727 0 98.402l393.61 393.61-393.61 393.61c-27.676 27.676-27.676 70.727 0 98.402s70.727 27.676 98.402 0l442.811-442.811c27.676-27.676 27.676-70.727 0-98.402l-442.811-442.811c-13.838-13.838-30.751-19.988-49.201-19.988z" /> +<glyph unicode="&#xe904;" glyph-name="arrow-t" horiz-adv-x="1929" d="M105.205-64c-28.055 0-56.11 14.027-77.151 35.068-42.082 42.082-35.068 112.219 7.014 147.288l862.685 813.589c42.082 42.082 112.219 35.068 147.288-7.014 42.082-42.082 35.068-112.219-7.014-147.288l-862.685-813.589c-21.041-21.041-42.082-28.055-70.137-28.055zM1823.562-64c-28.055 0-49.096 7.014-70.137 28.055l-855.671 813.589c-42.082 42.082-42.082 105.205-7.014 147.288 42.082 42.082 105.205 42.082 147.288 7.014l855.671-813.589c42.082-42.082 42.082-105.205 7.014-147.288-21.041-21.041-49.096-35.068-77.151-35.068z" /> +<glyph unicode="&#xe905;" glyph-name="arrow-b" horiz-adv-x="1929" d="M1823.562 960c28.055 0 56.11-14.027 77.151-35.068 42.082-42.082 35.068-112.219-7.014-147.288l-855.671-813.589c-42.082-42.082-105.205-35.068-147.288 7.014s-35.068 112.219 7.014 147.288l855.671 813.589c21.041 21.041 42.082 28.055 70.137 28.055zM105.205 960c28.055 0 49.096-7.014 70.137-28.055l862.685-813.589c42.082-42.082 42.082-105.205 7.014-147.288-42.082-42.082-105.205-42.082-147.288-7.014l-862.685 813.589c-42.082 42.082-49.096 105.205-7.014 147.288 21.041 21.041 49.096 35.068 77.151 35.068z" /> +<glyph unicode="&#xe906;" glyph-name="blank" d="M749.469 369.759c-21.962 0-41.18 19.217-41.18 41.18v233.351h-233.351c-21.962 0-41.18 19.217-41.18 41.18s19.217 41.18 41.18 41.18h274.531c21.962 0 41.18-19.217 41.18-41.18v-274.531c0-21.962-19.217-41.18-41.18-41.18zM266.295 161.115c-10.981 0-21.962 2.745-30.198 10.981-16.472 16.472-16.472 41.18 0 57.651l483.174 485.92c16.472 16.472 41.18 16.472 57.651 0s16.472-41.18 0-57.651l-480.429-485.92c-8.236-8.236-19.217-10.981-30.198-10.981zM771.432-64h-521.609c-140.011 0-252.568 112.558-252.568 252.568v521.609c0 140.011 112.558 252.568 252.568 252.568h301.984c21.962 0 41.18-19.217 41.18-41.18s-19.217-41.18-41.18-41.18h-301.984c-93.34 0-170.209-76.869-170.209-170.209v-521.609c0-93.34 76.869-170.209 170.209-170.209h521.609c93.34 0 170.209 76.869 170.209 170.209v301.984c0 21.962 19.217 41.18 41.18 41.18s41.18-19.217 41.18-41.18v-301.984c0-140.011-112.558-252.568-252.568-252.568z" /> +<glyph unicode="&#xe908;" glyph-name="close" d="M958.638-64c-17.43 0-33.407 5.81-46.479 18.882l-893.277 893.277c-26.145 26.145-26.145 66.814 0 92.959s66.814 26.145 92.959 0l893.277-893.277c26.145-26.145 26.145-66.814 0-92.959-13.072-11.62-30.502-18.882-46.479-18.882zM65.362-64c-17.43 0-33.407 5.81-46.479 18.882-26.145 26.145-26.145 66.814 0 92.959l893.277 893.277c26.145 26.145 66.814 26.145 92.959 0s26.145-66.814 0-92.959l-893.277-893.277c-13.072-11.62-29.050-18.882-46.479-18.882z" /> +<glyph unicode="&#xe909;" glyph-name="search" horiz-adv-x="985" d="M404.382 151.236c-104.357 0-208.713 39.134-286.981 117.401-156.535 156.535-156.535 417.427 0 573.962v0c156.535 156.535 417.427 156.535 573.962 0s156.535-417.427 0-573.962c-78.268-78.268-182.624-117.401-286.981-117.401zM182.624 777.376c-117.401-117.401-117.401-313.070 0-436.994 117.401-117.401 313.070-117.401 436.994 0 117.401 117.401 117.401 313.070 0 436.994s-313.070 117.401-436.994 0v0zM932.688-64c-13.045 0-26.089 6.522-32.611 13.045l-300.025 300.025c-19.567 19.567-19.567 52.178 0 71.745s52.178 19.567 71.745 0l300.025-300.025c19.567-19.567 19.567-52.178 0-71.745-13.045-6.522-26.089-13.045-39.134-13.045z" /> +</font></defs></svg> \ No newline at end of file Index: base3.10/src/main/webapp/fonts/icomoon.ttf =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/fonts/icomoon.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/WEB-INF/tiles/tiles-config.xml =================================================================== --- base3.10/src/main/webapp/WEB-INF/tiles/tiles-config.xml (revision 33) +++ base3.10/src/main/webapp/WEB-INF/tiles/tiles-config.xml (revision 34) @@ -7,7 +7,8 @@ <!-- 사용자 메인 템플릿 --> <definition name=".defaultLayout" template="/WEB-INF/tiles/layouts/defaultLayout.jsp"> <put-attribute name="header" value="/WEB-INF/tiles/template/defaultHeader.jsp"/> - <put-attribute name="menu" value="/WEB-INF/tiles/template/defaultMenu.jsp"/> + <put-attribute name="menu" value="/WEB-INF/tiles/template/defaultTopMenu.jsp"/> +<!-- <put-attribute name="menu" value="/WEB-INF/tiles/template/defaultMenu.jsp"/> --> <put-attribute name="body" value=""/> <put-attribute name="footer" value="/WEB-INF/tiles/template/defaultFooter.jsp"/> </definition> @@ -15,7 +16,7 @@ <!-- 사용자 서브 템플릿 --> <definition name=".defaultSubLayout" template="/WEB-INF/tiles/layouts/defaultSubLayout.jsp"> <put-attribute name="header" value="/WEB-INF/tiles/template/defaultHeader.jsp"/> - <put-attribute name="menu" value="/WEB-INF/tiles/template/defaultMenu.jsp"/> + <put-attribute name="menu" value="/WEB-INF/tiles/template/defaultTopMenu.jsp"/> <put-attribute name="subMenu" value="/WEB-INF/tiles/template/defaultSubMenu.jsp"/> <put-attribute name="body" value=""/> <put-attribute name="footer" value="/WEB-INF/tiles/template/defaultFooter.jsp"/> Index: base3.10/src/main/webapp/WEB-INF/tiles/layouts/defaultSubLayout.jsp =================================================================== --- base3.10/src/main/webapp/WEB-INF/tiles/layouts/defaultSubLayout.jsp (revision 33) +++ base3.10/src/main/webapp/WEB-INF/tiles/layouts/defaultSubLayout.jsp (revision 34) @@ -13,8 +13,8 @@ <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta property="og:type" content="website"> - <meta property="og:title" content="TS튜닝알리고"> - <meta property="og:url" content="cyberts.kr/vtsp/"> + <meta property="og:title" content="${systemVO.sysNm }"> + <meta property="og:url" content="localhost:8080"> <meta property="og:description" content="자동차 튜닝 관련 제품, 기술마켓, 비지니스지원, 일자리 정보제공"> <meta property="og:image" content="/images/custom/logo.jpg"/> <meta name="viewport" content="width=device-width, user-scalable=no" /> @@ -24,10 +24,10 @@ </head> <body> <tiles:insertAttribute name="menu" /> - <section class="section"> +<!-- <section class="section"> --> <tiles:insertAttribute name="subMenu" /> <tiles:insertAttribute name="body" /> - </section> +<!-- </section> --> <tiles:insertAttribute name="footer" /> </body> </html> \ No newline at end of file Index: base3.10/src/main/webapp/WEB-INF/tiles/layouts/defaultLayout.jsp =================================================================== --- base3.10/src/main/webapp/WEB-INF/tiles/layouts/defaultLayout.jsp (revision 33) +++ base3.10/src/main/webapp/WEB-INF/tiles/layouts/defaultLayout.jsp (revision 34) @@ -13,8 +13,8 @@ <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta property="og:type" content="website"> - <meta property="og:title" content="TS튜닝알리고"> - <meta property="og:url" content="cyberts.kr/vtsp/"> + <meta property="og:title" content="${systemVO.sysNm }"> + <meta property="og:url" content="localhost:8080"> <meta property="og:description" content="자동차 튜닝 관련 제품, 기술마켓, 비지니스지원, 일자리 정보제공"> <meta property="og:image" content="<c:url value='/images/custom/logo.jpg'/>"/> <meta name="viewport" content="width=device-width, user-scalable=no" /> @@ -22,9 +22,10 @@ <link rel="icon" href="<c:url value='/images/custom/favicon.ico' />" type="image/x-icon"> <tiles:insertAttribute name="header" /> </head> -<body class="index_body"> +<body> +<div class="main_container container"> <!-- main popup --> - <c:if test="${not empty popupList }"> + <%-- <c:if test="${not empty popupList }"> <div class="main_modal_wrap" style="display: none;"> <div class="main_modal"> <div class="modal_control"> @@ -52,10 +53,10 @@ </div> </div> </div> - </c:if> + </c:if> --%> <script> - $(document).ready(function(){ + /* $(document).ready(function(){ var mslidelrngth = $(".modal_slide").find(".m_slide").length; if (mslidelrngth > 1){ $(".modal_content").find(".slick-dots li:last-child a").on('focusout', function(){ @@ -66,16 +67,17 @@ $("#closeCheck").focus(); }); } - }); + }); */ </script> - - <!-- main popup --> <tiles:insertAttribute name="menu" /> <tiles:insertAttribute name="body" /> - <div class="modal" id="policy" role="dialog" aria-modal="true"> + <tiles:insertAttribute name="footer" /> + + <!-- main popup --> + <!-- <div class="modal" id="policy" role="dialog" aria-modal="true"> <div class="modal_wrap"> - <!-- Modal content --> + Modal content <div class="modal_box width500"> <div class="modal_title"> <h3>공공데이터 이용정책</h3> @@ -89,6 +91,11 @@ </div> </div> </div> - </div> + </div> --> + <script> + var rellax = new Rellax('.rellax'); //parallax + $("html").easeScroll(); //smooth scroll + </script> +</div> </body> </html> \ No newline at end of file Index: base3.10/src/main/webapp/WEB-INF/tiles/template/defaultFooter.jsp =================================================================== --- base3.10/src/main/webapp/WEB-INF/tiles/template/defaultFooter.jsp (revision 33) +++ base3.10/src/main/webapp/WEB-INF/tiles/template/defaultFooter.jsp (revision 34) @@ -5,82 +5,33 @@ <c:set value="${sessionScope.loginVO}" var="loginVO" /> <c:set value="${sessionScope.ntcnCnt}" var="ntcnCnt" /> <!-- footer start --> -<footer> - <button class="skip_top" title="top으로가기버튼" onclick="window.scrollTo(0,0);">top</button> - <div class="os"> - <div class="os_title"> - <strong>online service</strong> <em>고객지원</em> - </div> - <div class="os_list"> - <ul> - <li class="os2"><a href="<c:url value='/cop/bbs/000000000007/selectArticleList.do'/>" title="공지사항">공지사항</a></li> - <li class="os1"><a href="<c:url value='/mrk/cart/list.do'/>" title="장바구니">장바구니</a></li> - <li class="os3"><a href="<c:url value='/cst/faq/list.do'/>" title="자주묻는질문">자주묻는질문</a></li> - <li class="os6"><a href="#!" title="온라인도움말">온라인도움말</a></li> - </ul> - </div> - </div> - <div class="footer_bar"> - <div class="relative"> - <ul class="tac_list"> - <li><a href="https://kotsa.or.kr/portal/contents.do?menuCode=07010000" target="_blank" class="blank_w" title="이용약관 [새창열림]">이용약관</a></li> - <li><a href="https://kotsa.or.kr/portal/contents.do?menuCode=07020000" target="_blank" class="blank_w" title="개인보호정책 [새창열림]">개인보호정책</a></li> - <li><a href="https://kotsa.or.kr/portal/contents.do?menuCode=07040000" target="_blank" class="blank_w" title="이메일무단수집거부 [새창열림]">이메일무단수집거부</a></li> - <li><a href="https://kotsa.or.kr/portal/empList.do?menuCode=06020404" target="_blank" class="blank_w" title="조직 및 직원안내 [새창열림]">조직 및 직원안내</a></li> - <li><a href="https://kotsa.or.kr/portal/contents.do?menuCode=06040000" target="_blank" class="blank_w" title="찾아오시는길 [새창열림]">찾아오시는길</a></li> -<!-- <li><a href="#!" title="공공데이터 이용정책 [팝업열림]" class="openpopup" aria-controls="policy">공공데이터 이용정책</a></li> --> - </ul> - <ul class="familysite"> - <li> - <a class="btn_family" href="#!" title="관련사이트 열기">관련 사이트</a> - <ul> - <li class="blank"><a href="http://www.ntrh.or.kr" target="_blank" title="국립교통재활병원 [새창열림]">국립교통재활병원</a></li> - <li class="blank"><a href="https://www.kotsa.or.kr/mpis" target="_blank" title="기계식주차장 관리인 교육 [새창열림]">기계식주차장 관리인 교육</a></li> - <li class="blank"><a href="https://www.kotsa.or.kr/safeinfo" target="_blank" title="전세버스 정보확인 [새창열림]">전세버스 정보확인</a></li> - <li class="blank"><a href="https://www.clean.go.kr" target="_blank" title="청렴신문고 [새창열림]">청렴신문고</a></li> - <li class="blank"><a href="https://www.molit.go.kr" target="_blank" title="국토교통부 [새창열림]">국토교통부</a></li> - <li class="blank"><a href="https://www.safe182.go.kr" target="_blank" title="안전 DREAM [새창열림]">안전 DREAM</a></li> - <li class="blank"><a href="https://job.alio.go.kr" target="_blank" title="JOB-ALIO [새창열림]">JOB-ALIO</a></li> - <li class="blank"><a href="https://stat.molit.go.kr" target="_blank" title="국토교통 통계누리 [새창열림]">국토교통 통계누리</a></li> - <li class="blank"><a href="https://www.mois.go.kr" target="_blank" title="국가상징알아보기 [새창열림]">국가상징알아보기</a></li> - <li class="blank"><a href="http://www.car365.go.kr" target="_blank" title="자동차 365 [새창열림]">자동차 365</a></li> - </ul> - </li> - </ul> - </div> - </div> - <div class="footer"> - <ul> - <li> - <div class="logo"> - <a href="<c:url value="/" />" title="TS튜닝알리고 로고 [최상단으로 이동]">TS튜닝알리고</a> - </div> - <dl class="footer_info"> - <dt>주소</dt> - <dd>39660 경상북도 김천시 혁신로6길 17<br>(율곡동, 한국교통안전공단)</dd> - </dl> - </li> - <li> - <div class="cs_wrap"> - <p>고객센터</p> - <strong>1577-0990</strong> <em>평일 09:00 ~ 18:00<br /> 통화료는 - 사용자 부담 - </em> +<footer class="footer"> + <div class="inner"> + <button class="skip_top" type="button" title="맨위로가기" onclick="window.scrollTo(0,0);"><em class="blind">skip top</em></button> + <div class="footer_content"> + <div class="footer_left"> + <div class="footer_logo"> <a href="/" title="메인페이지로 이동"><img src="/images/user/logo.svg" alt="crossroards webzine 로고"></a> <a href="#!" title="apctp로 이동 [새창열림]"><img src="/images/user/logo_apctp.jpg" alt="apctp 로고"></a> </div> + <div class="footer_text"> <strong>crossroards webzine은 아시아태평양이론물리센터에서 발행합니다.</strong> + <p>(C) 2005~2022 Asia Pacific Center for Theoretical Physics ALL RIGHTS RESERVED. sc(at)apctp.org<br> + 크로스로드는 정부의 과학기술진흥기금 및 복권기금 지원으로 국민과 함께하고 있습니다.</p> </div> - </li> - </ul> - <p class="text_bottom">Copyright(C) TS. all rights reserved.</p> - <!-- 웹접근성 --> - <div class="webacc"> - <a href="http://webwatch.or.kr" target="_blank" title="[새창열림] WA 품질인증마크, 웹와치(WebWatch) 2021.12.6 ~ 2022.12.5"><img src="<c:url value='/images/custom/webacc.svg'/>" alt="과학기술정보통신부 WA(WEB접근성) 품질인증 마크, 웹와치(WebWatch) 2021.12.6 ~ 2022.12.5"></a> + </div> + <div class="sns"> + <ul> + <li class="insta"><a href="https://www.instagram.com/apctp_official/" target="_blank" title="instagram [새창열림]">instagram</a></li> + <li class="facebook"><a href="https://www.youtube.com/channel/UCR1zgxenBKqhxfTJUd-KE5g?view_as=subscriber" target="_blank" title="facebook [새창열림]">facebook</a></li> + <li class="naver"><a href="https://www.facebook.com/crossroads.apctp/" target="_blank" title="naver TV [새창열림]">naver TV</a></li> + <li class="youtube"><a href="https://tv.naver.com/apctpofficial" target="_blank" title="youtube [새창열림]">youtube</a></li> + <li class="rss"><a href="javasctipt:void(0)" target="_blank" title="RSS 2.0 [새창열림]">RSS 2.0</a></li> + </ul> + </div> </div> - <!-- 웹접근성 --> </div> - </footer> -<div class="modal" id="policy" role="dialog" aria-modal="true"> +<!-- footer end --> +<!-- <div class="modal" id="policy" role="dialog" aria-modal="true"> <div class="modal_wrap"> - <!-- Modal content --> + Modal content <div class="modal_box width500" > <div class="modal_title"> <strong>공공데이터 이용정책</strong> @@ -94,8 +45,16 @@ </div> </div> </div> - </div> + </div> --> + + <script type="text/javascript" src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script> + <script src="/js/user/designJS.js"></script> <script> + AOS.init({ + easing: 'ease-out-back', + duration: 1000 + }); //slide up animation + // 사용자 권한가져오기 function fncGetAuthorCode() { return "${loginVO.authorCode }" Index: base3.10/src/main/webapp/WEB-INF/tiles/template/defaultHeader.jsp =================================================================== --- base3.10/src/main/webapp/WEB-INF/tiles/template/defaultHeader.jsp (revision 33) +++ base3.10/src/main/webapp/WEB-INF/tiles/template/defaultHeader.jsp (revision 34) @@ -29,14 +29,12 @@ <script type="text/javascript" src="<c:url value='/js/com/jquery.fullPage.js'><c:param name="dt" value="${nowDate}"/></c:url>" ></script> <!-- CSS --> -<link rel="stylesheet" type="text/css" href="<c:url value='/css/custom/slick.css'><c:param name="dt" value="${nowDate}"/></c:url>"> -<link rel="stylesheet" type="text/css" href="<c:url value='/css/custom/slick-theme.css'><c:param name="dt" value="${nowDate}"/></c:url>"> -<link rel="stylesheet" type="text/css" href="<c:url value='/css/custom/jquery.fullPage.css'><c:param name="dt" value="${nowDate}"/></c:url>" /> -<link rel="stylesheet" type="text/css" href="<c:url value='/css/custom/style.css'><c:param name="dt" value="${nowDate}"/></c:url>" /> -<link rel="stylesheet" type="text/css" href="<c:url value='/css/custom/board.css'><c:param name="dt" value="${nowDate}"/></c:url>" /> -<link rel="stylesheet" type="text/css" href="<c:url value='/css/custom/common.css'><c:param name="dt" value="${nowDate}"/></c:url>" /> -<%-- <link rel="stylesheet" type="text/css" href="<c:url value='/css/custom/popup.css'><c:param name="dt" value="${nowDate}"/></c:url>" /> --%> -<link rel="stylesheet" type="text/css" href="<c:url value='/css/custom/responsive.css'><c:param name="dt" value="${nowDate}"/></c:url>" /> +<link rel="stylesheet" type="text/css" href="<c:url value='/css/user/font.css'><c:param name="dt" value="${nowDate}"/></c:url>"> +<link rel="stylesheet" type="text/css" href="<c:url value='/css/user/style.css'><c:param name="dt" value="${nowDate}"/></c:url>"> +<link rel="stylesheet" type="text/css" href="<c:url value='/css/user/board.css'><c:param name="dt" value="${nowDate}"/></c:url>" /> +<link rel="stylesheet" type="text/css" href="<c:url value='/css/user/common.css'><c:param name="dt" value="${nowDate}"/></c:url>" /> +<link rel="stylesheet" type="text/css" href="<c:url value='/css/user/popup.css'><c:param name="dt" value="${nowDate}"/></c:url>" /> +<link rel="stylesheet" type="text/css" href="<c:url value='/css/user/responsive.css'><c:param name="dt" value="${nowDate}"/></c:url>" /> <link rel="stylesheet" type="text/css" href="<c:url value='/resource/jquery-ui-1.12.1/jquery-ui.min.css'><c:param name="dt" value="${nowDate}"/></c:url>"> @@ -44,6 +42,20 @@ <script type="text/javascript" src="<c:url value='/js/com/html2pdf.bundle.js'><c:param name="dt" value="${nowDate}"/></c:url>"></script> <%-- <script type="text/javascript" src="<c:url value='/js/com/fontawesome.js' ><c:param name="dt" value="${nowDate}"/></c:url>"></script> --%> +<!-- font--> +<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400|Arapey" rel="stylesheet"> +<link href="https://fonts.googleapis.com/css?family=Noto+Sans+KR:100,300,400,500,700,900&amp;subset=korean" rel="stylesheet"> + +<!--animation--> +<link rel="stylesheet" type="text/css" href="<c:url value='/css/user/aos.css' />" /> +<script type="text/javascript" src="/js/user/ScrollMagic.js"></script> +<script type="text/javascript" src="/js/user/debug.addIndicators.js"></script> +<script type="text/javascript" src="/js/user/animation.gsap.js"></script> + +<!--slide--> +<link rel="stylesheet" type="text/css" href="<c:url value='/css/user/swiper-bundle.css' />" /> +<script type="text/javascript" src="/js/user/swiper-bundle.js"></script> + <script type="text/javascript" src="<c:url value='/js/com/jquery.smoothwheel.js' ><c:param name="dt" value="${nowDate}"/></c:url>"></script> <script type="text/javascript" src="<c:url value='/js/com/jquery.easing.1.3.js' ><c:param name="dt" value="${nowDate}"/></c:url>"></script> @@ -76,7 +88,7 @@ <!-- 공통JS --> <script type="text/javascript" src="<c:url value='/js/com/common.js' ><c:param name="dt" value="${nowDate}"/></c:url>"></script> -<script type="text/javascript" src="<c:url value='/js/com/designJS.js' ><c:param name="dt" value="${nowDate}"/></c:url>"></script> +<script type="text/javascript" src="<c:url value='/js/user/designJS.js' ><c:param name="dt" value="${nowDate}"/></c:url>"></script> <!-- 파일 업로드(common.js 필요) --> <script type="text/javascript" src="<c:url value='/js/com/dragFileUploader.js' ><c:param name="dt" value="${nowDate}"/></c:url>"></script> Index: base3.10/src/main/webapp/WEB-INF/tiles/template/defaultTopMenu.jsp =================================================================== --- base3.10/src/main/webapp/WEB-INF/tiles/template/defaultTopMenu.jsp (nonexistent) +++ base3.10/src/main/webapp/WEB-INF/tiles/template/defaultTopMenu.jsp (revision 34) @@ -0,0 +1,23 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<header class="header"> + <div class="skip"> <a href="#contents" onclick="$('#contents').attr('tabindex', '-1').focus(); return false;">본문 바로가기</a> <a href="#gnb_wrap" onclick="$('#gnb_wrap').attr('tabindex', '-1').focus(); return false;">메뉴바로가기</a> </div> + <div class="inner"> + <h1><a href="/" title="메인페이지로 이동"><em class="blind">crossroards webzine</em></a></h1> + <div class="header_list"> + <ul class="header_left" id="gnb_wrap"> + <li><a href="/" title="home">home</a></li> + <li><a href="https://www.apctp.org/" target="_blank" title="apctp [새창열림]">apctp</a></li> + <li><a href="/content/common/about.html" title="about crossroards">about crossroards</a></li> + </ul> + <ul class="header_right"> + <li><a href="/content/common/archive.html" title="archive">archive</a></li> + <li><a href="/content/common/notice_list.html" title="공지사항">notice</a></li> + <li><a href="javasctipt:void(0)" aria-haspopup="dialog" data-popup="login">admin</a></li> + </ul> + </div> + <div class="header_bottom"> <a href="/content/common/magazine_list.html" class="info" title="2022년1월 통권 196호">2022년1월 통권 196호</a> + <button type="button" class="total_search" title="통합검색" aria-haspopup="dialog" data-popup="search"><span class="icon-search"></span><em class="blind">통합검색</em></button> + </div> + </div> +</header> \ No newline at end of file Property changes on: base3.10/src/main/webapp/WEB-INF/tiles/template/defaultTopMenu.jsp ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/WEB-INF/jsp/egovframework/com/cmm/userIndex.jsp =================================================================== --- base3.10/src/main/webapp/WEB-INF/jsp/egovframework/com/cmm/userIndex.jsp (nonexistent) +++ base3.10/src/main/webapp/WEB-INF/jsp/egovframework/com/cmm/userIndex.jsp (revision 34) @@ -0,0 +1,160 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<div class="swiper main_slide"> + <div class="swiper-wrapper"> + + <!--slide--> + <div class="swiper-slide bg_box"> <img src="/images/user/main_bg.jpg" alt=""> + <div class="inner"><em class="rellax" title="cross street" data-rellax-speed="4">cross street</em> <strong data-swiper-parallax="-2000" class="rellax" data-rellax-speed="3">허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경</strong> + <p data-swiper-parallax="-3000" class="rellax" data-rellax-speed="2">조선 시대 가장 존경받는 정승이 누구인지 물어보면 누구나 이견 없이 황희 정승을 꼽을 것이다.<br> + 황희는 현재의 국무총리 역할인 조선 시대 정승이었던 좌의정, 우의정, 영의정을 무려 25년 가까이 수행하였다.</p> + <button data-swiper-parallax="-4000" onClick="location.href='/content/common/article_view.html'" class="rellax" data-rellax-speed="1">show more</button> + </div> + </div> + <div class="swiper-slide bg_box"> <img src="/images/user/main_bg.jpg" alt=""> + <div class="inner"><em class="rellax" title="cross street" data-rellax-speed="4">cross street</em> <strong data-swiper-parallax="-2000" class="rellax" data-rellax-speed="3">허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경</strong> + <p data-swiper-parallax="-3000" class="rellax" data-rellax-speed="2">조선 시대 가장 존경받는 정승이 누구인지 물어보면 누구나 이견 없이 황희 정승을 꼽을 것이다.<br> + 황희는 현재의 국무총리 역할인 조선 시대 정승이었던 좌의정, 우의정, 영의정을 무려 25년 가까이 수행하였다.</p> + <button data-swiper-parallax="-4000" onClick="location.href='/content/common/article_view.html'" class="rellax" data-rellax-speed="1">show more</button> + </div> + </div> + <div class="swiper-slide bg_box"> <img src="/images/user/main_bg.jpg" alt=""> + <div class="inner"><em class="rellax" title="cross street" data-rellax-speed="4">cross street</em> <strong data-swiper-parallax="-2000" class="rellax" data-rellax-speed="3">허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경</strong> + <p data-swiper-parallax="-3000" class="rellax" data-rellax-speed="2">조선 시대 가장 존경받는 정승이 누구인지 물어보면 누구나 이견 없이 황희 정승을 꼽을 것이다.<br> + 황희는 현재의 국무총리 역할인 조선 시대 정승이었던 좌의정, 우의정, 영의정을 무려 25년 가까이 수행하였다.</p> + <button data-swiper-parallax="-4000" onClick="location.href='/content/common/article_view.html'" class="rellax" data-rellax-speed="1">show more</button> + </div> + </div> + + <!--slide--> + </div> + <div class="swiper-button-next"></div> + <div class="swiper-button-prev"></div> + <div class="swiper-pagination rellax" data-rellax-speed="2.3"></div> +</div> +<div class="main_content"> + <div class="inner"> + <!--hot click start--> + <div class="rellax" data-rellax-speed="4"> + <div class="hotClick"> + <div class="title_wrap"> + <h2 data-aos="zoom-in">hot click</h2> + </div> + <ol class="listshow"> + <li data-aos="zoom-in"><a href="javascript:void(0)" title="APCTP 2021 올해의 과학도서">APCTP 2021 올해의 과학도서</a></li> + <li data-aos="zoom-in"><a href="javascript:void(0)" title="APCTP 2021 올해의 과학도서">APCTP 2021 올해의 과학도서</a></li> + <li data-aos="zoom-in"><a href="javascript:void(0)" title="APCTP 2021 올해의 과학도서">APCTP 2021 올해의 과학도서</a></li> + <li data-aos="zoom-in"><a href="javascript:void(0)" title="APCTP 2021 올해의 과학도서">APCTP 2021 올해의 과학도서</a></li> + <li data-aos="zoom-in"><a href="javascript:void(0)" title="APCTP 2021 올해의 과학도서">APCTP 2021 올해의 과학도서</a></li> + <li data-aos="zoom-in"><a href="javascript:void(0)" title="APCTP 2021 올해의 과학도서">APCTP 2021 올해의 과학도서</a></li> + <li data-aos="zoom-in"><a href="javascript:void(0)" title="APCTP 2021 올해의 과학도서">APCTP 2021 올해의 과학도서</a></li> + <li data-aos="zoom-in"><a href="javascript:void(0)" title="APCTP 2021 올해의 과학도서">APCTP 2021 올해의 과학도서</a></li> + <li data-aos="zoom-in"><a href="javascript:void(0)" title="APCTP 2021 올해의 과학도서">APCTP 2021 올해의 과학도서</a></li> + <li data-aos="zoom-in"><a href="javascript:void(0)" title="APCTP 2021 올해의 과학도서">APCTP 2021 올해의 과학도서</a></li> + <li data-aos="zoom-in"><a href="javascript:void(0)" title="APCTP 2021 올해의 과학도서">APCTP 2021 올해의 과학도서</a></li> + </ol> + </div> + </div> + <!--hot click end--> + <!--recent articles start--> + <div class="article_list main_wrap rearticle rellax" data-rellax-speed="3"> + <div class="title_wrap"> + <h2 data-aos="zoom-in">recent articles</h2> + <button type="button" class="showmore" data-aos="zoom-in" data-aos-delay="200" >show more<span class="icon-arrow-r"></span></button> + </div> + <ul class="listshow"> + <li data-aos="zoom-in"> <a href="/content/common/article_view.html" class="bg_box" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경" > <img src="/images/user/sample1.jpg" alt="우주이미지"> </a> <a href="#!" class="category">Cross Street</a> <a href="#!" class="title textover" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경">허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경</a> + <p class="by"> <a href="/content/common/writer_list.html" title="작가 정보" class="writer">강성주</a><em>국립과천과학관</em></p> + <p class="text"> <a href="/content/common/article_view.html" class="textover" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경">조선 시대 가장 존경받는 정승이 누구인지 물어보면 누구나 이견 없이 황희 정승을 꼽을 것이다. 황희는 현재의 국무총리 역할인 조선 시대 정승이었던 좌의정, 우의정, 영의정을 무려 25년 가까이 수행하였다. 황희는 현재의 국무총리 역할인 조선 시대 정승이었던 좌의정, 우의정, 영의정을 무려 25년 가까이 수행하였다.</a> </p> + </li> + <li data-aos="zoom-in"> <a href="/content/common/article_view.html" class="bg_box" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경" > <img src="/images/user/sample1.jpg" alt="우주이미지"> </a> <a href="#!" class="category">Cross Street</a> <a href="#!" class="title textover" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경">허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경</a> + <p class="by"> <a href="/content/common/writer_list.html" title="작가 정보" class="writer">강성주</a><em>국립과천과학관</em></p> + <p class="text"> <a href="/content/common/article_view.html" class="textover" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경">조선 시대 가장 존경받는 정승이 누구인지 물어보면 누구나 이견 없이 황희 정승을 꼽을 것이다. 황희는 현재의 국무총리 역할인 조선 시대 정승이었던 좌의정, 우의정, 영의정을 무려 25년 가까이 수행하였다. 황희는 현재의 국무총리 역할인 조선 시대 정승이었던 좌의정, 우의정, 영의정을 무려 25년 가까이 수행하였다.</a> </p> + </li> + <li data-aos="zoom-in"> <a href="/content/common/article_view.html" class="bg_box" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경" > <img src="/images/user/sample1.jpg" alt="우주이미지"> </a> <a href="#!" class="category">Cross Street</a> <a href="#!" class="title textover" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경">허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경</a> + <p class="by"> <a href="/content/common/writer_list.html" title="작가 정보" class="writer">강성주</a><em>국립과천과학관</em></p> + <p class="text"> <a href="/content/common/article_view.html" class="textover" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경">조선 시대 가장 존경받는 정승이 누구인지 물어보면 누구나 이견 없이 황희 정승을 꼽을 것이다. 황희는 현재의 국무총리 역할인 조선 시대 정승이었던 좌의정, 우의정, 영의정을 무려 25년 가까이 수행하였다. 황희는 현재의 국무총리 역할인 조선 시대 정승이었던 좌의정, 우의정, 영의정을 무려 25년 가까이 수행하였다.</a> </p> + </li> + </ul> + </div> + <!--recent articles end--> + <!--videos start--> + <div class="article_list main_wrap rellax" data-rellax-speed="2"> + <div class="title_wrap"> + <h2 data-aos="zoom-in">videos</h2> + <button type="button" class="showmore" data-aos="zoom-in" data-aos-delay="200">show more<span class="icon-arrow-r"></span></button> + </div> + <ul class="listshow"> + <li data-aos="zoom-in"><a href="#!" class="bg_box" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경"><img src="/images/user/sample1.jpg" alt="우주이미지"></a><a href="#!" class="title textover" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경">허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경</a> + <p class="time">05:00</p> + </li> + <li data-aos="zoom-in"><a href="#!" class="bg_box" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경"><img src="/images/user/sample1.jpg" alt="우주이미지"></a><a href="#!" class="title textover" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경">허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경</a> + <p class="time">05:00</p> + </li> + <li data-aos="zoom-in"><a href="#!" class="bg_box" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경"><img src="/images/user/sample1.jpg" alt="우주이미지"></a><a href="#!" class="title textover" title="허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경">허블 우주망원경의 업적 그리고 천문학의 새로운 역사의 시작, 제임스 웹 우주망원경</a> + <p class="time">05:00</p> + </li> + </ul> + </div> + <!--videos end--> + <!--banner start--> + <div class="banner main_wrap rellax" data-rellax-speed="1"> + <ul> + <li> + <div class="title_wrap"> + <h2 data-aos="zoom-in">APCTP's choice</h2> + </div> + <a href="javascript:void(0)" title="올해의 과학도서"><img src="/images/user/book1.png" alt="" data-aos="zoom-in" data-aos-delay="500"> + <div class="bg_box" data-aos="zoom-in" data-aos-delay="200"><img src="/images/user/banner1.jpg" alt="">올해의 과학도서</div> + </a></li> + <li> + <div class="title_wrap"> + <h2 data-aos="zoom-in" data-aos-delay="300">book report</h2> + </div> + <a href="javascript:void(0)" title="올해의 과학도서"><img src="/images/user/book2.png" alt="" data-aos="zoom-in" data-aos-delay="600"> + <div class="bg_box" data-aos="zoom-in" data-aos-delay="400"><img src="/images/user/banner2.jpg" alt="">올해의 과학도서<br> + 청소년 독후감 대회 수상작</div> + </a></li> + </ul> + </div> + <!--banner end--> + <!--notice start--> + <div class="notice main_wrap rellax" data-rellax-speed="0"> + <div class="title_wrap"> + <h2 data-aos="zoom-in"><a href="/content/common/notice_list.html" title="뉴스바로가기" >news & notice</a></h2> + <button type="button" class="showmore" onClick="location.href='/content/common/notice_list.html'" title="뉴스바로가기" data-aos="zoom-in" data-aos-delay="100">show more<span class="icon-arrow-r"></span></button> + </div> + <div class="swiper news_slide" data-aos="fade-left" data-aos-delay="300"> + <div class="swiper-wrapper"> + <!--slide--> + <div class="swiper-slide"><a href="/content/common/notice_list.html" class="textover" title="[과학 커뮤니케이선 강연] 2021 APCTP 공통 과학 +(올해의 과학도서 저자 인터뷰프로그램) 개최">[과학 커뮤니케이선 강연] 2021 APCTP 공통 과학 + (올해의 과학도서 저자 인터뷰프로그램) 개최(올해의 과학도서 저자 인터뷰프로그램) 개최</a> <em>2022.01.17</em> </div> + <div class="swiper-slide"><a href="/content/common/notice_list.html" class="textover" title="[과학 커뮤니케이선 강연] 2021 APCTP 공통 과학 +(올해의 과학도서 저자 인터뷰프로그램) 개최">[과학 커뮤니케이선 강연] 2021 APCTP 공통 과학 + (올해의 과학도서 저자 인터뷰프로그램) 개최</a> <em>2022.01.17</em> </div> + <div class="swiper-slide"><a href="/content/common/notice_list.html" class="textover" title="[과학 커뮤니케이선 강연] 2021 APCTP 공통 과학 +(올해의 과학도서 저자 인터뷰프로그램) 개최">[과학 커뮤니케이선 강연] 2021 APCTP 공통 과학 + (올해의 과학도서 저자 인터뷰프로그램) 개최</a> <em>2022.01.17</em> </div> + <div class="swiper-slide"><a href="/content/common/notice_list.html" class="textover" title="[과학 커뮤니케이선 강연] 2021 APCTP 공통 과학 +(올해의 과학도서 저자 인터뷰프로그램) 개최">[과학 커뮤니케이선 강연] 2021 APCTP 공통 과학 + (올해의 과학도서 저자 인터뷰프로그램) 개최</a> <em>2022.01.17</em> </div> + <div class="swiper-slide"><a href="/content/common/notice_list.html" class="textover" title="[과학 커뮤니케이선 강연] 2021 APCTP 공통 과학 +(올해의 과학도서 저자 인터뷰프로그램) 개최">[과학 커뮤니케이선 강연] 2021 APCTP 공통 과학 + (올해의 과학도서 저자 인터뷰프로그램) 개최</a> <em>2022.01.17</em> </div> + <div class="swiper-slide"><a href="/content/common/notice_list.html" class="textover" title="[과학 커뮤니케이선 강연] 2021 APCTP 공통 과학 +(올해의 과학도서 저자 인터뷰프로그램) 개최">[과학 커뮤니케이선 강연] 2021 APCTP 공통 과학 + (올해의 과학도서 저자 인터뷰프로그램) 개최</a> <em>2022.01.17</em> </div> + <!--slide--> + </div> + <div class="swiper-button-next"></div> + <div class="swiper-button-prev"></div> + <div class="swiper-pagination"></div> + </div> + </div> + <!--notice end--> + </div> + <div class="bg_box rellax" data-rellax-speed="-1" data-aos="zoom-in" data-aos-anchor-placement="center-center"> <img src="/images/user/main_bgwave.svg" alt=""> </div> +</div> +<script type="text/javascript" src="/js/user/rellax.js"></script> +<script src="/js/user/jquery.easeScroll.js"></script> \ No newline at end of file Property changes on: base3.10/src/main/webapp/WEB-INF/jsp/egovframework/com/cmm/userIndex.jsp ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/images/user/sample_notice.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/sample_notice.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/logo_fff.svg =================================================================== --- base3.10/src/main/webapp/images/user/logo_fff.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/logo_fff.svg (revision 34) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="레이어_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" + y="0px" viewBox="0 0 158.9 10" style="enable-background:new 0 0 158.9 10;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#FFFFFF;} +</style> +<g> + <g> + <path class="st0" d="M0,5.1C0,1.8,2.2,0,4.6,0c1.3,0,2.3,0.6,2.9,1.3L6.3,2.7C5.9,2.3,5.3,2,4.7,2C3.4,2,2.4,3.1,2.4,5 + c0,1.9,0.9,3,2.2,3C5.4,8,6,7.6,6.5,7.2l1.2,1.5C6.9,9.6,5.8,10,4.5,10C2.1,10,0,8.3,0,5.1z"/> + <path class="st0" d="M14.5,9.9l-1.8-3.4h-1.1v3.4H9.2V0.2h3.5c2.1,0,3.8,0.7,3.8,3c0,1.4-0.7,2.3-1.7,2.8l2.2,3.8H14.5z M11.6,4.6 + h1c1.1,0,1.7-0.5,1.7-1.4S13.7,2,12.6,2h-1V4.6z"/> + <path class="st0" d="M18.1,5c0-3.2,1.8-5,4.4-5C25.2,0,27,1.8,27,5c0,3.2-1.8,5.1-4.4,5.1C19.9,10,18.1,8.1,18.1,5z M24.6,5 + c0-1.9-0.8-3-2.1-3c-1.3,0-2.1,1.1-2.1,3c0,1.9,0.8,3.1,2.1,3.1C23.8,8,24.6,6.9,24.6,5z"/> + <path class="st0" d="M28.3,8.6L29.6,7c0.7,0.6,1.6,1,2.4,1c0.9,0,1.3-0.3,1.3-0.8c0-0.6-0.5-0.7-1.4-1.1l-1.2-0.5 + c-1-0.4-2-1.2-2-2.7c0-1.6,1.5-2.9,3.5-2.9c1.1,0,2.3,0.4,3.1,1.3l-1.2,1.5c-0.6-0.5-1.2-0.7-2-0.7C31.5,2,31,2.3,31,2.8 + c0,0.5,0.6,0.7,1.5,1.1l1.2,0.5c1.2,0.5,1.9,1.3,1.9,2.7c0,1.6-1.4,3-3.7,3C30.7,10,29.3,9.6,28.3,8.6z"/> + <path class="st0" d="M36.5,8.6L37.8,7c0.7,0.6,1.6,1,2.4,1c0.9,0,1.3-0.3,1.3-0.8c0-0.6-0.5-0.7-1.4-1.1l-1.2-0.5 + c-1-0.4-2-1.2-2-2.7c0-1.6,1.5-2.9,3.5-2.9c1.1,0,2.3,0.4,3.1,1.3l-1.2,1.5c-0.6-0.5-1.2-0.7-2-0.7c-0.7,0-1.2,0.3-1.2,0.8 + c0,0.5,0.6,0.7,1.5,1.1l1.2,0.5c1.2,0.5,1.9,1.3,1.9,2.7c0,1.6-1.4,3-3.7,3C38.8,10,37.5,9.6,36.5,8.6z"/> + <path class="st0" d="M50.7,9.9L49,6.4h-1.1v3.4h-2.3V0.2h3.5c2.1,0,3.8,0.7,3.8,3c0,1.4-0.7,2.3-1.7,2.8l2.2,3.8H50.7z M47.8,4.6 + h1c1.1,0,1.7-0.5,1.7-1.4S50,2,48.9,2h-1V4.6z"/> + <path class="st0" d="M54.4,5c0-3.2,1.8-5,4.4-5s4.4,1.8,4.4,5c0,3.2-1.8,5.1-4.4,5.1S54.4,8.1,54.4,5z M60.9,5c0-1.9-0.8-3-2.1-3 + c-1.3,0-2.1,1.1-2.1,3c0,1.9,0.8,3.1,2.1,3.1C60.1,8,60.9,6.9,60.9,5z"/> + <path class="st0" d="M69.6,7.6h-2.9l-0.6,2.2h-2.4l3-9.7h2.8l3,9.7h-2.4L69.6,7.6z M69.2,5.8L69,5c-0.3-1-0.5-2.1-0.8-3.1h-0.1 + c-0.2,1-0.5,2.1-0.7,3.1l-0.2,0.8H69.2z"/> + <path class="st0" d="M79,9.9l-1.8-3.4h-1.1v3.4h-2.3V0.2h3.5c2.1,0,3.8,0.7,3.8,3c0,1.4-0.7,2.3-1.7,2.8l2.2,3.8H79z M76.1,4.6h1 + c1.1,0,1.7-0.5,1.7-1.4S78.2,2,77.1,2h-1V4.6z"/> + <path class="st0" d="M83.1,0.2h2.8c3,0,4.9,1.4,4.9,4.8s-2,4.9-4.8,4.9h-2.9V0.2z M85.7,8c1.6,0,2.7-0.7,2.7-3S87.3,2,85.7,2h-0.3 + v6H85.7z"/> + <path class="st0" d="M92.1,8.6L93.4,7c0.7,0.6,1.6,1,2.4,1C96.6,8,97,7.7,97,7.2c0-0.6-0.5-0.7-1.4-1.1l-1.2-0.5 + c-1-0.4-2-1.2-2-2.7C92.4,1.3,93.9,0,96,0c1.1,0,2.3,0.4,3.1,1.3l-1.2,1.5C97.3,2.2,96.7,2,96,2c-0.7,0-1.2,0.3-1.2,0.8 + c0,0.5,0.6,0.7,1.5,1.1l1.2,0.5c1.2,0.5,1.9,1.3,1.9,2.7c0,1.6-1.4,3-3.7,3C94.4,10,93.1,9.6,92.1,8.6z"/> + </g> + <g> + <path class="st0" d="M101.9,0.3h1.6l0.9,5l0.5,3.1h0.1c0.2-1,0.4-2.1,0.6-3.1l1.2-5h1.3l1.2,5c0.2,1,0.4,2,0.7,3.1h0.1 + c0.2-1,0.3-2.1,0.5-3.1l0.9-5h1.4L111,9.9h-1.9l-1.3-5.3c-0.2-0.8-0.3-1.5-0.4-2.2h-0.1c-0.1,0.7-0.3,1.4-0.4,2.2l-1.3,5.3h-1.8 + L101.9,0.3z"/> + <path class="st0" d="M114.6,0.3h5.7v1.3h-4.1v2.7h3.5v1.3h-3.5v3.1h4.3v1.3h-5.8V0.3z"/> + <path class="st0" d="M122.5,0.3h3c2,0,3.4,0.6,3.4,2.4c0,0.9-0.5,1.8-1.4,2.1v0.1c1.1,0.2,1.9,1,1.9,2.3c0,1.9-1.5,2.8-3.7,2.8 + h-3.2V0.3z M125.3,4.3c1.5,0,2.1-0.5,2.1-1.4c0-1-0.7-1.4-2-1.4H124v2.8H125.3z M125.5,8.7c1.5,0,2.4-0.5,2.4-1.7 + c0-1.1-0.8-1.5-2.4-1.5H124v3.2H125.5z"/> + <path class="st0" d="M130.6,8.9l4.8-7.4H131V0.3h6.2v0.9l-4.8,7.4h4.8v1.3h-6.7V8.9z"/> + <path class="st0" d="M139.3,0.3h1.5v9.6h-1.5V0.3z"/> + <path class="st0" d="M143.4,0.3h1.5l3.2,5.6l1,2h0.1c-0.1-1-0.2-2.1-0.2-3.2V0.3h1.4v9.6h-1.5l-3.2-5.6l-1-2h-0.1 + c0.1,1,0.2,2.1,0.2,3.1v4.5h-1.4V0.3z"/> + <path class="st0" d="M153.1,0.3h5.7v1.3h-4.1v2.7h3.5v1.3h-3.5v3.1h4.3v1.3h-5.8V0.3z"/> + </g> +</g> +</svg> Index: base3.10/src/main/webapp/images/user/sns_logo.svg =================================================================== --- base3.10/src/main/webapp/images/user/sns_logo.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/sns_logo.svg (revision 34) @@ -0,0 +1,151 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="레이어_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" + y="0px" viewBox="0 0 180.3 60" style="enable-background:new 0 0 180.3 60;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#6A6B6B;} + .st1{fill:#7E7E7E;} + .st2{fill:#FFFFFF;} + .st3{fill:url(#SVGID_1_);} + .st4{fill:url(#SVGID_00000076600337762704624210000007006571112554556088_);} + .st5{fill:url(#SVGID_00000165228005465083780070000001366582890072926612_);} + .st6{fill:#8E8E8E;} + .st7{fill:#898989;} + .st8{fill:#365495;} + .st9{fill:#D8281C;} + .st10{fill:url(#SVGID_00000126289285560983314150000012744145300128365999_);} + .st11{fill:url(#SVGID_00000085236047454100431800000014914565923775401857_);} + .st12{fill:url(#SVGID_00000058582866853846880490000018380106427474767274_);} + .st13{fill:url(#SVGID_00000087408026700608449130000001698179953032829828_);} + .st14{fill:#E58027;} + .st15{fill-rule:evenodd;clip-rule:evenodd;fill:#57B7E1;} + .st16{fill-rule:evenodd;clip-rule:evenodd;fill:#888888;} +</style> +<g> + <g> + <path class="st0" d="M46.6,40.2v2.2h3.5L49.6,46h-3v8.8h-3.7V46h-3v-3.6h3v-3.1c0-5.4,7.2-3.9,7.2-3.9v3.1h-1.8 + C46.5,38.5,46.6,40.2,46.6,40.2"/> + </g> +</g> +<g> + <path class="st1" d="M116.7,39.2c-0.3-1-1.1-1.8-2.1-2.1c-1.9-0.5-9.3-0.5-9.3-0.5s-7.5,0-9.3,0.5c-1,0.3-1.8,1.1-2.1,2.1 + c-0.5,1.9-0.5,5.8-0.5,5.8s0,3.9,0.5,5.8c0.3,1,1.1,1.8,2.1,2.1c1.9,0.5,9.3,0.5,9.3,0.5s7.5,0,9.3-0.5c1-0.3,1.8-1.1,2.1-2.1 + c0.5-1.9,0.5-5.8,0.5-5.8S117.2,41.1,116.7,39.2"/> + <polygon class="st2" points="102.9,48.6 109.1,45 102.9,41.4 "/> +</g> +<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="14.9008" y1="6.5601" x2="15.079" y2="21.5304" gradientTransform="matrix(1 0 0 -1 0 59.89)"> + <stop offset="0" style="stop-color:#9F9E9F"/> + <stop offset="1" style="stop-color:#6A6B6B"/> +</linearGradient> +<path class="st3" d="M11.6,45c0-1.9,1.5-3.4,3.4-3.4s3.4,1.5,3.4,3.4s-1.5,3.4-3.4,3.4S11.6,46.9,11.6,45 M9.7,45 + c0,2.9,2.4,5.3,5.3,5.3s5.3-2.4,5.3-5.3s-2.4-5.3-5.3-5.3S9.7,42.1,9.7,45 M19.3,39.5c0,0.7,0.6,1.2,1.2,1.2s1.2-0.6,1.2-1.2 + c0-0.7-0.6-1.2-1.2-1.2S19.3,38.8,19.3,39.5 M10.8,53.4c-1,0-1.6-0.2-1.9-0.4c-0.5-0.2-0.8-0.4-1.2-0.8c-0.4-0.4-0.6-0.7-0.8-1.2 + c-0.1-0.4-0.3-0.9-0.4-1.9c0-1.1-0.1-1.4-0.1-4.2s0-3.1,0.1-4.2c0-1,0.2-1.6,0.4-1.9c0.2-0.5,0.4-0.8,0.8-1.2 + c0.4-0.4,0.7-0.6,1.2-0.8c0.4-0.1,0.9-0.3,1.9-0.4c1.1,0,1.4-0.1,4.2-0.1s3.1,0,4.2,0.1c1,0,1.6,0.2,1.9,0.4 + c0.5,0.2,0.8,0.4,1.2,0.8c0.4,0.4,0.6,0.7,0.8,1.2c0.1,0.4,0.3,0.9,0.4,1.9c0,1.1,0.1,1.4,0.1,4.2s0,3.1-0.1,4.2 + c0,1-0.2,1.6-0.4,1.9c-0.2,0.5-0.4,0.8-0.8,1.2s-0.7,0.6-1.2,0.8c-0.4,0.1-0.9,0.3-1.9,0.4c-1.1,0.1-1.4,0.1-4.2,0.1 + S11.9,53.5,10.8,53.4 M10.7,34.7c-1.1,0-1.9,0.2-2.5,0.5c-0.7,0.3-1.3,0.6-1.8,1.2c-0.6,0.6-0.9,1.2-1.2,1.8 + c-0.3,0.7-0.4,1.4-0.5,2.5S4.6,42.2,4.6,45s0,3.2,0.1,4.3c0,1.1,0.2,1.9,0.5,2.5c0.3,0.7,0.6,1.3,1.2,1.8c0.6,0.6,1.2,0.9,1.8,1.2 + c0.7,0.3,1.4,0.4,2.5,0.5s1.5,0.1,4.3,0.1s3.2,0,4.3-0.1c1.1-0.1,1.9-0.2,2.5-0.5c0.7-0.3,1.3-0.6,1.8-1.2c0.6-0.6,0.9-1.2,1.2-1.8 + c0.3-0.7,0.4-1.4,0.5-2.5s0.1-1.5,0.1-4.3s0-3.2-0.1-4.3s-0.2-1.9-0.5-2.5c-0.3-0.7-0.6-1.3-1.2-1.8c-0.6-0.6-1.2-0.9-1.8-1.2 + c-0.7-0.3-1.4-0.4-2.5-0.5s-1.5-0.1-4.3-0.1C12.2,34.7,11.8,34.7,10.7,34.7"/> +<g> + + <linearGradient id="SVGID_00000176732684331717475040000016021726933443095447_" gradientUnits="userSpaceOnUse" x1="69" y1="6.1255" x2="69" y2="19.1354" gradientTransform="matrix(1 0 0 -1 0 59.89)"> + <stop offset="0" style="stop-color:#8E8E8E"/> + <stop offset="1" style="stop-color:#6C6D6C"/> + </linearGradient> + <path style="fill:url(#SVGID_00000176732684331717475040000016021726933443095447_);" d="M71.9,52.6c0,1.6-1.3,2.9-2.9,2.9 + s-2.9-1.3-2.9-2.9V37.4c0-1.6,1.3-2.9,2.9-2.9s2.9,1.3,2.9,2.9V52.6z"/> + + <linearGradient id="SVGID_00000154427224833080165220000004873819146935312310_" gradientUnits="userSpaceOnUse" x1="69.6056" y1="8.2081" x2="78.2789" y2="12.8418" gradientTransform="matrix(1 0 0 -1 0 59.89)"> + <stop offset="0" style="stop-color:#7F7F7F"/> + <stop offset="1" style="stop-color:#8E8E8E"/> + </linearGradient> + <path style="fill:url(#SVGID_00000154427224833080165220000004873819146935312310_);" d="M70.6,55c-1.3,0.8-3.1,0.4-4-0.9 + c-0.8-1.3-0.4-3.1,0.9-4l11.9-7.5c1.3-0.8,3.1-0.4,4,0.9s0.4,3.1-0.9,4L70.6,55z"/> + <path class="st6" d="M70.6,35c-1.3-0.8-3.1-0.4-4,0.9c-0.8,1.3-0.4,3.1,0.9,4l11.9,7.5c1.3,0.8,3.1,0.4,4-0.9s0.4-3.1-0.9-4 + L70.6,35z"/> +</g> +<g id="RSS"> + <g> + <path class="st7" d="M132.3,51.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1c0-1.7,1.4-3.1,3.1-3.1S132.3,49.4,132.3,51.1z"/> + <path class="st7" d="M134.6,51.1c0-1.5-0.6-2.8-1.6-3.8l0,0c-1-1-2.3-1.6-3.8-1.6l0,0c-1,0-1.8-0.8-1.8-1.8l0,0 + c0-1,0.8-1.8,1.8-1.8l0,0c5,0,9.1,4.1,9.1,9.1l0,0c0,1-0.8,1.8-1.8,1.8l0,0C135.5,52.9,134.6,52.1,134.6,51.1L134.6,51.1z"/> + <path class="st7" d="M140.8,51.1c0-3.2-1.3-6.1-3.4-8.2l0,0c-2.1-2.1-5-3.4-8.2-3.4l0,0c-1,0-1.8-0.8-1.8-1.8l0,0 + c0-1,0.8-1.8,1.8-1.8l0,0c8.4,0,15.3,6.8,15.3,15.3l0,0c0,1-0.8,1.8-1.8,1.8l0,0C141.6,52.9,140.8,52.1,140.8,51.1L140.8,51.1z"/> + </g> +</g> +<g> + <path class="st8" d="M46.6,10.2v2.2h3.5L49.6,16h-3v8.8h-3.7V16h-3v-3.6h3V9.3c0-5.4,7.2-3.9,7.2-3.9v3.1h-1.8 + C46.5,8.5,46.6,10.2,46.6,10.2"/> +</g> +<g> + <path class="st9" d="M116.7,9.2c-0.3-1-1.1-1.8-2.1-2.1c-1.9-0.5-9.3-0.5-9.3-0.5s-7.5,0-9.3,0.5c-1,0.3-1.8,1.1-2.1,2.1 + c-0.5,1.9-0.5,5.8-0.5,5.8s0,3.9,0.5,5.8c0.3,1,1.1,1.8,2.1,2.1c1.9,0.5,9.3,0.5,9.3,0.5s7.5,0,9.3-0.5c1-0.3,1.8-1.1,2.1-2.1 + c0.5-1.9,0.5-5.8,0.5-5.8S117.2,11.1,116.7,9.2"/> + <polygon class="st2" points="102.9,18.6 109.1,15 102.9,11.4 "/> +</g> +<radialGradient id="SVGID_00000080912062125197932480000013750263773092520364_" cx="11.386" cy="34.5389" r="21.8809" gradientTransform="matrix(1 0 0 -1 0 59.89)" gradientUnits="userSpaceOnUse"> + <stop offset="0" style="stop-color:#F3C977"/> + <stop offset="0.2877" style="stop-color:#D09004"/> + <stop offset="0.6732" style="stop-color:#BC2C51"/> + <stop offset="1" style="stop-color:#6A1F75"/> +</radialGradient> +<path style="fill:url(#SVGID_00000080912062125197932480000013750263773092520364_);" d="M11.6,15c0-1.9,1.5-3.4,3.4-3.4 + s3.4,1.5,3.4,3.4s-1.5,3.4-3.4,3.4S11.6,16.9,11.6,15 M9.7,15c0,2.9,2.4,5.3,5.3,5.3s5.3-2.4,5.3-5.3S17.9,9.7,15,9.7 + S9.7,12.1,9.7,15 M19.3,9.5c0,0.7,0.6,1.2,1.2,1.2s1.2-0.6,1.2-1.2c0-0.7-0.6-1.2-1.2-1.2S19.3,8.8,19.3,9.5 M10.8,23.4 + c-1,0-1.6-0.2-1.9-0.4c-0.5-0.2-0.8-0.4-1.2-0.8c-0.4-0.4-0.6-0.7-0.8-1.2c-0.1-0.4-0.3-0.9-0.4-1.9c0-1.1-0.1-1.4-0.1-4.2 + s0-3.1,0.1-4.2c0-1,0.2-1.6,0.4-1.9C7.1,8.3,7.3,8,7.7,7.6C8.1,7.2,8.4,7,8.9,6.8c0.4-0.1,0.9-0.3,1.9-0.4c1.1,0,1.4-0.1,4.2-0.1 + s3.1,0,4.2,0.1c1,0,1.6,0.2,1.9,0.4c0.5,0.2,0.8,0.4,1.2,0.8c0.4,0.4,0.6,0.7,0.8,1.2c0.1,0.4,0.3,0.9,0.4,1.9 + c0,1.1,0.1,1.4,0.1,4.2s0,3.1-0.1,4.2c0,1-0.2,1.6-0.4,1.9c-0.2,0.5-0.4,0.8-0.8,1.2c-0.4,0.4-0.7,0.6-1.2,0.8 + c-0.4,0.1-0.9,0.3-1.9,0.4c-1.1,0.1-1.4,0.1-4.2,0.1S11.9,23.5,10.8,23.4 M10.7,4.7C9.6,4.8,8.9,5,8.2,5.2C7.6,5.5,7,5.8,6.4,6.4 + S5.5,7.6,5.2,8.2C5,8.9,4.8,9.6,4.7,10.7c-0.1,1.1-0.1,1.5-0.1,4.3s0,3.2,0.1,4.3c0,1.1,0.2,1.9,0.5,2.5c0.3,0.7,0.6,1.3,1.2,1.8 + c0.6,0.6,1.2,0.9,1.8,1.2c0.7,0.3,1.4,0.4,2.5,0.5s1.5,0.1,4.3,0.1s3.2,0,4.3-0.1c1.1-0.1,1.9-0.2,2.5-0.5c0.7-0.3,1.3-0.6,1.8-1.2 + c0.6-0.6,0.9-1.2,1.2-1.8c0.3-0.7,0.4-1.4,0.5-2.5s0.1-1.5,0.1-4.3s0-3.2-0.1-4.3s-0.2-1.9-0.5-2.5c-0.3-0.7-0.6-1.3-1.2-1.8 + c-0.6-0.6-1.2-0.9-1.8-1.2c-0.7-0.3-1.4-0.4-2.5-0.5S17.8,4.6,15,4.6C12.2,4.7,11.8,4.7,10.7,4.7"/> +<g> + + <linearGradient id="SVGID_00000122698295134744284030000011842284195876180616_" gradientUnits="userSpaceOnUse" x1="69" y1="55.2251" x2="69" y2="34.4615" gradientTransform="matrix(1 0 0 -1 0 59.89)"> + <stop offset="0" style="stop-color:#2199AC"/> + <stop offset="1" style="stop-color:#34AFC6"/> + </linearGradient> + <path style="fill:url(#SVGID_00000122698295134744284030000011842284195876180616_);" d="M71.9,22.6c0,1.6-1.3,2.9-2.9,2.9 + s-2.9-1.3-2.9-2.9V7.4c0-1.6,1.3-2.9,2.9-2.9s2.9,1.3,2.9,2.9V22.6z"/> + + <linearGradient id="SVGID_00000023984047536819573780000017197782856325314205_" gradientUnits="userSpaceOnUse" x1="44.8814" y1="27.7398" x2="62.7713" y2="27.7398" gradientTransform="matrix(0.9922 4.871173e-03 -4.871173e-03 -0.9969 21.7613 46.1917)"> + <stop offset="0" style="stop-color:#42A8C1"/> + <stop offset="0.1613" style="stop-color:#42A8C1"/> + <stop offset="0.5232" style="stop-color:#57B0A4"/> + <stop offset="0.7419" style="stop-color:#62B58F"/> + </linearGradient> + <path style="fill:url(#SVGID_00000023984047536819573780000017197782856325314205_);" d="M70.6,25c-1.3,0.8-3.1,0.4-4-0.9 + s-0.4-3.1,0.9-4l11.9-7.5c1.3-0.8,3.1-0.4,4,0.9s0.4,3.1-0.9,4L70.6,25z"/> + + <linearGradient id="SVGID_00000119110108702763925000000013880109965313935796_" gradientUnits="userSpaceOnUse" x1="62.4133" y1="51.0068" x2="80.3056" y2="51.0068" gradientTransform="matrix(0.9921 -4.939054e-03 4.939054e-03 -0.9969 3.9847 62.401)"> + <stop offset="0" style="stop-color:#58B077"/> + <stop offset="1" style="stop-color:#62B58F"/> + </linearGradient> + <path style="fill:url(#SVGID_00000119110108702763925000000013880109965313935796_);" d="M70.6,5c-1.3-0.8-3.1-0.4-4,0.9 + s-0.4,3.1,0.9,4l11.9,7.5c1.3,0.8,3.1,0.4,4-0.9s0.4-3.1-0.9-4L70.6,5z"/> +</g> +<g id="RSS_00000114051114186175792300000010357999997785302704_"> + <g> + <path class="st14" d="M132.3,21.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1s1.4-3.1,3.1-3.1S132.3,19.4,132.3,21.1z"/> + <path class="st14" d="M134.6,21.1c0-1.5-0.6-2.8-1.6-3.8l0,0c-1-1-2.3-1.6-3.8-1.6l0,0c-1,0-1.8-0.8-1.8-1.8l0,0 + c0-1,0.8-1.8,1.8-1.8l0,0c5,0,9.1,4.1,9.1,9.1l0,0c0,1-0.8,1.8-1.8,1.8l0,0C135.5,22.9,134.6,22.1,134.6,21.1L134.6,21.1z"/> + <path class="st14" d="M140.8,21.1c0-3.2-1.3-6.1-3.4-8.2l0,0c-2.1-2.1-5-3.4-8.2-3.4l0,0c-1,0-1.8-0.8-1.8-1.8l0,0 + c0-1,0.8-1.8,1.8-1.8l0,0c8.4,0,15.3,6.8,15.3,15.3l0,0c0,1-0.8,1.8-1.8,1.8l0,0C141.6,22.9,140.8,22.1,140.8,21.1L140.8,21.1z"/> + </g> +</g> +<path class="st15" d="M177,14.4c-0.8,0.1-2,0-2.7-0.3c1.3-0.1,2.2-0.7,2.5-1.5c-0.5,0.3-1.9,0.6-2.8,0.3c0-0.2-0.1-0.4-0.1-0.5 + c-0.6-2.3-2.7-4.1-5-3.9c0.2-0.1,0.4-0.1,0.5-0.2c0.2-0.1,1.7-0.3,1.5-0.8c-0.2-0.4-1.9,0.3-2.3,0.4c0.4-0.2,1.2-0.4,1.2-0.9 + c-0.7,0.1-1.3,0.4-1.8,0.9c0.2-0.2,0.3-0.4,0.4-0.7c-1.8,1.1-2.8,3.4-3.7,5.7c-0.7-0.6-1.2-1.1-1.8-1.4c-1.5-0.8-3.2-1.6-6-2.6 + c-0.1,0.9,0.5,2.1,2,2.9c-0.3,0-0.9,0.1-1.4,0.2c0.2,1.1,0.9,1.9,2.6,2.3c-0.8,0.1-1.2,0.2-1.6,0.6c0.4,0.7,1.3,1.6,2.9,1.4 + c-1.8,0.8-0.7,2.2,0.7,2c-2.5,2.6-6.4,2.4-8.7,0.2c5.9,8,18.7,4.8,20.6-3C175.6,15.4,176.5,14.9,177,14.4z"/> +<path class="st16" d="M177,44.4c-0.8,0.1-2,0-2.7-0.3c1.3-0.1,2.2-0.7,2.5-1.5c-0.5,0.3-1.9,0.6-2.8,0.3c0-0.2-0.1-0.4-0.1-0.5 + c-0.6-2.3-2.7-4.1-5-3.9c0.2-0.1,0.4-0.1,0.5-0.2c0.2-0.1,1.7-0.3,1.5-0.8c-0.2-0.4-1.9,0.3-2.3,0.4c0.4-0.2,1.2-0.4,1.2-0.9 + c-0.7,0.1-1.3,0.4-1.8,0.9c0.2-0.2,0.3-0.4,0.4-0.7c-1.8,1.1-2.8,3.4-3.7,5.7c-0.7-0.6-1.2-1.1-1.8-1.4c-1.5-0.8-3.2-1.6-6-2.6 + c-0.1,0.9,0.5,2.1,2,2.9c-0.3,0-0.9,0.1-1.4,0.2c0.2,1.1,0.9,1.9,2.6,2.3c-0.8,0.1-1.2,0.2-1.6,0.6c0.4,0.7,1.3,1.6,2.9,1.4 + c-1.8,0.8-0.7,2.2,0.7,2c-2.5,2.6-6.4,2.4-8.7,0.2c5.9,8,18.7,4.8,20.6-3C175.6,45.4,176.5,44.9,177,44.4z"/> +</svg> Index: base3.10/src/main/webapp/images/user/logo.svg =================================================================== --- base3.10/src/main/webapp/images/user/logo.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/logo.svg (revision 34) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="레이어_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" + y="0px" viewBox="0 0 158.9 10" style="enable-background:new 0 0 158.9 10;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#040000;} +</style> +<g> + <g> + <path class="st0" d="M0,5.1C0,1.8,2.2,0,4.6,0c1.3,0,2.3,0.6,2.9,1.3L6.3,2.7C5.9,2.3,5.3,2,4.7,2C3.4,2,2.4,3.1,2.4,5 + c0,1.9,0.9,3,2.2,3C5.4,8,6,7.6,6.5,7.2l1.2,1.5C6.9,9.6,5.8,10,4.5,10C2.1,10,0,8.3,0,5.1z"/> + <path class="st0" d="M14.5,9.9l-1.8-3.4h-1.1v3.4H9.2V0.2h3.5c2.1,0,3.8,0.7,3.8,3c0,1.4-0.7,2.3-1.7,2.8l2.2,3.8H14.5z M11.6,4.6 + h1c1.1,0,1.7-0.5,1.7-1.4S13.7,2,12.6,2h-1V4.6z"/> + <path class="st0" d="M18.1,5c0-3.2,1.8-5,4.4-5C25.2,0,27,1.8,27,5c0,3.2-1.8,5.1-4.4,5.1C19.9,10,18.1,8.1,18.1,5z M24.6,5 + c0-1.9-0.8-3-2.1-3c-1.3,0-2.1,1.1-2.1,3c0,1.9,0.8,3.1,2.1,3.1C23.8,8,24.6,6.9,24.6,5z"/> + <path class="st0" d="M28.3,8.6L29.6,7c0.7,0.6,1.6,1,2.4,1c0.9,0,1.3-0.3,1.3-0.8c0-0.6-0.5-0.7-1.4-1.1l-1.2-0.5 + c-1-0.4-2-1.2-2-2.7c0-1.6,1.5-2.9,3.5-2.9c1.1,0,2.3,0.4,3.1,1.3l-1.2,1.5c-0.6-0.5-1.2-0.7-2-0.7C31.5,2,31,2.3,31,2.8 + c0,0.5,0.6,0.7,1.5,1.1l1.2,0.5c1.2,0.5,1.9,1.3,1.9,2.7c0,1.6-1.4,3-3.7,3C30.7,10,29.3,9.6,28.3,8.6z"/> + <path class="st0" d="M36.5,8.6L37.8,7c0.7,0.6,1.6,1,2.4,1c0.9,0,1.3-0.3,1.3-0.8c0-0.6-0.5-0.7-1.4-1.1l-1.2-0.5 + c-1-0.4-2-1.2-2-2.7c0-1.6,1.5-2.9,3.5-2.9c1.1,0,2.3,0.4,3.1,1.3l-1.2,1.5c-0.6-0.5-1.2-0.7-2-0.7c-0.7,0-1.2,0.3-1.2,0.8 + c0,0.5,0.6,0.7,1.5,1.1l1.2,0.5c1.2,0.5,1.9,1.3,1.9,2.7c0,1.6-1.4,3-3.7,3C38.8,10,37.5,9.6,36.5,8.6z"/> + <path class="st0" d="M50.7,9.9L49,6.4h-1.1v3.4h-2.3V0.2h3.5c2.1,0,3.8,0.7,3.8,3c0,1.4-0.7,2.3-1.7,2.8l2.2,3.8H50.7z M47.8,4.6 + h1c1.1,0,1.7-0.5,1.7-1.4S50,2,48.9,2h-1V4.6z"/> + <path class="st0" d="M54.4,5c0-3.2,1.8-5,4.4-5s4.4,1.8,4.4,5c0,3.2-1.8,5.1-4.4,5.1S54.4,8.1,54.4,5z M60.9,5c0-1.9-0.8-3-2.1-3 + c-1.3,0-2.1,1.1-2.1,3c0,1.9,0.8,3.1,2.1,3.1C60.1,8,60.9,6.9,60.9,5z"/> + <path class="st0" d="M69.6,7.6h-2.9l-0.6,2.2h-2.4l3-9.7h2.8l3,9.7h-2.4L69.6,7.6z M69.2,5.8L69,5c-0.3-1-0.5-2.1-0.8-3.1h-0.1 + c-0.2,1-0.5,2.1-0.7,3.1l-0.2,0.8H69.2z"/> + <path class="st0" d="M79,9.9l-1.8-3.4h-1.1v3.4h-2.3V0.2h3.5c2.1,0,3.8,0.7,3.8,3c0,1.4-0.7,2.3-1.7,2.8l2.2,3.8H79z M76.1,4.6h1 + c1.1,0,1.7-0.5,1.7-1.4S78.2,2,77.1,2h-1V4.6z"/> + <path class="st0" d="M83.1,0.2h2.8c3,0,4.9,1.4,4.9,4.8s-2,4.9-4.8,4.9h-2.9V0.2z M85.7,8c1.6,0,2.7-0.7,2.7-3S87.3,2,85.7,2h-0.3 + v6H85.7z"/> + <path class="st0" d="M92.1,8.6L93.4,7c0.7,0.6,1.6,1,2.4,1C96.6,8,97,7.7,97,7.2c0-0.6-0.5-0.7-1.4-1.1l-1.2-0.5 + c-1-0.4-2-1.2-2-2.7C92.4,1.3,93.9,0,96,0c1.1,0,2.3,0.4,3.1,1.3l-1.2,1.5C97.3,2.2,96.7,2,96,2c-0.7,0-1.2,0.3-1.2,0.8 + c0,0.5,0.6,0.7,1.5,1.1l1.2,0.5c1.2,0.5,1.9,1.3,1.9,2.7c0,1.6-1.4,3-3.7,3C94.4,10,93.1,9.6,92.1,8.6z"/> + </g> + <g> + <path class="st0" d="M101.9,0.3h1.6l0.9,5l0.5,3.1h0.1c0.2-1,0.4-2.1,0.6-3.1l1.2-5h1.3l1.2,5c0.2,1,0.4,2,0.7,3.1h0.1 + c0.2-1,0.3-2.1,0.5-3.1l0.9-5h1.4L111,9.9h-1.9l-1.3-5.3c-0.2-0.8-0.3-1.5-0.4-2.2h-0.1c-0.1,0.7-0.3,1.4-0.4,2.2l-1.3,5.3h-1.8 + L101.9,0.3z"/> + <path class="st0" d="M114.6,0.3h5.7v1.3h-4.1v2.7h3.5v1.3h-3.5v3.1h4.3v1.3h-5.8V0.3z"/> + <path class="st0" d="M122.5,0.3h3c2,0,3.4,0.6,3.4,2.4c0,0.9-0.5,1.8-1.4,2.1v0.1c1.1,0.2,1.9,1,1.9,2.3c0,1.9-1.5,2.8-3.7,2.8 + h-3.2V0.3z M125.3,4.3c1.5,0,2.1-0.5,2.1-1.4c0-1-0.7-1.4-2-1.4H124v2.8H125.3z M125.5,8.7c1.5,0,2.4-0.5,2.4-1.7 + c0-1.1-0.8-1.5-2.4-1.5H124v3.2H125.5z"/> + <path class="st0" d="M130.6,8.9l4.8-7.4H131V0.3h6.2v0.9l-4.8,7.4h4.8v1.3h-6.7V8.9z"/> + <path class="st0" d="M139.3,0.3h1.5v9.6h-1.5V0.3z"/> + <path class="st0" d="M143.4,0.3h1.5l3.2,5.6l1,2h0.1c-0.1-1-0.2-2.1-0.2-3.2V0.3h1.4v9.6h-1.5l-3.2-5.6l-1-2h-0.1 + c0.1,1,0.2,2.1,0.2,3.1v4.5h-1.4V0.3z"/> + <path class="st0" d="M153.1,0.3h5.7v1.3h-4.1v2.7h3.5v1.3h-3.5v3.1h4.3v1.3h-5.8V0.3z"/> + </g> +</g> +</svg> Index: base3.10/src/main/webapp/images/user/arrow_double_right.svg =================================================================== --- base3.10/src/main/webapp/images/user/arrow_double_right.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/arrow_double_right.svg (revision 34) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 61 66.6" style="enable-background:new 0 0 61 66.6;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#3C3C3C;} +</style> +<g> + <path class="st0" d="M4.5,66.6c-1.2,0-2.3-0.4-3.2-1.3c-1.8-1.8-1.8-4.6,0-6.4l25.6-25.6L1.3,7.7c-1.8-1.8-1.8-4.6,0-6.4 + c1.8-1.8,4.6-1.8,6.4,0l28.8,28.8c1.8,1.8,1.8,4.6,0,6.4L7.7,65.3C6.8,66.2,5.7,66.6,4.5,66.6z"/> + <path class="st0" d="M27.7,66.6c-1.2,0-2.3-0.4-3.2-1.3c-1.8-1.8-1.8-4.6,0-6.4l25.6-25.6L24.5,7.7c-1.8-1.8-1.8-4.6,0-6.4 + c1.8-1.8,4.6-1.8,6.4,0l28.8,28.8c1.8,1.8,1.8,4.6,0,6.4L30.9,65.3C30,66.2,28.9,66.6,27.7,66.6z"/> +</g> +</svg> Index: base3.10/src/main/webapp/images/user/sample1.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/sample1.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/skip_top.svg =================================================================== --- base3.10/src/main/webapp/images/user/skip_top.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/skip_top.svg (revision 34) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="레이어_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" + y="0px" viewBox="0 0 150.1 181.1" style="enable-background:new 0 0 150.1 181.1;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:none;stroke:#FFFFFF;stroke-width:19;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;} +</style> +<g> + <polyline class="st0" points="9.5,75 75,9.5 140.6,75 "/> + <line class="st0" x1="75" y1="9.5" x2="75" y2="171.6"/> +</g> +</svg> Index: base3.10/src/main/webapp/images/user/sample_writer.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/sample_writer.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/book1.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/book1.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/favicon.ico =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/favicon.ico ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/icon_blank.svg =================================================================== --- base3.10/src/main/webapp/images/user/icon_blank.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/icon_blank.svg (revision 34) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 37.3 37.3" style="enable-background:new 0 0 37.3 37.3;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#323232;} +</style> +<g> + <path class="st0" d="M27.3,21.5c-0.8,0-1.5-0.7-1.5-1.5v-8.5h-8.5c-0.8,0-1.5-0.7-1.5-1.5s0.7-1.5,1.5-1.5h10 + c0.8,0,1.5,0.7,1.5,1.5v10C28.8,20.8,28.1,21.5,27.3,21.5z"/> + <path class="st0" d="M9.7,29.1c-0.4,0-0.8-0.1-1.1-0.4c-0.6-0.6-0.6-1.5,0-2.1L26.2,8.9c0.6-0.6,1.5-0.6,2.1,0 + c0.6,0.6,0.6,1.5,0,2.1L10.8,28.7C10.5,29,10.1,29.1,9.7,29.1z"/> +</g> +<path class="st0" d="M28.1,37.3h-19c-5.1,0-9.2-4.1-9.2-9.2v-19C-0.1,4,4-0.1,9.1-0.1h11c0.8,0,1.5,0.7,1.5,1.5s-0.7,1.5-1.5,1.5 + h-11c-3.4,0-6.2,2.8-6.2,6.2v19c0,3.4,2.8,6.2,6.2,6.2h19c3.4,0,6.2-2.8,6.2-6.2v-11c0-0.8,0.7-1.5,1.5-1.5s1.5,0.7,1.5,1.5v11 + C37.3,33.2,33.2,37.3,28.1,37.3z"/> +</svg> Index: base3.10/src/main/webapp/images/user/book2.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/book2.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/icon_search.svg =================================================================== --- base3.10/src/main/webapp/images/user/icon_search.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/icon_search.svg (revision 34) @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="레이어_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" + y="0px" viewBox="0 0 15.1 15.7" style="enable-background:new 0 0 15.1 15.7;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#343231;} +</style> +<g> + <path class="st0" d="M6.2,12.4c-1.6,0-3.2-0.6-4.4-1.8c-2.4-2.4-2.4-6.4,0-8.8l0,0c2.4-2.4,6.4-2.4,8.8,0s2.4,6.4,0,8.8 + C9.4,11.8,7.8,12.4,6.2,12.4z M2.8,2.8C1,4.6,1,7.6,2.8,9.5c1.8,1.8,4.8,1.8,6.7,0c1.8-1.8,1.8-4.8,0-6.7S4.7,1,2.8,2.8L2.8,2.8z" + /> + <path class="st0" d="M14.3,15.7c-0.2,0-0.4-0.1-0.5-0.2l-4.6-4.6c-0.3-0.3-0.3-0.8,0-1.1c0.3-0.3,0.8-0.3,1.1,0l4.6,4.6 + c0.3,0.3,0.3,0.8,0,1.1C14.7,15.6,14.5,15.7,14.3,15.7z"/> +</g> +</svg> Index: base3.10/src/main/webapp/images/user/arrow_top.svg =================================================================== --- base3.10/src/main/webapp/images/user/arrow_top.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/arrow_top.svg (revision 34) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 27.5 14.6" style="enable-background:new 0 0 27.5 14.6;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#333333;} +</style> +<g> + <path class="st0" d="M1.5,14.6c-0.4,0-0.8-0.2-1.1-0.5c-0.6-0.6-0.5-1.6,0.1-2.1L12.8,0.4c0.6-0.6,1.6-0.5,2.1,0.1 + c0.6,0.6,0.5,1.6-0.1,2.1L2.5,14.2C2.2,14.5,1.9,14.6,1.5,14.6z"/> + <path class="st0" d="M26,14.6c-0.4,0-0.7-0.1-1-0.4L12.8,2.6c-0.6-0.6-0.6-1.5-0.1-2.1c0.6-0.6,1.5-0.6,2.1-0.1L27,12 + c0.6,0.6,0.6,1.5,0.1,2.1C26.8,14.4,26.4,14.6,26,14.6z"/> +</g> +</svg> Index: base3.10/src/main/webapp/images/user/arrow_bottom.svg =================================================================== --- base3.10/src/main/webapp/images/user/arrow_bottom.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/arrow_bottom.svg (revision 34) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 27.5 14.6" style="enable-background:new 0 0 27.5 14.6;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#333333;} +</style> +<g> + <path class="st0" d="M26,0c0.4,0,0.8,0.2,1.1,0.5c0.6,0.6,0.5,1.6-0.1,2.1L14.8,14.2c-0.6,0.6-1.5,0.5-2.1-0.1 + c-0.6-0.6-0.5-1.6,0.1-2.1L25,0.4C25.3,0.1,25.6,0,26,0z"/> + <path class="st0" d="M1.5,0c0.4,0,0.7,0.1,1,0.4L14.8,12c0.6,0.6,0.6,1.5,0.1,2.1c-0.6,0.6-1.5,0.6-2.1,0.1L0.5,2.6 + C-0.1,2-0.2,1.1,0.4,0.5C0.7,0.2,1.1,0,1.5,0z"/> +</g> +</svg> Index: base3.10/src/main/webapp/images/user/map1.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/map1.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/editor2.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/editor2.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/logo_v.svg =================================================================== --- base3.10/src/main/webapp/images/user/logo_v.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/logo_v.svg (revision 34) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="레이어_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" + y="0px" viewBox="0 0 99.4 24.1" style="enable-background:new 0 0 99.4 24.1;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#040000;} +</style> +<g> + <g> + <path class="st0" d="M0,5.1C0,1.8,2.2,0,4.6,0c1.3,0,2.3,0.6,2.9,1.3L6.3,2.7C5.9,2.3,5.3,2,4.7,2C3.4,2,2.4,3.1,2.4,5 + s0.9,3,2.2,3C5.4,8,6,7.6,6.5,7.2l1.2,1.5C6.9,9.6,5.8,10,4.5,10C2.1,10,0,8.3,0,5.1z"/> + <path class="st0" d="M14.5,9.9l-1.8-3.4h-1.1v3.4H9.2V0.2h3.5c2.1,0,3.8,0.7,3.8,3c0,1.4-0.7,2.3-1.7,2.8L17,9.8L14.5,9.9 + L14.5,9.9z M11.6,4.6h1c1.1,0,1.7-0.5,1.7-1.4S13.7,2,12.6,2h-1V4.6z"/> + <path class="st0" d="M18.1,5c0-3.2,1.8-5,4.4-5C25.2,0,27,1.8,27,5s-1.8,5.1-4.4,5.1C19.9,10,18.1,8.1,18.1,5z M24.6,5 + c0-1.9-0.8-3-2.1-3c-1.3,0-2.1,1.1-2.1,3s0.8,3.1,2.1,3.1C23.8,8,24.6,6.9,24.6,5z"/> + <path class="st0" d="M28.3,8.6L29.6,7c0.7,0.6,1.6,1,2.4,1c0.9,0,1.3-0.3,1.3-0.8c0-0.6-0.5-0.7-1.4-1.1l-1.2-0.5 + c-1-0.4-2-1.2-2-2.7c0-1.6,1.5-2.9,3.5-2.9c1.1,0,2.3,0.4,3.1,1.3l-1.2,1.5c-0.6-0.5-1.2-0.7-2-0.7C31.5,2,31,2.3,31,2.8 + s0.6,0.7,1.5,1.1l1.2,0.5c1.2,0.5,1.9,1.3,1.9,2.7c0,1.6-1.4,3-3.7,3C30.7,10,29.3,9.6,28.3,8.6z"/> + <path class="st0" d="M36.5,8.6L37.8,7c0.7,0.6,1.6,1,2.4,1c0.9,0,1.3-0.3,1.3-0.8c0-0.6-0.5-0.7-1.4-1.1l-1.2-0.5 + c-1-0.4-2-1.2-2-2.7c0-1.6,1.5-2.9,3.5-2.9c1.1,0,2.3,0.4,3.1,1.3l-1.2,1.5c-0.6-0.5-1.2-0.7-2-0.7c-0.7,0-1.2,0.3-1.2,0.8 + s0.6,0.7,1.5,1.1l1.2,0.5C43,5,43.7,5.8,43.7,7.2c0,1.6-1.4,3-3.7,3C38.8,10,37.5,9.6,36.5,8.6z"/> + <path class="st0" d="M50.7,9.9L49,6.4h-1.1v3.4h-2.3V0.2h3.5c2.1,0,3.8,0.7,3.8,3c0,1.4-0.7,2.3-1.7,2.8l2.2,3.8L50.7,9.9 + L50.7,9.9z M47.8,4.6h1c1.1,0,1.7-0.5,1.7-1.4S50,2,48.9,2h-1v2.6H47.8z"/> + <path class="st0" d="M54.4,5c0-3.2,1.8-5,4.4-5s4.4,1.8,4.4,5s-1.8,5.1-4.4,5.1S54.4,8.1,54.4,5z M60.9,5c0-1.9-0.8-3-2.1-3 + s-2.1,1.1-2.1,3s0.8,3.1,2.1,3.1C60.1,8,60.9,6.9,60.9,5z"/> + <path class="st0" d="M69.6,7.6h-2.9l-0.6,2.2h-2.4l3-9.7h2.8l3,9.7h-2.4L69.6,7.6z M69.2,5.8L69,5c-0.3-1-0.5-2.1-0.8-3.1h-0.1 + c-0.2,1-0.5,2.1-0.7,3.1l-0.2,0.8H69.2z"/> + <path class="st0" d="M79,9.9l-1.8-3.4h-1.1v3.4h-2.3V0.2h3.5c2.1,0,3.8,0.7,3.8,3c0,1.4-0.7,2.3-1.7,2.8l2.2,3.8L79,9.9L79,9.9z + M76.1,4.6h1c1.1,0,1.7-0.5,1.7-1.4S78.2,2,77.1,2h-1V4.6z"/> + <path class="st0" d="M83.1,0.2h2.8c3,0,4.9,1.4,4.9,4.8s-2,4.9-4.8,4.9h-2.9V0.2z M85.7,8c1.6,0,2.7-0.7,2.7-3s-1.1-3-2.7-3h-0.3 + v6H85.7z"/> + <path class="st0" d="M92.1,8.6L93.4,7c0.7,0.6,1.6,1,2.4,1C96.6,8,97,7.7,97,7.2c0-0.6-0.5-0.7-1.4-1.1l-1.2-0.5 + c-1-0.4-2-1.2-2-2.7C92.4,1.3,93.9,0,96,0c1.1,0,2.3,0.4,3.1,1.3l-1.2,1.5C97.3,2.2,96.7,2,96,2s-1.2,0.3-1.2,0.8s0.6,0.7,1.5,1.1 + l1.2,0.5c1.2,0.5,1.9,1.3,1.9,2.7c0,1.6-1.4,3-3.7,3C94.4,10,93.1,9.6,92.1,8.6z"/> + </g> + <g> + <path class="st0" d="M21.2,14.4h1.6l0.9,5l0.5,3.1h0.1c0.2-1,0.4-2.1,0.6-3.1l1.2-5h1.3l1.2,5c0.2,1,0.4,2,0.7,3.1h0.1 + c0.2-1,0.3-2.1,0.5-3.1l0.9-5h1.4L30.2,24h-1.9L27,18.7c-0.2-0.8-0.3-1.5-0.4-2.2h-0.1c-0.1,0.7-0.3,1.4-0.4,2.2L24.8,24H23 + L21.2,14.4z"/> + <path class="st0" d="M33.8,14.4h5.7v1.3h-4.1v2.7h3.5v1.3h-3.5v3.1h4.3v1.3h-5.8L33.8,14.4L33.8,14.4z"/> + <path class="st0" d="M41.8,14.4h3c2,0,3.4,0.6,3.4,2.4c0,0.9-0.5,1.8-1.4,2.1V19c1.1,0.2,1.9,1,1.9,2.3c0,1.9-1.5,2.8-3.7,2.8 + h-3.2V14.4z M44.6,18.4c1.5,0,2.1-0.5,2.1-1.4c0-1-0.7-1.4-2-1.4h-1.4v2.8H44.6z M44.8,22.8c1.5,0,2.4-0.5,2.4-1.7 + c0-1.1-0.8-1.5-2.4-1.5h-1.5v3.2H44.8z"/> + <path class="st0" d="M49.9,23l4.8-7.4h-4.4v-1.2h6.2v0.9l-4.8,7.4h4.8V24h-6.7v-1H49.9z"/> + <path class="st0" d="M58.6,14.4h1.5V24h-1.5V14.4z"/> + <path class="st0" d="M62.6,14.4h1.5l3.2,5.6l1,2h0.1c-0.1-1-0.2-2.1-0.2-3.2v-4.4h1.4V24h-1.5l-3.2-5.6l-1-2h-0.1 + c0.1,1,0.2,2.1,0.2,3.1V24h-1.4V14.4z"/> + <path class="st0" d="M72.4,14.4h5.7v1.3h-4.1v2.7h3.5v1.3h-3.5v3.1h4.3v1.3h-5.8L72.4,14.4L72.4,14.4z"/> + </g> +</g> +</svg> Index: base3.10/src/main/webapp/images/user/banner1.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/banner1.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/icon_time.svg =================================================================== --- base3.10/src/main/webapp/images/user/icon_time.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/icon_time.svg (revision 34) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="레이어_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" + y="0px" viewBox="0 0 13.2 13.2" style="enable-background:new 0 0 13.2 13.2;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#CCCCCC;} + .st1{fill:#FFFFFF;} +</style> +<g> + <circle class="st0" cx="6.6" cy="6.6" r="6.6"/> + <path class="st1" d="M6.6,7.3C6.2,7.3,5.9,7,5.9,6.6V2.8c0-0.4,0.3-0.7,0.7-0.7s0.7,0.3,0.7,0.7v3.8C7.3,7,7,7.3,6.6,7.3z"/> + <path class="st1" d="M10,7.3H6.6C6.2,7.3,5.9,7,5.9,6.6s0.3-0.7,0.7-0.7H10c0.4,0,0.7,0.3,0.7,0.7S10.4,7.3,10,7.3z"/> +</g> +</svg> Index: base3.10/src/main/webapp/images/user/map2.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/map2.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/editor3.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/editor3.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/banner2.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/banner2.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/editor4.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/editor4.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/main_bgwave.svg =================================================================== --- base3.10/src/main/webapp/images/user/main_bgwave.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/main_bgwave.svg (revision 34) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="레이어_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" + y="0px" viewBox="0 0 1609.7 734.4" style="enable-background:new 0 0 1609.7 734.4;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:url(#SVGID_1_);} +</style> +<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="804.85" y1="791.2224" x2="804.85" y2="301.1872" gradientTransform="matrix(1 0 0 -1 0 1014.8759)"> + <stop offset="0" style="stop-color:#E2F2F4"/> + <stop offset="1" style="stop-color:#E2F2F4;stop-opacity:0"/> +</linearGradient> +<path class="st0" d="M0,304.7c0,0,52.6-118.7,200.1-134.7c98.4-10.7,222.4,62,222.4,62s162.5,87.7,267.3,59.9 + c97-25.7,132.6-53.5,191-114.1c49.4-51.2,200.4-206,479-173.3c170.4,20,249.9,96.3,249.9,96.3v633.6H0V304.7z"/> +</svg> Index: base3.10/src/main/webapp/images/user/editor5.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/editor5.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/arrow_left.svg =================================================================== --- base3.10/src/main/webapp/images/user/arrow_left.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/arrow_left.svg (revision 34) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 37.8 66.6" style="enable-background:new 0 0 37.8 66.6;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#3C3C3C;} +</style> +<path class="st0" d="M33.3,66.6c-1.2,0-2.3-0.4-3.2-1.3L1.3,36.5c-1.8-1.8-1.8-4.6,0-6.4L30.1,1.3c1.8-1.8,4.6-1.8,6.4,0 + c1.8,1.8,1.8,4.6,0,6.4L10.9,33.3l25.6,25.6c1.8,1.8,1.8,4.6,0,6.4C35.6,66.2,34.5,66.6,33.3,66.6z"/> +</svg> Index: base3.10/src/main/webapp/images/user/nophoto.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/nophoto.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/arrow_right.svg =================================================================== --- base3.10/src/main/webapp/images/user/arrow_right.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/arrow_right.svg (revision 34) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 37.8 66.6" style="enable-background:new 0 0 37.8 66.6;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#3C3C3C;} +</style> +<path class="st0" d="M4.5,66.6c-1.2,0-2.3-0.4-3.2-1.3c-1.8-1.8-1.8-4.6,0-6.4l25.6-25.6L1.3,7.7c-1.8-1.8-1.8-4.6,0-6.4 + c1.8-1.8,4.6-1.8,6.4,0l28.8,28.8c1.8,1.8,1.8,4.6,0,6.4L7.7,65.3C6.8,66.2,5.7,66.6,4.5,66.6z"/> +</svg> Index: base3.10/src/main/webapp/images/user/icon_blank_w.svg =================================================================== --- base3.10/src/main/webapp/images/user/icon_blank_w.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/icon_blank_w.svg (revision 34) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 25.2.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 37.3 37.3" style="enable-background:new 0 0 37.3 37.3;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:none;stroke:#FFFFFF;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;} +</style> +<g> + <polyline class="st0" points="17.3,10 27.3,10 27.3,20 "/> + <line class="st0" x1="27.3" y1="10" x2="9.7" y2="27.6"/> +</g> +<path class="st0" d="M35.8,17.1v11c0,4.2-3.4,7.7-7.7,7.7h-19c-4.2,0-7.7-3.4-7.7-7.7v-19c0-4.2,3.4-7.7,7.7-7.7h11"/> +</svg> Index: base3.10/src/main/webapp/images/user/icon_print.svg =================================================================== --- base3.10/src/main/webapp/images/user/icon_print.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/icon_print.svg (revision 34) @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="레이어_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" + y="0px" viewBox="0 0 30 60" style="enable-background:new 0 0 30 60;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#898989;} + .st1{fill:#323333;} +</style> +<g> + <path class="st0" d="M19.3,41.7c-0.3,0-0.5-0.2-0.5-0.5v-3.5l-7.5,0l0,3.6c0,0.3-0.2,0.5-0.5,0.5c-0.3,0-0.5-0.2-0.5-0.5v-3.5 + c0-0.6,0.5-1,1-1h7.5c0.6,0,1,0.5,1,1v3.5C19.8,41.4,19.6,41.7,19.3,41.7z"/> + <path class="st0" d="M22,49.6h-2.4c-0.3,0-0.5-0.2-0.5-0.5c0-0.3,0.2-0.5,0.5-0.5H22l0-6.9L8,41.7l0,6.9l2.4,0 + c0.3,0,0.5,0.2,0.5,0.5c0,0.3-0.2,0.5-0.5,0.5H8c-0.6,0-1-0.5-1-1v-6.9c0-0.6,0.5-1,1-1H22c0.6,0,1,0.5,1,1v6.9 + C23,49.1,22.5,49.6,22,49.6z"/> + <path class="st0" d="M20.1,53.4H9.9v-7.3h10.3V53.4z M10.9,52.4h8.2v-5.2h-8.2V52.4z"/> + <g> + <path class="st0" d="M18.1,49.3h-6.1c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h6.1c0.3,0,0.5,0.2,0.5,0.5S18.3,49.3,18.1,49.3z"/> + <path class="st0" d="M18.1,51.3h-6.1c-0.3,0-0.5-0.2-0.5-0.5c0-0.3,0.2-0.5,0.5-0.5h6.1c0.3,0,0.5,0.2,0.5,0.5 + C18.6,51,18.3,51.3,18.1,51.3z"/> + </g> + <circle class="st0" cx="18.6" cy="43.2" r="0.6"/> + <circle class="st0" cx="20.3" cy="43.2" r="0.6"/> +</g> +<g> + <path class="st1" d="M19.3,11.7c-0.3,0-0.5-0.2-0.5-0.5V7.6l-7.5,0l0,3.6c0,0.3-0.2,0.5-0.5,0.5c-0.3,0-0.5-0.2-0.5-0.5V7.6 + c0-0.6,0.5-1,1-1h7.5c0.6,0,1,0.5,1,1v3.5C19.8,11.4,19.6,11.7,19.3,11.7z"/> + <path class="st1" d="M22,19.6h-2.4c-0.3,0-0.5-0.2-0.5-0.5c0-0.3,0.2-0.5,0.5-0.5H22l0-6.9L8,11.7l0,6.9l2.4,0 + c0.3,0,0.5,0.2,0.5,0.5c0,0.3-0.2,0.5-0.5,0.5H8c-0.6,0-1-0.5-1-1v-6.9c0-0.6,0.5-1,1-1H22c0.6,0,1,0.5,1,1v6.9 + C23,19.1,22.5,19.6,22,19.6z"/> + <path class="st1" d="M20.1,23.4H9.9v-7.3h10.3V23.4z M10.9,22.4h8.2v-5.2h-8.2V22.4z"/> + <g> + <path class="st1" d="M18.1,19.3h-6.1c-0.3,0-0.5-0.2-0.5-0.5c0-0.3,0.2-0.5,0.5-0.5h6.1c0.3,0,0.5,0.2,0.5,0.5 + S18.3,19.3,18.1,19.3z"/> + <path class="st1" d="M18.1,21.3h-6.1c-0.3,0-0.5-0.2-0.5-0.5c0-0.3,0.2-0.5,0.5-0.5h6.1c0.3,0,0.5,0.2,0.5,0.5 + C18.6,21,18.3,21.3,18.1,21.3z"/> + </g> + <circle class="st1" cx="18.6" cy="13.2" r="0.6"/> + <circle class="st1" cx="20.3" cy="13.2" r="0.6"/> +</g> +</svg> Index: base3.10/src/main/webapp/images/user/arrow_double_left.svg =================================================================== --- base3.10/src/main/webapp/images/user/arrow_double_left.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/arrow_double_left.svg (revision 34) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 61 66.6" style="enable-background:new 0 0 61 66.6;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#3C3C3C;} +</style> +<g> + <path class="st0" d="M56.5,66.6c-1.2,0-2.3-0.4-3.2-1.3L24.5,36.5c-1.8-1.8-1.8-4.6,0-6.4L53.3,1.3c1.8-1.8,4.6-1.8,6.4,0 + c1.8,1.8,1.8,4.6,0,6.4L34.1,33.3l25.6,25.6c1.8,1.8,1.8,4.6,0,6.4C58.8,66.2,57.7,66.6,56.5,66.6z"/> + <path class="st0" d="M33.3,66.6c-1.2,0-2.3-0.4-3.2-1.3L1.3,36.5c-1.8-1.8-1.8-4.6,0-6.4L30.1,1.3c1.8-1.8,4.6-1.8,6.4,0 + c1.8,1.8,1.8,4.6,0,6.4L10.9,33.3l25.6,25.6c1.8,1.8,1.8,4.6,0,6.4C35.6,66.2,34.5,66.6,33.3,66.6z"/> +</g> +</svg> Index: base3.10/src/main/webapp/images/user/x.svg =================================================================== --- base3.10/src/main/webapp/images/user/x.svg (nonexistent) +++ base3.10/src/main/webapp/images/user/x.svg (revision 34) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 70.5 70.5" style="enable-background:new 0 0 70.5 70.5;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#3C3C3C;} +</style> +<g> + <path class="st0" d="M66,70.5c-1.2,0-2.3-0.4-3.2-1.3L1.3,7.7c-1.8-1.8-1.8-4.6,0-6.4c1.8-1.8,4.6-1.8,6.4,0l61.5,61.5 + c1.8,1.8,1.8,4.6,0,6.4C68.3,70,67.1,70.5,66,70.5z"/> + <path class="st0" d="M4.5,70.5c-1.2,0-2.3-0.4-3.2-1.3c-1.8-1.8-1.8-4.6,0-6.4L62.8,1.3c1.8-1.8,4.6-1.8,6.4,0 + c1.8,1.8,1.8,4.6,0,6.4L7.7,69.2C6.8,70,5.7,70.5,4.5,70.5z"/> +</g> +</svg> Index: base3.10/src/main/webapp/images/user/main_bg.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/main_bg.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/editor1.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/editor1.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/images/user/logo_apctp.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: base3.10/src/main/webapp/images/user/logo_apctp.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: base3.10/src/main/webapp/js/com/designJS.js =================================================================== --- base3.10/src/main/webapp/js/com/designJS.js (revision 33) +++ base3.10/src/main/webapp/js/com/designJS.js (nonexistent) @@ -1,1149 +0,0 @@ -(function() { - /**함수**/ - var board = { - 'survey' : function() { - //설문조사 결과 bar 채우기 - $(".bar").each(function(){ - var bar_width = $(this).parent(".per_bar").prev(".item_text").children(".per_no").children("em").text(); - $(this).css({ width: bar_width + '%'}); - }); - }, - 'calendar' : function(){ - $(".schedule_wrap").each(function(){ - var calendarH = $(this).height(); - var dayH = $(".calendar.month .day_wrap li").outerHeight() / .6; - if (calendarH > dayH){ - $(this).parent("li").addClass("long"); - $(this).after("<button type='button' class='clickmore'>더보기</button>"); - } - }); - //댓글더보기 클릭시 내용 펼쳐짐 - $(".clickmore").click(function(){ - $(this).hide().parent("li").removeClass("long"); - }) - - }, - 'marketH' : function(){ - - var picmaskH = $(".pic_mask").height(); - if (picmaskH < 500){ - $(".pic_mask").removeClass("long"); - $(".pic_mask").next("button").hide(); - } - else { - $(".pic_mask").addClass("long"); - $(".pic_mask").next("button").show(); - } - - //댓글더보기 클릭시 내용 펼쳐짐 - $(".clickmore").click(function(){ - $(this).text("간단히 보기"); - $(this).toggleClass("more"); - $(".pic_mask").removeClass("long"); - }); - - $(window).resize(function(){ - - }); - }, - 'marketImg' : function(){ -// $(".pic_mask").find("img").attr("alt", "제품 상세 설명 이미지"); - }, - 'overX' : function(){ - //반응형 설정 - var overLi = $(".scatg ul li"); - var overTotal = 0; - overLi.each(function(){ - overTotal = overTotal += Number($(this).outerWidth() + 10); - }); - - $(".scatg ul").css({ width : overTotal }) - - $(window).resize(function(){ - var overLi = $(".scatg ul li"); - var overTotal = 0; - overLi.each(function(){ - overTotal = overTotal += Number($(this).outerWidth() + 10); - }); - - $(".scatg ul").css({ width : overTotal }) - }); - }, - 'design' : function(){ - $(".btn_group .fr").prev(".pagination").addClass("onpage"); - - if ( $(".btn_group div").hasClass("fl") ){ - $(this).parent(".btn_group").removeClass("goList"); - } - - //$("button:contains('목록')").addClass("goList").closest(".btn_group").addClass("goList"); - $("button:contains('주소찾기')").addClass("btnAddress"); - - $(".modal").attr("tabindex", "1"); - - //must * 추가 - $(".must .board_label, .must .tit, em.must").append("<b class='mustText'>*</b>"); - - //캘린더 표기 앞글자 추가 - $(".calendar_control ul li p").each(function(){ - var calText = $(this).text(); - let calem = calText.charAt(0); - $(this).prepend("<em>" + calem + "</em>"); - }); - - //대체텍스트 입력 방법 toggle - $(".openSample").attr("title", "이미지 대체텍스트 등록방법보기"); - $(".openSample").on('click', function(){ - $(this).toggleClass("on"); - $(".imgUpsample").slideToggle(); - }); - - //게시판에 img alt값 없을떄 제목(해당 게시물 h2) 넣기 - //$(".fr-view").find("img").each(function(){ - // var imgAlt = $(this).attr("alt"); - // var h2title = $(".board_header h2").text(); - // if (imgAlt == null) { - // $(this).attr("alt", h2title); - // } - //}); - - //이미지 alt추가 - $(".imgUpsample").find("li").each(function(){ - var imgsample = $(this).find("p").text(); - $(this).find("img").attr("alt", imgsample); - }) - - } - } - - var skip = { - 'skipPage' : function() { - //웹접근성을 위한 본문 바로가기 - //본문 바로가기 - $('.skip a').on('focus', function(){ - $(this).stop().animate({"top":0, "opacity":1}); - }); - $('.skip a').on('click', function(){ - $(this).stop().animate({"top":"-30px", "opacity":0}); - }); - $('.skip a').on('focusout', function(){ - $(this).stop().animate({"top":"-30px", "opacity":0}); - }); - } - } - - var gnb = { - 'show' : function() { - $(".gnb").on("mouseenter focusin", function(){ - $("body").addClass("gnbOn"); - }).on("mouseleave focusout", function(){ - $("body").removeClass("gnbOn"); - $(".submenu_wrap").css("opacity", "0"); - }) - - //gnb mousrover 시 submanu 열림 - $(".gnb li.depth1").on("mouseenter focusin", function(){ - $(".submenu_wrap").css("opacity", "0").removeClass("active"); - $(".gnb li.depth1").removeClass("on"); - $(this).addClass("on"); - $(this).find(".submenu_wrap").css("opacity", "1") - }) - - }, - 'hide' : function() { - //header mouseleave 시 gnb 닫힘 - $(".header").on("mouseleave ", function(){ - $("body").removeClass("gnbOn"); - $(".gnb li.depth1").removeClass("on"); - $(".submenu_wrap").removeClass("active"); - }); - - }, - 'gnbTabKey' : function() { - //웹접근성을 위한 gnb tab 키 적용 - $(".gnb li.depth1").last().find(".depth2 li").last().focusout(function(){ - $(".submenu_wrap").removeClass("active"); - $("body").removeClass("gnbOn"); - }); - - - }, - 'btnMypage' : function() { - //마이페이지 서브메뉴 펼쳐짐 - $(".mnb li.gnb_mypage").on("mouseenter focusin", function(){ - $(".mnb_sub").addClass("active"); - }).on("mouseleave focusout", function(){ - $(".mnb_sub").removeClass("active"); - }); - }, - 'breadcrumb' : function(){ - - //현재위치표시 - $(".btn_location .now").on({ - click : function(){ - if ($(this).next(".location").css('display') == 'none') { - $('.location').slideUp(); - $('.btn_location .now').removeClass('on'); - $(this).toggleClass("on"); - $(this).next(".location").slideToggle(); - } else { - $('.location').slideUp(); - $(this).removeClass('on'); - } - } - }); - - $(".location li:last-child").on({ - focusout : function(){ - $('.location').slideUp(); - $(".now").removeClass('on'); - } - }); - - if ( $(window).width() < 701){ - //반응형 설정 - var locationLi = $(".breadcrumb .location li"); - var locationTotal = 0; - locationLi.each(function(){ - locationTotal = locationTotal += Number($(this).outerWidth() + 10); - }); - $(".location").css({ width : locationTotal }) - - } - else { - $(".location").css({ width: "100%" }); - } - - $(window).resize(function(){ - - if ( $(window).width() < 701){ - - //반응형 설정 - var locationLi = $(".breadcrumb .location li"); - var locationTotal = 0; - locationLi.each(function(){ - locationTotal = locationTotal += Number($(this).outerWidth() + 10); - }); - $(".location").css({ width : locationTotal }) - - } - else { - $(".location").css({ width: "100%" }); - } - }); - }, - 'mypageGnb' : function() { - var mypageMenu = $(".mypage_lnb"); - var mypagesubMenu = mypageMenu.find("li.active").html(); - //mypage - $(".mpage").find(".sub_title").before("<div class='mypage_submenu overX'></div>"); - $(".mypage_submenu").html(mypagesubMenu); - $(".mysub").parent("li").addClass("have"); - $(".mypage_submenu .mysub").parent(".mypage_submenu").addClass("have"); - - if ( $(window).width() < 1200){ - $(".mypage_submenu").before(mypageMenu); - } - else { - $(".my_content_wrap").before(mypageMenu); - } - - $(window).resize(function(){ - if ( $(window).width() < 1200){ - $(".mypage_submenu").before(mypageMenu); - } - else { - $(".my_content_wrap").before(mypageMenu); - } - }); - - if ( $(window).width() < 701){ - var mymainLi = $(".mypage_lnb > ul > li"); - var mymaintotalWidth = 0; - mymainLi.each(function(){ - mymaintotalWidth = mymaintotalWidth += Number($(this).outerWidth() + 5); - }) - $(".mypage_lnb ul").css({ width : mymaintotalWidth }); - - var mysubLi = $(".mypage_submenu > ul > li"); - var mysubtotalWidth = 0; - mysubLi.each(function(){ - mysubtotalWidth = mysubtotalWidth += Number($(this).outerWidth() + 15); - }) - $(".mypage_submenu ul").css({ width : mysubtotalWidth }); - - } - else { - $(".mypage_lnb ul").css({ width: "100%" }); - } - - $(window).resize(function(){ - - if ( $(window).width() < 701){ - var mymainLi = $(".mypage_lnb > ul > li"); - var mymaintotalWidth = 0; - mymainLi.each(function(){ - mymaintotalWidth = mymaintotalWidth += Number($(this).outerWidth() + 5); - }) - $(".mypage_lnb ul").css({ width : mymaintotalWidth }); - - var mysubLi = $(".mypage_submenu > ul > li"); - var mysubtotalWidth = 0; - mysubLi.each(function(){ - mysubtotalWidth = mysubtotalWidth += Number($(this).outerWidth() + 15); - }) - $(".mypage_submenu ul").css({ width : mysubtotalWidth }); - - } - else { - $(".mypage_lnb ul").css({ width: "100%" }); - } - }); - }, - 'gnbMobile' : function(){ - var depth2Menu = $(".gnb ul").find("li.active").find(".submenu").html(); - var depth3Menu = $(".gnb").find(".depth2").find("li.active").find(".depth3_wrap").html(); - $(".gnb_2depth_mobile").html(depth2Menu) - $(".gnb_3depth_mobile").html(depth3Menu) - $(".gnb_mobile").find(".depth3").parent(".gnb_3depth_mobile").addClass("have") - - var mgLi2 = $(".gnb_2depth_mobile ul li"); - var mg2totalWidth = 0; - mgLi2.each(function(){ - mg2totalWidth = mg2totalWidth += Number($(this).outerWidth() + 10); - }) - $(".gnb_2depth_mobile ul").css({ width : mg2totalWidth }) - - var mgLi3 = $(".gnb_3depth_mobile ul li"); - var mg3totalWidth = 0; - mgLi3.each(function(){ - mg3totalWidth = mg3totalWidth += Number($(this).outerWidth() + 30); - }) - $(".gnb_3depth_mobile ul").css({ width : mg3totalWidth }) - - $(window).resize(function(){ - var mgLi2 = $(".gnb_2depth_mobile ul li"); - var mg2totalWidth = 0; - mgLi2.each(function(){ - mg2totalWidth = mg2totalWidth += Number($(this).outerWidth() + 10); - }) - $(".gnb_2depth_mobile ul").css({ width : mg2totalWidth }) - - var mgLi3 = $(".gnb_3depth_mobile ul li"); - var mg3totalWidth = 0; - mgLi3.each(function(){ - mg3totalWidth = mg3totalWidth += Number($(this).outerWidth() + 30); - }) - $(".gnb_3depth_mobile ul").css({ width : mg3totalWidth }) - }); - } - } - - - var clickEvent = { - - 'familysite' : function(){ - //familysite toggle - $(".btn_family").on("click", function(){ - $(".familysite").toggleClass("active"); - if ($(".familysite").hasClass('active')){ - $(".btn_family").attr("title", "관련사이트 닫기"); - } else{ - $(".btn_family").attr("title", "관련사이트 열기"); - } - }); - $(".familysite li ul li:last-child").on("focusout", function(){ - $(".btn_family").focus(); - }); - }, - 'map' : function(){ - //지도 넓게 보기 - $(".btn_fold").on('click', function(){ - $(".map_list_wrap").toggleClass("wide"); - }); - }, - 'productView' : function(){ - //상품 상세설명 더보기 버튼 - $('.pic_sub button').on('click', function (){ - $(this).toggleClass("active"); - $(".pic_mask").toggleClass("show"); - if ($(this).hasClass('active')){ - $(this).attr("title", "상세정보 간단히 보기").text("간단히 보기"); - } else{ - $(this).attr("title", "상세정보 더보기").text("자세히 보기"); - } - }); - - }, - 'terms' : function(){ - //회원가입 약관 - // $(".btn_terms").on('click', function(){ - // $(this).toggleClass("active"); - // $(this).parent(".terms_wrap").next(".textarea_member_wrap").slideToggle(); - // }); - - $('.btn_terms').on('click', function(){ - if ($(this).parent(".terms_wrap").next(".textarea_member_wrap").css('display') == 'none') { - $('.textarea_member_wrap').slideUp(); - $('.btn_terms').removeClass('active'); - $(this).toggleClass("active"); - $(this).parent(".terms_wrap").next(".textarea_member_wrap").slideToggle(); - } else { - $('.textarea_member_wrap').slideUp(); - $(this).removeClass('active'); - } - }); - - }, - 'howto' : function(){ - //신청방법 - $(".howto_wrap button").on('click', function(){ - $(this).toggleClass("active"); - $(".title_box").toggleClass("active"); - $(".howto").slideToggle(); - }); - }, - 'skip_top' : function(){ - if ($("body").hasClass("index_body")) { - //$(".skip_top").attr("onclick", "location.href='/vtsp/'"); - $(".skip_top").attr("onclick", "location.href='#anchor1'"); - $(".skip_top").addClass("forIndex"); - } - }, - 'productImg' : function(){ - //상품이미지 변경 - $('.thumb_list li').on('click', function(){ - $('.thumb_list li').removeClass("active"); - $(this).addClass("active"); - var thubImg = $(this).children(".bg_box").children("img").attr("src"); - $(".img_frame").children(".bg_box").css({ backgroundImage: "url(" + thubImg + ")" }); - }); - }, - 'inputCategory' : function(){ - //검색, 선택 버튼 설정 - $(".btn_input").on("click", function(){ - $(this).addClass("active"); - $(".btn_select").removeClass("active"); - $(".input_show").show(); - $(".select_show").hide(); - }); - $(".btn_select").on("click", function(){ - $(this).addClass("active"); - $(".btn_input").removeClass("active"); - $(".select_show").show(); - $(".input_show").hide(); - }); - }, - 'mapShow' : function(){ - //지도 show - $(".show_map").on("click", function(){ - $(this).hide(); - $(".show_list").show(); - $(".map_list_wrap, .map_wrap").addClass("active"); - }); - }, - 'mapHide' : function(){ - ///지도 hide - $(".show_list").on("click", function(){ - $(this).hide(); - $(".show_map").show(); - $(".map_list_wrap, .map_wrap").removeClass("active"); - }); - }, - 'showmore' : function(){ - $(".tbac_sub_info button").click(function(){ - $(this).parent(".btn_group").hide(); - $(".board_view").show(); - }) - } - } - - // toggle events - var toggle = { - 'toggleList' : function(){ - //toggle list - $('.toggle_tit').on('click', function(){ - if ($(this).next('.toggle_box').css('display') == 'none') { - $('.toggle_box').slideUp(); - $('.toggle_tit').removeClass('active'); - $(this).addClass('active'); - $(this).next(".toggle_box").slideDown(); - } else { - $('.toggle_box').slideUp(); - $(this).removeClass('active'); - } - }); - }, - - 'toggleBtn' : function(){ - $('.btn_toggle').on('click', function(){ - $(this).toggleClass("active"); - $(this).parent(".toggle_btn_tit").next(".toggle_box").slideToggle(); - }); - }, - 'arrowBtn' : function(){ - $('.btn_arrow_down').on('click', function(){ - $(this).toggleClass("active") - $(this).parent(".toggle_wrap").find(".toggle_content").slideToggle(); - }); - }, - 'estToggle' : function(){ - //견적항목 담기 목록 - $(document).on('click', '.est_sel_title', function() { - $(this).parent(".est_selected li").toggleClass("active"); - $(this).toggleClass("on"); - $(this).next(".est_sel_content_wrap").stop().slideToggle(); - var titleText = $(this).closest("li").attr("title"); - - if ($(this).hasClass("on")){ - $(this).attr("title",titleText+" 접기"); - } - else{ - $(this).attr("title",titleText+" 펼치기"); - } - }); - }, - 'activeToggle' : function(){ - $('.active_toggle').on('click', function(){ - $('.active_toggle').removeClass("active"); - $(this).toggleClass("active"); - }); - }, - 'jobList' : function(){ - var widwidth = $(window).width(); - if (widwidth < 500){ - $(".toggle").addClass("mobile"); - $(".toggle .toggle_content").hide(); - $(".toggle .tit_wrap").on('click', function(){ - $(this).toggleClass("on") - $(this).next(".toggle_content").slideToggle(); - }); - } - else { - $(".toggle").removeClass("mobile"); - $(".toggle .toggle_content").show(); - $(".toggle .tit_wrap").on('click', function(){ - $(this).removeClass("on"); - $(this).next(".toggle_content").slideDown(); - }); - } - } - } - - var sitemap = { - 'close' : function(){ - - $(".gnb_sitemap a").on("click", function(){ - $(".sitemap_wrap").addClass("open"); - $(".close_sitemap").focus() - }); - - $(".close_sitemap").on("click", function(){ - $(".sitemap_wrap").removeClass("open"); - $(".gnb_sitemap a").focus(); //표시해둔 곳으로 초점 이동 - }); - - $(".sitemap_left .depth1:last-child .submenu .depth2 > li:last-child").on('focusout', function() { - //$(".sitemap_wrap").removeClass("active"); - $(".close_sitemap").focus() - }); - } - } - - var popup = { - 'open' : function(){ - // $(".openpopup").on("click", function(){ - // var popupname = $(this).attr("name"); - // $("." + popupname).show().addClass("open").find(".btn_close").focus(); - // var el = $(this); - // el.attr('data-focus','on'); //레이어 팝업이 닫힐떄를 위한 표시 - 접근성 - // }); - - $(".openpopup").on('click', function(){ - - var op = $(this); - var lp = $("#" + $(this).attr("aria-controls")); - var lpObj = lp.find(".modal_box"); - var lpObjClose = lp.find(".btn_close"); - var lpObjTabbale = lpObj.find("button, input:not([type='hidden']), select, iframe, textarea, [href], [tabindex]:not([tabindex='-1'])"); - var lpObjTabbaleFirst = lpObjTabbale && lpObjTabbale.first() - var lpObjTabbaleLast = lpObjTabbale && lpObjTabbale.last() - var lpOuterObjHidden = $("") //레이어 바깥요소 - var all = $("").add(lp); - var tabDisable; - var nowScrollPos = $(window).scrollTop(); - - - function lpClose() { - $("body").removeClass("scroll-off").css("top", "").off("scroll touchmove mousewheel"); - $(window).scrollTop(nowScrollPos); // 레이어 닫은 후 화면 최상단으로 이동 방지 - if (tabDisable === true) lpObj.attr("tabindex", "-1"); - all.removeClass("open"); - lpOuterObjHidden.removeAttr("aria-hidden"); - op.focus(); //레이어 닫은 후 원래 있던 곳으로 초점 이동 - $(document).off("keydown.lp_keydown"); - - } - - $(this).blur(); - all.addClass("open"); - lpOuterObjHidden.attr("aria-hidden", "true"); //레이어 바깥 영역을 스크린리더가 읽지 않게 - - lpObjTabbale.length ? lpObjTabbaleFirst.focus().on("keydown", function(event){ - if (event.shiftkey && (event.keycode || event.which) === 9) { - - event.preventDefault(); - lpObjTabbaleLast.focus(); - - } - - }) : lpObj.attr("tabindex", "0").focus().on("keydown", function(){ - tabDisabble = true; - if ((event.keyCode || event.which) === 9) event.preventDefault(); - // 레이어 밖으로 초점이동 안되게 - }); - - lpObjTabbaleLast.on("keydown", function(event){ - if (!event.shiftkey && (event.keycode || event.which) === 9) { - event.preventDefault(); - lpObjTabbaleFirst.focus(); - } - }) - - lpObjClose.on("click", lpClose); //레이어 닫기 - - lp.on("click", function(){ - if (event.target === event.currentTarget) { - lpClose(); //반투명 배경 클릭시 레이어 닫기 - } - }); - - $(document).on("keydown.lp_keydown", function(event){ - //esc키 : 레이어닫기 - var keyType = event.keycode || event.which; - if (keyType === 27 && lp.hasClass("open")){ - lpClose() - } - }) - }) - - - }, - 'close' : function(){ - //$(".close, .btn_close, .member_close").on('click', function(){ - // $(".modal, .member_wrap").hide().removeClass("open"); - // $("a[data-focus~=on]").focus(); //표시해둔 곳으로 초점 이동 - // - //}); - - } - } - - var search = { - init : function() { - this.addEvent(); - }, - 'issearch' : function(){ - $(".btn_is").on('click', function(){ - $(".int_search").addClass("open"); - $(".is_search .inputText").focus() - }); - $(".close_is").on('click', function(){ - $(".int_search").removeClass("open"); - $(".btn_is").focus(); - }); - $(".close_is").on('focusout', function(){ - $(".is_search .inputText").focus(); - }); //통합검색 포커스 - - $(".keyword_footer .btn_close").on('focusout', function(){ - $("#cmmTotalSearchAuto li:first-child a").focus(); - }); //연관 검색어 포커스 - - } - } - - // 배경 이미지 넣기 - var itemImg = { - 'bgImg' : function() { - $(".bg_box, .item_img").each(function(){ - var item_img_box = $(this).children("img").attr("src"); - $(this).css({backgroundImage: "url(" + item_img_box + ")"}); - }); - }, - //버튼 배경 이미지 넣기 - 'btnImg' : function() { - $(".btn_img").each(function(){ - var btn_img = $(this).children("img").attr("src"); - $(this).css({backgroundImage: "url(" + btn_img + ")"}); - }); - } - } - - function inputFocus() { - //input focus event - //포커스시 - $(document).on('focus', '.inputText, .textArea', function() { - $(this).parent('.text_show').addClass("focus"); - }); - //포커스아웃시 - $(document).on('focusout', '.inputText, .textArea', function() { - if($(this).val() == '') { - $(this).parent('.text_show').removeClass("focus"); - } - }); - var inputText = $('.inputText, .textArea'); - inputText.each(function() { - if ($(this).val().trim() != '') { - $(this).parent('.text_show').addClass('focus'); - } - }); - } - - //slick slide - var slideShow = { - 'cardSlide' : function() { - $(".card_wrap").slick({ - centerMode: true, - centerPadding: '0', - slidesToShow: 1, - dots: true, - accessibility:true, - customPaging: function(slider, i){ - return '<a href="#!" class="dot" title="' + $(slider.$slides[i]).find('.slick_list').attr('data-dot-title') + '번째로 이동">슬라이드이동버튼</a>'; - }, - }); - - $(".card_wrap3").slick({ - rows: 1, - centerMode: true, - infinite : true, - centerPadding: '0', - slidesToShow: 3, - keyboard: true, - dots: true, - accessibility:true, - }); - - - //index 아이콘 title - $(".m_slide").each(function(){ - var modaldot = $(this).index() + 1; - $(this).attr("data-dot-title", modaldot + "번째로 이동"); - }) - - //index 아이콘 title - $(".slick-dots li").each(function(){ - var indexdot = $(this).index() + 1; - $(this).find("a").attr("title", indexdot + "번째 페이지로 이동"); - }) - - $(".modal_slide").slick({ - centerMode: true, - centerPadding: '0', - slidesToShow: 1, - dots: true, - arrow: true, - accessibility:true, - customPaging: function(slider, i){ - return '<a href="#!" class="dot" title="' + $(slider.$slides[i]).find('.m_slide').attr('data-dot-title') + '">슬라이드이동버튼</a>'; - }, - }); - - var $reiviewSlider = $(".review_wrap").slick({ - dot: false, - centerMode: true, - arrow: true, - infinite : true, - slideToScroll: 1, - keyboard: true, - dots: true, - accessibility:true, - variableWidth: true, - responsive:[ - - { - breakpoint:1200, - settings:{ - centerPadding: '0', - slidesToShow: 1, - slidesToScroll: 1, - } - } - ] - }); - - $reiviewSlider.on('beforeChange', function(event, slick, currentSlide, nextSlide){ - var slideNo = nextSlide+1; - $(".reviewAcnt").html("0"+slideNo); - }) - - $(".graph").slick({ - rows: 1, - //centerMode: true, - centerPadding: '10%', - slidesToShow: 2, - slidesToScroll: 2, - dots: true, - customPaging: function(slider, i){ - return '<a href="#!" class="dot" title="' + $(slider.$slides[i]).find('.graph_list').attr('data-dot-title') + '번째로 이동">슬라이드이동버튼</a>'; - }, - keyboard: true, - accessibility:true, - responsive:[ - { - breakpoint:1500, - settings:{ - centerMode: true, - centerPadding: '20%', - slidesToShow: 1, - slidesToScroll: 1, - } - }, - { - breakpoint:1200, - settings:{ - centerMode: true, - centerPadding: '10%', - slidesToShow: 1, - slidesToScroll: 1, - } - }, - { - breakpoint:500, - settings:{ - centerMode: true, - centerPadding: '0', - slidesToShow: 1, - slidesToScroll: 1, - } - } - ] - }); - - $(".index_slide").slick({ - rows: 1, - //infinite : true, - centerMode: true, - centerPadding: '0', - slidesToShow: 1, - slidesToScroll: 1, - dots: true, - customPaging: function(slider, i){ - return '<a href="#!" class="dot" title="' + $(slider.$slides[i]).find('.slick_list').attr('data-dot-title') + '">슬라이드이동버튼</a>'; - }, - arrows: true, - autoplay: true, - autoplaySpeed: 4000, - keyboard: true, - accessibility:true, - speed: 1000, - }); - $(".btn_play").on("click", function(){ - $(this).addClass("on"); - $(".btn_pause").removeClass("on"); - $(".index_slide").slick("slickPlay"); - }) - $(".btn_pause").on("click", function(){ - $(this).addClass("on"); - $(".btn_play").removeClass("on"); - $(".index_slide").slick("slickPause"); - }); - - }, - 'slideButton' : function() { - //slick button title - $(".slick-prev").attr("title", "이전컨텐츠"); - $(".slick-next").attr("title", "다음컨텐츠"); - } - - } - - // 스크롤 시 top버튼 토글 함수 - function scrollTopToggle() { - var scroll = $(window).scrollTop(); - var windowH = $(window).height(); - var htmlH = $("html").outerHeight(); - var headerH = $(".header").outerHeight(); - var footerH = $("footer").outerHeight(); - var subtitleH = $(".sub_title").outerHeight(); - var picMainH = $(".pic_main").outerHeight(); - var headnameH = $(".headname").outerHeight(); - var categoryH = $(".market_category").outerHeight(); - var searchH = $(".detail_search_wrap").outerHeight(); - var cmtintro1 = $(".cmtintro.section1").outerHeight(); - var cmtintro2 = $(".cmtintro.section2").outerHeight(); - var cmtintro3 = $(".cmtintro.section3").outerHeight(); - var cmtintro4 = $(".cmtintro.section4").outerHeight(); - var cmtintro5 = $(".cmtintro.section5").outerHeight(); - - $(".familysite").removeClass("active"); - - //포털소개 - if (scroll >= 150) { - $(".cmtintro.section1").addClass("active"); - $(".cmtintro.section2").removeClass("active"); - } else { - $(".cmtintro.section1").removeClass("active"); - } - if (scroll >= headerH + cmtintro1) { - $(".cmtintro.section1").addClass("gone"); - $(".cmtintro.section2").addClass("active"); - $(".cmtintro.section3").removeClass("active"); - } else { - $(".cmtintro.section1").removeClass("gone"); - } - if (scroll >= headerH + cmtintro1 + cmtintro2) { - $(".cmtintro.section1").addClass("gone"); - $(".cmtintro.section3").addClass("active"); - $(".cmtintro.section4").removeClass("active"); - } else { - $(".cmtintro.section2").removeClass("gone"); - } - if (scroll >= headerH + cmtintro1 + cmtintro2 + cmtintro3) { - $(".cmtintro.section2").addClass("gone"); - $(".cmtintro.section4").addClass("active"); - $(".cmtintro.section5").removeClass("active"); - } else { - $(".cmtintro.section3").removeClass("gone"); - } - if (scroll >= headerH + cmtintro1 + cmtintro2 + cmtintro3 + cmtintro4) { - $(".cmtintro.section3").addClass("gone"); - $(".cmtintro.section5").addClass("active"); - $(".cmtintro.section6").removeClass("active"); - } else { - $(".cmtintro.section4").removeClass("gone"); - } - if (scroll >= headerH + cmtintro1 + cmtintro2 + cmtintro3 + cmtintro4 + cmtintro5) { - $(".cmtintro.section4").addClass("gone"); - $(".cmtintro.section6").addClass("active"); - } else { - $(".cmtintro.section5").removeClass("gone"); - } - - //스크롤시 skip top 버튼 toggle - if (scroll >= 150) { - $(".skip_top").addClass("fix"); - } else { - $(".skip_top").removeClass("fix"); - } - - //마이페이지메뉴, 마켓 정보박스 fix - if (scroll >= headerH + subtitleH - 50) { - $(".payment, .price_wrap").addClass("fix"); - } else { - $(".payment, .price_wrap").removeClass("fix"); - } - - //브랜드관 animation - if (scroll >= headerH + subtitleH + headnameH - 150) { - $(".brand_header").addClass("on"); - } else { - $(".brand_header").removeClass("on"); - } - - //하단 도달 시 마이페이지메뉴, 마켓 정보박스 아래 띄움 - if (scroll >= htmlH - windowH - footerH + 150) { - $(".payment").addClass("nofix"); - } else { - $(".payment").removeClass("nofix"); - } - - //스크롤 시 마켓 카테고리 fix - if (scroll >= headerH + subtitleH + picMainH + categoryH - 10) { - $(".market_category, .pic_sub, .text_sub, .market_info, .market_view_wrap").addClass("fix"); - $(".payment").addClass("morefix"); - } else { - $(".market_category, .pic_sub, .text_sub, .market_info, .market_view_wrap").removeClass("fix"); - $(".payment").removeClass("morefix"); - } - - //하단 도달 시 마이페이지메뉴, 마켓 정보박스 아래 띄움 - if (scroll >= htmlH - windowH - footerH - 20) { - $(".payment").addClass("bottom"); - $(".price_wrap").addClass("nofix"); - } else { - $(".payment").removeClass("bottom"); - $(".price_wrap").removeClass("nofix") - } - - //하단 도달 시 마이페이지메뉴, 마켓 정보박스 아래 띄움 - if (scroll >= headerH + subtitleH + searchH) { - $(".search_result").addClass("fix"); - } else { - $(".search_result").removeClass("fix"); - } - - } - - // switch 체크 시 라인 active - function checkSwitch() { - if ($("input[type='checkbox'].switch").is(":checked")) { - $(".row").addClass("active"); - } else { - $(".row").removeClass("active"); - } - } - - // 이미지 사이즈 함수 - function boardContentImg() { - var img_length = $(".board_content img, .item_info_wrap img").length; - var _div_width = $(".board_content, .item_info_wrap").width(); - var _div_height = $(".board_content, .item_info_wrap").height(); - - for(var i=0;i<img_length;i++){ - var _width = $(".board_content img, .item_info_wrap img").eq(i).width(); - var _height = $(".board_content img, .item_info_wrap img").eq(i).height(); - if(_width < _div_width){ - $(".board_content img, .item_info_wrap img").eq(i).width(_width); - } else{ - $(".board_content img, .item_info_wrap img").eq(i).width("100%"); - } - if(_height < _div_height){ - $(".board_content img, .item_info_wrap img").eq(i).height("auto"); - } else{ - $(".board_content img, .item_info_wrap img").eq(i).height("auto"); - } - } - - $(window).resize(function(){ - var img_length = $(".board_content img").length; - var _div_width = $(".board_content").width(); - var _div_height = $(".board_content").height(); - - for(var i=0;i<img_length;i++){ - var _width = $(".board_content img").eq(i).width(); - var _height = $(".board_content img").eq(i).height(); - if(_width < _div_width){ - $(".board_content img").eq(i).width(_width); - } else{ - $(".board_content img").eq(i).width("100%"); - } - if(_height < _div_height){ - $(".board_content img").eq(i).height("auto"); - } else{ - $(".board_content img").eq(i).height("auto"); - } - } - }); - } - - // 마켓 카테고리 active - function pageSection() { - var scrollDistance = $(window).scrollTop(); - // Assign active class to nav links while scolling - $('.page-section').each(function(i) { - if ($(this).position().top <= scrollDistance) { - $('.market_category ul li.active, .search_category ul li.active').removeClass('active'); - $('.market_category ul li, .search_category ul li').eq(i).addClass('active'); - } - }); - } - - //a title 추가 - function addTitle() { - - $(".fr-file").each(function(){ - var filename = $(this).text() - $(this).attr("title", filename + " 다운받기") - }) - - } - - //tab 설정 - function tabs() { - // Default Action - $("ul.tabs li").children("a").attr("title", "선택안됨"); - $("ul.tabs").each(function() { - $(this).children("li:first").addClass("active") // Activate first tab - $(this).children("li:first").children("a").attr("title", "선택됨"); - - $(this).closest(".tab_wrap").find(".tab_content").hide(); // Hide all tab content - var activeTab = $(this).find("a").attr("href"); - $(activeTab).show(); - }); - - // On Click Event - $("ul.tabs li").click(function() { - $(this).parent("ul.tabs").children("li").removeClass("active");// Remove any "active" class - $(this).addClass("active"); // Add "active" class to selected tab - $(this).closest(".tab_wrap").find(".tab_content").hide(); // Hide all tab content - $("ul.tabs li").children("a").attr("title", "선택안됨"); - $(this).children("a").attr("title", "선택됨"); - var clickTab = $(this).find("a").attr("href"); // Find the rel - $(clickTab).fadeIn(); // Fade in the active content - return false; - }); - - } - - - $(document).ready(function() { - - /**이벤트**/ - $(window).scroll(function() { - //마켓 카테고리 active - pageSection(); - //scroll events - scrollTopToggle() - }); - - inputFocus(); //inputText focus 이벤트 - checkSwitch(); //카테고리 스위치 - addTitle(); //a 에 title 넣기 - tabs(); //tab - - board.survey(".bar"); //설문조사 bar 채우기 - board.calendar(); //달력 일정 숨기기 - board.marketH() //상세설명 높이 설정 - board.marketImg() //상세이미지 alt추가 - board.overX() - board.design() - - //popup - popup.open(); - popup.close(); - - skip.skipPage(); //웹접근성을 위한 본문 바로가기 - - //gnb - gnb.show(); - gnb.hide(); - gnb.gnbTabKey(); //gnb웹접근성(키보드로 이동) - gnb.btnMypage(); //header mypage button toggle - gnb.breadcrumb() //현재위치표시 toggle - gnb.mypageGnb() //마이페이지메뉴 - gnb.gnbMobile() - - //click events - clickEvent.familysite(); //패밀리사이트 toggle - clickEvent.map(); //지도넓게보기 - clickEvent.productView(); //상품 상세설명 더보기 버튼 - clickEvent.terms(); //회원가입 약관 toggle - clickEvent.howto(); //신청방법 toggle - clickEvent.skip_top(); //top으로가기버튼 event - clickEvent.productImg(); //상품이미지 변경 toggle - clickEvent.inputCategory() //input category toggle - clickEvent.mapShow() //반응형 지도 show - clickEvent.mapHide() //반응형 지도 hide - clickEvent.showmore() - - //toggle events - toggle.toggleList(); - toggle.toggleBtn(); - toggle.arrowBtn(); //견적서 toggle - toggle.estToggle(); //견적서 선택된 차종 리스트 toggle - toggle.activeToggle() //active toggle 설정 - toggle.jobList() - - search.issearch() //통합검색 포커스 이동 - - sitemap.close(".sitemap_wrap"); //사이트맵 close - itemImg.bgImg(); //자식요소 img 에 src 를 이용한 배경이미지 넣기 - itemImg.btnImg(); //버튼의 자식요소 img 에 src 를 이용한 배경이미지 넣기 - slideShow.cardSlide(".card_wrap"); //카드 형식의 슬라이드쇼 - slideShow.slideButton() - boardContentImg() //img 넓이가 부모요소의 넓이 이상 이면 100% 로 맞추기 - - }); -})(); \ No newline at end of file Index: base3.10/src/main/webapp/js/user/designJS.js =================================================================== --- base3.10/src/main/webapp/js/user/designJS.js (nonexistent) +++ base3.10/src/main/webapp/js/user/designJS.js (revision 34) @@ -0,0 +1,558 @@ +(function() { + /**함수**/ + "use strict"; +///// 웹접근성을 위한 본문 바로가기 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +var skip = { + 'skipPage' : function() { + + $('.skip a').on('focus', function(){ + $(this).stop().animate({"top":0, "opacity":1}); + }); + $('.skip a').on('click', function(){ + $(this).stop().animate({"top":"-30px", "opacity":0}); + }); + $('.skip a').on('focusout', function(){ + $(this).stop().animate({"top":"-30px", "opacity":0}); + }); + } +}; + +///// img background //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +var imgBg = { + 'bgImg' : function() { + $(".bg_box").each(function(){ + var bg_box = $(this).children("img").attr("src"); + $(this).css({backgroundImage: "url(" + bg_box + ")"}); + }); + }, + //버튼 배경 이미지 넣기 + 'btnImg' : function() { + $(".btn_img").each(function(){ + var btn_img = $(this).children("img").attr("src"); + $(this).css({backgroundImage: "url(" + btn_img + ")"}); + }); + } +} + +///// icon //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + var icon = { + //icon + 'icon' : function() { + + if (!('boxShadow' in document.body.style)) { + document.body.setAttribute('class', 'noBoxShadow'); + } + + document.body.addEventListener("click", function(e) { + var target = e.target; + if (target.tagName === "INPUT" && + target.getAttribute('class').indexOf('liga') === -1) { + target.select(); + } + }); + + } + }; + + +///// input focus event //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +var inputFocus = { + 'focus' : function() { + //포커스시 + $(document).on('focus', '.inputText, .textArea', function() { + $(this).parent('.text_show').addClass("focus"); + }); + //포커스아웃시 + $(document).on('focusout', '.inputText, .textArea', function() { + if($(this).val() === '') { + $(this).parent('.text_show').removeClass("focus"); + } + }); + var inputText = $('.inputText, .textArea'); + inputText.each(function() { + if ($(this).val().trim() !== '') { + $(this).parent('.text_show').addClass('focus'); + } + }); + } +}; + +///// slick //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +var slide = { + 'basicslide' : function() { + + var swiper = new Swiper(".main_slide", { + speed: 600, + keyboard: { + enabled: true, + }, + parallax: true, + pagination: { + el: ".swiper-pagination", + clickable: true, + }, + navigation: { + nextEl: ".swiper-button-next", + prevEl: ".swiper-button-prev", + }, + }); + + var swiperNews = new Swiper(".news_slide", { + slidesPerView: 4, + spaceBetween: 30, + speed: 600, + keyboard: { + enabled: true, + }, + pagination: { + el: ".swiper-pagination", + type: "progressbar", + }, + navigation: { + nextEl: ".swiper-button-next", + prevEl: ".swiper-button-prev", + }, + }); + + var swiperMove = new Swiper(".move", { + slidesPerView: "auto", + speed: 600, + keyboard: { + enabled: true, + }, + }); + + //slide width + var docWidth = $(document).outerWidth(); + var inner = $(".inner").outerWidth(); + var cal = (docWidth - inner) / 2; + + $(".news_slide").width(inner + cal); + $(".news_slide .swiper-button-prev, .news_slide .swiper-button-next").css({right: cal}); + + } +}; + +///// scroll //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// 스크롤 시 top버튼 토글 함수 +function scrollEvent() { + var scroll = $(window).scrollTop(); + + //포털소개 + if (scroll >= 150) { + $(".cmtintro.section1").addClass("active"); + $(".cmtintro.section2").removeClass("active"); + } else { + $(".cmtintro.section1").removeClass("active"); + } + +} + +//리스트 animation delay +function delay(){ + $(".listshow").find("li").each(function(){ + var hot = $(this).index(); + $(this).attr("data-aos-delay", hot * "100"); + }) +} + +//menu 클릭시 해당 컨텐츠로 이동 +function scrollmove(){ + $(".move a").on('click', function(){ + var target = $(this).attr("class"); + var targetOffset = $("#" + target).offset().top - 80; + window.scrollTo(0, targetOffset) + }) +} + +// toggle events +var toggle = { + 'togglelist' : function(){ + //toggle list + $('.toggle_tit').on('click', function(){ + if ($(this).next('.toggle_box').css('display') == 'none') { + $('.toggle_box').slideUp(); + $('.toggle_tit').removeClass('active'); + $(this).addClass('active'); + $(this).next(".toggle_box").slideDown(); + } else { + $('.toggle_box').slideUp(); + $(this).removeClass('active'); + } + }); + } +} + + +//// magic scroll /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// toggle events +var masicCcroll = { + 'animation' : function(){ + + // 웹진 목록 + var controller = new ScrollMagic.Controller(); + var sec1 = $("#sec1").outerHeight(); + var sec2 = $("#sec2").outerHeight(); + var sec3 = $("#sec3").outerHeight(); + var sec4 = $("#sec4").outerHeight(); + // build scenes + new ScrollMagic.Scene({triggerElement: "#sec1", triggerHook:0.1}) + .duration(sec1) + .setClassToggle(".move1", "active") // add class toggle + .addTo(controller); + new ScrollMagic.Scene({triggerElement: "#sec2", triggerHook:0.1}) + .duration(sec2) + .setClassToggle(".move2", "active") // add class toggle + .addTo(controller); + new ScrollMagic.Scene({triggerElement: "#sec3", triggerHook:0.1}) + .duration(sec3) + .setClassToggle(".move3", "active") // add class toggle + .addTo(controller); + new ScrollMagic.Scene({triggerElement: "#sec4", triggerHook:0.1}) + .duration(sec4) + .setClassToggle(".move4", "active") // add class toggle + .addTo(controller); + new ScrollMagic.Scene({triggerElement: ".fixed-menu", triggerHook: 0}) + .setClassToggle(".move, .fixed-menu", "fix") // add class toggle + .addTo(controller); + + //about + var revealElements = $(".content_wrap ul li, .content_wrap h3, .office_box") + for (var i=0; i<revealElements.length; i++) { + + var scene2 = new ScrollMagic.Scene({ + triggerElement: revealElements[i], + triggerHook: 0.7 + }) + .setClassToggle(revealElements[i], "visible") // add class toggle + .addTo(controller) + } + + } +} + + + + +///// tab //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +var tabs = { + 'tabs': function () { + + const tabGroups = document.querySelectorAll('[data-role="tab"]'); + if (tabGroups) { + let currentTarget, targetTabWrap, targetTabListWrap, targetPanelWrap; + // 이벤트 타겟 변수 설정 + const init = (e) => { + currentTarget = e.target.tagName; + currentTarget === 'BUTTON' || 'A' ? currentTarget = e.target : currentTarget = e.target.closest('button') || e.target.closest('a'); + targetTabWrap = currentTarget.closest('[data-role="tab"]'); + targetTabListWrap = targetTabWrap.querySelector('[role="tablist"]'); + targetPanelWrap = targetTabWrap.querySelector('.wrap-tab-contents'); + }; + // 클릭 이벤트 + const tabClickEvt = (e) => { + init(e); + if (currentTarget.ariaSelected === 'false') { + // 미선택된 탭 속성 false 상태로 만들기 + tabRemoveEvt(targetTabListWrap, targetPanelWrap); + // 선택 된 탭 속성 true 상태로 만들기 + tabAddEvt(currentTarget, targetTabWrap); + } + }; + // 키보드 접근 이벤트 + const tabKeyUpEvt = (e) => { + init(e); + const targetBtnWrap = currentTarget.parentElement; + if (e.key === 'ArrowRight') { + // 키보드 -> 화살표를 눌렀을 때 + if (targetBtnWrap.nextElementSibling) { + targetBtnWrap.nextElementSibling.children[0].focus(); + tabRemoveEvt(targetTabListWrap, targetPanelWrap); + tabAddEvt(targetBtnWrap.nextElementSibling.children[0], targetTabWrap); + } + else homeKeyEvt(targetTabListWrap, targetTabWrap, targetPanelWrap); + } else if (e.key === 'ArrowLeft') { + // 키보드 <- 화살표를 눌렀을 때 + if (targetBtnWrap.previousElementSibling) { + targetBtnWrap.previousElementSibling.children[0].focus(); + tabRemoveEvt(targetTabListWrap, targetPanelWrap); + tabAddEvt(targetBtnWrap.previousElementSibling.children[0], targetTabWrap); + } else endKeyEvt(targetTabListWrap, targetTabWrap, targetPanelWrap); + } + // 키보드 End 키 눌렀을 때 + else if (e.key === 'End') endKeyEvt(targetTabListWrap, targetTabWrap, targetPanelWrap); + // 키보드 Home 키 눌렀을 때 + else if (e.key === 'Home') homeKeyEvt(targetTabListWrap, targetTabWrap, targetPanelWrap); + }; + // tab active event + const tabAddEvt = (currentTarget, targetPanelWrap) => { + // 선택 된 탭 속성 true 로 변경 + currentTarget.setAttribute('aria-selected', 'true'); + currentTarget.removeAttribute('tabindex'); + currentTarget.parentElement.classList.add('active'); + // 연결 된 tabpanel 숨김 해제 + targetPanelWrap.querySelector(`[aria-labelledby="${currentTarget.id}"]`).removeAttribute('hidden'); + targetPanelWrap.querySelector(`[aria-labelledby="${currentTarget.id}"]`).setAttribute('tabindex', '0'); + }; + // tab active remove event + const tabRemoveEvt = (tabListWrap, tabPanelWrap) => { + targetTabListWrap.querySelectorAll('li').forEach((tabBtnWrap) => { + // 기존에 선택 된 탭 속성 false 로 변경 + if (tabBtnWrap.classList.contains('active')) { + tabBtnWrap.classList.remove('active'); + tabBtnWrap.querySelector('[role="tab"]').setAttribute('aria-selected', 'false'); + tabBtnWrap.querySelector('[role="tab"]').setAttribute('tabindex', '-1'); + } + }); + // 기존에 선택 된 tabpanel 숨김 + for (let tabPanel of targetPanelWrap.children) { + tabPanel.setAttribute('hidden', 'false'); + tabPanel.setAttribute('tabindex', '-1'); + } + }; + // 키보드 Home key Event (선택된 탭 리스트 중 첫 번째 리스트로 포커스 이동) + const homeKeyEvt = (targetTabListWrap, targetTabWrap, targetPanelWrap) => { + targetTabListWrap.children[0].children[0].focus(); + tabRemoveEvt(targetTabListWrap, targetPanelWrap); + tabAddEvt(targetTabListWrap.children[0].children[0], targetTabWrap); + }; + // 키보드 End key Event (선택된 탭 리스트 중 마지막 리스트로 포커스 이동) + const endKeyEvt = (targetTabListWrap, targetTabWrap, targetPanelWrap) => { + const targetTabLists = targetTabListWrap.querySelectorAll('li'); + targetTabLists[targetTabLists.length - 1].children[0].focus(); + tabRemoveEvt(targetTabListWrap, targetPanelWrap); + tabAddEvt(targetTabLists[targetTabLists.length - 1].children[0], targetTabWrap); + }; + // 클릭/키보드 탭 이벤트 제거/할당 + tabGroups.forEach((tabWrapper) => { + const tabBtns = tabWrapper.querySelectorAll('[role="tab"]'); + tabBtns.forEach((tabBtn) => { + tabBtn.removeEventListener('click', tabClickEvt); + tabBtn.addEventListener('click', tabClickEvt); + tabBtn.removeEventListener('keyup', tabKeyUpEvt); + tabBtn.addEventListener('keyup', tabKeyUpEvt); + }); + }); + } + } +}; + +///// popup //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +var popup = { + 'popup': function () { + + const popupBtnAll = document.querySelectorAll('[aria-haspopup="dialog"]'); + if (popupBtnAll) { + let currentTarget, focusEl = [], + popupDepth = 0, + popupDimmed, keyEscapeEvt, KeyEvtEl; + const _$this = this, + popupAll = document.querySelectorAll('[role="dialog"]'), + popupCloseBtnAll = document.querySelectorAll('[popup-close]'); + + // ESC 누름 감지 + const keyEvent = { + get keyEscape() { + return this._state; + }, + set keyEscape(state) { + this._state = state; + if (state) escKeyEvt(KeyEvtEl, keyEscapeEvt); + }, + }; + keyEvent; + // popup dimmed 생성 + const createdDimmed = () => { + const createDiv = document.createElement('div'); + createDiv.classList.add('popup-dimmed'); + document.querySelector('body').appendChild(createDiv); + }; + // popup dimmed click 시 팝업 닫기 + const dimmedClick = (e) => { + if (e.target.classList.contains('wrap-layer-popup')) { + popupCloseAll(); + keyEvent.keyEscape = false; + } + }; + // popup open + const popupOpen = (e) => { + currentTarget = e.target.tagName; + currentTarget === 'BUTTON' || currentTarget === 'A' ? currentTarget = e.target : currentTarget = e.target.closest('button') || e.target.closest('a'); + + popupDimmed = document.querySelectorAll('.popup-dimmed'); + if (popupDimmed.length === 0) createdDimmed(); + + popupAll.forEach((popupEl) => { + if (popupEl.getAttribute('data-popup') === currentTarget.getAttribute('data-popup')) { + popupDepth += 1; // popup depth 저장 + focusEl.splice((popupDepth - 1), 0, currentTarget); // popup focus Element 저장 + popupEl.classList.add('popup-open'); // open class add + popupEl.setAttribute('popup-depth', popupDepth); // popup depth 설정 + + // dimmed click 이벤트 할당 + popupEl.removeEventListener('click', dimmedClick); + popupEl.addEventListener('click', dimmedClick); + + document.body.classList.add('scroll-lock'); // popup scroll lock + popupEl.querySelector('.wrap-layer-popup-title').focus(); // popup 오픈 시 타이틀에 포커스 + + // shift+tab 또는 <- 화살표 키 키보드 동작 시 팝업 밖으로 포커스 이동 방지 이벤트 할당 + popupEl.querySelector('.wrap-layer-popup-title').removeEventListener('keydown', titleKeyDown); + popupEl.querySelector('.wrap-layer-popup-title').addEventListener('keydown', titleKeyDown); + + // popup 위 팝업 케이스 dimmed 수정 + if (popupDepth > 1) document.querySelector(`[popup-depth='${popupDepth - 1}']`).classList.add('prev-popup'); + + KeyEvtEl = popupEl; // ESC 키 동작을 위한 현재 활성화 된 popup element 저장 + }; + }); + }; + // popup close + const popupClose = (e) => { + // 키보드 이벤트 ESC 일 경우 currentTarget 설정 + if (e.key == 'Escape' || e.key == 'Esc') currentTarget = KeyEvtEl.querySelector('.btn-layer-close'); + // 일반적인 클릭, 키보드 이벤트 일 경우 currentTarget 설정 + else { + currentTarget = e.target.tagName; + currentTarget === 'BUTTON' || currentTarget === 'A' ? currentTarget = e.target : currentTarget = e.target.closest('button') || e.target.closest('a'); + let popupId = currentTarget.getAttribute('popup-close'); + if (currentTarget.getAttribute('popup-close-all') === 'true') return popupCloseAll(); + if (currentTarget.getAttribute('popup-confirm')) confirmEvt[popupId](); + else if (currentTarget.getAttribute('popup-cancel')) cancelEvt[popupId](); + } + popupAll.forEach((popupEl) => { + if (popupEl.getAttribute('data-popup') === currentTarget.getAttribute('popup-close')) { + popupEl.classList.remove('popup-open'); + // 저장된 focus element 가 있을 때 + if (focusEl.length > 0) { + focusEl[popupDepth - 1].focus(); // focus 상태 재설정 + focusEl.splice((popupDepth - 1), 1); // popup focus Element 삭제 + popupDepth -= 1; // popup depth 재설정 + KeyEvtEl = document.querySelector(`.wrap-layer-popup[popup-depth='${popupDepth}']`); // ESC 키 동작을 위한 현재 활성화 된 popup element 저장 + } else { // 저장된 focus element 가 없을 때 + document.body.setAttribute('tabindex', '0'); + document.body.focus(); + KeyEvtEl = null; + } + }; + }); + // 오픈 된 popup이 있는 지 확인 + const openPopups = document.querySelectorAll(`.popup-open`); + if (openPopups.length === 0) popupCloseAll('none'); + else if (openPopups.length > 0) { // 오픈된 popup이 있을 경우 popup dimmed 수정 + const getPopupValue = currentTarget.getAttribute('popup-close') || currentTarget.getAttribute('data-popup'); + const getPopupDepth = Number(document.querySelector(`.wrap-layer-popup[data-popup='${getPopupValue}']`).getAttribute('popup-depth')); + document.querySelector(`.wrap-layer-popup[popup-depth='${getPopupDepth - 1}']`).classList.remove('prev-popup'); + document.querySelector(`.wrap-layer-popup[data-popup='${getPopupValue}']`).removeAttribute('popup-depth'); + }; + }; + // popup close All + const popupCloseAll = (focusActionNone) => { + // dimmed 삭제 + const popupDimmed = document.querySelector('.popup-dimmed'); + popupDimmed.style.opacity = 0; + popupDimmed.addEventListener('transitionend', function () { + if (popupDimmed.parentNode !== null) popupDimmed.parentNode.removeChild(popupDimmed); + }); + // popup depth 설정 삭제 + popupAll.forEach((popupEl) => { + popupEl.classList.remove('prev-popup'); + popupEl.removeAttribute('popup-depth'); + }); + // scroll lock 해지 + document.body.classList.remove('scroll-lock'); + // popupClose Event 통해서 focus 설정이 되지 않았을 경우 (popupCloseAll 단독 실행일 경우) + if (focusActionNone !== 'none') { + if (focusEl.length > 0) focusEl[0].focus(); // 저장된 focus element 가 있을 때 + else { // 저장된 focus element 가 없을 때 + document.body.setAttribute('tabindex', '0'); + document.body.focus(); + }; + focusEl = []; // focus reset + } + popupAll.forEach((popupEl) => popupEl.classList.remove('popup-open')); // open class 삭제 + popupDepth = 0; // popup depth reset + KeyEvtEl = null; // KeyEvtEl reset + }; + + // ESC 키보드 이벤트 + const escKeyEvt = (El, e) => { + const openPopups = document.querySelectorAll(`.popup-open`); + // 팝업 열린 상태에서 키보드 ESC 키 이벤트 실행 + if (openPopups.length > 0) popupClose(e); + }; + // popup 닫기 키보드 이벤트 + const closeBtnKeyDown = (e) => { + if ((e.key == 'Tab' && !e.shiftKey) || e.key == 'ArrowRight') { + e.preventDefault(); + popupAll.forEach((popupEl) => { + if (popupEl.getAttribute('data-popup') === e.target.getAttribute('popup-close')) { + popupEl.querySelector('.wrap-layer-popup-title').focus(); + }; + }); + }; + }; + // popup title 키보드 이벤트 + const titleKeyDown = (e) => { + if ((e.key == 'Tab' && e.shiftKey) || e.key == 'ArrowLeft') { + e.preventDefault(); + popupAll.forEach((popupEl) => { + if (popupEl.getAttribute('data-popup') === e.target.closest('.wrap-layer-popup').getAttribute('data-popup')) { + popupEl.querySelector('.btn-layer-close').focus(); + }; + }); + }; + }; + + // 키보드 ESC 키 누름 감지 이벤트 + const escKeyDown = (e) => { + if (e.key == 'Escape' || e.key == 'Esc') { + keyEscapeEvt = e; + keyEvent.keyEscape = true; + }; + }; + + // 클릭/키보드 팝업 이벤트 제거/할당 + // 팝업 열기 + popupBtnAll.forEach((popupBtn) => { + popupBtn.removeEventListener('click', popupOpen); + popupBtn.addEventListener('click', popupOpen); + }); + // 팝업 닫기 + popupCloseBtnAll.forEach((popupCloseBtn) => { + popupCloseBtn.removeEventListener('click', popupClose); + popupCloseBtn.addEventListener('click', popupClose); + if (popupCloseBtn.classList.contains('btn-layer-close')) { + popupCloseBtn.removeEventListener('keydown', closeBtnKeyDown); + popupCloseBtn.addEventListener('keydown', closeBtnKeyDown); + } + }); + // ESC 키로 팝업 닫기 + window.removeEventListener('keydown', escKeyDown); + window.addEventListener('keydown', escKeyDown); + } + } +} + +$(document).ready(function() { + + /**이벤트**/ + $(window).scroll(function() { + scrollEvent(); //scroll events + }); + inputFocus.focus(); //inputText focus 이벤트 + popup.popup(); //popup + tabs.tabs() //tabs + imgBg.bgImg(); //img background + skip.skipPage(); //웹접근성을 위한 본문 바로가기 + delay() //스크롤 애니메이션 제어 + slide.basicslide(); //카드 형식의 슬라이드쇼 + icon.icon() //arrow icon + scrollmove() //메뉴 클릭시 해당 화면으로 scroll이동 + toggle.togglelist() //toggle + masicCcroll.animation() //scroll animation + + }); +})(); \ No newline at end of file Property changes on: base3.10/src/main/webapp/js/user/designJS.js ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/js/user/swiper-bundle.js =================================================================== --- base3.10/src/main/webapp/js/user/swiper-bundle.js (nonexistent) +++ base3.10/src/main/webapp/js/user/swiper-bundle.js (revision 34) @@ -0,0 +1,10082 @@ +/** + * Swiper 7.4.1 + * Most modern mobile touch slider and framework with hardware accelerated transitions + * https://swiperjs.com + * + * Copyright 2014-2021 Vladimir Kharlampidi + * + * Released under the MIT License + * + * Released on: December 24, 2021 + */ + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Swiper = factory()); +}(this, (function () { 'use strict'; + + /** + * SSR Window 4.0.2 + * Better handling for window object in SSR environment + * https://github.com/nolimits4web/ssr-window + * + * Copyright 2021, Vladimir Kharlampidi + * + * Licensed under MIT + * + * Released on: December 13, 2021 + */ + + /* eslint-disable no-param-reassign */ + function isObject$1(obj) { + return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object; + } + + function extend$1(target = {}, src = {}) { + Object.keys(src).forEach(key => { + if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject$1(src[key]) && isObject$1(target[key]) && Object.keys(src[key]).length > 0) { + extend$1(target[key], src[key]); + } + }); + } + + const ssrDocument = { + body: {}, + + addEventListener() {}, + + removeEventListener() {}, + + activeElement: { + blur() {}, + + nodeName: '' + }, + + querySelector() { + return null; + }, + + querySelectorAll() { + return []; + }, + + getElementById() { + return null; + }, + + createEvent() { + return { + initEvent() {} + + }; + }, + + createElement() { + return { + children: [], + childNodes: [], + style: {}, + + setAttribute() {}, + + getElementsByTagName() { + return []; + } + + }; + }, + + createElementNS() { + return {}; + }, + + importNode() { + return null; + }, + + location: { + hash: '', + host: '', + hostname: '', + href: '', + origin: '', + pathname: '', + protocol: '', + search: '' + } + }; + + function getDocument() { + const doc = typeof document !== 'undefined' ? document : {}; + extend$1(doc, ssrDocument); + return doc; + } + + const ssrWindow = { + document: ssrDocument, + navigator: { + userAgent: '' + }, + location: { + hash: '', + host: '', + hostname: '', + href: '', + origin: '', + pathname: '', + protocol: '', + search: '' + }, + history: { + replaceState() {}, + + pushState() {}, + + go() {}, + + back() {} + + }, + CustomEvent: function CustomEvent() { + return this; + }, + + addEventListener() {}, + + removeEventListener() {}, + + getComputedStyle() { + return { + getPropertyValue() { + return ''; + } + + }; + }, + + Image() {}, + + Date() {}, + + screen: {}, + + setTimeout() {}, + + clearTimeout() {}, + + matchMedia() { + return {}; + }, + + requestAnimationFrame(callback) { + if (typeof setTimeout === 'undefined') { + callback(); + return null; + } + + return setTimeout(callback, 0); + }, + + cancelAnimationFrame(id) { + if (typeof setTimeout === 'undefined') { + return; + } + + clearTimeout(id); + } + + }; + + function getWindow() { + const win = typeof window !== 'undefined' ? window : {}; + extend$1(win, ssrWindow); + return win; + } + + /** + * Dom7 4.0.2 + * Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API + * https://framework7.io/docs/dom7.html + * + * Copyright 2021, Vladimir Kharlampidi + * + * Licensed under MIT + * + * Released on: December 13, 2021 + */ + /* eslint-disable no-proto */ + + function makeReactive(obj) { + const proto = obj.__proto__; + Object.defineProperty(obj, '__proto__', { + get() { + return proto; + }, + + set(value) { + proto.__proto__ = value; + } + + }); + } + + class Dom7 extends Array { + constructor(items) { + super(...(items || [])); + makeReactive(this); + } + + } + + function arrayFlat(arr = []) { + const res = []; + arr.forEach(el => { + if (Array.isArray(el)) { + res.push(...arrayFlat(el)); + } else { + res.push(el); + } + }); + return res; + } + + function arrayFilter(arr, callback) { + return Array.prototype.filter.call(arr, callback); + } + + function arrayUnique(arr) { + const uniqueArray = []; + + for (let i = 0; i < arr.length; i += 1) { + if (uniqueArray.indexOf(arr[i]) === -1) uniqueArray.push(arr[i]); + } + + return uniqueArray; + } + + + function qsa(selector, context) { + if (typeof selector !== 'string') { + return [selector]; + } + + const a = []; + const res = context.querySelectorAll(selector); + + for (let i = 0; i < res.length; i += 1) { + a.push(res[i]); + } + + return a; + } + + function $(selector, context) { + const window = getWindow(); + const document = getDocument(); + let arr = []; + + if (!context && selector instanceof Dom7) { + return selector; + } + + if (!selector) { + return new Dom7(arr); + } + + if (typeof selector === 'string') { + const html = selector.trim(); + + if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) { + let toCreate = 'div'; + if (html.indexOf('<li') === 0) toCreate = 'ul'; + if (html.indexOf('<tr') === 0) toCreate = 'tbody'; + if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) toCreate = 'tr'; + if (html.indexOf('<tbody') === 0) toCreate = 'table'; + if (html.indexOf('<option') === 0) toCreate = 'select'; + const tempParent = document.createElement(toCreate); + tempParent.innerHTML = html; + + for (let i = 0; i < tempParent.childNodes.length; i += 1) { + arr.push(tempParent.childNodes[i]); + } + } else { + arr = qsa(selector.trim(), context || document); + } // arr = qsa(selector, document); + + } else if (selector.nodeType || selector === window || selector === document) { + arr.push(selector); + } else if (Array.isArray(selector)) { + if (selector instanceof Dom7) return selector; + arr = selector; + } + + return new Dom7(arrayUnique(arr)); + } + + $.fn = Dom7.prototype; // eslint-disable-next-line + + function addClass(...classes) { + const classNames = arrayFlat(classes.map(c => c.split(' '))); + this.forEach(el => { + el.classList.add(...classNames); + }); + return this; + } + + function removeClass(...classes) { + const classNames = arrayFlat(classes.map(c => c.split(' '))); + this.forEach(el => { + el.classList.remove(...classNames); + }); + return this; + } + + function toggleClass(...classes) { + const classNames = arrayFlat(classes.map(c => c.split(' '))); + this.forEach(el => { + classNames.forEach(className => { + el.classList.toggle(className); + }); + }); + } + + function hasClass(...classes) { + const classNames = arrayFlat(classes.map(c => c.split(' '))); + return arrayFilter(this, el => { + return classNames.filter(className => el.classList.contains(className)).length > 0; + }).length > 0; + } + + function attr(attrs, value) { + if (arguments.length === 1 && typeof attrs === 'string') { + // Get attr + if (this[0]) return this[0].getAttribute(attrs); + return undefined; + } // Set attrs + + + for (let i = 0; i < this.length; i += 1) { + if (arguments.length === 2) { + // String + this[i].setAttribute(attrs, value); + } else { + // Object + for (const attrName in attrs) { + this[i][attrName] = attrs[attrName]; + this[i].setAttribute(attrName, attrs[attrName]); + } + } + } + + return this; + } + + function removeAttr(attr) { + for (let i = 0; i < this.length; i += 1) { + this[i].removeAttribute(attr); + } + + return this; + } + + function transform(transform) { + for (let i = 0; i < this.length; i += 1) { + this[i].style.transform = transform; + } + + return this; + } + + function transition$1(duration) { + for (let i = 0; i < this.length; i += 1) { + this[i].style.transitionDuration = typeof duration !== 'string' ? `${duration}ms` : duration; + } + + return this; + } + + function on(...args) { + let [eventType, targetSelector, listener, capture] = args; + + if (typeof args[1] === 'function') { + [eventType, listener, capture] = args; + targetSelector = undefined; + } + + if (!capture) capture = false; + + function handleLiveEvent(e) { + const target = e.target; + if (!target) return; + const eventData = e.target.dom7EventData || []; + + if (eventData.indexOf(e) < 0) { + eventData.unshift(e); + } + + if ($(target).is(targetSelector)) listener.apply(target, eventData);else { + const parents = $(target).parents(); // eslint-disable-line + + for (let k = 0; k < parents.length; k += 1) { + if ($(parents[k]).is(targetSelector)) listener.apply(parents[k], eventData); + } + } + } + + function handleEvent(e) { + const eventData = e && e.target ? e.target.dom7EventData || [] : []; + + if (eventData.indexOf(e) < 0) { + eventData.unshift(e); + } + + listener.apply(this, eventData); + } + + const events = eventType.split(' '); + let j; + + for (let i = 0; i < this.length; i += 1) { + const el = this[i]; + + if (!targetSelector) { + for (j = 0; j < events.length; j += 1) { + const event = events[j]; + if (!el.dom7Listeners) el.dom7Listeners = {}; + if (!el.dom7Listeners[event]) el.dom7Listeners[event] = []; + el.dom7Listeners[event].push({ + listener, + proxyListener: handleEvent + }); + el.addEventListener(event, handleEvent, capture); + } + } else { + // Live events + for (j = 0; j < events.length; j += 1) { + const event = events[j]; + if (!el.dom7LiveListeners) el.dom7LiveListeners = {}; + if (!el.dom7LiveListeners[event]) el.dom7LiveListeners[event] = []; + el.dom7LiveListeners[event].push({ + listener, + proxyListener: handleLiveEvent + }); + el.addEventListener(event, handleLiveEvent, capture); + } + } + } + + return this; + } + + function off(...args) { + let [eventType, targetSelector, listener, capture] = args; + + if (typeof args[1] === 'function') { + [eventType, listener, capture] = args; + targetSelector = undefined; + } + + if (!capture) capture = false; + const events = eventType.split(' '); + + for (let i = 0; i < events.length; i += 1) { + const event = events[i]; + + for (let j = 0; j < this.length; j += 1) { + const el = this[j]; + let handlers; + + if (!targetSelector && el.dom7Listeners) { + handlers = el.dom7Listeners[event]; + } else if (targetSelector && el.dom7LiveListeners) { + handlers = el.dom7LiveListeners[event]; + } + + if (handlers && handlers.length) { + for (let k = handlers.length - 1; k >= 0; k -= 1) { + const handler = handlers[k]; + + if (listener && handler.listener === listener) { + el.removeEventListener(event, handler.proxyListener, capture); + handlers.splice(k, 1); + } else if (listener && handler.listener && handler.listener.dom7proxy && handler.listener.dom7proxy === listener) { + el.removeEventListener(event, handler.proxyListener, capture); + handlers.splice(k, 1); + } else if (!listener) { + el.removeEventListener(event, handler.proxyListener, capture); + handlers.splice(k, 1); + } + } + } + } + } + + return this; + } + + function trigger(...args) { + const window = getWindow(); + const events = args[0].split(' '); + const eventData = args[1]; + + for (let i = 0; i < events.length; i += 1) { + const event = events[i]; + + for (let j = 0; j < this.length; j += 1) { + const el = this[j]; + + if (window.CustomEvent) { + const evt = new window.CustomEvent(event, { + detail: eventData, + bubbles: true, + cancelable: true + }); + el.dom7EventData = args.filter((data, dataIndex) => dataIndex > 0); + el.dispatchEvent(evt); + el.dom7EventData = []; + delete el.dom7EventData; + } + } + } + + return this; + } + + function transitionEnd$1(callback) { + const dom = this; + + function fireCallBack(e) { + if (e.target !== this) return; + callback.call(this, e); + dom.off('transitionend', fireCallBack); + } + + if (callback) { + dom.on('transitionend', fireCallBack); + } + + return this; + } + + function outerWidth(includeMargins) { + if (this.length > 0) { + if (includeMargins) { + const styles = this.styles(); + return this[0].offsetWidth + parseFloat(styles.getPropertyValue('margin-right')) + parseFloat(styles.getPropertyValue('margin-left')); + } + + return this[0].offsetWidth; + } + + return null; + } + + function outerHeight(includeMargins) { + if (this.length > 0) { + if (includeMargins) { + const styles = this.styles(); + return this[0].offsetHeight + parseFloat(styles.getPropertyValue('margin-top')) + parseFloat(styles.getPropertyValue('margin-bottom')); + } + + return this[0].offsetHeight; + } + + return null; + } + + function offset() { + if (this.length > 0) { + const window = getWindow(); + const document = getDocument(); + const el = this[0]; + const box = el.getBoundingClientRect(); + const body = document.body; + const clientTop = el.clientTop || body.clientTop || 0; + const clientLeft = el.clientLeft || body.clientLeft || 0; + const scrollTop = el === window ? window.scrollY : el.scrollTop; + const scrollLeft = el === window ? window.scrollX : el.scrollLeft; + return { + top: box.top + scrollTop - clientTop, + left: box.left + scrollLeft - clientLeft + }; + } + + return null; + } + + function styles() { + const window = getWindow(); + if (this[0]) return window.getComputedStyle(this[0], null); + return {}; + } + + function css(props, value) { + const window = getWindow(); + let i; + + if (arguments.length === 1) { + if (typeof props === 'string') { + // .css('width') + if (this[0]) return window.getComputedStyle(this[0], null).getPropertyValue(props); + } else { + // .css({ width: '100px' }) + for (i = 0; i < this.length; i += 1) { + for (const prop in props) { + this[i].style[prop] = props[prop]; + } + } + + return this; + } + } + + if (arguments.length === 2 && typeof props === 'string') { + // .css('width', '100px') + for (i = 0; i < this.length; i += 1) { + this[i].style[props] = value; + } + + return this; + } + + return this; + } + + function each(callback) { + if (!callback) return this; + this.forEach((el, index) => { + callback.apply(el, [el, index]); + }); + return this; + } + + function filter(callback) { + const result = arrayFilter(this, callback); + return $(result); + } + + function html(html) { + if (typeof html === 'undefined') { + return this[0] ? this[0].innerHTML : null; + } + + for (let i = 0; i < this.length; i += 1) { + this[i].innerHTML = html; + } + + return this; + } + + function text(text) { + if (typeof text === 'undefined') { + return this[0] ? this[0].textContent.trim() : null; + } + + for (let i = 0; i < this.length; i += 1) { + this[i].textContent = text; + } + + return this; + } + + function is(selector) { + const window = getWindow(); + const document = getDocument(); + const el = this[0]; + let compareWith; + let i; + if (!el || typeof selector === 'undefined') return false; + + if (typeof selector === 'string') { + if (el.matches) return el.matches(selector); + if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector); + if (el.msMatchesSelector) return el.msMatchesSelector(selector); + compareWith = $(selector); + + for (i = 0; i < compareWith.length; i += 1) { + if (compareWith[i] === el) return true; + } + + return false; + } + + if (selector === document) { + return el === document; + } + + if (selector === window) { + return el === window; + } + + if (selector.nodeType || selector instanceof Dom7) { + compareWith = selector.nodeType ? [selector] : selector; + + for (i = 0; i < compareWith.length; i += 1) { + if (compareWith[i] === el) return true; + } + + return false; + } + + return false; + } + + function index() { + let child = this[0]; + let i; + + if (child) { + i = 0; // eslint-disable-next-line + + while ((child = child.previousSibling) !== null) { + if (child.nodeType === 1) i += 1; + } + + return i; + } + + return undefined; + } + + function eq(index) { + if (typeof index === 'undefined') return this; + const length = this.length; + + if (index > length - 1) { + return $([]); + } + + if (index < 0) { + const returnIndex = length + index; + if (returnIndex < 0) return $([]); + return $([this[returnIndex]]); + } + + return $([this[index]]); + } + + function append(...els) { + let newChild; + const document = getDocument(); + + for (let k = 0; k < els.length; k += 1) { + newChild = els[k]; + + for (let i = 0; i < this.length; i += 1) { + if (typeof newChild === 'string') { + const tempDiv = document.createElement('div'); + tempDiv.innerHTML = newChild; + + while (tempDiv.firstChild) { + this[i].appendChild(tempDiv.firstChild); + } + } else if (newChild instanceof Dom7) { + for (let j = 0; j < newChild.length; j += 1) { + this[i].appendChild(newChild[j]); + } + } else { + this[i].appendChild(newChild); + } + } + } + + return this; + } + + function prepend(newChild) { + const document = getDocument(); + let i; + let j; + + for (i = 0; i < this.length; i += 1) { + if (typeof newChild === 'string') { + const tempDiv = document.createElement('div'); + tempDiv.innerHTML = newChild; + + for (j = tempDiv.childNodes.length - 1; j >= 0; j -= 1) { + this[i].insertBefore(tempDiv.childNodes[j], this[i].childNodes[0]); + } + } else if (newChild instanceof Dom7) { + for (j = 0; j < newChild.length; j += 1) { + this[i].insertBefore(newChild[j], this[i].childNodes[0]); + } + } else { + this[i].insertBefore(newChild, this[i].childNodes[0]); + } + } + + return this; + } + + function next(selector) { + if (this.length > 0) { + if (selector) { + if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) { + return $([this[0].nextElementSibling]); + } + + return $([]); + } + + if (this[0].nextElementSibling) return $([this[0].nextElementSibling]); + return $([]); + } + + return $([]); + } + + function nextAll(selector) { + const nextEls = []; + let el = this[0]; + if (!el) return $([]); + + while (el.nextElementSibling) { + const next = el.nextElementSibling; // eslint-disable-line + + if (selector) { + if ($(next).is(selector)) nextEls.push(next); + } else nextEls.push(next); + + el = next; + } + + return $(nextEls); + } + + function prev(selector) { + if (this.length > 0) { + const el = this[0]; + + if (selector) { + if (el.previousElementSibling && $(el.previousElementSibling).is(selector)) { + return $([el.previousElementSibling]); + } + + return $([]); + } + + if (el.previousElementSibling) return $([el.previousElementSibling]); + return $([]); + } + + return $([]); + } + + function prevAll(selector) { + const prevEls = []; + let el = this[0]; + if (!el) return $([]); + + while (el.previousElementSibling) { + const prev = el.previousElementSibling; // eslint-disable-line + + if (selector) { + if ($(prev).is(selector)) prevEls.push(prev); + } else prevEls.push(prev); + + el = prev; + } + + return $(prevEls); + } + + function parent(selector) { + const parents = []; // eslint-disable-line + + for (let i = 0; i < this.length; i += 1) { + if (this[i].parentNode !== null) { + if (selector) { + if ($(this[i].parentNode).is(selector)) parents.push(this[i].parentNode); + } else { + parents.push(this[i].parentNode); + } + } + } + + return $(parents); + } + + function parents(selector) { + const parents = []; // eslint-disable-line + + for (let i = 0; i < this.length; i += 1) { + let parent = this[i].parentNode; // eslint-disable-line + + while (parent) { + if (selector) { + if ($(parent).is(selector)) parents.push(parent); + } else { + parents.push(parent); + } + + parent = parent.parentNode; + } + } + + return $(parents); + } + + function closest(selector) { + let closest = this; // eslint-disable-line + + if (typeof selector === 'undefined') { + return $([]); + } + + if (!closest.is(selector)) { + closest = closest.parents(selector).eq(0); + } + + return closest; + } + + function find(selector) { + const foundElements = []; + + for (let i = 0; i < this.length; i += 1) { + const found = this[i].querySelectorAll(selector); + + for (let j = 0; j < found.length; j += 1) { + foundElements.push(found[j]); + } + } + + return $(foundElements); + } + + function children(selector) { + const children = []; // eslint-disable-line + + for (let i = 0; i < this.length; i += 1) { + const childNodes = this[i].children; + + for (let j = 0; j < childNodes.length; j += 1) { + if (!selector || $(childNodes[j]).is(selector)) { + children.push(childNodes[j]); + } + } + } + + return $(children); + } + + function remove() { + for (let i = 0; i < this.length; i += 1) { + if (this[i].parentNode) this[i].parentNode.removeChild(this[i]); + } + + return this; + } + + const Methods = { + addClass, + removeClass, + hasClass, + toggleClass, + attr, + removeAttr, + transform, + transition: transition$1, + on, + off, + trigger, + transitionEnd: transitionEnd$1, + outerWidth, + outerHeight, + styles, + offset, + css, + each, + html, + text, + is, + index, + eq, + append, + prepend, + next, + nextAll, + prev, + prevAll, + parent, + parents, + closest, + find, + children, + filter, + remove + }; + Object.keys(Methods).forEach(methodName => { + Object.defineProperty($.fn, methodName, { + value: Methods[methodName], + writable: true + }); + }); + + function deleteProps(obj) { + const object = obj; + Object.keys(object).forEach(key => { + try { + object[key] = null; + } catch (e) {// no getter for object + } + + try { + delete object[key]; + } catch (e) {// something got wrong + } + }); + } + + function nextTick(callback, delay = 0) { + return setTimeout(callback, delay); + } + + function now() { + return Date.now(); + } + + function getComputedStyle$1(el) { + const window = getWindow(); + let style; + + if (window.getComputedStyle) { + style = window.getComputedStyle(el, null); + } + + if (!style && el.currentStyle) { + style = el.currentStyle; + } + + if (!style) { + style = el.style; + } + + return style; + } + + function getTranslate(el, axis = 'x') { + const window = getWindow(); + let matrix; + let curTransform; + let transformMatrix; + const curStyle = getComputedStyle$1(el); + + if (window.WebKitCSSMatrix) { + curTransform = curStyle.transform || curStyle.webkitTransform; + + if (curTransform.split(',').length > 6) { + curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', '); + } // Some old versions of Webkit choke when 'none' is passed; pass + // empty string instead in this case + + + transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform); + } else { + transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,'); + matrix = transformMatrix.toString().split(','); + } + + if (axis === 'x') { + // Latest Chrome and webkits Fix + if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41; // Crazy IE10 Matrix + else if (matrix.length === 16) curTransform = parseFloat(matrix[12]); // Normal Browsers + else curTransform = parseFloat(matrix[4]); + } + + if (axis === 'y') { + // Latest Chrome and webkits Fix + if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42; // Crazy IE10 Matrix + else if (matrix.length === 16) curTransform = parseFloat(matrix[13]); // Normal Browsers + else curTransform = parseFloat(matrix[5]); + } + + return curTransform || 0; + } + + function isObject(o) { + return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object'; + } + + function isNode(node) { + // eslint-disable-next-line + if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') { + return node instanceof HTMLElement; + } + + return node && (node.nodeType === 1 || node.nodeType === 11); + } + + function extend(...args) { + const to = Object(args[0]); + const noExtend = ['__proto__', 'constructor', 'prototype']; + + for (let i = 1; i < args.length; i += 1) { + const nextSource = args[i]; + + if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) { + const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0); + + for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) { + const nextKey = keysArray[nextIndex]; + const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey); + + if (desc !== undefined && desc.enumerable) { + if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) { + if (nextSource[nextKey].__swiper__) { + to[nextKey] = nextSource[nextKey]; + } else { + extend(to[nextKey], nextSource[nextKey]); + } + } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) { + to[nextKey] = {}; + + if (nextSource[nextKey].__swiper__) { + to[nextKey] = nextSource[nextKey]; + } else { + extend(to[nextKey], nextSource[nextKey]); + } + } else { + to[nextKey] = nextSource[nextKey]; + } + } + } + } + } + + return to; + } + + function setCSSProperty(el, varName, varValue) { + el.style.setProperty(varName, varValue); + } + + function animateCSSModeScroll({ + swiper, + targetPosition, + side + }) { + const window = getWindow(); + const startPosition = -swiper.translate; + let startTime = null; + let time; + const duration = swiper.params.speed; + swiper.wrapperEl.style.scrollSnapType = 'none'; + window.cancelAnimationFrame(swiper.cssModeFrameID); + const dir = targetPosition > startPosition ? 'next' : 'prev'; + + const isOutOfBound = (current, target) => { + return dir === 'next' && current >= target || dir === 'prev' && current <= target; + }; + + const animate = () => { + time = new Date().getTime(); + + if (startTime === null) { + startTime = time; + } + + const progress = Math.max(Math.min((time - startTime) / duration, 1), 0); + const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2; + let currentPosition = startPosition + easeProgress * (targetPosition - startPosition); + + if (isOutOfBound(currentPosition, targetPosition)) { + currentPosition = targetPosition; + } + + swiper.wrapperEl.scrollTo({ + [side]: currentPosition + }); + + if (isOutOfBound(currentPosition, targetPosition)) { + swiper.wrapperEl.style.overflow = 'hidden'; + swiper.wrapperEl.style.scrollSnapType = ''; + setTimeout(() => { + swiper.wrapperEl.style.overflow = ''; + swiper.wrapperEl.scrollTo({ + [side]: currentPosition + }); + }); + window.cancelAnimationFrame(swiper.cssModeFrameID); + return; + } + + swiper.cssModeFrameID = window.requestAnimationFrame(animate); + }; + + animate(); + } + + let support; + + function calcSupport() { + const window = getWindow(); + const document = getDocument(); + return { + smoothScroll: document.documentElement && 'scrollBehavior' in document.documentElement.style, + touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch), + passiveListener: function checkPassiveListener() { + let supportsPassive = false; + + try { + const opts = Object.defineProperty({}, 'passive', { + // eslint-disable-next-line + get() { + supportsPassive = true; + } + + }); + window.addEventListener('testPassiveListener', null, opts); + } catch (e) {// No support + } + + return supportsPassive; + }(), + gestures: function checkGestures() { + return 'ongesturestart' in window; + }() + }; + } + + function getSupport() { + if (!support) { + support = calcSupport(); + } + + return support; + } + + let deviceCached; + + function calcDevice({ + userAgent + } = {}) { + const support = getSupport(); + const window = getWindow(); + const platform = window.navigator.platform; + const ua = userAgent || window.navigator.userAgent; + const device = { + ios: false, + android: false + }; + const screenWidth = window.screen.width; + const screenHeight = window.screen.height; + const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line + + let ipad = ua.match(/(iPad).*OS\s([\d_]+)/); + const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); + const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/); + const windows = platform === 'Win32'; + let macos = platform === 'MacIntel'; // iPadOs 13 fix + + const iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810']; + + if (!ipad && macos && support.touch && iPadScreens.indexOf(`${screenWidth}x${screenHeight}`) >= 0) { + ipad = ua.match(/(Version)\/([\d.]+)/); + if (!ipad) ipad = [0, 1, '13_0_0']; + macos = false; + } // Android + + + if (android && !windows) { + device.os = 'android'; + device.android = true; + } + + if (ipad || iphone || ipod) { + device.os = 'ios'; + device.ios = true; + } // Export object + + + return device; + } + + function getDevice(overrides = {}) { + if (!deviceCached) { + deviceCached = calcDevice(overrides); + } + + return deviceCached; + } + + let browser; + + function calcBrowser() { + const window = getWindow(); + + function isSafari() { + const ua = window.navigator.userAgent.toLowerCase(); + return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0; + } + + return { + isSafari: isSafari(), + isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent) + }; + } + + function getBrowser() { + if (!browser) { + browser = calcBrowser(); + } + + return browser; + } + + function Resize({ + swiper, + on, + emit + }) { + const window = getWindow(); + let observer = null; + + const resizeHandler = () => { + if (!swiper || swiper.destroyed || !swiper.initialized) return; + emit('beforeResize'); + emit('resize'); + }; + + const createObserver = () => { + if (!swiper || swiper.destroyed || !swiper.initialized) return; + observer = new ResizeObserver(entries => { + const { + width, + height + } = swiper; + let newWidth = width; + let newHeight = height; + entries.forEach(({ + contentBoxSize, + contentRect, + target + }) => { + if (target && target !== swiper.el) return; + newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize; + newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize; + }); + + if (newWidth !== width || newHeight !== height) { + resizeHandler(); + } + }); + observer.observe(swiper.el); + }; + + const removeObserver = () => { + if (observer && observer.unobserve && swiper.el) { + observer.unobserve(swiper.el); + observer = null; + } + }; + + const orientationChangeHandler = () => { + if (!swiper || swiper.destroyed || !swiper.initialized) return; + emit('orientationchange'); + }; + + on('init', () => { + if (swiper.params.resizeObserver && typeof window.ResizeObserver !== 'undefined') { + createObserver(); + return; + } + + window.addEventListener('resize', resizeHandler); + window.addEventListener('orientationchange', orientationChangeHandler); + }); + on('destroy', () => { + removeObserver(); + window.removeEventListener('resize', resizeHandler); + window.removeEventListener('orientationchange', orientationChangeHandler); + }); + } + + function Observer({ + swiper, + extendParams, + on, + emit + }) { + const observers = []; + const window = getWindow(); + + const attach = (target, options = {}) => { + const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver; + const observer = new ObserverFunc(mutations => { + // The observerUpdate event should only be triggered + // once despite the number of mutations. Additional + // triggers are redundant and are very costly + if (mutations.length === 1) { + emit('observerUpdate', mutations[0]); + return; + } + + const observerUpdate = function observerUpdate() { + emit('observerUpdate', mutations[0]); + }; + + if (window.requestAnimationFrame) { + window.requestAnimationFrame(observerUpdate); + } else { + window.setTimeout(observerUpdate, 0); + } + }); + observer.observe(target, { + attributes: typeof options.attributes === 'undefined' ? true : options.attributes, + childList: typeof options.childList === 'undefined' ? true : options.childList, + characterData: typeof options.characterData === 'undefined' ? true : options.characterData + }); + observers.push(observer); + }; + + const init = () => { + if (!swiper.params.observer) return; + + if (swiper.params.observeParents) { + const containerParents = swiper.$el.parents(); + + for (let i = 0; i < containerParents.length; i += 1) { + attach(containerParents[i]); + } + } // Observe container + + + attach(swiper.$el[0], { + childList: swiper.params.observeSlideChildren + }); // Observe wrapper + + attach(swiper.$wrapperEl[0], { + attributes: false + }); + }; + + const destroy = () => { + observers.forEach(observer => { + observer.disconnect(); + }); + observers.splice(0, observers.length); + }; + + extendParams({ + observer: false, + observeParents: false, + observeSlideChildren: false + }); + on('init', init); + on('destroy', destroy); + } + + /* eslint-disable no-underscore-dangle */ + var eventsEmitter = { + on(events, handler, priority) { + const self = this; + if (typeof handler !== 'function') return self; + const method = priority ? 'unshift' : 'push'; + events.split(' ').forEach(event => { + if (!self.eventsListeners[event]) self.eventsListeners[event] = []; + self.eventsListeners[event][method](handler); + }); + return self; + }, + + once(events, handler, priority) { + const self = this; + if (typeof handler !== 'function') return self; + + function onceHandler(...args) { + self.off(events, onceHandler); + + if (onceHandler.__emitterProxy) { + delete onceHandler.__emitterProxy; + } + + handler.apply(self, args); + } + + onceHandler.__emitterProxy = handler; + return self.on(events, onceHandler, priority); + }, + + onAny(handler, priority) { + const self = this; + if (typeof handler !== 'function') return self; + const method = priority ? 'unshift' : 'push'; + + if (self.eventsAnyListeners.indexOf(handler) < 0) { + self.eventsAnyListeners[method](handler); + } + + return self; + }, + + offAny(handler) { + const self = this; + if (!self.eventsAnyListeners) return self; + const index = self.eventsAnyListeners.indexOf(handler); + + if (index >= 0) { + self.eventsAnyListeners.splice(index, 1); + } + + return self; + }, + + off(events, handler) { + const self = this; + if (!self.eventsListeners) return self; + events.split(' ').forEach(event => { + if (typeof handler === 'undefined') { + self.eventsListeners[event] = []; + } else if (self.eventsListeners[event]) { + self.eventsListeners[event].forEach((eventHandler, index) => { + if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) { + self.eventsListeners[event].splice(index, 1); + } + }); + } + }); + return self; + }, + + emit(...args) { + const self = this; + if (!self.eventsListeners) return self; + let events; + let data; + let context; + + if (typeof args[0] === 'string' || Array.isArray(args[0])) { + events = args[0]; + data = args.slice(1, args.length); + context = self; + } else { + events = args[0].events; + data = args[0].data; + context = args[0].context || self; + } + + data.unshift(context); + const eventsArray = Array.isArray(events) ? events : events.split(' '); + eventsArray.forEach(event => { + if (self.eventsAnyListeners && self.eventsAnyListeners.length) { + self.eventsAnyListeners.forEach(eventHandler => { + eventHandler.apply(context, [event, ...data]); + }); + } + + if (self.eventsListeners && self.eventsListeners[event]) { + self.eventsListeners[event].forEach(eventHandler => { + eventHandler.apply(context, data); + }); + } + }); + return self; + } + + }; + + function updateSize() { + const swiper = this; + let width; + let height; + const $el = swiper.$el; + + if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) { + width = swiper.params.width; + } else { + width = $el[0].clientWidth; + } + + if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) { + height = swiper.params.height; + } else { + height = $el[0].clientHeight; + } + + if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) { + return; + } // Subtract paddings + + + width = width - parseInt($el.css('padding-left') || 0, 10) - parseInt($el.css('padding-right') || 0, 10); + height = height - parseInt($el.css('padding-top') || 0, 10) - parseInt($el.css('padding-bottom') || 0, 10); + if (Number.isNaN(width)) width = 0; + if (Number.isNaN(height)) height = 0; + Object.assign(swiper, { + width, + height, + size: swiper.isHorizontal() ? width : height + }); + } + + function updateSlides() { + const swiper = this; + + function getDirectionLabel(property) { + if (swiper.isHorizontal()) { + return property; + } // prettier-ignore + + + return { + 'width': 'height', + 'margin-top': 'margin-left', + 'margin-bottom ': 'margin-right', + 'margin-left': 'margin-top', + 'margin-right': 'margin-bottom', + 'padding-left': 'padding-top', + 'padding-right': 'padding-bottom', + 'marginRight': 'marginBottom' + }[property]; + } + + function getDirectionPropertyValue(node, label) { + return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0); + } + + const params = swiper.params; + const { + $wrapperEl, + size: swiperSize, + rtlTranslate: rtl, + wrongRTL + } = swiper; + const isVirtual = swiper.virtual && params.virtual.enabled; + const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length; + const slides = $wrapperEl.children(`.${swiper.params.slideClass}`); + const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length; + let snapGrid = []; + const slidesGrid = []; + const slidesSizesGrid = []; + let offsetBefore = params.slidesOffsetBefore; + + if (typeof offsetBefore === 'function') { + offsetBefore = params.slidesOffsetBefore.call(swiper); + } + + let offsetAfter = params.slidesOffsetAfter; + + if (typeof offsetAfter === 'function') { + offsetAfter = params.slidesOffsetAfter.call(swiper); + } + + const previousSnapGridLength = swiper.snapGrid.length; + const previousSlidesGridLength = swiper.slidesGrid.length; + let spaceBetween = params.spaceBetween; + let slidePosition = -offsetBefore; + let prevSlideSize = 0; + let index = 0; + + if (typeof swiperSize === 'undefined') { + return; + } + + if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) { + spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize; + } + + swiper.virtualSize = -spaceBetween; // reset margins + + if (rtl) slides.css({ + marginLeft: '', + marginBottom: '', + marginTop: '' + });else slides.css({ + marginRight: '', + marginBottom: '', + marginTop: '' + }); // reset cssMode offsets + + if (params.centeredSlides && params.cssMode) { + setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-before', ''); + setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-after', ''); + } + + const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid; + + if (gridEnabled) { + swiper.grid.initSlides(slidesLength); + } // Calc slides + + + let slideSize; + const shouldResetSlideSize = params.slidesPerView === 'auto' && params.breakpoints && Object.keys(params.breakpoints).filter(key => { + return typeof params.breakpoints[key].slidesPerView !== 'undefined'; + }).length > 0; + + for (let i = 0; i < slidesLength; i += 1) { + slideSize = 0; + const slide = slides.eq(i); + + if (gridEnabled) { + swiper.grid.updateSlide(i, slide, slidesLength, getDirectionLabel); + } + + if (slide.css('display') === 'none') continue; // eslint-disable-line + + if (params.slidesPerView === 'auto') { + if (shouldResetSlideSize) { + slides[i].style[getDirectionLabel('width')] = ``; + } + + const slideStyles = getComputedStyle(slide[0]); + const currentTransform = slide[0].style.transform; + const currentWebKitTransform = slide[0].style.webkitTransform; + + if (currentTransform) { + slide[0].style.transform = 'none'; + } + + if (currentWebKitTransform) { + slide[0].style.webkitTransform = 'none'; + } + + if (params.roundLengths) { + slideSize = swiper.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true); + } else { + // eslint-disable-next-line + const width = getDirectionPropertyValue(slideStyles, 'width'); + const paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left'); + const paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right'); + const marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left'); + const marginRight = getDirectionPropertyValue(slideStyles, 'margin-right'); + const boxSizing = slideStyles.getPropertyValue('box-sizing'); + + if (boxSizing && boxSizing === 'border-box') { + slideSize = width + marginLeft + marginRight; + } else { + const { + clientWidth, + offsetWidth + } = slide[0]; + slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth); + } + } + + if (currentTransform) { + slide[0].style.transform = currentTransform; + } + + if (currentWebKitTransform) { + slide[0].style.webkitTransform = currentWebKitTransform; + } + + if (params.roundLengths) slideSize = Math.floor(slideSize); + } else { + slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView; + if (params.roundLengths) slideSize = Math.floor(slideSize); + + if (slides[i]) { + slides[i].style[getDirectionLabel('width')] = `${slideSize}px`; + } + } + + if (slides[i]) { + slides[i].swiperSlideSize = slideSize; + } + + slidesSizesGrid.push(slideSize); + + if (params.centeredSlides) { + slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween; + if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween; + if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween; + if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0; + if (params.roundLengths) slidePosition = Math.floor(slidePosition); + if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition); + slidesGrid.push(slidePosition); + } else { + if (params.roundLengths) slidePosition = Math.floor(slidePosition); + if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition); + slidesGrid.push(slidePosition); + slidePosition = slidePosition + slideSize + spaceBetween; + } + + swiper.virtualSize += slideSize + spaceBetween; + prevSlideSize = slideSize; + index += 1; + } + + swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter; + + if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) { + $wrapperEl.css({ + width: `${swiper.virtualSize + params.spaceBetween}px` + }); + } + + if (params.setWrapperSize) { + $wrapperEl.css({ + [getDirectionLabel('width')]: `${swiper.virtualSize + params.spaceBetween}px` + }); + } + + if (gridEnabled) { + swiper.grid.updateWrapperSize(slideSize, snapGrid, getDirectionLabel); + } // Remove last grid elements depending on width + + + if (!params.centeredSlides) { + const newSlidesGrid = []; + + for (let i = 0; i < snapGrid.length; i += 1) { + let slidesGridItem = snapGrid[i]; + if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem); + + if (snapGrid[i] <= swiper.virtualSize - swiperSize) { + newSlidesGrid.push(slidesGridItem); + } + } + + snapGrid = newSlidesGrid; + + if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) { + snapGrid.push(swiper.virtualSize - swiperSize); + } + } + + if (snapGrid.length === 0) snapGrid = [0]; + + if (params.spaceBetween !== 0) { + const key = swiper.isHorizontal() && rtl ? 'marginLeft' : getDirectionLabel('marginRight'); + slides.filter((_, slideIndex) => { + if (!params.cssMode) return true; + + if (slideIndex === slides.length - 1) { + return false; + } + + return true; + }).css({ + [key]: `${spaceBetween}px` + }); + } + + if (params.centeredSlides && params.centeredSlidesBounds) { + let allSlidesSize = 0; + slidesSizesGrid.forEach(slideSizeValue => { + allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0); + }); + allSlidesSize -= params.spaceBetween; + const maxSnap = allSlidesSize - swiperSize; + snapGrid = snapGrid.map(snap => { + if (snap < 0) return -offsetBefore; + if (snap > maxSnap) return maxSnap + offsetAfter; + return snap; + }); + } + + if (params.centerInsufficientSlides) { + let allSlidesSize = 0; + slidesSizesGrid.forEach(slideSizeValue => { + allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0); + }); + allSlidesSize -= params.spaceBetween; + + if (allSlidesSize < swiperSize) { + const allSlidesOffset = (swiperSize - allSlidesSize) / 2; + snapGrid.forEach((snap, snapIndex) => { + snapGrid[snapIndex] = snap - allSlidesOffset; + }); + slidesGrid.forEach((snap, snapIndex) => { + slidesGrid[snapIndex] = snap + allSlidesOffset; + }); + } + } + + Object.assign(swiper, { + slides, + snapGrid, + slidesGrid, + slidesSizesGrid + }); + + if (params.centeredSlides && params.cssMode && !params.centeredSlidesBounds) { + setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-before', `${-snapGrid[0]}px`); + setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-after', `${swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2}px`); + const addToSnapGrid = -swiper.snapGrid[0]; + const addToSlidesGrid = -swiper.slidesGrid[0]; + swiper.snapGrid = swiper.snapGrid.map(v => v + addToSnapGrid); + swiper.slidesGrid = swiper.slidesGrid.map(v => v + addToSlidesGrid); + } + + if (slidesLength !== previousSlidesLength) { + swiper.emit('slidesLengthChange'); + } + + if (snapGrid.length !== previousSnapGridLength) { + if (swiper.params.watchOverflow) swiper.checkOverflow(); + swiper.emit('snapGridLengthChange'); + } + + if (slidesGrid.length !== previousSlidesGridLength) { + swiper.emit('slidesGridLengthChange'); + } + + if (params.watchSlidesProgress) { + swiper.updateSlidesOffset(); + } + } + + function updateAutoHeight(speed) { + const swiper = this; + const activeSlides = []; + const isVirtual = swiper.virtual && swiper.params.virtual.enabled; + let newHeight = 0; + let i; + + if (typeof speed === 'number') { + swiper.setTransition(speed); + } else if (speed === true) { + swiper.setTransition(swiper.params.speed); + } + + const getSlideByIndex = index => { + if (isVirtual) { + return swiper.slides.filter(el => parseInt(el.getAttribute('data-swiper-slide-index'), 10) === index)[0]; + } + + return swiper.slides.eq(index)[0]; + }; // Find slides currently in view + + + if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) { + if (swiper.params.centeredSlides) { + swiper.visibleSlides.each(slide => { + activeSlides.push(slide); + }); + } else { + for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) { + const index = swiper.activeIndex + i; + if (index > swiper.slides.length && !isVirtual) break; + activeSlides.push(getSlideByIndex(index)); + } + } + } else { + activeSlides.push(getSlideByIndex(swiper.activeIndex)); + } // Find new height from highest slide in view + + + for (i = 0; i < activeSlides.length; i += 1) { + if (typeof activeSlides[i] !== 'undefined') { + const height = activeSlides[i].offsetHeight; + newHeight = height > newHeight ? height : newHeight; + } + } // Update Height + + + if (newHeight || newHeight === 0) swiper.$wrapperEl.css('height', `${newHeight}px`); + } + + function updateSlidesOffset() { + const swiper = this; + const slides = swiper.slides; + + for (let i = 0; i < slides.length; i += 1) { + slides[i].swiperSlideOffset = swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop; + } + } + + function updateSlidesProgress(translate = this && this.translate || 0) { + const swiper = this; + const params = swiper.params; + const { + slides, + rtlTranslate: rtl, + snapGrid + } = swiper; + if (slides.length === 0) return; + if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset(); + let offsetCenter = -translate; + if (rtl) offsetCenter = translate; // Visible Slides + + slides.removeClass(params.slideVisibleClass); + swiper.visibleSlidesIndexes = []; + swiper.visibleSlides = []; + + for (let i = 0; i < slides.length; i += 1) { + const slide = slides[i]; + let slideOffset = slide.swiperSlideOffset; + + if (params.cssMode && params.centeredSlides) { + slideOffset -= slides[0].swiperSlideOffset; + } + + const slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + params.spaceBetween); + const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + params.spaceBetween); + const slideBefore = -(offsetCenter - slideOffset); + const slideAfter = slideBefore + swiper.slidesSizesGrid[i]; + const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size; + + if (isVisible) { + swiper.visibleSlides.push(slide); + swiper.visibleSlidesIndexes.push(i); + slides.eq(i).addClass(params.slideVisibleClass); + } + + slide.progress = rtl ? -slideProgress : slideProgress; + slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress; + } + + swiper.visibleSlides = $(swiper.visibleSlides); + } + + function updateProgress(translate) { + const swiper = this; + + if (typeof translate === 'undefined') { + const multiplier = swiper.rtlTranslate ? -1 : 1; // eslint-disable-next-line + + translate = swiper && swiper.translate && swiper.translate * multiplier || 0; + } + + const params = swiper.params; + const translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); + let { + progress, + isBeginning, + isEnd + } = swiper; + const wasBeginning = isBeginning; + const wasEnd = isEnd; + + if (translatesDiff === 0) { + progress = 0; + isBeginning = true; + isEnd = true; + } else { + progress = (translate - swiper.minTranslate()) / translatesDiff; + isBeginning = progress <= 0; + isEnd = progress >= 1; + } + + Object.assign(swiper, { + progress, + isBeginning, + isEnd + }); + if (params.watchSlidesProgress || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate); + + if (isBeginning && !wasBeginning) { + swiper.emit('reachBeginning toEdge'); + } + + if (isEnd && !wasEnd) { + swiper.emit('reachEnd toEdge'); + } + + if (wasBeginning && !isBeginning || wasEnd && !isEnd) { + swiper.emit('fromEdge'); + } + + swiper.emit('progress', progress); + } + + function updateSlidesClasses() { + const swiper = this; + const { + slides, + params, + $wrapperEl, + activeIndex, + realIndex + } = swiper; + const isVirtual = swiper.virtual && params.virtual.enabled; + slides.removeClass(`${params.slideActiveClass} ${params.slideNextClass} ${params.slidePrevClass} ${params.slideDuplicateActiveClass} ${params.slideDuplicateNextClass} ${params.slideDuplicatePrevClass}`); + let activeSlide; + + if (isVirtual) { + activeSlide = swiper.$wrapperEl.find(`.${params.slideClass}[data-swiper-slide-index="${activeIndex}"]`); + } else { + activeSlide = slides.eq(activeIndex); + } // Active classes + + + activeSlide.addClass(params.slideActiveClass); + + if (params.loop) { + // Duplicate to all looped slides + if (activeSlide.hasClass(params.slideDuplicateClass)) { + $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${realIndex}"]`).addClass(params.slideDuplicateActiveClass); + } else { + $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${realIndex}"]`).addClass(params.slideDuplicateActiveClass); + } + } // Next Slide + + + let nextSlide = activeSlide.nextAll(`.${params.slideClass}`).eq(0).addClass(params.slideNextClass); + + if (params.loop && nextSlide.length === 0) { + nextSlide = slides.eq(0); + nextSlide.addClass(params.slideNextClass); + } // Prev Slide + + + let prevSlide = activeSlide.prevAll(`.${params.slideClass}`).eq(0).addClass(params.slidePrevClass); + + if (params.loop && prevSlide.length === 0) { + prevSlide = slides.eq(-1); + prevSlide.addClass(params.slidePrevClass); + } + + if (params.loop) { + // Duplicate to all looped slides + if (nextSlide.hasClass(params.slideDuplicateClass)) { + $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${nextSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicateNextClass); + } else { + $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${nextSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicateNextClass); + } + + if (prevSlide.hasClass(params.slideDuplicateClass)) { + $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${prevSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicatePrevClass); + } else { + $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${prevSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicatePrevClass); + } + } + + swiper.emitSlidesClasses(); + } + + function updateActiveIndex(newActiveIndex) { + const swiper = this; + const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate; + const { + slidesGrid, + snapGrid, + params, + activeIndex: previousIndex, + realIndex: previousRealIndex, + snapIndex: previousSnapIndex + } = swiper; + let activeIndex = newActiveIndex; + let snapIndex; + + if (typeof activeIndex === 'undefined') { + for (let i = 0; i < slidesGrid.length; i += 1) { + if (typeof slidesGrid[i + 1] !== 'undefined') { + if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) { + activeIndex = i; + } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) { + activeIndex = i + 1; + } + } else if (translate >= slidesGrid[i]) { + activeIndex = i; + } + } // Normalize slideIndex + + + if (params.normalizeSlideIndex) { + if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0; + } + } + + if (snapGrid.indexOf(translate) >= 0) { + snapIndex = snapGrid.indexOf(translate); + } else { + const skip = Math.min(params.slidesPerGroupSkip, activeIndex); + snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup); + } + + if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1; + + if (activeIndex === previousIndex) { + if (snapIndex !== previousSnapIndex) { + swiper.snapIndex = snapIndex; + swiper.emit('snapIndexChange'); + } + + return; + } // Get real index + + + const realIndex = parseInt(swiper.slides.eq(activeIndex).attr('data-swiper-slide-index') || activeIndex, 10); + Object.assign(swiper, { + snapIndex, + realIndex, + previousIndex, + activeIndex + }); + swiper.emit('activeIndexChange'); + swiper.emit('snapIndexChange'); + + if (previousRealIndex !== realIndex) { + swiper.emit('realIndexChange'); + } + + if (swiper.initialized || swiper.params.runCallbacksOnInit) { + swiper.emit('slideChange'); + } + } + + function updateClickedSlide(e) { + const swiper = this; + const params = swiper.params; + const slide = $(e).closest(`.${params.slideClass}`)[0]; + let slideFound = false; + let slideIndex; + + if (slide) { + for (let i = 0; i < swiper.slides.length; i += 1) { + if (swiper.slides[i] === slide) { + slideFound = true; + slideIndex = i; + break; + } + } + } + + if (slide && slideFound) { + swiper.clickedSlide = slide; + + if (swiper.virtual && swiper.params.virtual.enabled) { + swiper.clickedIndex = parseInt($(slide).attr('data-swiper-slide-index'), 10); + } else { + swiper.clickedIndex = slideIndex; + } + } else { + swiper.clickedSlide = undefined; + swiper.clickedIndex = undefined; + return; + } + + if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) { + swiper.slideToClickedSlide(); + } + } + + var update = { + updateSize, + updateSlides, + updateAutoHeight, + updateSlidesOffset, + updateSlidesProgress, + updateProgress, + updateSlidesClasses, + updateActiveIndex, + updateClickedSlide + }; + + function getSwiperTranslate(axis = this.isHorizontal() ? 'x' : 'y') { + const swiper = this; + const { + params, + rtlTranslate: rtl, + translate, + $wrapperEl + } = swiper; + + if (params.virtualTranslate) { + return rtl ? -translate : translate; + } + + if (params.cssMode) { + return translate; + } + + let currentTranslate = getTranslate($wrapperEl[0], axis); + if (rtl) currentTranslate = -currentTranslate; + return currentTranslate || 0; + } + + function setTranslate(translate, byController) { + const swiper = this; + const { + rtlTranslate: rtl, + params, + $wrapperEl, + wrapperEl, + progress + } = swiper; + let x = 0; + let y = 0; + const z = 0; + + if (swiper.isHorizontal()) { + x = rtl ? -translate : translate; + } else { + y = translate; + } + + if (params.roundLengths) { + x = Math.floor(x); + y = Math.floor(y); + } + + if (params.cssMode) { + wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y; + } else if (!params.virtualTranslate) { + $wrapperEl.transform(`translate3d(${x}px, ${y}px, ${z}px)`); + } + + swiper.previousTranslate = swiper.translate; + swiper.translate = swiper.isHorizontal() ? x : y; // Check if we need to update progress + + let newProgress; + const translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); + + if (translatesDiff === 0) { + newProgress = 0; + } else { + newProgress = (translate - swiper.minTranslate()) / translatesDiff; + } + + if (newProgress !== progress) { + swiper.updateProgress(translate); + } + + swiper.emit('setTranslate', swiper.translate, byController); + } + + function minTranslate() { + return -this.snapGrid[0]; + } + + function maxTranslate() { + return -this.snapGrid[this.snapGrid.length - 1]; + } + + function translateTo(translate = 0, speed = this.params.speed, runCallbacks = true, translateBounds = true, internal) { + const swiper = this; + const { + params, + wrapperEl + } = swiper; + + if (swiper.animating && params.preventInteractionOnTransition) { + return false; + } + + const minTranslate = swiper.minTranslate(); + const maxTranslate = swiper.maxTranslate(); + let newTranslate; + if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate; // Update progress + + swiper.updateProgress(newTranslate); + + if (params.cssMode) { + const isH = swiper.isHorizontal(); + + if (speed === 0) { + wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate; + } else { + if (!swiper.support.smoothScroll) { + animateCSSModeScroll({ + swiper, + targetPosition: -newTranslate, + side: isH ? 'left' : 'top' + }); + return true; + } + + wrapperEl.scrollTo({ + [isH ? 'left' : 'top']: -newTranslate, + behavior: 'smooth' + }); + } + + return true; + } + + if (speed === 0) { + swiper.setTransition(0); + swiper.setTranslate(newTranslate); + + if (runCallbacks) { + swiper.emit('beforeTransitionStart', speed, internal); + swiper.emit('transitionEnd'); + } + } else { + swiper.setTransition(speed); + swiper.setTranslate(newTranslate); + + if (runCallbacks) { + swiper.emit('beforeTransitionStart', speed, internal); + swiper.emit('transitionStart'); + } + + if (!swiper.animating) { + swiper.animating = true; + + if (!swiper.onTranslateToWrapperTransitionEnd) { + swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) { + if (!swiper || swiper.destroyed) return; + if (e.target !== this) return; + swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd); + swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd); + swiper.onTranslateToWrapperTransitionEnd = null; + delete swiper.onTranslateToWrapperTransitionEnd; + + if (runCallbacks) { + swiper.emit('transitionEnd'); + } + }; + } + + swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd); + swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd); + } + } + + return true; + } + + var translate = { + getTranslate: getSwiperTranslate, + setTranslate, + minTranslate, + maxTranslate, + translateTo + }; + + function setTransition(duration, byController) { + const swiper = this; + + if (!swiper.params.cssMode) { + swiper.$wrapperEl.transition(duration); + } + + swiper.emit('setTransition', duration, byController); + } + + function transitionEmit({ + swiper, + runCallbacks, + direction, + step + }) { + const { + activeIndex, + previousIndex + } = swiper; + let dir = direction; + + if (!dir) { + if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset'; + } + + swiper.emit(`transition${step}`); + + if (runCallbacks && activeIndex !== previousIndex) { + if (dir === 'reset') { + swiper.emit(`slideResetTransition${step}`); + return; + } + + swiper.emit(`slideChangeTransition${step}`); + + if (dir === 'next') { + swiper.emit(`slideNextTransition${step}`); + } else { + swiper.emit(`slidePrevTransition${step}`); + } + } + } + + function transitionStart(runCallbacks = true, direction) { + const swiper = this; + const { + params + } = swiper; + if (params.cssMode) return; + + if (params.autoHeight) { + swiper.updateAutoHeight(); + } + + transitionEmit({ + swiper, + runCallbacks, + direction, + step: 'Start' + }); + } + + function transitionEnd(runCallbacks = true, direction) { + const swiper = this; + const { + params + } = swiper; + swiper.animating = false; + if (params.cssMode) return; + swiper.setTransition(0); + transitionEmit({ + swiper, + runCallbacks, + direction, + step: 'End' + }); + } + + var transition = { + setTransition, + transitionStart, + transitionEnd + }; + + function slideTo(index = 0, speed = this.params.speed, runCallbacks = true, internal, initial) { + if (typeof index !== 'number' && typeof index !== 'string') { + throw new Error(`The 'index' argument cannot have type other than 'number' or 'string'. [${typeof index}] given.`); + } + + if (typeof index === 'string') { + /** + * The `index` argument converted from `string` to `number`. + * @type {number} + */ + const indexAsNumber = parseInt(index, 10); + /** + * Determines whether the `index` argument is a valid `number` + * after being converted from the `string` type. + * @type {boolean} + */ + + const isValidNumber = isFinite(indexAsNumber); + + if (!isValidNumber) { + throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${index}] given.`); + } // Knowing that the converted `index` is a valid number, + // we can update the original argument's value. + + + index = indexAsNumber; + } + + const swiper = this; + let slideIndex = index; + if (slideIndex < 0) slideIndex = 0; + const { + params, + snapGrid, + slidesGrid, + previousIndex, + activeIndex, + rtlTranslate: rtl, + wrapperEl, + enabled + } = swiper; + + if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) { + return false; + } + + const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex); + let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup); + if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1; + + if ((activeIndex || params.initialSlide || 0) === (previousIndex || 0) && runCallbacks) { + swiper.emit('beforeSlideChangeStart'); + } + + const translate = -snapGrid[snapIndex]; // Update progress + + swiper.updateProgress(translate); // Normalize slideIndex + + if (params.normalizeSlideIndex) { + for (let i = 0; i < slidesGrid.length; i += 1) { + const normalizedTranslate = -Math.floor(translate * 100); + const normalizedGrid = Math.floor(slidesGrid[i] * 100); + const normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100); + + if (typeof slidesGrid[i + 1] !== 'undefined') { + if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) { + slideIndex = i; + } else if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext) { + slideIndex = i + 1; + } + } else if (normalizedTranslate >= normalizedGrid) { + slideIndex = i; + } + } + } // Directions locks + + + if (swiper.initialized && slideIndex !== activeIndex) { + if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) { + return false; + } + + if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) { + if ((activeIndex || 0) !== slideIndex) return false; + } + } + + let direction; + if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset'; // Update Index + + if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) { + swiper.updateActiveIndex(slideIndex); // Update Height + + if (params.autoHeight) { + swiper.updateAutoHeight(); + } + + swiper.updateSlidesClasses(); + + if (params.effect !== 'slide') { + swiper.setTranslate(translate); + } + + if (direction !== 'reset') { + swiper.transitionStart(runCallbacks, direction); + swiper.transitionEnd(runCallbacks, direction); + } + + return false; + } + + if (params.cssMode) { + const isH = swiper.isHorizontal(); + const t = rtl ? translate : -translate; + + if (speed === 0) { + const isVirtual = swiper.virtual && swiper.params.virtual.enabled; + + if (isVirtual) { + swiper.wrapperEl.style.scrollSnapType = 'none'; + swiper._immediateVirtual = true; + } + + wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t; + + if (isVirtual) { + requestAnimationFrame(() => { + swiper.wrapperEl.style.scrollSnapType = ''; + swiper._swiperImmediateVirtual = false; + }); + } + } else { + if (!swiper.support.smoothScroll) { + animateCSSModeScroll({ + swiper, + targetPosition: t, + side: isH ? 'left' : 'top' + }); + return true; + } + + wrapperEl.scrollTo({ + [isH ? 'left' : 'top']: t, + behavior: 'smooth' + }); + } + + return true; + } + + swiper.setTransition(speed); + swiper.setTranslate(translate); + swiper.updateActiveIndex(slideIndex); + swiper.updateSlidesClasses(); + swiper.emit('beforeTransitionStart', speed, internal); + swiper.transitionStart(runCallbacks, direction); + + if (speed === 0) { + swiper.transitionEnd(runCallbacks, direction); + } else if (!swiper.animating) { + swiper.animating = true; + + if (!swiper.onSlideToWrapperTransitionEnd) { + swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) { + if (!swiper || swiper.destroyed) return; + if (e.target !== this) return; + swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd); + swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd); + swiper.onSlideToWrapperTransitionEnd = null; + delete swiper.onSlideToWrapperTransitionEnd; + swiper.transitionEnd(runCallbacks, direction); + }; + } + + swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd); + swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd); + } + + return true; + } + + function slideToLoop(index = 0, speed = this.params.speed, runCallbacks = true, internal) { + const swiper = this; + let newIndex = index; + + if (swiper.params.loop) { + newIndex += swiper.loopedSlides; + } + + return swiper.slideTo(newIndex, speed, runCallbacks, internal); + } + + /* eslint no-unused-vars: "off" */ + function slideNext(speed = this.params.speed, runCallbacks = true, internal) { + const swiper = this; + const { + animating, + enabled, + params + } = swiper; + if (!enabled) return swiper; + let perGroup = params.slidesPerGroup; + + if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) { + perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1); + } + + const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : perGroup; + + if (params.loop) { + if (animating && params.loopPreventsSlide) return false; + swiper.loopFix(); // eslint-disable-next-line + + swiper._clientLeft = swiper.$wrapperEl[0].clientLeft; + } + + if (params.rewind && swiper.isEnd) { + return swiper.slideTo(0, speed, runCallbacks, internal); + } + + return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal); + } + + /* eslint no-unused-vars: "off" */ + function slidePrev(speed = this.params.speed, runCallbacks = true, internal) { + const swiper = this; + const { + params, + animating, + snapGrid, + slidesGrid, + rtlTranslate, + enabled + } = swiper; + if (!enabled) return swiper; + + if (params.loop) { + if (animating && params.loopPreventsSlide) return false; + swiper.loopFix(); // eslint-disable-next-line + + swiper._clientLeft = swiper.$wrapperEl[0].clientLeft; + } + + const translate = rtlTranslate ? swiper.translate : -swiper.translate; + + function normalize(val) { + if (val < 0) return -Math.floor(Math.abs(val)); + return Math.floor(val); + } + + const normalizedTranslate = normalize(translate); + const normalizedSnapGrid = snapGrid.map(val => normalize(val)); + let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1]; + + if (typeof prevSnap === 'undefined' && params.cssMode) { + let prevSnapIndex; + snapGrid.forEach((snap, snapIndex) => { + if (normalizedTranslate >= snap) { + // prevSnap = snap; + prevSnapIndex = snapIndex; + } + }); + + if (typeof prevSnapIndex !== 'undefined') { + prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex]; + } + } + + let prevIndex = 0; + + if (typeof prevSnap !== 'undefined') { + prevIndex = slidesGrid.indexOf(prevSnap); + if (prevIndex < 0) prevIndex = swiper.activeIndex - 1; + + if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) { + prevIndex = prevIndex - swiper.slidesPerViewDynamic('previous', true) + 1; + prevIndex = Math.max(prevIndex, 0); + } + } + + if (params.rewind && swiper.isBeginning) { + return swiper.slideTo(swiper.slides.length - 1, speed, runCallbacks, internal); + } + + return swiper.slideTo(prevIndex, speed, runCallbacks, internal); + } + + /* eslint no-unused-vars: "off" */ + function slideReset(speed = this.params.speed, runCallbacks = true, internal) { + const swiper = this; + return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal); + } + + /* eslint no-unused-vars: "off" */ + function slideToClosest(speed = this.params.speed, runCallbacks = true, internal, threshold = 0.5) { + const swiper = this; + let index = swiper.activeIndex; + const skip = Math.min(swiper.params.slidesPerGroupSkip, index); + const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup); + const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate; + + if (translate >= swiper.snapGrid[snapIndex]) { + // The current translate is on or after the current snap index, so the choice + // is between the current index and the one after it. + const currentSnap = swiper.snapGrid[snapIndex]; + const nextSnap = swiper.snapGrid[snapIndex + 1]; + + if (translate - currentSnap > (nextSnap - currentSnap) * threshold) { + index += swiper.params.slidesPerGroup; + } + } else { + // The current translate is before the current snap index, so the choice + // is between the current index and the one before it. + const prevSnap = swiper.snapGrid[snapIndex - 1]; + const currentSnap = swiper.snapGrid[snapIndex]; + + if (translate - prevSnap <= (currentSnap - prevSnap) * threshold) { + index -= swiper.params.slidesPerGroup; + } + } + + index = Math.max(index, 0); + index = Math.min(index, swiper.slidesGrid.length - 1); + return swiper.slideTo(index, speed, runCallbacks, internal); + } + + function slideToClickedSlide() { + const swiper = this; + const { + params, + $wrapperEl + } = swiper; + const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView; + let slideToIndex = swiper.clickedIndex; + let realIndex; + + if (params.loop) { + if (swiper.animating) return; + realIndex = parseInt($(swiper.clickedSlide).attr('data-swiper-slide-index'), 10); + + if (params.centeredSlides) { + if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) { + swiper.loopFix(); + slideToIndex = $wrapperEl.children(`.${params.slideClass}[data-swiper-slide-index="${realIndex}"]:not(.${params.slideDuplicateClass})`).eq(0).index(); + nextTick(() => { + swiper.slideTo(slideToIndex); + }); + } else { + swiper.slideTo(slideToIndex); + } + } else if (slideToIndex > swiper.slides.length - slidesPerView) { + swiper.loopFix(); + slideToIndex = $wrapperEl.children(`.${params.slideClass}[data-swiper-slide-index="${realIndex}"]:not(.${params.slideDuplicateClass})`).eq(0).index(); + nextTick(() => { + swiper.slideTo(slideToIndex); + }); + } else { + swiper.slideTo(slideToIndex); + } + } else { + swiper.slideTo(slideToIndex); + } + } + + var slide = { + slideTo, + slideToLoop, + slideNext, + slidePrev, + slideReset, + slideToClosest, + slideToClickedSlide + }; + + function loopCreate() { + const swiper = this; + const document = getDocument(); + const { + params, + $wrapperEl + } = swiper; // Remove duplicated slides + + const $selector = $wrapperEl.children().length > 0 ? $($wrapperEl.children()[0].parentNode) : $wrapperEl; + $selector.children(`.${params.slideClass}.${params.slideDuplicateClass}`).remove(); + let slides = $selector.children(`.${params.slideClass}`); + + if (params.loopFillGroupWithBlank) { + const blankSlidesNum = params.slidesPerGroup - slides.length % params.slidesPerGroup; + + if (blankSlidesNum !== params.slidesPerGroup) { + for (let i = 0; i < blankSlidesNum; i += 1) { + const blankNode = $(document.createElement('div')).addClass(`${params.slideClass} ${params.slideBlankClass}`); + $selector.append(blankNode); + } + + slides = $selector.children(`.${params.slideClass}`); + } + } + + if (params.slidesPerView === 'auto' && !params.loopedSlides) params.loopedSlides = slides.length; + swiper.loopedSlides = Math.ceil(parseFloat(params.loopedSlides || params.slidesPerView, 10)); + swiper.loopedSlides += params.loopAdditionalSlides; + + if (swiper.loopedSlides > slides.length) { + swiper.loopedSlides = slides.length; + } + + const prependSlides = []; + const appendSlides = []; + slides.each((el, index) => { + const slide = $(el); + + if (index < swiper.loopedSlides) { + appendSlides.push(el); + } + + if (index < slides.length && index >= slides.length - swiper.loopedSlides) { + prependSlides.push(el); + } + + slide.attr('data-swiper-slide-index', index); + }); + + for (let i = 0; i < appendSlides.length; i += 1) { + $selector.append($(appendSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass)); + } + + for (let i = prependSlides.length - 1; i >= 0; i -= 1) { + $selector.prepend($(prependSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass)); + } + } + + function loopFix() { + const swiper = this; + swiper.emit('beforeLoopFix'); + const { + activeIndex, + slides, + loopedSlides, + allowSlidePrev, + allowSlideNext, + snapGrid, + rtlTranslate: rtl + } = swiper; + let newIndex; + swiper.allowSlidePrev = true; + swiper.allowSlideNext = true; + const snapTranslate = -snapGrid[activeIndex]; + const diff = snapTranslate - swiper.getTranslate(); // Fix For Negative Oversliding + + if (activeIndex < loopedSlides) { + newIndex = slides.length - loopedSlides * 3 + activeIndex; + newIndex += loopedSlides; + const slideChanged = swiper.slideTo(newIndex, 0, false, true); + + if (slideChanged && diff !== 0) { + swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff); + } + } else if (activeIndex >= slides.length - loopedSlides) { + // Fix For Positive Oversliding + newIndex = -slides.length + activeIndex + loopedSlides; + newIndex += loopedSlides; + const slideChanged = swiper.slideTo(newIndex, 0, false, true); + + if (slideChanged && diff !== 0) { + swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff); + } + } + + swiper.allowSlidePrev = allowSlidePrev; + swiper.allowSlideNext = allowSlideNext; + swiper.emit('loopFix'); + } + + function loopDestroy() { + const swiper = this; + const { + $wrapperEl, + params, + slides + } = swiper; + $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass},.${params.slideClass}.${params.slideBlankClass}`).remove(); + slides.removeAttr('data-swiper-slide-index'); + } + + var loop = { + loopCreate, + loopFix, + loopDestroy + }; + + function setGrabCursor(moving) { + const swiper = this; + if (swiper.support.touch || !swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return; + const el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl; + el.style.cursor = 'move'; + el.style.cursor = moving ? '-webkit-grabbing' : '-webkit-grab'; + el.style.cursor = moving ? '-moz-grabbin' : '-moz-grab'; + el.style.cursor = moving ? 'grabbing' : 'grab'; + } + + function unsetGrabCursor() { + const swiper = this; + + if (swiper.support.touch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) { + return; + } + + swiper[swiper.params.touchEventsTarget === 'container' ? 'el' : 'wrapperEl'].style.cursor = ''; + } + + var grabCursor = { + setGrabCursor, + unsetGrabCursor + }; + + function closestElement(selector, base = this) { + function __closestFrom(el) { + if (!el || el === getDocument() || el === getWindow()) return null; + if (el.assignedSlot) el = el.assignedSlot; + const found = el.closest(selector); + return found || __closestFrom(el.getRootNode().host); + } + + return __closestFrom(base); + } + + function onTouchStart(event) { + const swiper = this; + const document = getDocument(); + const window = getWindow(); + const data = swiper.touchEventsData; + const { + params, + touches, + enabled + } = swiper; + if (!enabled) return; + + if (swiper.animating && params.preventInteractionOnTransition) { + return; + } + + if (!swiper.animating && params.cssMode && params.loop) { + swiper.loopFix(); + } + + let e = event; + if (e.originalEvent) e = e.originalEvent; + let $targetEl = $(e.target); + + if (params.touchEventsTarget === 'wrapper') { + if (!$targetEl.closest(swiper.wrapperEl).length) return; + } + + data.isTouchEvent = e.type === 'touchstart'; + if (!data.isTouchEvent && 'which' in e && e.which === 3) return; + if (!data.isTouchEvent && 'button' in e && e.button > 0) return; + if (data.isTouched && data.isMoved) return; // change target el for shadow root component + + const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== ''; + + if (swipingClassHasValue && e.target && e.target.shadowRoot && event.path && event.path[0]) { + $targetEl = $(event.path[0]); + } + + const noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`; + const isTargetShadow = !!(e.target && e.target.shadowRoot); // use closestElement for shadow root element to get the actual closest for nested shadow root element + + if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, e.target) : $targetEl.closest(noSwipingSelector)[0])) { + swiper.allowClick = true; + return; + } + + if (params.swipeHandler) { + if (!$targetEl.closest(params.swipeHandler)[0]) return; + } + + touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX; + touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY; + const startX = touches.currentX; + const startY = touches.currentY; // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore + + const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection; + const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold; + + if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) { + if (edgeSwipeDetection === 'prevent') { + event.preventDefault(); + } else { + return; + } + } + + Object.assign(data, { + isTouched: true, + isMoved: false, + allowTouchCallbacks: true, + isScrolling: undefined, + startMoving: undefined + }); + touches.startX = startX; + touches.startY = startY; + data.touchStartTime = now(); + swiper.allowClick = true; + swiper.updateSize(); + swiper.swipeDirection = undefined; + if (params.threshold > 0) data.allowThresholdMove = false; + + if (e.type !== 'touchstart') { + let preventDefault = true; + if ($targetEl.is(data.focusableElements)) preventDefault = false; + + if (document.activeElement && $(document.activeElement).is(data.focusableElements) && document.activeElement !== $targetEl[0]) { + document.activeElement.blur(); + } + + const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault; + + if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !$targetEl[0].isContentEditable) { + e.preventDefault(); + } + } + + swiper.emit('touchStart', e); + } + + function onTouchMove(event) { + const document = getDocument(); + const swiper = this; + const data = swiper.touchEventsData; + const { + params, + touches, + rtlTranslate: rtl, + enabled + } = swiper; + if (!enabled) return; + let e = event; + if (e.originalEvent) e = e.originalEvent; + + if (!data.isTouched) { + if (data.startMoving && data.isScrolling) { + swiper.emit('touchMoveOpposite', e); + } + + return; + } + + if (data.isTouchEvent && e.type !== 'touchmove') return; + const targetTouch = e.type === 'touchmove' && e.targetTouches && (e.targetTouches[0] || e.changedTouches[0]); + const pageX = e.type === 'touchmove' ? targetTouch.pageX : e.pageX; + const pageY = e.type === 'touchmove' ? targetTouch.pageY : e.pageY; + + if (e.preventedByNestedSwiper) { + touches.startX = pageX; + touches.startY = pageY; + return; + } + + if (!swiper.allowTouchMove) { + // isMoved = true; + swiper.allowClick = false; + + if (data.isTouched) { + Object.assign(touches, { + startX: pageX, + startY: pageY, + currentX: pageX, + currentY: pageY + }); + data.touchStartTime = now(); + } + + return; + } + + if (data.isTouchEvent && params.touchReleaseOnEdges && !params.loop) { + if (swiper.isVertical()) { + // Vertical + if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) { + data.isTouched = false; + data.isMoved = false; + return; + } + } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) { + return; + } + } + + if (data.isTouchEvent && document.activeElement) { + if (e.target === document.activeElement && $(e.target).is(data.focusableElements)) { + data.isMoved = true; + swiper.allowClick = false; + return; + } + } + + if (data.allowTouchCallbacks) { + swiper.emit('touchMove', e); + } + + if (e.targetTouches && e.targetTouches.length > 1) return; + touches.currentX = pageX; + touches.currentY = pageY; + const diffX = touches.currentX - touches.startX; + const diffY = touches.currentY - touches.startY; + if (swiper.params.threshold && Math.sqrt(diffX ** 2 + diffY ** 2) < swiper.params.threshold) return; + + if (typeof data.isScrolling === 'undefined') { + let touchAngle; + + if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) { + data.isScrolling = false; + } else { + // eslint-disable-next-line + if (diffX * diffX + diffY * diffY >= 25) { + touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI; + data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle; + } + } + } + + if (data.isScrolling) { + swiper.emit('touchMoveOpposite', e); + } + + if (typeof data.startMoving === 'undefined') { + if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) { + data.startMoving = true; + } + } + + if (data.isScrolling) { + data.isTouched = false; + return; + } + + if (!data.startMoving) { + return; + } + + swiper.allowClick = false; + + if (!params.cssMode && e.cancelable) { + e.preventDefault(); + } + + if (params.touchMoveStopPropagation && !params.nested) { + e.stopPropagation(); + } + + if (!data.isMoved) { + if (params.loop && !params.cssMode) { + swiper.loopFix(); + } + + data.startTranslate = swiper.getTranslate(); + swiper.setTransition(0); + + if (swiper.animating) { + swiper.$wrapperEl.trigger('webkitTransitionEnd transitionend'); + } + + data.allowMomentumBounce = false; // Grab Cursor + + if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) { + swiper.setGrabCursor(true); + } + + swiper.emit('sliderFirstMove', e); + } + + swiper.emit('sliderMove', e); + data.isMoved = true; + let diff = swiper.isHorizontal() ? diffX : diffY; + touches.diff = diff; + diff *= params.touchRatio; + if (rtl) diff = -diff; + swiper.swipeDirection = diff > 0 ? 'prev' : 'next'; + data.currentTranslate = diff + data.startTranslate; + let disableParentSwiper = true; + let resistanceRatio = params.resistanceRatio; + + if (params.touchReleaseOnEdges) { + resistanceRatio = 0; + } + + if (diff > 0 && data.currentTranslate > swiper.minTranslate()) { + disableParentSwiper = false; + if (params.resistance) data.currentTranslate = swiper.minTranslate() - 1 + (-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio; + } else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) { + disableParentSwiper = false; + if (params.resistance) data.currentTranslate = swiper.maxTranslate() + 1 - (swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio; + } + + if (disableParentSwiper) { + e.preventedByNestedSwiper = true; + } // Directions locks + + + if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) { + data.currentTranslate = data.startTranslate; + } + + if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) { + data.currentTranslate = data.startTranslate; + } + + if (!swiper.allowSlidePrev && !swiper.allowSlideNext) { + data.currentTranslate = data.startTranslate; + } // Threshold + + + if (params.threshold > 0) { + if (Math.abs(diff) > params.threshold || data.allowThresholdMove) { + if (!data.allowThresholdMove) { + data.allowThresholdMove = true; + touches.startX = touches.currentX; + touches.startY = touches.currentY; + data.currentTranslate = data.startTranslate; + touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY; + return; + } + } else { + data.currentTranslate = data.startTranslate; + return; + } + } + + if (!params.followFinger || params.cssMode) return; // Update active index in free mode + + if (params.freeMode && params.freeMode.enabled && swiper.freeMode || params.watchSlidesProgress) { + swiper.updateActiveIndex(); + swiper.updateSlidesClasses(); + } + + if (swiper.params.freeMode && params.freeMode.enabled && swiper.freeMode) { + swiper.freeMode.onTouchMove(); + } // Update progress + + + swiper.updateProgress(data.currentTranslate); // Update translate + + swiper.setTranslate(data.currentTranslate); + } + + function onTouchEnd(event) { + const swiper = this; + const data = swiper.touchEventsData; + const { + params, + touches, + rtlTranslate: rtl, + slidesGrid, + enabled + } = swiper; + if (!enabled) return; + let e = event; + if (e.originalEvent) e = e.originalEvent; + + if (data.allowTouchCallbacks) { + swiper.emit('touchEnd', e); + } + + data.allowTouchCallbacks = false; + + if (!data.isTouched) { + if (data.isMoved && params.grabCursor) { + swiper.setGrabCursor(false); + } + + data.isMoved = false; + data.startMoving = false; + return; + } // Return Grab Cursor + + + if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) { + swiper.setGrabCursor(false); + } // Time diff + + + const touchEndTime = now(); + const timeDiff = touchEndTime - data.touchStartTime; // Tap, doubleTap, Click + + if (swiper.allowClick) { + const pathTree = e.path || e.composedPath && e.composedPath(); + swiper.updateClickedSlide(pathTree && pathTree[0] || e.target); + swiper.emit('tap click', e); + + if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) { + swiper.emit('doubleTap doubleClick', e); + } + } + + data.lastClickTime = now(); + nextTick(() => { + if (!swiper.destroyed) swiper.allowClick = true; + }); + + if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) { + data.isTouched = false; + data.isMoved = false; + data.startMoving = false; + return; + } + + data.isTouched = false; + data.isMoved = false; + data.startMoving = false; + let currentPos; + + if (params.followFinger) { + currentPos = rtl ? swiper.translate : -swiper.translate; + } else { + currentPos = -data.currentTranslate; + } + + if (params.cssMode) { + return; + } + + if (swiper.params.freeMode && params.freeMode.enabled) { + swiper.freeMode.onTouchEnd({ + currentPos + }); + return; + } // Find current slide + + + let stopIndex = 0; + let groupSize = swiper.slidesSizesGrid[0]; + + for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) { + const increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup; + + if (typeof slidesGrid[i + increment] !== 'undefined') { + if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) { + stopIndex = i; + groupSize = slidesGrid[i + increment] - slidesGrid[i]; + } + } else if (currentPos >= slidesGrid[i]) { + stopIndex = i; + groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2]; + } + } // Find current slide size + + + const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize; + const increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup; + + if (timeDiff > params.longSwipesMs) { + // Long touches + if (!params.longSwipes) { + swiper.slideTo(swiper.activeIndex); + return; + } + + if (swiper.swipeDirection === 'next') { + if (ratio >= params.longSwipesRatio) swiper.slideTo(stopIndex + increment);else swiper.slideTo(stopIndex); + } + + if (swiper.swipeDirection === 'prev') { + if (ratio > 1 - params.longSwipesRatio) swiper.slideTo(stopIndex + increment);else swiper.slideTo(stopIndex); + } + } else { + // Short swipes + if (!params.shortSwipes) { + swiper.slideTo(swiper.activeIndex); + return; + } + + const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl); + + if (!isNavButtonTarget) { + if (swiper.swipeDirection === 'next') { + swiper.slideTo(stopIndex + increment); + } + + if (swiper.swipeDirection === 'prev') { + swiper.slideTo(stopIndex); + } + } else if (e.target === swiper.navigation.nextEl) { + swiper.slideTo(stopIndex + increment); + } else { + swiper.slideTo(stopIndex); + } + } + } + + function onResize() { + const swiper = this; + const { + params, + el + } = swiper; + if (el && el.offsetWidth === 0) return; // Breakpoints + + if (params.breakpoints) { + swiper.setBreakpoint(); + } // Save locks + + + const { + allowSlideNext, + allowSlidePrev, + snapGrid + } = swiper; // Disable locks on resize + + swiper.allowSlideNext = true; + swiper.allowSlidePrev = true; + swiper.updateSize(); + swiper.updateSlides(); + swiper.updateSlidesClasses(); + + if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides) { + swiper.slideTo(swiper.slides.length - 1, 0, false, true); + } else { + swiper.slideTo(swiper.activeIndex, 0, false, true); + } + + if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) { + swiper.autoplay.run(); + } // Return locks after resize + + + swiper.allowSlidePrev = allowSlidePrev; + swiper.allowSlideNext = allowSlideNext; + + if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) { + swiper.checkOverflow(); + } + } + + function onClick(e) { + const swiper = this; + if (!swiper.enabled) return; + + if (!swiper.allowClick) { + if (swiper.params.preventClicks) e.preventDefault(); + + if (swiper.params.preventClicksPropagation && swiper.animating) { + e.stopPropagation(); + e.stopImmediatePropagation(); + } + } + } + + function onScroll() { + const swiper = this; + const { + wrapperEl, + rtlTranslate, + enabled + } = swiper; + if (!enabled) return; + swiper.previousTranslate = swiper.translate; + + if (swiper.isHorizontal()) { + swiper.translate = -wrapperEl.scrollLeft; + } else { + swiper.translate = -wrapperEl.scrollTop; + } // eslint-disable-next-line + + + if (swiper.translate === -0) swiper.translate = 0; + swiper.updateActiveIndex(); + swiper.updateSlidesClasses(); + let newProgress; + const translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); + + if (translatesDiff === 0) { + newProgress = 0; + } else { + newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff; + } + + if (newProgress !== swiper.progress) { + swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate); + } + + swiper.emit('setTranslate', swiper.translate, false); + } + + let dummyEventAttached = false; + + function dummyEventListener() {} + + const events = (swiper, method) => { + const document = getDocument(); + const { + params, + touchEvents, + el, + wrapperEl, + device, + support + } = swiper; + const capture = !!params.nested; + const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener'; + const swiperMethod = method; // Touch Events + + if (!support.touch) { + el[domMethod](touchEvents.start, swiper.onTouchStart, false); + document[domMethod](touchEvents.move, swiper.onTouchMove, capture); + document[domMethod](touchEvents.end, swiper.onTouchEnd, false); + } else { + const passiveListener = touchEvents.start === 'touchstart' && support.passiveListener && params.passiveListeners ? { + passive: true, + capture: false + } : false; + el[domMethod](touchEvents.start, swiper.onTouchStart, passiveListener); + el[domMethod](touchEvents.move, swiper.onTouchMove, support.passiveListener ? { + passive: false, + capture + } : capture); + el[domMethod](touchEvents.end, swiper.onTouchEnd, passiveListener); + + if (touchEvents.cancel) { + el[domMethod](touchEvents.cancel, swiper.onTouchEnd, passiveListener); + } + } // Prevent Links Clicks + + + if (params.preventClicks || params.preventClicksPropagation) { + el[domMethod]('click', swiper.onClick, true); + } + + if (params.cssMode) { + wrapperEl[domMethod]('scroll', swiper.onScroll); + } // Resize handler + + + if (params.updateOnWindowResize) { + swiper[swiperMethod](device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true); + } else { + swiper[swiperMethod]('observerUpdate', onResize, true); + } + }; + + function attachEvents() { + const swiper = this; + const document = getDocument(); + const { + params, + support + } = swiper; + swiper.onTouchStart = onTouchStart.bind(swiper); + swiper.onTouchMove = onTouchMove.bind(swiper); + swiper.onTouchEnd = onTouchEnd.bind(swiper); + + if (params.cssMode) { + swiper.onScroll = onScroll.bind(swiper); + } + + swiper.onClick = onClick.bind(swiper); + + if (support.touch && !dummyEventAttached) { + document.addEventListener('touchstart', dummyEventListener); + dummyEventAttached = true; + } + + events(swiper, 'on'); + } + + function detachEvents() { + const swiper = this; + events(swiper, 'off'); + } + + var events$1 = { + attachEvents, + detachEvents + }; + + const isGridEnabled = (swiper, params) => { + return swiper.grid && params.grid && params.grid.rows > 1; + }; + + function setBreakpoint() { + const swiper = this; + const { + activeIndex, + initialized, + loopedSlides = 0, + params, + $el + } = swiper; + const breakpoints = params.breakpoints; + if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return; // Get breakpoint for window width and update parameters + + const breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el); + if (!breakpoint || swiper.currentBreakpoint === breakpoint) return; + const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined; + const breakpointParams = breakpointOnlyParams || swiper.originalParams; + const wasMultiRow = isGridEnabled(swiper, params); + const isMultiRow = isGridEnabled(swiper, breakpointParams); + const wasEnabled = params.enabled; + + if (wasMultiRow && !isMultiRow) { + $el.removeClass(`${params.containerModifierClass}grid ${params.containerModifierClass}grid-column`); + swiper.emitContainerClasses(); + } else if (!wasMultiRow && isMultiRow) { + $el.addClass(`${params.containerModifierClass}grid`); + + if (breakpointParams.grid.fill && breakpointParams.grid.fill === 'column' || !breakpointParams.grid.fill && params.grid.fill === 'column') { + $el.addClass(`${params.containerModifierClass}grid-column`); + } + + swiper.emitContainerClasses(); + } + + const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction; + const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged); + + if (directionChanged && initialized) { + swiper.changeDirection(); + } + + extend(swiper.params, breakpointParams); + const isEnabled = swiper.params.enabled; + Object.assign(swiper, { + allowTouchMove: swiper.params.allowTouchMove, + allowSlideNext: swiper.params.allowSlideNext, + allowSlidePrev: swiper.params.allowSlidePrev + }); + + if (wasEnabled && !isEnabled) { + swiper.disable(); + } else if (!wasEnabled && isEnabled) { + swiper.enable(); + } + + swiper.currentBreakpoint = breakpoint; + swiper.emit('_beforeBreakpoint', breakpointParams); + + if (needsReLoop && initialized) { + swiper.loopDestroy(); + swiper.loopCreate(); + swiper.updateSlides(); + swiper.slideTo(activeIndex - loopedSlides + swiper.loopedSlides, 0, false); + } + + swiper.emit('breakpoint', breakpointParams); + } + + function getBreakpoint(breakpoints, base = 'window', containerEl) { + if (!breakpoints || base === 'container' && !containerEl) return undefined; + let breakpoint = false; + const window = getWindow(); + const currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight; + const points = Object.keys(breakpoints).map(point => { + if (typeof point === 'string' && point.indexOf('@') === 0) { + const minRatio = parseFloat(point.substr(1)); + const value = currentHeight * minRatio; + return { + value, + point + }; + } + + return { + value: point, + point + }; + }); + points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10)); + + for (let i = 0; i < points.length; i += 1) { + const { + point, + value + } = points[i]; + + if (base === 'window') { + if (window.matchMedia(`(min-width: ${value}px)`).matches) { + breakpoint = point; + } + } else if (value <= containerEl.clientWidth) { + breakpoint = point; + } + } + + return breakpoint || 'max'; + } + + var breakpoints = { + setBreakpoint, + getBreakpoint + }; + + function prepareClasses(entries, prefix) { + const resultClasses = []; + entries.forEach(item => { + if (typeof item === 'object') { + Object.keys(item).forEach(classNames => { + if (item[classNames]) { + resultClasses.push(prefix + classNames); + } + }); + } else if (typeof item === 'string') { + resultClasses.push(prefix + item); + } + }); + return resultClasses; + } + + function addClasses() { + const swiper = this; + const { + classNames, + params, + rtl, + $el, + device, + support + } = swiper; // prettier-ignore + + const suffixes = prepareClasses(['initialized', params.direction, { + 'pointer-events': !support.touch + }, { + 'free-mode': swiper.params.freeMode && params.freeMode.enabled + }, { + 'autoheight': params.autoHeight + }, { + 'rtl': rtl + }, { + 'grid': params.grid && params.grid.rows > 1 + }, { + 'grid-column': params.grid && params.grid.rows > 1 && params.grid.fill === 'column' + }, { + 'android': device.android + }, { + 'ios': device.ios + }, { + 'css-mode': params.cssMode + }, { + 'centered': params.cssMode && params.centeredSlides + }], params.containerModifierClass); + classNames.push(...suffixes); + $el.addClass([...classNames].join(' ')); + swiper.emitContainerClasses(); + } + + function removeClasses() { + const swiper = this; + const { + $el, + classNames + } = swiper; + $el.removeClass(classNames.join(' ')); + swiper.emitContainerClasses(); + } + + var classes = { + addClasses, + removeClasses + }; + + function loadImage(imageEl, src, srcset, sizes, checkForComplete, callback) { + const window = getWindow(); + let image; + + function onReady() { + if (callback) callback(); + } + + const isPicture = $(imageEl).parent('picture')[0]; + + if (!isPicture && (!imageEl.complete || !checkForComplete)) { + if (src) { + image = new window.Image(); + image.onload = onReady; + image.onerror = onReady; + + if (sizes) { + image.sizes = sizes; + } + + if (srcset) { + image.srcset = srcset; + } + + if (src) { + image.src = src; + } + } else { + onReady(); + } + } else { + // image already loaded... + onReady(); + } + } + + function preloadImages() { + const swiper = this; + swiper.imagesToLoad = swiper.$el.find('img'); + + function onReady() { + if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) return; + if (swiper.imagesLoaded !== undefined) swiper.imagesLoaded += 1; + + if (swiper.imagesLoaded === swiper.imagesToLoad.length) { + if (swiper.params.updateOnImagesReady) swiper.update(); + swiper.emit('imagesReady'); + } + } + + for (let i = 0; i < swiper.imagesToLoad.length; i += 1) { + const imageEl = swiper.imagesToLoad[i]; + swiper.loadImage(imageEl, imageEl.currentSrc || imageEl.getAttribute('src'), imageEl.srcset || imageEl.getAttribute('srcset'), imageEl.sizes || imageEl.getAttribute('sizes'), true, onReady); + } + } + + var images = { + loadImage, + preloadImages + }; + + function checkOverflow() { + const swiper = this; + const { + isLocked: wasLocked, + params + } = swiper; + const { + slidesOffsetBefore + } = params; + + if (slidesOffsetBefore) { + const lastSlideIndex = swiper.slides.length - 1; + const lastSlideRightEdge = swiper.slidesGrid[lastSlideIndex] + swiper.slidesSizesGrid[lastSlideIndex] + slidesOffsetBefore * 2; + swiper.isLocked = swiper.size > lastSlideRightEdge; + } else { + swiper.isLocked = swiper.snapGrid.length === 1; + } + + if (params.allowSlideNext === true) { + swiper.allowSlideNext = !swiper.isLocked; + } + + if (params.allowSlidePrev === true) { + swiper.allowSlidePrev = !swiper.isLocked; + } + + if (wasLocked && wasLocked !== swiper.isLocked) { + swiper.isEnd = false; + } + + if (wasLocked !== swiper.isLocked) { + swiper.emit(swiper.isLocked ? 'lock' : 'unlock'); + } + } + + var checkOverflow$1 = { + checkOverflow + }; + + var defaults = { + init: true, + direction: 'horizontal', + touchEventsTarget: 'wrapper', + initialSlide: 0, + speed: 300, + cssMode: false, + updateOnWindowResize: true, + resizeObserver: true, + nested: false, + createElements: false, + enabled: true, + focusableElements: 'input, select, option, textarea, button, video, label', + // Overrides + width: null, + height: null, + // + preventInteractionOnTransition: false, + // ssr + userAgent: null, + url: null, + // To support iOS's swipe-to-go-back gesture (when being used in-app). + edgeSwipeDetection: false, + edgeSwipeThreshold: 20, + // Autoheight + autoHeight: false, + // Set wrapper width + setWrapperSize: false, + // Virtual Translate + virtualTranslate: false, + // Effects + effect: 'slide', + // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip' + // Breakpoints + breakpoints: undefined, + breakpointsBase: 'window', + // Slides grid + spaceBetween: 0, + slidesPerView: 1, + slidesPerGroup: 1, + slidesPerGroupSkip: 0, + slidesPerGroupAuto: false, + centeredSlides: false, + centeredSlidesBounds: false, + slidesOffsetBefore: 0, + // in px + slidesOffsetAfter: 0, + // in px + normalizeSlideIndex: true, + centerInsufficientSlides: false, + // Disable swiper and hide navigation when container not overflow + watchOverflow: true, + // Round length + roundLengths: false, + // Touches + touchRatio: 1, + touchAngle: 45, + simulateTouch: true, + shortSwipes: true, + longSwipes: true, + longSwipesRatio: 0.5, + longSwipesMs: 300, + followFinger: true, + allowTouchMove: true, + threshold: 0, + touchMoveStopPropagation: false, + touchStartPreventDefault: true, + touchStartForcePreventDefault: false, + touchReleaseOnEdges: false, + // Unique Navigation Elements + uniqueNavElements: true, + // Resistance + resistance: true, + resistanceRatio: 0.85, + // Progress + watchSlidesProgress: false, + // Cursor + grabCursor: false, + // Clicks + preventClicks: true, + preventClicksPropagation: true, + slideToClickedSlide: false, + // Images + preloadImages: true, + updateOnImagesReady: true, + // loop + loop: false, + loopAdditionalSlides: 0, + loopedSlides: null, + loopFillGroupWithBlank: false, + loopPreventsSlide: true, + // rewind + rewind: false, + // Swiping/no swiping + allowSlidePrev: true, + allowSlideNext: true, + swipeHandler: null, + // '.swipe-handler', + noSwiping: true, + noSwipingClass: 'swiper-no-swiping', + noSwipingSelector: null, + // Passive Listeners + passiveListeners: true, + // NS + containerModifierClass: 'swiper-', + // NEW + slideClass: 'swiper-slide', + slideBlankClass: 'swiper-slide-invisible-blank', + slideActiveClass: 'swiper-slide-active', + slideDuplicateActiveClass: 'swiper-slide-duplicate-active', + slideVisibleClass: 'swiper-slide-visible', + slideDuplicateClass: 'swiper-slide-duplicate', + slideNextClass: 'swiper-slide-next', + slideDuplicateNextClass: 'swiper-slide-duplicate-next', + slidePrevClass: 'swiper-slide-prev', + slideDuplicatePrevClass: 'swiper-slide-duplicate-prev', + wrapperClass: 'swiper-wrapper', + // Callbacks + runCallbacksOnInit: true, + // Internals + _emitClasses: false + }; + + function moduleExtendParams(params, allModulesParams) { + return function extendParams(obj = {}) { + const moduleParamName = Object.keys(obj)[0]; + const moduleParams = obj[moduleParamName]; + + if (typeof moduleParams !== 'object' || moduleParams === null) { + extend(allModulesParams, obj); + return; + } + + if (['navigation', 'pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] === true) { + params[moduleParamName] = { + auto: true + }; + } + + if (!(moduleParamName in params && 'enabled' in moduleParams)) { + extend(allModulesParams, obj); + return; + } + + if (params[moduleParamName] === true) { + params[moduleParamName] = { + enabled: true + }; + } + + if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) { + params[moduleParamName].enabled = true; + } + + if (!params[moduleParamName]) params[moduleParamName] = { + enabled: false + }; + extend(allModulesParams, obj); + }; + } + + /* eslint no-param-reassign: "off" */ + const prototypes = { + eventsEmitter, + update, + translate, + transition, + slide, + loop, + grabCursor, + events: events$1, + breakpoints, + checkOverflow: checkOverflow$1, + classes, + images + }; + const extendedDefaults = {}; + + class Swiper { + constructor(...args) { + let el; + let params; + + if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') { + params = args[0]; + } else { + [el, params] = args; + } + + if (!params) params = {}; + params = extend({}, params); + if (el && !params.el) params.el = el; + + if (params.el && $(params.el).length > 1) { + const swipers = []; + $(params.el).each(containerEl => { + const newParams = extend({}, params, { + el: containerEl + }); + swipers.push(new Swiper(newParams)); + }); + return swipers; + } // Swiper Instance + + + const swiper = this; + swiper.__swiper__ = true; + swiper.support = getSupport(); + swiper.device = getDevice({ + userAgent: params.userAgent + }); + swiper.browser = getBrowser(); + swiper.eventsListeners = {}; + swiper.eventsAnyListeners = []; + swiper.modules = [...swiper.__modules__]; + + if (params.modules && Array.isArray(params.modules)) { + swiper.modules.push(...params.modules); + } + + const allModulesParams = {}; + swiper.modules.forEach(mod => { + mod({ + swiper, + extendParams: moduleExtendParams(params, allModulesParams), + on: swiper.on.bind(swiper), + once: swiper.once.bind(swiper), + off: swiper.off.bind(swiper), + emit: swiper.emit.bind(swiper) + }); + }); // Extend defaults with modules params + + const swiperParams = extend({}, defaults, allModulesParams); // Extend defaults with passed params + + swiper.params = extend({}, swiperParams, extendedDefaults, params); + swiper.originalParams = extend({}, swiper.params); + swiper.passedParams = extend({}, params); // add event listeners + + if (swiper.params && swiper.params.on) { + Object.keys(swiper.params.on).forEach(eventName => { + swiper.on(eventName, swiper.params.on[eventName]); + }); + } + + if (swiper.params && swiper.params.onAny) { + swiper.onAny(swiper.params.onAny); + } // Save Dom lib + + + swiper.$ = $; // Extend Swiper + + Object.assign(swiper, { + enabled: swiper.params.enabled, + el, + // Classes + classNames: [], + // Slides + slides: $(), + slidesGrid: [], + snapGrid: [], + slidesSizesGrid: [], + + // isDirection + isHorizontal() { + return swiper.params.direction === 'horizontal'; + }, + + isVertical() { + return swiper.params.direction === 'vertical'; + }, + + // Indexes + activeIndex: 0, + realIndex: 0, + // + isBeginning: true, + isEnd: false, + // Props + translate: 0, + previousTranslate: 0, + progress: 0, + velocity: 0, + animating: false, + // Locks + allowSlideNext: swiper.params.allowSlideNext, + allowSlidePrev: swiper.params.allowSlidePrev, + // Touch Events + touchEvents: function touchEvents() { + const touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel']; + const desktop = ['pointerdown', 'pointermove', 'pointerup']; + swiper.touchEventsTouch = { + start: touch[0], + move: touch[1], + end: touch[2], + cancel: touch[3] + }; + swiper.touchEventsDesktop = { + start: desktop[0], + move: desktop[1], + end: desktop[2] + }; + return swiper.support.touch || !swiper.params.simulateTouch ? swiper.touchEventsTouch : swiper.touchEventsDesktop; + }(), + touchEventsData: { + isTouched: undefined, + isMoved: undefined, + allowTouchCallbacks: undefined, + touchStartTime: undefined, + isScrolling: undefined, + currentTranslate: undefined, + startTranslate: undefined, + allowThresholdMove: undefined, + // Form elements to match + focusableElements: swiper.params.focusableElements, + // Last click time + lastClickTime: now(), + clickTimeout: undefined, + // Velocities + velocities: [], + allowMomentumBounce: undefined, + isTouchEvent: undefined, + startMoving: undefined + }, + // Clicks + allowClick: true, + // Touches + allowTouchMove: swiper.params.allowTouchMove, + touches: { + startX: 0, + startY: 0, + currentX: 0, + currentY: 0, + diff: 0 + }, + // Images + imagesToLoad: [], + imagesLoaded: 0 + }); + swiper.emit('_swiper'); // Init + + if (swiper.params.init) { + swiper.init(); + } // Return app instance + + + return swiper; + } + + enable() { + const swiper = this; + if (swiper.enabled) return; + swiper.enabled = true; + + if (swiper.params.grabCursor) { + swiper.setGrabCursor(); + } + + swiper.emit('enable'); + } + + disable() { + const swiper = this; + if (!swiper.enabled) return; + swiper.enabled = false; + + if (swiper.params.grabCursor) { + swiper.unsetGrabCursor(); + } + + swiper.emit('disable'); + } + + setProgress(progress, speed) { + const swiper = this; + progress = Math.min(Math.max(progress, 0), 1); + const min = swiper.minTranslate(); + const max = swiper.maxTranslate(); + const current = (max - min) * progress + min; + swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed); + swiper.updateActiveIndex(); + swiper.updateSlidesClasses(); + } + + emitContainerClasses() { + const swiper = this; + if (!swiper.params._emitClasses || !swiper.el) return; + const cls = swiper.el.className.split(' ').filter(className => { + return className.indexOf('swiper') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0; + }); + swiper.emit('_containerClasses', cls.join(' ')); + } + + getSlideClasses(slideEl) { + const swiper = this; + return slideEl.className.split(' ').filter(className => { + return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0; + }).join(' '); + } + + emitSlidesClasses() { + const swiper = this; + if (!swiper.params._emitClasses || !swiper.el) return; + const updates = []; + swiper.slides.each(slideEl => { + const classNames = swiper.getSlideClasses(slideEl); + updates.push({ + slideEl, + classNames + }); + swiper.emit('_slideClass', slideEl, classNames); + }); + swiper.emit('_slideClasses', updates); + } + + slidesPerViewDynamic(view = 'current', exact = false) { + const swiper = this; + const { + params, + slides, + slidesGrid, + slidesSizesGrid, + size: swiperSize, + activeIndex + } = swiper; + let spv = 1; + + if (params.centeredSlides) { + let slideSize = slides[activeIndex].swiperSlideSize; + let breakLoop; + + for (let i = activeIndex + 1; i < slides.length; i += 1) { + if (slides[i] && !breakLoop) { + slideSize += slides[i].swiperSlideSize; + spv += 1; + if (slideSize > swiperSize) breakLoop = true; + } + } + + for (let i = activeIndex - 1; i >= 0; i -= 1) { + if (slides[i] && !breakLoop) { + slideSize += slides[i].swiperSlideSize; + spv += 1; + if (slideSize > swiperSize) breakLoop = true; + } + } + } else { + // eslint-disable-next-line + if (view === 'current') { + for (let i = activeIndex + 1; i < slides.length; i += 1) { + const slideInView = exact ? slidesGrid[i] + slidesSizesGrid[i] - slidesGrid[activeIndex] < swiperSize : slidesGrid[i] - slidesGrid[activeIndex] < swiperSize; + + if (slideInView) { + spv += 1; + } + } + } else { + // previous + for (let i = activeIndex - 1; i >= 0; i -= 1) { + const slideInView = slidesGrid[activeIndex] - slidesGrid[i] < swiperSize; + + if (slideInView) { + spv += 1; + } + } + } + } + + return spv; + } + + update() { + const swiper = this; + if (!swiper || swiper.destroyed) return; + const { + snapGrid, + params + } = swiper; // Breakpoints + + if (params.breakpoints) { + swiper.setBreakpoint(); + } + + swiper.updateSize(); + swiper.updateSlides(); + swiper.updateProgress(); + swiper.updateSlidesClasses(); + + function setTranslate() { + const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate; + const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate()); + swiper.setTranslate(newTranslate); + swiper.updateActiveIndex(); + swiper.updateSlidesClasses(); + } + + let translated; + + if (swiper.params.freeMode && swiper.params.freeMode.enabled) { + setTranslate(); + + if (swiper.params.autoHeight) { + swiper.updateAutoHeight(); + } + } else { + if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) { + translated = swiper.slideTo(swiper.slides.length - 1, 0, false, true); + } else { + translated = swiper.slideTo(swiper.activeIndex, 0, false, true); + } + + if (!translated) { + setTranslate(); + } + } + + if (params.watchOverflow && snapGrid !== swiper.snapGrid) { + swiper.checkOverflow(); + } + + swiper.emit('update'); + } + + changeDirection(newDirection, needUpdate = true) { + const swiper = this; + const currentDirection = swiper.params.direction; + + if (!newDirection) { + // eslint-disable-next-line + newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal'; + } + + if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') { + return swiper; + } + + swiper.$el.removeClass(`${swiper.params.containerModifierClass}${currentDirection}`).addClass(`${swiper.params.containerModifierClass}${newDirection}`); + swiper.emitContainerClasses(); + swiper.params.direction = newDirection; + swiper.slides.each(slideEl => { + if (newDirection === 'vertical') { + slideEl.style.width = ''; + } else { + slideEl.style.height = ''; + } + }); + swiper.emit('changeDirection'); + if (needUpdate) swiper.update(); + return swiper; + } + + mount(el) { + const swiper = this; + if (swiper.mounted) return true; // Find el + + const $el = $(el || swiper.params.el); + el = $el[0]; + + if (!el) { + return false; + } + + el.swiper = swiper; + + const getWrapperSelector = () => { + return `.${(swiper.params.wrapperClass || '').trim().split(' ').join('.')}`; + }; + + const getWrapper = () => { + if (el && el.shadowRoot && el.shadowRoot.querySelector) { + const res = $(el.shadowRoot.querySelector(getWrapperSelector())); // Children needs to return slot items + + res.children = options => $el.children(options); + + return res; + } + + return $el.children(getWrapperSelector()); + }; // Find Wrapper + + + let $wrapperEl = getWrapper(); + + if ($wrapperEl.length === 0 && swiper.params.createElements) { + const document = getDocument(); + const wrapper = document.createElement('div'); + $wrapperEl = $(wrapper); + wrapper.className = swiper.params.wrapperClass; + $el.append(wrapper); + $el.children(`.${swiper.params.slideClass}`).each(slideEl => { + $wrapperEl.append(slideEl); + }); + } + + Object.assign(swiper, { + $el, + el, + $wrapperEl, + wrapperEl: $wrapperEl[0], + mounted: true, + // RTL + rtl: el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl', + rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'), + wrongRTL: $wrapperEl.css('display') === '-webkit-box' + }); + return true; + } + + init(el) { + const swiper = this; + if (swiper.initialized) return swiper; + const mounted = swiper.mount(el); + if (mounted === false) return swiper; + swiper.emit('beforeInit'); // Set breakpoint + + if (swiper.params.breakpoints) { + swiper.setBreakpoint(); + } // Add Classes + + + swiper.addClasses(); // Create loop + + if (swiper.params.loop) { + swiper.loopCreate(); + } // Update size + + + swiper.updateSize(); // Update slides + + swiper.updateSlides(); + + if (swiper.params.watchOverflow) { + swiper.checkOverflow(); + } // Set Grab Cursor + + + if (swiper.params.grabCursor && swiper.enabled) { + swiper.setGrabCursor(); + } + + if (swiper.params.preloadImages) { + swiper.preloadImages(); + } // Slide To Initial Slide + + + if (swiper.params.loop) { + swiper.slideTo(swiper.params.initialSlide + swiper.loopedSlides, 0, swiper.params.runCallbacksOnInit, false, true); + } else { + swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true); + } // Attach events + + + swiper.attachEvents(); // Init Flag + + swiper.initialized = true; // Emit + + swiper.emit('init'); + swiper.emit('afterInit'); + return swiper; + } + + destroy(deleteInstance = true, cleanStyles = true) { + const swiper = this; + const { + params, + $el, + $wrapperEl, + slides + } = swiper; + + if (typeof swiper.params === 'undefined' || swiper.destroyed) { + return null; + } + + swiper.emit('beforeDestroy'); // Init Flag + + swiper.initialized = false; // Detach events + + swiper.detachEvents(); // Destroy loop + + if (params.loop) { + swiper.loopDestroy(); + } // Cleanup styles + + + if (cleanStyles) { + swiper.removeClasses(); + $el.removeAttr('style'); + $wrapperEl.removeAttr('style'); + + if (slides && slides.length) { + slides.removeClass([params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass].join(' ')).removeAttr('style').removeAttr('data-swiper-slide-index'); + } + } + + swiper.emit('destroy'); // Detach emitter events + + Object.keys(swiper.eventsListeners).forEach(eventName => { + swiper.off(eventName); + }); + + if (deleteInstance !== false) { + swiper.$el[0].swiper = null; + deleteProps(swiper); + } + + swiper.destroyed = true; + return null; + } + + static extendDefaults(newDefaults) { + extend(extendedDefaults, newDefaults); + } + + static get extendedDefaults() { + return extendedDefaults; + } + + static get defaults() { + return defaults; + } + + static installModule(mod) { + if (!Swiper.prototype.__modules__) Swiper.prototype.__modules__ = []; + const modules = Swiper.prototype.__modules__; + + if (typeof mod === 'function' && modules.indexOf(mod) < 0) { + modules.push(mod); + } + } + + static use(module) { + if (Array.isArray(module)) { + module.forEach(m => Swiper.installModule(m)); + return Swiper; + } + + Swiper.installModule(module); + return Swiper; + } + + } + + Object.keys(prototypes).forEach(prototypeGroup => { + Object.keys(prototypes[prototypeGroup]).forEach(protoMethod => { + Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod]; + }); + }); + Swiper.use([Resize, Observer]); + + function Virtual({ + swiper, + extendParams, + on + }) { + extendParams({ + virtual: { + enabled: false, + slides: [], + cache: true, + renderSlide: null, + renderExternal: null, + renderExternalUpdate: true, + addSlidesBefore: 0, + addSlidesAfter: 0 + } + }); + let cssModeTimeout; + swiper.virtual = { + cache: {}, + from: undefined, + to: undefined, + slides: [], + offset: 0, + slidesGrid: [] + }; + + function renderSlide(slide, index) { + const params = swiper.params.virtual; + + if (params.cache && swiper.virtual.cache[index]) { + return swiper.virtual.cache[index]; + } + + const $slideEl = params.renderSlide ? $(params.renderSlide.call(swiper, slide, index)) : $(`<div class="${swiper.params.slideClass}" data-swiper-slide-index="${index}">${slide}</div>`); + if (!$slideEl.attr('data-swiper-slide-index')) $slideEl.attr('data-swiper-slide-index', index); + if (params.cache) swiper.virtual.cache[index] = $slideEl; + return $slideEl; + } + + function update(force) { + const { + slidesPerView, + slidesPerGroup, + centeredSlides + } = swiper.params; + const { + addSlidesBefore, + addSlidesAfter + } = swiper.params.virtual; + const { + from: previousFrom, + to: previousTo, + slides, + slidesGrid: previousSlidesGrid, + offset: previousOffset + } = swiper.virtual; + + if (!swiper.params.cssMode) { + swiper.updateActiveIndex(); + } + + const activeIndex = swiper.activeIndex || 0; + let offsetProp; + if (swiper.rtlTranslate) offsetProp = 'right';else offsetProp = swiper.isHorizontal() ? 'left' : 'top'; + let slidesAfter; + let slidesBefore; + + if (centeredSlides) { + slidesAfter = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesAfter; + slidesBefore = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesBefore; + } else { + slidesAfter = slidesPerView + (slidesPerGroup - 1) + addSlidesAfter; + slidesBefore = slidesPerGroup + addSlidesBefore; + } + + const from = Math.max((activeIndex || 0) - slidesBefore, 0); + const to = Math.min((activeIndex || 0) + slidesAfter, slides.length - 1); + const offset = (swiper.slidesGrid[from] || 0) - (swiper.slidesGrid[0] || 0); + Object.assign(swiper.virtual, { + from, + to, + offset, + slidesGrid: swiper.slidesGrid + }); + + function onRendered() { + swiper.updateSlides(); + swiper.updateProgress(); + swiper.updateSlidesClasses(); + + if (swiper.lazy && swiper.params.lazy.enabled) { + swiper.lazy.load(); + } + } + + if (previousFrom === from && previousTo === to && !force) { + if (swiper.slidesGrid !== previousSlidesGrid && offset !== previousOffset) { + swiper.slides.css(offsetProp, `${offset}px`); + } + + swiper.updateProgress(); + return; + } + + if (swiper.params.virtual.renderExternal) { + swiper.params.virtual.renderExternal.call(swiper, { + offset, + from, + to, + slides: function getSlides() { + const slidesToRender = []; + + for (let i = from; i <= to; i += 1) { + slidesToRender.push(slides[i]); + } + + return slidesToRender; + }() + }); + + if (swiper.params.virtual.renderExternalUpdate) { + onRendered(); + } + + return; + } + + const prependIndexes = []; + const appendIndexes = []; + + if (force) { + swiper.$wrapperEl.find(`.${swiper.params.slideClass}`).remove(); + } else { + for (let i = previousFrom; i <= previousTo; i += 1) { + if (i < from || i > to) { + swiper.$wrapperEl.find(`.${swiper.params.slideClass}[data-swiper-slide-index="${i}"]`).remove(); + } + } + } + + for (let i = 0; i < slides.length; i += 1) { + if (i >= from && i <= to) { + if (typeof previousTo === 'undefined' || force) { + appendIndexes.push(i); + } else { + if (i > previousTo) appendIndexes.push(i); + if (i < previousFrom) prependIndexes.push(i); + } + } + } + + appendIndexes.forEach(index => { + swiper.$wrapperEl.append(renderSlide(slides[index], index)); + }); + prependIndexes.sort((a, b) => b - a).forEach(index => { + swiper.$wrapperEl.prepend(renderSlide(slides[index], index)); + }); + swiper.$wrapperEl.children('.swiper-slide').css(offsetProp, `${offset}px`); + onRendered(); + } + + function appendSlide(slides) { + if (typeof slides === 'object' && 'length' in slides) { + for (let i = 0; i < slides.length; i += 1) { + if (slides[i]) swiper.virtual.slides.push(slides[i]); + } + } else { + swiper.virtual.slides.push(slides); + } + + update(true); + } + + function prependSlide(slides) { + const activeIndex = swiper.activeIndex; + let newActiveIndex = activeIndex + 1; + let numberOfNewSlides = 1; + + if (Array.isArray(slides)) { + for (let i = 0; i < slides.length; i += 1) { + if (slides[i]) swiper.virtual.slides.unshift(slides[i]); + } + + newActiveIndex = activeIndex + slides.length; + numberOfNewSlides = slides.length; + } else { + swiper.virtual.slides.unshift(slides); + } + + if (swiper.params.virtual.cache) { + const cache = swiper.virtual.cache; + const newCache = {}; + Object.keys(cache).forEach(cachedIndex => { + const $cachedEl = cache[cachedIndex]; + const cachedElIndex = $cachedEl.attr('data-swiper-slide-index'); + + if (cachedElIndex) { + $cachedEl.attr('data-swiper-slide-index', parseInt(cachedElIndex, 10) + numberOfNewSlides); + } + + newCache[parseInt(cachedIndex, 10) + numberOfNewSlides] = $cachedEl; + }); + swiper.virtual.cache = newCache; + } + + update(true); + swiper.slideTo(newActiveIndex, 0); + } + + function removeSlide(slidesIndexes) { + if (typeof slidesIndexes === 'undefined' || slidesIndexes === null) return; + let activeIndex = swiper.activeIndex; + + if (Array.isArray(slidesIndexes)) { + for (let i = slidesIndexes.length - 1; i >= 0; i -= 1) { + swiper.virtual.slides.splice(slidesIndexes[i], 1); + + if (swiper.params.virtual.cache) { + delete swiper.virtual.cache[slidesIndexes[i]]; + } + + if (slidesIndexes[i] < activeIndex) activeIndex -= 1; + activeIndex = Math.max(activeIndex, 0); + } + } else { + swiper.virtual.slides.splice(slidesIndexes, 1); + + if (swiper.params.virtual.cache) { + delete swiper.virtual.cache[slidesIndexes]; + } + + if (slidesIndexes < activeIndex) activeIndex -= 1; + activeIndex = Math.max(activeIndex, 0); + } + + update(true); + swiper.slideTo(activeIndex, 0); + } + + function removeAllSlides() { + swiper.virtual.slides = []; + + if (swiper.params.virtual.cache) { + swiper.virtual.cache = {}; + } + + update(true); + swiper.slideTo(0, 0); + } + + on('beforeInit', () => { + if (!swiper.params.virtual.enabled) return; + swiper.virtual.slides = swiper.params.virtual.slides; + swiper.classNames.push(`${swiper.params.containerModifierClass}virtual`); + swiper.params.watchSlidesProgress = true; + swiper.originalParams.watchSlidesProgress = true; + + if (!swiper.params.initialSlide) { + update(); + } + }); + on('setTranslate', () => { + if (!swiper.params.virtual.enabled) return; + + if (swiper.params.cssMode && !swiper._immediateVirtual) { + clearTimeout(cssModeTimeout); + cssModeTimeout = setTimeout(() => { + update(); + }, 100); + } else { + update(); + } + }); + on('init update resize', () => { + if (!swiper.params.virtual.enabled) return; + + if (swiper.params.cssMode) { + setCSSProperty(swiper.wrapperEl, '--swiper-virtual-size', `${swiper.virtualSize}px`); + } + }); + Object.assign(swiper.virtual, { + appendSlide, + prependSlide, + removeSlide, + removeAllSlides, + update + }); + } + + /* eslint-disable consistent-return */ + function Keyboard({ + swiper, + extendParams, + on, + emit + }) { + const document = getDocument(); + const window = getWindow(); + swiper.keyboard = { + enabled: false + }; + extendParams({ + keyboard: { + enabled: false, + onlyInViewport: true, + pageUpDown: true + } + }); + + function handle(event) { + if (!swiper.enabled) return; + const { + rtlTranslate: rtl + } = swiper; + let e = event; + if (e.originalEvent) e = e.originalEvent; // jquery fix + + const kc = e.keyCode || e.charCode; + const pageUpDown = swiper.params.keyboard.pageUpDown; + const isPageUp = pageUpDown && kc === 33; + const isPageDown = pageUpDown && kc === 34; + const isArrowLeft = kc === 37; + const isArrowRight = kc === 39; + const isArrowUp = kc === 38; + const isArrowDown = kc === 40; // Directions locks + + if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) { + return false; + } + + if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) { + return false; + } + + if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) { + return undefined; + } + + if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) { + return undefined; + } + + if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) { + let inView = false; // Check that swiper should be inside of visible area of window + + if (swiper.$el.parents(`.${swiper.params.slideClass}`).length > 0 && swiper.$el.parents(`.${swiper.params.slideActiveClass}`).length === 0) { + return undefined; + } + + const $el = swiper.$el; + const swiperWidth = $el[0].clientWidth; + const swiperHeight = $el[0].clientHeight; + const windowWidth = window.innerWidth; + const windowHeight = window.innerHeight; + const swiperOffset = swiper.$el.offset(); + if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft; + const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]]; + + for (let i = 0; i < swiperCoord.length; i += 1) { + const point = swiperCoord[i]; + + if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) { + if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line + + inView = true; + } + } + + if (!inView) return undefined; + } + + if (swiper.isHorizontal()) { + if (isPageUp || isPageDown || isArrowLeft || isArrowRight) { + if (e.preventDefault) e.preventDefault();else e.returnValue = false; + } + + if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext(); + if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev(); + } else { + if (isPageUp || isPageDown || isArrowUp || isArrowDown) { + if (e.preventDefault) e.preventDefault();else e.returnValue = false; + } + + if (isPageDown || isArrowDown) swiper.slideNext(); + if (isPageUp || isArrowUp) swiper.slidePrev(); + } + + emit('keyPress', kc); + return undefined; + } + + function enable() { + if (swiper.keyboard.enabled) return; + $(document).on('keydown', handle); + swiper.keyboard.enabled = true; + } + + function disable() { + if (!swiper.keyboard.enabled) return; + $(document).off('keydown', handle); + swiper.keyboard.enabled = false; + } + + on('init', () => { + if (swiper.params.keyboard.enabled) { + enable(); + } + }); + on('destroy', () => { + if (swiper.keyboard.enabled) { + disable(); + } + }); + Object.assign(swiper.keyboard, { + enable, + disable + }); + } + + /* eslint-disable consistent-return */ + function Mousewheel({ + swiper, + extendParams, + on, + emit + }) { + const window = getWindow(); + extendParams({ + mousewheel: { + enabled: false, + releaseOnEdges: false, + invert: false, + forceToAxis: false, + sensitivity: 1, + eventsTarget: 'container', + thresholdDelta: null, + thresholdTime: null + } + }); + swiper.mousewheel = { + enabled: false + }; + let timeout; + let lastScrollTime = now(); + let lastEventBeforeSnap; + const recentWheelEvents = []; + + function normalize(e) { + // Reasonable defaults + const PIXEL_STEP = 10; + const LINE_HEIGHT = 40; + const PAGE_HEIGHT = 800; + let sX = 0; + let sY = 0; // spinX, spinY + + let pX = 0; + let pY = 0; // pixelX, pixelY + // Legacy + + if ('detail' in e) { + sY = e.detail; + } + + if ('wheelDelta' in e) { + sY = -e.wheelDelta / 120; + } + + if ('wheelDeltaY' in e) { + sY = -e.wheelDeltaY / 120; + } + + if ('wheelDeltaX' in e) { + sX = -e.wheelDeltaX / 120; + } // side scrolling on FF with DOMMouseScroll + + + if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) { + sX = sY; + sY = 0; + } + + pX = sX * PIXEL_STEP; + pY = sY * PIXEL_STEP; + + if ('deltaY' in e) { + pY = e.deltaY; + } + + if ('deltaX' in e) { + pX = e.deltaX; + } + + if (e.shiftKey && !pX) { + // if user scrolls with shift he wants horizontal scroll + pX = pY; + pY = 0; + } + + if ((pX || pY) && e.deltaMode) { + if (e.deltaMode === 1) { + // delta in LINE units + pX *= LINE_HEIGHT; + pY *= LINE_HEIGHT; + } else { + // delta in PAGE units + pX *= PAGE_HEIGHT; + pY *= PAGE_HEIGHT; + } + } // Fall-back if spin cannot be determined + + + if (pX && !sX) { + sX = pX < 1 ? -1 : 1; + } + + if (pY && !sY) { + sY = pY < 1 ? -1 : 1; + } + + return { + spinX: sX, + spinY: sY, + pixelX: pX, + pixelY: pY + }; + } + + function handleMouseEnter() { + if (!swiper.enabled) return; + swiper.mouseEntered = true; + } + + function handleMouseLeave() { + if (!swiper.enabled) return; + swiper.mouseEntered = false; + } + + function animateSlider(newEvent) { + if (swiper.params.mousewheel.thresholdDelta && newEvent.delta < swiper.params.mousewheel.thresholdDelta) { + // Prevent if delta of wheel scroll delta is below configured threshold + return false; + } + + if (swiper.params.mousewheel.thresholdTime && now() - lastScrollTime < swiper.params.mousewheel.thresholdTime) { + // Prevent if time between scrolls is below configured threshold + return false; + } // If the movement is NOT big enough and + // if the last time the user scrolled was too close to the current one (avoid continuously triggering the slider): + // Don't go any further (avoid insignificant scroll movement). + + + if (newEvent.delta >= 6 && now() - lastScrollTime < 60) { + // Return false as a default + return true; + } // If user is scrolling towards the end: + // If the slider hasn't hit the latest slide or + // if the slider is a loop and + // if the slider isn't moving right now: + // Go to next slide and + // emit a scroll event. + // Else (the user is scrolling towards the beginning) and + // if the slider hasn't hit the first slide or + // if the slider is a loop and + // if the slider isn't moving right now: + // Go to prev slide and + // emit a scroll event. + + + if (newEvent.direction < 0) { + if ((!swiper.isEnd || swiper.params.loop) && !swiper.animating) { + swiper.slideNext(); + emit('scroll', newEvent.raw); + } + } else if ((!swiper.isBeginning || swiper.params.loop) && !swiper.animating) { + swiper.slidePrev(); + emit('scroll', newEvent.raw); + } // If you got here is because an animation has been triggered so store the current time + + + lastScrollTime = new window.Date().getTime(); // Return false as a default + + return false; + } + + function releaseScroll(newEvent) { + const params = swiper.params.mousewheel; + + if (newEvent.direction < 0) { + if (swiper.isEnd && !swiper.params.loop && params.releaseOnEdges) { + // Return true to animate scroll on edges + return true; + } + } else if (swiper.isBeginning && !swiper.params.loop && params.releaseOnEdges) { + // Return true to animate scroll on edges + return true; + } + + return false; + } + + function handle(event) { + let e = event; + let disableParentSwiper = true; + if (!swiper.enabled) return; + const params = swiper.params.mousewheel; + + if (swiper.params.cssMode) { + e.preventDefault(); + } + + let target = swiper.$el; + + if (swiper.params.mousewheel.eventsTarget !== 'container') { + target = $(swiper.params.mousewheel.eventsTarget); + } + + if (!swiper.mouseEntered && !target[0].contains(e.target) && !params.releaseOnEdges) return true; + if (e.originalEvent) e = e.originalEvent; // jquery fix + + let delta = 0; + const rtlFactor = swiper.rtlTranslate ? -1 : 1; + const data = normalize(e); + + if (params.forceToAxis) { + if (swiper.isHorizontal()) { + if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = -data.pixelX * rtlFactor;else return true; + } else if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = -data.pixelY;else return true; + } else { + delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? -data.pixelX * rtlFactor : -data.pixelY; + } + + if (delta === 0) return true; + if (params.invert) delta = -delta; // Get the scroll positions + + let positions = swiper.getTranslate() + delta * params.sensitivity; + if (positions >= swiper.minTranslate()) positions = swiper.minTranslate(); + if (positions <= swiper.maxTranslate()) positions = swiper.maxTranslate(); // When loop is true: + // the disableParentSwiper will be true. + // When loop is false: + // if the scroll positions is not on edge, + // then the disableParentSwiper will be true. + // if the scroll on edge positions, + // then the disableParentSwiper will be false. + + disableParentSwiper = swiper.params.loop ? true : !(positions === swiper.minTranslate() || positions === swiper.maxTranslate()); + if (disableParentSwiper && swiper.params.nested) e.stopPropagation(); + + if (!swiper.params.freeMode || !swiper.params.freeMode.enabled) { + // Register the new event in a variable which stores the relevant data + const newEvent = { + time: now(), + delta: Math.abs(delta), + direction: Math.sign(delta), + raw: event + }; // Keep the most recent events + + if (recentWheelEvents.length >= 2) { + recentWheelEvents.shift(); // only store the last N events + } + + const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined; + recentWheelEvents.push(newEvent); // If there is at least one previous recorded event: + // If direction has changed or + // if the scroll is quicker than the previous one: + // Animate the slider. + // Else (this is the first time the wheel is moved): + // Animate the slider. + + if (prevEvent) { + if (newEvent.direction !== prevEvent.direction || newEvent.delta > prevEvent.delta || newEvent.time > prevEvent.time + 150) { + animateSlider(newEvent); + } + } else { + animateSlider(newEvent); + } // If it's time to release the scroll: + // Return now so you don't hit the preventDefault. + + + if (releaseScroll(newEvent)) { + return true; + } + } else { + // Freemode or scrollContainer: + // If we recently snapped after a momentum scroll, then ignore wheel events + // to give time for the deceleration to finish. Stop ignoring after 500 msecs + // or if it's a new scroll (larger delta or inverse sign as last event before + // an end-of-momentum snap). + const newEvent = { + time: now(), + delta: Math.abs(delta), + direction: Math.sign(delta) + }; + const ignoreWheelEvents = lastEventBeforeSnap && newEvent.time < lastEventBeforeSnap.time + 500 && newEvent.delta <= lastEventBeforeSnap.delta && newEvent.direction === lastEventBeforeSnap.direction; + + if (!ignoreWheelEvents) { + lastEventBeforeSnap = undefined; + + if (swiper.params.loop) { + swiper.loopFix(); + } + + let position = swiper.getTranslate() + delta * params.sensitivity; + const wasBeginning = swiper.isBeginning; + const wasEnd = swiper.isEnd; + if (position >= swiper.minTranslate()) position = swiper.minTranslate(); + if (position <= swiper.maxTranslate()) position = swiper.maxTranslate(); + swiper.setTransition(0); + swiper.setTranslate(position); + swiper.updateProgress(); + swiper.updateActiveIndex(); + swiper.updateSlidesClasses(); + + if (!wasBeginning && swiper.isBeginning || !wasEnd && swiper.isEnd) { + swiper.updateSlidesClasses(); + } + + if (swiper.params.freeMode.sticky) { + // When wheel scrolling starts with sticky (aka snap) enabled, then detect + // the end of a momentum scroll by storing recent (N=15?) wheel events. + // 1. do all N events have decreasing or same (absolute value) delta? + // 2. did all N events arrive in the last M (M=500?) msecs? + // 3. does the earliest event have an (absolute value) delta that's + // at least P (P=1?) larger than the most recent event's delta? + // 4. does the latest event have a delta that's smaller than Q (Q=6?) pixels? + // If 1-4 are "yes" then we're near the end of a momentum scroll deceleration. + // Snap immediately and ignore remaining wheel events in this scroll. + // See comment above for "remaining wheel events in this scroll" determination. + // If 1-4 aren't satisfied, then wait to snap until 500ms after the last event. + clearTimeout(timeout); + timeout = undefined; + + if (recentWheelEvents.length >= 15) { + recentWheelEvents.shift(); // only store the last N events + } + + const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined; + const firstEvent = recentWheelEvents[0]; + recentWheelEvents.push(newEvent); + + if (prevEvent && (newEvent.delta > prevEvent.delta || newEvent.direction !== prevEvent.direction)) { + // Increasing or reverse-sign delta means the user started scrolling again. Clear the wheel event log. + recentWheelEvents.splice(0); + } else if (recentWheelEvents.length >= 15 && newEvent.time - firstEvent.time < 500 && firstEvent.delta - newEvent.delta >= 1 && newEvent.delta <= 6) { + // We're at the end of the deceleration of a momentum scroll, so there's no need + // to wait for more events. Snap ASAP on the next tick. + // Also, because there's some remaining momentum we'll bias the snap in the + // direction of the ongoing scroll because it's better UX for the scroll to snap + // in the same direction as the scroll instead of reversing to snap. Therefore, + // if it's already scrolled more than 20% in the current direction, keep going. + const snapToThreshold = delta > 0 ? 0.8 : 0.2; + lastEventBeforeSnap = newEvent; + recentWheelEvents.splice(0); + timeout = nextTick(() => { + swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold); + }, 0); // no delay; move on next tick + } + + if (!timeout) { + // if we get here, then we haven't detected the end of a momentum scroll, so + // we'll consider a scroll "complete" when there haven't been any wheel events + // for 500ms. + timeout = nextTick(() => { + const snapToThreshold = 0.5; + lastEventBeforeSnap = newEvent; + recentWheelEvents.splice(0); + swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold); + }, 500); + } + } // Emit event + + + if (!ignoreWheelEvents) emit('scroll', e); // Stop autoplay + + if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.autoplay.stop(); // Return page scroll on edge positions + + if (position === swiper.minTranslate() || position === swiper.maxTranslate()) return true; + } + } + + if (e.preventDefault) e.preventDefault();else e.returnValue = false; + return false; + } + + function events(method) { + let target = swiper.$el; + + if (swiper.params.mousewheel.eventsTarget !== 'container') { + target = $(swiper.params.mousewheel.eventsTarget); + } + + target[method]('mouseenter', handleMouseEnter); + target[method]('mouseleave', handleMouseLeave); + target[method]('wheel', handle); + } + + function enable() { + if (swiper.params.cssMode) { + swiper.wrapperEl.removeEventListener('wheel', handle); + return true; + } + + if (swiper.mousewheel.enabled) return false; + events('on'); + swiper.mousewheel.enabled = true; + return true; + } + + function disable() { + if (swiper.params.cssMode) { + swiper.wrapperEl.addEventListener(event, handle); + return true; + } + + if (!swiper.mousewheel.enabled) return false; + events('off'); + swiper.mousewheel.enabled = false; + return true; + } + + on('init', () => { + if (!swiper.params.mousewheel.enabled && swiper.params.cssMode) { + disable(); + } + + if (swiper.params.mousewheel.enabled) enable(); + }); + on('destroy', () => { + if (swiper.params.cssMode) { + enable(); + } + + if (swiper.mousewheel.enabled) disable(); + }); + Object.assign(swiper.mousewheel, { + enable, + disable + }); + } + + function createElementIfNotDefined(swiper, originalParams, params, checkProps) { + const document = getDocument(); + + if (swiper.params.createElements) { + Object.keys(checkProps).forEach(key => { + if (!params[key] && params.auto === true) { + let element = swiper.$el.children(`.${checkProps[key]}`)[0]; + + if (!element) { + element = document.createElement('div'); + element.className = checkProps[key]; + swiper.$el.append(element); + } + + params[key] = element; + originalParams[key] = element; + } + }); + } + + return params; + } + + function Navigation({ + swiper, + extendParams, + on, + emit + }) { + extendParams({ + navigation: { + nextEl: null, + prevEl: null, + hideOnClick: false, + disabledClass: 'swiper-button-disabled', + hiddenClass: 'swiper-button-hidden', + lockClass: 'swiper-button-lock' + } + }); + swiper.navigation = { + nextEl: null, + $nextEl: null, + prevEl: null, + $prevEl: null + }; + + function getEl(el) { + let $el; + + if (el) { + $el = $(el); + + if (swiper.params.uniqueNavElements && typeof el === 'string' && $el.length > 1 && swiper.$el.find(el).length === 1) { + $el = swiper.$el.find(el); + } + } + + return $el; + } + + function toggleEl($el, disabled) { + const params = swiper.params.navigation; + + if ($el && $el.length > 0) { + $el[disabled ? 'addClass' : 'removeClass'](params.disabledClass); + if ($el[0] && $el[0].tagName === 'BUTTON') $el[0].disabled = disabled; + + if (swiper.params.watchOverflow && swiper.enabled) { + $el[swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass); + } + } + } + + function update() { + // Update Navigation Buttons + if (swiper.params.loop) return; + const { + $nextEl, + $prevEl + } = swiper.navigation; + toggleEl($prevEl, swiper.isBeginning && !swiper.params.rewind); + toggleEl($nextEl, swiper.isEnd && !swiper.params.rewind); + } + + function onPrevClick(e) { + e.preventDefault(); + if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return; + swiper.slidePrev(); + } + + function onNextClick(e) { + e.preventDefault(); + if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return; + swiper.slideNext(); + } + + function init() { + const params = swiper.params.navigation; + swiper.params.navigation = createElementIfNotDefined(swiper, swiper.originalParams.navigation, swiper.params.navigation, { + nextEl: 'swiper-button-next', + prevEl: 'swiper-button-prev' + }); + if (!(params.nextEl || params.prevEl)) return; + const $nextEl = getEl(params.nextEl); + const $prevEl = getEl(params.prevEl); + + if ($nextEl && $nextEl.length > 0) { + $nextEl.on('click', onNextClick); + } + + if ($prevEl && $prevEl.length > 0) { + $prevEl.on('click', onPrevClick); + } + + Object.assign(swiper.navigation, { + $nextEl, + nextEl: $nextEl && $nextEl[0], + $prevEl, + prevEl: $prevEl && $prevEl[0] + }); + + if (!swiper.enabled) { + if ($nextEl) $nextEl.addClass(params.lockClass); + if ($prevEl) $prevEl.addClass(params.lockClass); + } + } + + function destroy() { + const { + $nextEl, + $prevEl + } = swiper.navigation; + + if ($nextEl && $nextEl.length) { + $nextEl.off('click', onNextClick); + $nextEl.removeClass(swiper.params.navigation.disabledClass); + } + + if ($prevEl && $prevEl.length) { + $prevEl.off('click', onPrevClick); + $prevEl.removeClass(swiper.params.navigation.disabledClass); + } + } + + on('init', () => { + init(); + update(); + }); + on('toEdge fromEdge lock unlock', () => { + update(); + }); + on('destroy', () => { + destroy(); + }); + on('enable disable', () => { + const { + $nextEl, + $prevEl + } = swiper.navigation; + + if ($nextEl) { + $nextEl[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.navigation.lockClass); + } + + if ($prevEl) { + $prevEl[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.navigation.lockClass); + } + }); + on('click', (_s, e) => { + const { + $nextEl, + $prevEl + } = swiper.navigation; + const targetEl = e.target; + + if (swiper.params.navigation.hideOnClick && !$(targetEl).is($prevEl) && !$(targetEl).is($nextEl)) { + if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return; + let isHidden; + + if ($nextEl) { + isHidden = $nextEl.hasClass(swiper.params.navigation.hiddenClass); + } else if ($prevEl) { + isHidden = $prevEl.hasClass(swiper.params.navigation.hiddenClass); + } + + if (isHidden === true) { + emit('navigationShow'); + } else { + emit('navigationHide'); + } + + if ($nextEl) { + $nextEl.toggleClass(swiper.params.navigation.hiddenClass); + } + + if ($prevEl) { + $prevEl.toggleClass(swiper.params.navigation.hiddenClass); + } + } + }); + Object.assign(swiper.navigation, { + update, + init, + destroy + }); + } + + function classesToSelector(classes = '') { + return `.${classes.trim().replace(/([\.:!\/])/g, '\\$1') // eslint-disable-line + .replace(/ /g, '.')}`; + } + + function Pagination({ + swiper, + extendParams, + on, + emit + }) { + const pfx = 'swiper-pagination'; + extendParams({ + pagination: { + el: null, + bulletElement: 'span', + clickable: false, + hideOnClick: false, + renderBullet: null, + renderProgressbar: null, + renderFraction: null, + renderCustom: null, + progressbarOpposite: false, + type: 'bullets', + // 'bullets' or 'progressbar' or 'fraction' or 'custom' + dynamicBullets: false, + dynamicMainBullets: 1, + formatFractionCurrent: number => number, + formatFractionTotal: number => number, + bulletClass: `${pfx}-bullet`, + bulletActiveClass: `${pfx}-bullet-active`, + modifierClass: `${pfx}-`, + currentClass: `${pfx}-current`, + totalClass: `${pfx}-total`, + hiddenClass: `${pfx}-hidden`, + progressbarFillClass: `${pfx}-progressbar-fill`, + progressbarOppositeClass: `${pfx}-progressbar-opposite`, + clickableClass: `${pfx}-clickable`, + lockClass: `${pfx}-lock`, + horizontalClass: `${pfx}-horizontal`, + verticalClass: `${pfx}-vertical` + } + }); + swiper.pagination = { + el: null, + $el: null, + bullets: [] + }; + let bulletSize; + let dynamicBulletIndex = 0; + + function isPaginationDisabled() { + return !swiper.params.pagination.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0; + } + + function setSideBullets($bulletEl, position) { + const { + bulletActiveClass + } = swiper.params.pagination; + $bulletEl[position]().addClass(`${bulletActiveClass}-${position}`)[position]().addClass(`${bulletActiveClass}-${position}-${position}`); + } + + function update() { + // Render || Update Pagination bullets/items + const rtl = swiper.rtl; + const params = swiper.params.pagination; + if (isPaginationDisabled()) return; + const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length; + const $el = swiper.pagination.$el; // Current/Total + + let current; + const total = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length; + + if (swiper.params.loop) { + current = Math.ceil((swiper.activeIndex - swiper.loopedSlides) / swiper.params.slidesPerGroup); + + if (current > slidesLength - 1 - swiper.loopedSlides * 2) { + current -= slidesLength - swiper.loopedSlides * 2; + } + + if (current > total - 1) current -= total; + if (current < 0 && swiper.params.paginationType !== 'bullets') current = total + current; + } else if (typeof swiper.snapIndex !== 'undefined') { + current = swiper.snapIndex; + } else { + current = swiper.activeIndex || 0; + } // Types + + + if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) { + const bullets = swiper.pagination.bullets; + let firstIndex; + let lastIndex; + let midIndex; + + if (params.dynamicBullets) { + bulletSize = bullets.eq(0)[swiper.isHorizontal() ? 'outerWidth' : 'outerHeight'](true); + $el.css(swiper.isHorizontal() ? 'width' : 'height', `${bulletSize * (params.dynamicMainBullets + 4)}px`); + + if (params.dynamicMainBullets > 1 && swiper.previousIndex !== undefined) { + dynamicBulletIndex += current - (swiper.previousIndex - swiper.loopedSlides || 0); + + if (dynamicBulletIndex > params.dynamicMainBullets - 1) { + dynamicBulletIndex = params.dynamicMainBullets - 1; + } else if (dynamicBulletIndex < 0) { + dynamicBulletIndex = 0; + } + } + + firstIndex = Math.max(current - dynamicBulletIndex, 0); + lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1); + midIndex = (lastIndex + firstIndex) / 2; + } + + bullets.removeClass(['', '-next', '-next-next', '-prev', '-prev-prev', '-main'].map(suffix => `${params.bulletActiveClass}${suffix}`).join(' ')); + + if ($el.length > 1) { + bullets.each(bullet => { + const $bullet = $(bullet); + const bulletIndex = $bullet.index(); + + if (bulletIndex === current) { + $bullet.addClass(params.bulletActiveClass); + } + + if (params.dynamicBullets) { + if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) { + $bullet.addClass(`${params.bulletActiveClass}-main`); + } + + if (bulletIndex === firstIndex) { + setSideBullets($bullet, 'prev'); + } + + if (bulletIndex === lastIndex) { + setSideBullets($bullet, 'next'); + } + } + }); + } else { + const $bullet = bullets.eq(current); + const bulletIndex = $bullet.index(); + $bullet.addClass(params.bulletActiveClass); + + if (params.dynamicBullets) { + const $firstDisplayedBullet = bullets.eq(firstIndex); + const $lastDisplayedBullet = bullets.eq(lastIndex); + + for (let i = firstIndex; i <= lastIndex; i += 1) { + bullets.eq(i).addClass(`${params.bulletActiveClass}-main`); + } + + if (swiper.params.loop) { + if (bulletIndex >= bullets.length) { + for (let i = params.dynamicMainBullets; i >= 0; i -= 1) { + bullets.eq(bullets.length - i).addClass(`${params.bulletActiveClass}-main`); + } + + bullets.eq(bullets.length - params.dynamicMainBullets - 1).addClass(`${params.bulletActiveClass}-prev`); + } else { + setSideBullets($firstDisplayedBullet, 'prev'); + setSideBullets($lastDisplayedBullet, 'next'); + } + } else { + setSideBullets($firstDisplayedBullet, 'prev'); + setSideBullets($lastDisplayedBullet, 'next'); + } + } + } + + if (params.dynamicBullets) { + const dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4); + const bulletsOffset = (bulletSize * dynamicBulletsLength - bulletSize) / 2 - midIndex * bulletSize; + const offsetProp = rtl ? 'right' : 'left'; + bullets.css(swiper.isHorizontal() ? offsetProp : 'top', `${bulletsOffset}px`); + } + } + + if (params.type === 'fraction') { + $el.find(classesToSelector(params.currentClass)).text(params.formatFractionCurrent(current + 1)); + $el.find(classesToSelector(params.totalClass)).text(params.formatFractionTotal(total)); + } + + if (params.type === 'progressbar') { + let progressbarDirection; + + if (params.progressbarOpposite) { + progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal'; + } else { + progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical'; + } + + const scale = (current + 1) / total; + let scaleX = 1; + let scaleY = 1; + + if (progressbarDirection === 'horizontal') { + scaleX = scale; + } else { + scaleY = scale; + } + + $el.find(classesToSelector(params.progressbarFillClass)).transform(`translate3d(0,0,0) scaleX(${scaleX}) scaleY(${scaleY})`).transition(swiper.params.speed); + } + + if (params.type === 'custom' && params.renderCustom) { + $el.html(params.renderCustom(swiper, current + 1, total)); + emit('paginationRender', $el[0]); + } else { + emit('paginationUpdate', $el[0]); + } + + if (swiper.params.watchOverflow && swiper.enabled) { + $el[swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass); + } + } + + function render() { + // Render Container + const params = swiper.params.pagination; + if (isPaginationDisabled()) return; + const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length; + const $el = swiper.pagination.$el; + let paginationHTML = ''; + + if (params.type === 'bullets') { + let numberOfBullets = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length; + + if (swiper.params.freeMode && swiper.params.freeMode.enabled && !swiper.params.loop && numberOfBullets > slidesLength) { + numberOfBullets = slidesLength; + } + + for (let i = 0; i < numberOfBullets; i += 1) { + if (params.renderBullet) { + paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass); + } else { + paginationHTML += `<${params.bulletElement} class="${params.bulletClass}"></${params.bulletElement}>`; + } + } + + $el.html(paginationHTML); + swiper.pagination.bullets = $el.find(classesToSelector(params.bulletClass)); + } + + if (params.type === 'fraction') { + if (params.renderFraction) { + paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass); + } else { + paginationHTML = `<span class="${params.currentClass}"></span>` + ' / ' + `<span class="${params.totalClass}"></span>`; + } + + $el.html(paginationHTML); + } + + if (params.type === 'progressbar') { + if (params.renderProgressbar) { + paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass); + } else { + paginationHTML = `<span class="${params.progressbarFillClass}"></span>`; + } + + $el.html(paginationHTML); + } + + if (params.type !== 'custom') { + emit('paginationRender', swiper.pagination.$el[0]); + } + } + + function init() { + swiper.params.pagination = createElementIfNotDefined(swiper, swiper.originalParams.pagination, swiper.params.pagination, { + el: 'swiper-pagination' + }); + const params = swiper.params.pagination; + if (!params.el) return; + let $el = $(params.el); + if ($el.length === 0) return; + + if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1) { + $el = swiper.$el.find(params.el); // check if it belongs to another nested Swiper + + if ($el.length > 1) { + $el = $el.filter(el => { + if ($(el).parents('.swiper')[0] !== swiper.el) return false; + return true; + }); + } + } + + if (params.type === 'bullets' && params.clickable) { + $el.addClass(params.clickableClass); + } + + $el.addClass(params.modifierClass + params.type); + $el.addClass(params.modifierClass + swiper.params.direction); + + if (params.type === 'bullets' && params.dynamicBullets) { + $el.addClass(`${params.modifierClass}${params.type}-dynamic`); + dynamicBulletIndex = 0; + + if (params.dynamicMainBullets < 1) { + params.dynamicMainBullets = 1; + } + } + + if (params.type === 'progressbar' && params.progressbarOpposite) { + $el.addClass(params.progressbarOppositeClass); + } + + if (params.clickable) { + $el.on('click', classesToSelector(params.bulletClass), function onClick(e) { + e.preventDefault(); + let index = $(this).index() * swiper.params.slidesPerGroup; + if (swiper.params.loop) index += swiper.loopedSlides; + swiper.slideTo(index); + }); + } + + Object.assign(swiper.pagination, { + $el, + el: $el[0] + }); + + if (!swiper.enabled) { + $el.addClass(params.lockClass); + } + } + + function destroy() { + const params = swiper.params.pagination; + if (isPaginationDisabled()) return; + const $el = swiper.pagination.$el; + $el.removeClass(params.hiddenClass); + $el.removeClass(params.modifierClass + params.type); + $el.removeClass(params.modifierClass + swiper.params.direction); + if (swiper.pagination.bullets && swiper.pagination.bullets.removeClass) swiper.pagination.bullets.removeClass(params.bulletActiveClass); + + if (params.clickable) { + $el.off('click', classesToSelector(params.bulletClass)); + } + } + + on('init', () => { + init(); + render(); + update(); + }); + on('activeIndexChange', () => { + if (swiper.params.loop) { + update(); + } else if (typeof swiper.snapIndex === 'undefined') { + update(); + } + }); + on('snapIndexChange', () => { + if (!swiper.params.loop) { + update(); + } + }); + on('slidesLengthChange', () => { + if (swiper.params.loop) { + render(); + update(); + } + }); + on('snapGridLengthChange', () => { + if (!swiper.params.loop) { + render(); + update(); + } + }); + on('destroy', () => { + destroy(); + }); + on('enable disable', () => { + const { + $el + } = swiper.pagination; + + if ($el) { + $el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.pagination.lockClass); + } + }); + on('lock unlock', () => { + update(); + }); + on('click', (_s, e) => { + const targetEl = e.target; + const { + $el + } = swiper.pagination; + + if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && $el.length > 0 && !$(targetEl).hasClass(swiper.params.pagination.bulletClass)) { + if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return; + const isHidden = $el.hasClass(swiper.params.pagination.hiddenClass); + + if (isHidden === true) { + emit('paginationShow'); + } else { + emit('paginationHide'); + } + + $el.toggleClass(swiper.params.pagination.hiddenClass); + } + }); + Object.assign(swiper.pagination, { + render, + update, + init, + destroy + }); + } + + function Scrollbar({ + swiper, + extendParams, + on, + emit + }) { + const document = getDocument(); + let isTouched = false; + let timeout = null; + let dragTimeout = null; + let dragStartPos; + let dragSize; + let trackSize; + let divider; + extendParams({ + scrollbar: { + el: null, + dragSize: 'auto', + hide: false, + draggable: false, + snapOnRelease: true, + lockClass: 'swiper-scrollbar-lock', + dragClass: 'swiper-scrollbar-drag' + } + }); + swiper.scrollbar = { + el: null, + dragEl: null, + $el: null, + $dragEl: null + }; + + function setTranslate() { + if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; + const { + scrollbar, + rtlTranslate: rtl, + progress + } = swiper; + const { + $dragEl, + $el + } = scrollbar; + const params = swiper.params.scrollbar; + let newSize = dragSize; + let newPos = (trackSize - dragSize) * progress; + + if (rtl) { + newPos = -newPos; + + if (newPos > 0) { + newSize = dragSize - newPos; + newPos = 0; + } else if (-newPos + dragSize > trackSize) { + newSize = trackSize + newPos; + } + } else if (newPos < 0) { + newSize = dragSize + newPos; + newPos = 0; + } else if (newPos + dragSize > trackSize) { + newSize = trackSize - newPos; + } + + if (swiper.isHorizontal()) { + $dragEl.transform(`translate3d(${newPos}px, 0, 0)`); + $dragEl[0].style.width = `${newSize}px`; + } else { + $dragEl.transform(`translate3d(0px, ${newPos}px, 0)`); + $dragEl[0].style.height = `${newSize}px`; + } + + if (params.hide) { + clearTimeout(timeout); + $el[0].style.opacity = 1; + timeout = setTimeout(() => { + $el[0].style.opacity = 0; + $el.transition(400); + }, 1000); + } + } + + function setTransition(duration) { + if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; + swiper.scrollbar.$dragEl.transition(duration); + } + + function updateSize() { + if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; + const { + scrollbar + } = swiper; + const { + $dragEl, + $el + } = scrollbar; + $dragEl[0].style.width = ''; + $dragEl[0].style.height = ''; + trackSize = swiper.isHorizontal() ? $el[0].offsetWidth : $el[0].offsetHeight; + divider = swiper.size / (swiper.virtualSize + swiper.params.slidesOffsetBefore - (swiper.params.centeredSlides ? swiper.snapGrid[0] : 0)); + + if (swiper.params.scrollbar.dragSize === 'auto') { + dragSize = trackSize * divider; + } else { + dragSize = parseInt(swiper.params.scrollbar.dragSize, 10); + } + + if (swiper.isHorizontal()) { + $dragEl[0].style.width = `${dragSize}px`; + } else { + $dragEl[0].style.height = `${dragSize}px`; + } + + if (divider >= 1) { + $el[0].style.display = 'none'; + } else { + $el[0].style.display = ''; + } + + if (swiper.params.scrollbar.hide) { + $el[0].style.opacity = 0; + } + + if (swiper.params.watchOverflow && swiper.enabled) { + scrollbar.$el[swiper.isLocked ? 'addClass' : 'removeClass'](swiper.params.scrollbar.lockClass); + } + } + + function getPointerPosition(e) { + if (swiper.isHorizontal()) { + return e.type === 'touchstart' || e.type === 'touchmove' ? e.targetTouches[0].clientX : e.clientX; + } + + return e.type === 'touchstart' || e.type === 'touchmove' ? e.targetTouches[0].clientY : e.clientY; + } + + function setDragPosition(e) { + const { + scrollbar, + rtlTranslate: rtl + } = swiper; + const { + $el + } = scrollbar; + let positionRatio; + positionRatio = (getPointerPosition(e) - $el.offset()[swiper.isHorizontal() ? 'left' : 'top'] - (dragStartPos !== null ? dragStartPos : dragSize / 2)) / (trackSize - dragSize); + positionRatio = Math.max(Math.min(positionRatio, 1), 0); + + if (rtl) { + positionRatio = 1 - positionRatio; + } + + const position = swiper.minTranslate() + (swiper.maxTranslate() - swiper.minTranslate()) * positionRatio; + swiper.updateProgress(position); + swiper.setTranslate(position); + swiper.updateActiveIndex(); + swiper.updateSlidesClasses(); + } + + function onDragStart(e) { + const params = swiper.params.scrollbar; + const { + scrollbar, + $wrapperEl + } = swiper; + const { + $el, + $dragEl + } = scrollbar; + isTouched = true; + dragStartPos = e.target === $dragEl[0] || e.target === $dragEl ? getPointerPosition(e) - e.target.getBoundingClientRect()[swiper.isHorizontal() ? 'left' : 'top'] : null; + e.preventDefault(); + e.stopPropagation(); + $wrapperEl.transition(100); + $dragEl.transition(100); + setDragPosition(e); + clearTimeout(dragTimeout); + $el.transition(0); + + if (params.hide) { + $el.css('opacity', 1); + } + + if (swiper.params.cssMode) { + swiper.$wrapperEl.css('scroll-snap-type', 'none'); + } + + emit('scrollbarDragStart', e); + } + + function onDragMove(e) { + const { + scrollbar, + $wrapperEl + } = swiper; + const { + $el, + $dragEl + } = scrollbar; + if (!isTouched) return; + if (e.preventDefault) e.preventDefault();else e.returnValue = false; + setDragPosition(e); + $wrapperEl.transition(0); + $el.transition(0); + $dragEl.transition(0); + emit('scrollbarDragMove', e); + } + + function onDragEnd(e) { + const params = swiper.params.scrollbar; + const { + scrollbar, + $wrapperEl + } = swiper; + const { + $el + } = scrollbar; + if (!isTouched) return; + isTouched = false; + + if (swiper.params.cssMode) { + swiper.$wrapperEl.css('scroll-snap-type', ''); + $wrapperEl.transition(''); + } + + if (params.hide) { + clearTimeout(dragTimeout); + dragTimeout = nextTick(() => { + $el.css('opacity', 0); + $el.transition(400); + }, 1000); + } + + emit('scrollbarDragEnd', e); + + if (params.snapOnRelease) { + swiper.slideToClosest(); + } + } + + function events(method) { + const { + scrollbar, + touchEventsTouch, + touchEventsDesktop, + params, + support + } = swiper; + const $el = scrollbar.$el; + const target = $el[0]; + const activeListener = support.passiveListener && params.passiveListeners ? { + passive: false, + capture: false + } : false; + const passiveListener = support.passiveListener && params.passiveListeners ? { + passive: true, + capture: false + } : false; + if (!target) return; + const eventMethod = method === 'on' ? 'addEventListener' : 'removeEventListener'; + + if (!support.touch) { + target[eventMethod](touchEventsDesktop.start, onDragStart, activeListener); + document[eventMethod](touchEventsDesktop.move, onDragMove, activeListener); + document[eventMethod](touchEventsDesktop.end, onDragEnd, passiveListener); + } else { + target[eventMethod](touchEventsTouch.start, onDragStart, activeListener); + target[eventMethod](touchEventsTouch.move, onDragMove, activeListener); + target[eventMethod](touchEventsTouch.end, onDragEnd, passiveListener); + } + } + + function enableDraggable() { + if (!swiper.params.scrollbar.el) return; + events('on'); + } + + function disableDraggable() { + if (!swiper.params.scrollbar.el) return; + events('off'); + } + + function init() { + const { + scrollbar, + $el: $swiperEl + } = swiper; + swiper.params.scrollbar = createElementIfNotDefined(swiper, swiper.originalParams.scrollbar, swiper.params.scrollbar, { + el: 'swiper-scrollbar' + }); + const params = swiper.params.scrollbar; + if (!params.el) return; + let $el = $(params.el); + + if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1 && $swiperEl.find(params.el).length === 1) { + $el = $swiperEl.find(params.el); + } + + let $dragEl = $el.find(`.${swiper.params.scrollbar.dragClass}`); + + if ($dragEl.length === 0) { + $dragEl = $(`<div class="${swiper.params.scrollbar.dragClass}"></div>`); + $el.append($dragEl); + } + + Object.assign(scrollbar, { + $el, + el: $el[0], + $dragEl, + dragEl: $dragEl[0] + }); + + if (params.draggable) { + enableDraggable(); + } + + if ($el) { + $el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.scrollbar.lockClass); + } + } + + function destroy() { + disableDraggable(); + } + + on('init', () => { + init(); + updateSize(); + setTranslate(); + }); + on('update resize observerUpdate lock unlock', () => { + updateSize(); + }); + on('setTranslate', () => { + setTranslate(); + }); + on('setTransition', (_s, duration) => { + setTransition(duration); + }); + on('enable disable', () => { + const { + $el + } = swiper.scrollbar; + + if ($el) { + $el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.scrollbar.lockClass); + } + }); + on('destroy', () => { + destroy(); + }); + Object.assign(swiper.scrollbar, { + updateSize, + setTranslate, + init, + destroy + }); + } + + function Parallax({ + swiper, + extendParams, + on + }) { + extendParams({ + parallax: { + enabled: false + } + }); + + const setTransform = (el, progress) => { + const { + rtl + } = swiper; + const $el = $(el); + const rtlFactor = rtl ? -1 : 1; + const p = $el.attr('data-swiper-parallax') || '0'; + let x = $el.attr('data-swiper-parallax-x'); + let y = $el.attr('data-swiper-parallax-y'); + const scale = $el.attr('data-swiper-parallax-scale'); + const opacity = $el.attr('data-swiper-parallax-opacity'); + + if (x || y) { + x = x || '0'; + y = y || '0'; + } else if (swiper.isHorizontal()) { + x = p; + y = '0'; + } else { + y = p; + x = '0'; + } + + if (x.indexOf('%') >= 0) { + x = `${parseInt(x, 10) * progress * rtlFactor}%`; + } else { + x = `${x * progress * rtlFactor}px`; + } + + if (y.indexOf('%') >= 0) { + y = `${parseInt(y, 10) * progress}%`; + } else { + y = `${y * progress}px`; + } + + if (typeof opacity !== 'undefined' && opacity !== null) { + const currentOpacity = opacity - (opacity - 1) * (1 - Math.abs(progress)); + $el[0].style.opacity = currentOpacity; + } + + if (typeof scale === 'undefined' || scale === null) { + $el.transform(`translate3d(${x}, ${y}, 0px)`); + } else { + const currentScale = scale - (scale - 1) * (1 - Math.abs(progress)); + $el.transform(`translate3d(${x}, ${y}, 0px) scale(${currentScale})`); + } + }; + + const setTranslate = () => { + const { + $el, + slides, + progress, + snapGrid + } = swiper; + $el.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(el => { + setTransform(el, progress); + }); + slides.each((slideEl, slideIndex) => { + let slideProgress = slideEl.progress; + + if (swiper.params.slidesPerGroup > 1 && swiper.params.slidesPerView !== 'auto') { + slideProgress += Math.ceil(slideIndex / 2) - progress * (snapGrid.length - 1); + } + + slideProgress = Math.min(Math.max(slideProgress, -1), 1); + $(slideEl).find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(el => { + setTransform(el, slideProgress); + }); + }); + }; + + const setTransition = (duration = swiper.params.speed) => { + const { + $el + } = swiper; + $el.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(parallaxEl => { + const $parallaxEl = $(parallaxEl); + let parallaxDuration = parseInt($parallaxEl.attr('data-swiper-parallax-duration'), 10) || duration; + if (duration === 0) parallaxDuration = 0; + $parallaxEl.transition(parallaxDuration); + }); + }; + + on('beforeInit', () => { + if (!swiper.params.parallax.enabled) return; + swiper.params.watchSlidesProgress = true; + swiper.originalParams.watchSlidesProgress = true; + }); + on('init', () => { + if (!swiper.params.parallax.enabled) return; + setTranslate(); + }); + on('setTranslate', () => { + if (!swiper.params.parallax.enabled) return; + setTranslate(); + }); + on('setTransition', (_swiper, duration) => { + if (!swiper.params.parallax.enabled) return; + setTransition(duration); + }); + } + + function Zoom({ + swiper, + extendParams, + on, + emit + }) { + const window = getWindow(); + extendParams({ + zoom: { + enabled: false, + maxRatio: 3, + minRatio: 1, + toggle: true, + containerClass: 'swiper-zoom-container', + zoomedSlideClass: 'swiper-slide-zoomed' + } + }); + swiper.zoom = { + enabled: false + }; + let currentScale = 1; + let isScaling = false; + let gesturesEnabled; + let fakeGestureTouched; + let fakeGestureMoved; + const gesture = { + $slideEl: undefined, + slideWidth: undefined, + slideHeight: undefined, + $imageEl: undefined, + $imageWrapEl: undefined, + maxRatio: 3 + }; + const image = { + isTouched: undefined, + isMoved: undefined, + currentX: undefined, + currentY: undefined, + minX: undefined, + minY: undefined, + maxX: undefined, + maxY: undefined, + width: undefined, + height: undefined, + startX: undefined, + startY: undefined, + touchesStart: {}, + touchesCurrent: {} + }; + const velocity = { + x: undefined, + y: undefined, + prevPositionX: undefined, + prevPositionY: undefined, + prevTime: undefined + }; + let scale = 1; + Object.defineProperty(swiper.zoom, 'scale', { + get() { + return scale; + }, + + set(value) { + if (scale !== value) { + const imageEl = gesture.$imageEl ? gesture.$imageEl[0] : undefined; + const slideEl = gesture.$slideEl ? gesture.$slideEl[0] : undefined; + emit('zoomChange', value, imageEl, slideEl); + } + + scale = value; + } + + }); + + function getDistanceBetweenTouches(e) { + if (e.targetTouches.length < 2) return 1; + const x1 = e.targetTouches[0].pageX; + const y1 = e.targetTouches[0].pageY; + const x2 = e.targetTouches[1].pageX; + const y2 = e.targetTouches[1].pageY; + const distance = Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2); + return distance; + } // Events + + + function onGestureStart(e) { + const support = swiper.support; + const params = swiper.params.zoom; + fakeGestureTouched = false; + fakeGestureMoved = false; + + if (!support.gestures) { + if (e.type !== 'touchstart' || e.type === 'touchstart' && e.targetTouches.length < 2) { + return; + } + + fakeGestureTouched = true; + gesture.scaleStart = getDistanceBetweenTouches(e); + } + + if (!gesture.$slideEl || !gesture.$slideEl.length) { + gesture.$slideEl = $(e.target).closest(`.${swiper.params.slideClass}`); + if (gesture.$slideEl.length === 0) gesture.$slideEl = swiper.slides.eq(swiper.activeIndex); + gesture.$imageEl = gesture.$slideEl.find(`.${params.containerClass}`).eq(0).find('picture, img, svg, canvas, .swiper-zoom-target').eq(0); + gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`); + gesture.maxRatio = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio; + + if (gesture.$imageWrapEl.length === 0) { + gesture.$imageEl = undefined; + return; + } + } + + if (gesture.$imageEl) { + gesture.$imageEl.transition(0); + } + + isScaling = true; + } + + function onGestureChange(e) { + const support = swiper.support; + const params = swiper.params.zoom; + const zoom = swiper.zoom; + + if (!support.gestures) { + if (e.type !== 'touchmove' || e.type === 'touchmove' && e.targetTouches.length < 2) { + return; + } + + fakeGestureMoved = true; + gesture.scaleMove = getDistanceBetweenTouches(e); + } + + if (!gesture.$imageEl || gesture.$imageEl.length === 0) { + if (e.type === 'gesturechange') onGestureStart(e); + return; + } + + if (support.gestures) { + zoom.scale = e.scale * currentScale; + } else { + zoom.scale = gesture.scaleMove / gesture.scaleStart * currentScale; + } + + if (zoom.scale > gesture.maxRatio) { + zoom.scale = gesture.maxRatio - 1 + (zoom.scale - gesture.maxRatio + 1) ** 0.5; + } + + if (zoom.scale < params.minRatio) { + zoom.scale = params.minRatio + 1 - (params.minRatio - zoom.scale + 1) ** 0.5; + } + + gesture.$imageEl.transform(`translate3d(0,0,0) scale(${zoom.scale})`); + } + + function onGestureEnd(e) { + const device = swiper.device; + const support = swiper.support; + const params = swiper.params.zoom; + const zoom = swiper.zoom; + + if (!support.gestures) { + if (!fakeGestureTouched || !fakeGestureMoved) { + return; + } + + if (e.type !== 'touchend' || e.type === 'touchend' && e.changedTouches.length < 2 && !device.android) { + return; + } + + fakeGestureTouched = false; + fakeGestureMoved = false; + } + + if (!gesture.$imageEl || gesture.$imageEl.length === 0) return; + zoom.scale = Math.max(Math.min(zoom.scale, gesture.maxRatio), params.minRatio); + gesture.$imageEl.transition(swiper.params.speed).transform(`translate3d(0,0,0) scale(${zoom.scale})`); + currentScale = zoom.scale; + isScaling = false; + if (zoom.scale === 1) gesture.$slideEl = undefined; + } + + function onTouchStart(e) { + const device = swiper.device; + if (!gesture.$imageEl || gesture.$imageEl.length === 0) return; + if (image.isTouched) return; + if (device.android && e.cancelable) e.preventDefault(); + image.isTouched = true; + image.touchesStart.x = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX; + image.touchesStart.y = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY; + } + + function onTouchMove(e) { + const zoom = swiper.zoom; + if (!gesture.$imageEl || gesture.$imageEl.length === 0) return; + swiper.allowClick = false; + if (!image.isTouched || !gesture.$slideEl) return; + + if (!image.isMoved) { + image.width = gesture.$imageEl[0].offsetWidth; + image.height = gesture.$imageEl[0].offsetHeight; + image.startX = getTranslate(gesture.$imageWrapEl[0], 'x') || 0; + image.startY = getTranslate(gesture.$imageWrapEl[0], 'y') || 0; + gesture.slideWidth = gesture.$slideEl[0].offsetWidth; + gesture.slideHeight = gesture.$slideEl[0].offsetHeight; + gesture.$imageWrapEl.transition(0); + } // Define if we need image drag + + + const scaledWidth = image.width * zoom.scale; + const scaledHeight = image.height * zoom.scale; + if (scaledWidth < gesture.slideWidth && scaledHeight < gesture.slideHeight) return; + image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0); + image.maxX = -image.minX; + image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0); + image.maxY = -image.minY; + image.touchesCurrent.x = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX; + image.touchesCurrent.y = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY; + + if (!image.isMoved && !isScaling) { + if (swiper.isHorizontal() && (Math.floor(image.minX) === Math.floor(image.startX) && image.touchesCurrent.x < image.touchesStart.x || Math.floor(image.maxX) === Math.floor(image.startX) && image.touchesCurrent.x > image.touchesStart.x)) { + image.isTouched = false; + return; + } + + if (!swiper.isHorizontal() && (Math.floor(image.minY) === Math.floor(image.startY) && image.touchesCurrent.y < image.touchesStart.y || Math.floor(image.maxY) === Math.floor(image.startY) && image.touchesCurrent.y > image.touchesStart.y)) { + image.isTouched = false; + return; + } + } + + if (e.cancelable) { + e.preventDefault(); + } + + e.stopPropagation(); + image.isMoved = true; + image.currentX = image.touchesCurrent.x - image.touchesStart.x + image.startX; + image.currentY = image.touchesCurrent.y - image.touchesStart.y + image.startY; + + if (image.currentX < image.minX) { + image.currentX = image.minX + 1 - (image.minX - image.currentX + 1) ** 0.8; + } + + if (image.currentX > image.maxX) { + image.currentX = image.maxX - 1 + (image.currentX - image.maxX + 1) ** 0.8; + } + + if (image.currentY < image.minY) { + image.currentY = image.minY + 1 - (image.minY - image.currentY + 1) ** 0.8; + } + + if (image.currentY > image.maxY) { + image.currentY = image.maxY - 1 + (image.currentY - image.maxY + 1) ** 0.8; + } // Velocity + + + if (!velocity.prevPositionX) velocity.prevPositionX = image.touchesCurrent.x; + if (!velocity.prevPositionY) velocity.prevPositionY = image.touchesCurrent.y; + if (!velocity.prevTime) velocity.prevTime = Date.now(); + velocity.x = (image.touchesCurrent.x - velocity.prevPositionX) / (Date.now() - velocity.prevTime) / 2; + velocity.y = (image.touchesCurrent.y - velocity.prevPositionY) / (Date.now() - velocity.prevTime) / 2; + if (Math.abs(image.touchesCurrent.x - velocity.prevPositionX) < 2) velocity.x = 0; + if (Math.abs(image.touchesCurrent.y - velocity.prevPositionY) < 2) velocity.y = 0; + velocity.prevPositionX = image.touchesCurrent.x; + velocity.prevPositionY = image.touchesCurrent.y; + velocity.prevTime = Date.now(); + gesture.$imageWrapEl.transform(`translate3d(${image.currentX}px, ${image.currentY}px,0)`); + } + + function onTouchEnd() { + const zoom = swiper.zoom; + if (!gesture.$imageEl || gesture.$imageEl.length === 0) return; + + if (!image.isTouched || !image.isMoved) { + image.isTouched = false; + image.isMoved = false; + return; + } + + image.isTouched = false; + image.isMoved = false; + let momentumDurationX = 300; + let momentumDurationY = 300; + const momentumDistanceX = velocity.x * momentumDurationX; + const newPositionX = image.currentX + momentumDistanceX; + const momentumDistanceY = velocity.y * momentumDurationY; + const newPositionY = image.currentY + momentumDistanceY; // Fix duration + + if (velocity.x !== 0) momentumDurationX = Math.abs((newPositionX - image.currentX) / velocity.x); + if (velocity.y !== 0) momentumDurationY = Math.abs((newPositionY - image.currentY) / velocity.y); + const momentumDuration = Math.max(momentumDurationX, momentumDurationY); + image.currentX = newPositionX; + image.currentY = newPositionY; // Define if we need image drag + + const scaledWidth = image.width * zoom.scale; + const scaledHeight = image.height * zoom.scale; + image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0); + image.maxX = -image.minX; + image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0); + image.maxY = -image.minY; + image.currentX = Math.max(Math.min(image.currentX, image.maxX), image.minX); + image.currentY = Math.max(Math.min(image.currentY, image.maxY), image.minY); + gesture.$imageWrapEl.transition(momentumDuration).transform(`translate3d(${image.currentX}px, ${image.currentY}px,0)`); + } + + function onTransitionEnd() { + const zoom = swiper.zoom; + + if (gesture.$slideEl && swiper.previousIndex !== swiper.activeIndex) { + if (gesture.$imageEl) { + gesture.$imageEl.transform('translate3d(0,0,0) scale(1)'); + } + + if (gesture.$imageWrapEl) { + gesture.$imageWrapEl.transform('translate3d(0,0,0)'); + } + + zoom.scale = 1; + currentScale = 1; + gesture.$slideEl = undefined; + gesture.$imageEl = undefined; + gesture.$imageWrapEl = undefined; + } + } + + function zoomIn(e) { + const zoom = swiper.zoom; + const params = swiper.params.zoom; + + if (!gesture.$slideEl) { + if (e && e.target) { + gesture.$slideEl = $(e.target).closest(`.${swiper.params.slideClass}`); + } + + if (!gesture.$slideEl) { + if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) { + gesture.$slideEl = swiper.$wrapperEl.children(`.${swiper.params.slideActiveClass}`); + } else { + gesture.$slideEl = swiper.slides.eq(swiper.activeIndex); + } + } + + gesture.$imageEl = gesture.$slideEl.find(`.${params.containerClass}`).eq(0).find('picture, img, svg, canvas, .swiper-zoom-target').eq(0); + gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`); + } + + if (!gesture.$imageEl || gesture.$imageEl.length === 0 || !gesture.$imageWrapEl || gesture.$imageWrapEl.length === 0) return; + + if (swiper.params.cssMode) { + swiper.wrapperEl.style.overflow = 'hidden'; + swiper.wrapperEl.style.touchAction = 'none'; + } + + gesture.$slideEl.addClass(`${params.zoomedSlideClass}`); + let touchX; + let touchY; + let offsetX; + let offsetY; + let diffX; + let diffY; + let translateX; + let translateY; + let imageWidth; + let imageHeight; + let scaledWidth; + let scaledHeight; + let translateMinX; + let translateMinY; + let translateMaxX; + let translateMaxY; + let slideWidth; + let slideHeight; + + if (typeof image.touchesStart.x === 'undefined' && e) { + touchX = e.type === 'touchend' ? e.changedTouches[0].pageX : e.pageX; + touchY = e.type === 'touchend' ? e.changedTouches[0].pageY : e.pageY; + } else { + touchX = image.touchesStart.x; + touchY = image.touchesStart.y; + } + + zoom.scale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio; + currentScale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio; + + if (e) { + slideWidth = gesture.$slideEl[0].offsetWidth; + slideHeight = gesture.$slideEl[0].offsetHeight; + offsetX = gesture.$slideEl.offset().left + window.scrollX; + offsetY = gesture.$slideEl.offset().top + window.scrollY; + diffX = offsetX + slideWidth / 2 - touchX; + diffY = offsetY + slideHeight / 2 - touchY; + imageWidth = gesture.$imageEl[0].offsetWidth; + imageHeight = gesture.$imageEl[0].offsetHeight; + scaledWidth = imageWidth * zoom.scale; + scaledHeight = imageHeight * zoom.scale; + translateMinX = Math.min(slideWidth / 2 - scaledWidth / 2, 0); + translateMinY = Math.min(slideHeight / 2 - scaledHeight / 2, 0); + translateMaxX = -translateMinX; + translateMaxY = -translateMinY; + translateX = diffX * zoom.scale; + translateY = diffY * zoom.scale; + + if (translateX < translateMinX) { + translateX = translateMinX; + } + + if (translateX > translateMaxX) { + translateX = translateMaxX; + } + + if (translateY < translateMinY) { + translateY = translateMinY; + } + + if (translateY > translateMaxY) { + translateY = translateMaxY; + } + } else { + translateX = 0; + translateY = 0; + } + + gesture.$imageWrapEl.transition(300).transform(`translate3d(${translateX}px, ${translateY}px,0)`); + gesture.$imageEl.transition(300).transform(`translate3d(0,0,0) scale(${zoom.scale})`); + } + + function zoomOut() { + const zoom = swiper.zoom; + const params = swiper.params.zoom; + + if (!gesture.$slideEl) { + if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) { + gesture.$slideEl = swiper.$wrapperEl.children(`.${swiper.params.slideActiveClass}`); + } else { + gesture.$slideEl = swiper.slides.eq(swiper.activeIndex); + } + + gesture.$imageEl = gesture.$slideEl.find(`.${params.containerClass}`).eq(0).find('picture, img, svg, canvas, .swiper-zoom-target').eq(0); + gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`); + } + + if (!gesture.$imageEl || gesture.$imageEl.length === 0 || !gesture.$imageWrapEl || gesture.$imageWrapEl.length === 0) return; + + if (swiper.params.cssMode) { + swiper.wrapperEl.style.overflow = ''; + swiper.wrapperEl.style.touchAction = ''; + } + + zoom.scale = 1; + currentScale = 1; + gesture.$imageWrapEl.transition(300).transform('translate3d(0,0,0)'); + gesture.$imageEl.transition(300).transform('translate3d(0,0,0) scale(1)'); + gesture.$slideEl.removeClass(`${params.zoomedSlideClass}`); + gesture.$slideEl = undefined; + } // Toggle Zoom + + + function zoomToggle(e) { + const zoom = swiper.zoom; + + if (zoom.scale && zoom.scale !== 1) { + // Zoom Out + zoomOut(); + } else { + // Zoom In + zoomIn(e); + } + } + + function getListeners() { + const support = swiper.support; + const passiveListener = swiper.touchEvents.start === 'touchstart' && support.passiveListener && swiper.params.passiveListeners ? { + passive: true, + capture: false + } : false; + const activeListenerWithCapture = support.passiveListener ? { + passive: false, + capture: true + } : true; + return { + passiveListener, + activeListenerWithCapture + }; + } + + function getSlideSelector() { + return `.${swiper.params.slideClass}`; + } + + function toggleGestures(method) { + const { + passiveListener + } = getListeners(); + const slideSelector = getSlideSelector(); + swiper.$wrapperEl[method]('gesturestart', slideSelector, onGestureStart, passiveListener); + swiper.$wrapperEl[method]('gesturechange', slideSelector, onGestureChange, passiveListener); + swiper.$wrapperEl[method]('gestureend', slideSelector, onGestureEnd, passiveListener); + } + + function enableGestures() { + if (gesturesEnabled) return; + gesturesEnabled = true; + toggleGestures('on'); + } + + function disableGestures() { + if (!gesturesEnabled) return; + gesturesEnabled = false; + toggleGestures('off'); + } // Attach/Detach Events + + + function enable() { + const zoom = swiper.zoom; + if (zoom.enabled) return; + zoom.enabled = true; + const support = swiper.support; + const { + passiveListener, + activeListenerWithCapture + } = getListeners(); + const slideSelector = getSlideSelector(); // Scale image + + if (support.gestures) { + swiper.$wrapperEl.on(swiper.touchEvents.start, enableGestures, passiveListener); + swiper.$wrapperEl.on(swiper.touchEvents.end, disableGestures, passiveListener); + } else if (swiper.touchEvents.start === 'touchstart') { + swiper.$wrapperEl.on(swiper.touchEvents.start, slideSelector, onGestureStart, passiveListener); + swiper.$wrapperEl.on(swiper.touchEvents.move, slideSelector, onGestureChange, activeListenerWithCapture); + swiper.$wrapperEl.on(swiper.touchEvents.end, slideSelector, onGestureEnd, passiveListener); + + if (swiper.touchEvents.cancel) { + swiper.$wrapperEl.on(swiper.touchEvents.cancel, slideSelector, onGestureEnd, passiveListener); + } + } // Move image + + + swiper.$wrapperEl.on(swiper.touchEvents.move, `.${swiper.params.zoom.containerClass}`, onTouchMove, activeListenerWithCapture); + } + + function disable() { + const zoom = swiper.zoom; + if (!zoom.enabled) return; + const support = swiper.support; + zoom.enabled = false; + const { + passiveListener, + activeListenerWithCapture + } = getListeners(); + const slideSelector = getSlideSelector(); // Scale image + + if (support.gestures) { + swiper.$wrapperEl.off(swiper.touchEvents.start, enableGestures, passiveListener); + swiper.$wrapperEl.off(swiper.touchEvents.end, disableGestures, passiveListener); + } else if (swiper.touchEvents.start === 'touchstart') { + swiper.$wrapperEl.off(swiper.touchEvents.start, slideSelector, onGestureStart, passiveListener); + swiper.$wrapperEl.off(swiper.touchEvents.move, slideSelector, onGestureChange, activeListenerWithCapture); + swiper.$wrapperEl.off(swiper.touchEvents.end, slideSelector, onGestureEnd, passiveListener); + + if (swiper.touchEvents.cancel) { + swiper.$wrapperEl.off(swiper.touchEvents.cancel, slideSelector, onGestureEnd, passiveListener); + } + } // Move image + + + swiper.$wrapperEl.off(swiper.touchEvents.move, `.${swiper.params.zoom.containerClass}`, onTouchMove, activeListenerWithCapture); + } + + on('init', () => { + if (swiper.params.zoom.enabled) { + enable(); + } + }); + on('destroy', () => { + disable(); + }); + on('touchStart', (_s, e) => { + if (!swiper.zoom.enabled) return; + onTouchStart(e); + }); + on('touchEnd', (_s, e) => { + if (!swiper.zoom.enabled) return; + onTouchEnd(); + }); + on('doubleTap', (_s, e) => { + if (!swiper.animating && swiper.params.zoom.enabled && swiper.zoom.enabled && swiper.params.zoom.toggle) { + zoomToggle(e); + } + }); + on('transitionEnd', () => { + if (swiper.zoom.enabled && swiper.params.zoom.enabled) { + onTransitionEnd(); + } + }); + on('slideChange', () => { + if (swiper.zoom.enabled && swiper.params.zoom.enabled && swiper.params.cssMode) { + onTransitionEnd(); + } + }); + Object.assign(swiper.zoom, { + enable, + disable, + in: zoomIn, + out: zoomOut, + toggle: zoomToggle + }); + } + + function Lazy({ + swiper, + extendParams, + on, + emit + }) { + extendParams({ + lazy: { + checkInView: false, + enabled: false, + loadPrevNext: false, + loadPrevNextAmount: 1, + loadOnTransitionStart: false, + scrollingElement: '', + elementClass: 'swiper-lazy', + loadingClass: 'swiper-lazy-loading', + loadedClass: 'swiper-lazy-loaded', + preloaderClass: 'swiper-lazy-preloader' + } + }); + swiper.lazy = {}; + let scrollHandlerAttached = false; + let initialImageLoaded = false; + + function loadInSlide(index, loadInDuplicate = true) { + const params = swiper.params.lazy; + if (typeof index === 'undefined') return; + if (swiper.slides.length === 0) return; + const isVirtual = swiper.virtual && swiper.params.virtual.enabled; + const $slideEl = isVirtual ? swiper.$wrapperEl.children(`.${swiper.params.slideClass}[data-swiper-slide-index="${index}"]`) : swiper.slides.eq(index); + const $images = $slideEl.find(`.${params.elementClass}:not(.${params.loadedClass}):not(.${params.loadingClass})`); + + if ($slideEl.hasClass(params.elementClass) && !$slideEl.hasClass(params.loadedClass) && !$slideEl.hasClass(params.loadingClass)) { + $images.push($slideEl[0]); + } + + if ($images.length === 0) return; + $images.each(imageEl => { + const $imageEl = $(imageEl); + $imageEl.addClass(params.loadingClass); + const background = $imageEl.attr('data-background'); + const src = $imageEl.attr('data-src'); + const srcset = $imageEl.attr('data-srcset'); + const sizes = $imageEl.attr('data-sizes'); + const $pictureEl = $imageEl.parent('picture'); + swiper.loadImage($imageEl[0], src || background, srcset, sizes, false, () => { + if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper && !swiper.params || swiper.destroyed) return; + + if (background) { + $imageEl.css('background-image', `url("${background}")`); + $imageEl.removeAttr('data-background'); + } else { + if (srcset) { + $imageEl.attr('srcset', srcset); + $imageEl.removeAttr('data-srcset'); + } + + if (sizes) { + $imageEl.attr('sizes', sizes); + $imageEl.removeAttr('data-sizes'); + } + + if ($pictureEl.length) { + $pictureEl.children('source').each(sourceEl => { + const $source = $(sourceEl); + + if ($source.attr('data-srcset')) { + $source.attr('srcset', $source.attr('data-srcset')); + $source.removeAttr('data-srcset'); + } + }); + } + + if (src) { + $imageEl.attr('src', src); + $imageEl.removeAttr('data-src'); + } + } + + $imageEl.addClass(params.loadedClass).removeClass(params.loadingClass); + $slideEl.find(`.${params.preloaderClass}`).remove(); + + if (swiper.params.loop && loadInDuplicate) { + const slideOriginalIndex = $slideEl.attr('data-swiper-slide-index'); + + if ($slideEl.hasClass(swiper.params.slideDuplicateClass)) { + const originalSlide = swiper.$wrapperEl.children(`[data-swiper-slide-index="${slideOriginalIndex}"]:not(.${swiper.params.slideDuplicateClass})`); + loadInSlide(originalSlide.index(), false); + } else { + const duplicatedSlide = swiper.$wrapperEl.children(`.${swiper.params.slideDuplicateClass}[data-swiper-slide-index="${slideOriginalIndex}"]`); + loadInSlide(duplicatedSlide.index(), false); + } + } + + emit('lazyImageReady', $slideEl[0], $imageEl[0]); + + if (swiper.params.autoHeight) { + swiper.updateAutoHeight(); + } + }); + emit('lazyImageLoad', $slideEl[0], $imageEl[0]); + }); + } + + function load() { + const { + $wrapperEl, + params: swiperParams, + slides, + activeIndex + } = swiper; + const isVirtual = swiper.virtual && swiperParams.virtual.enabled; + const params = swiperParams.lazy; + let slidesPerView = swiperParams.slidesPerView; + + if (slidesPerView === 'auto') { + slidesPerView = 0; + } + + function slideExist(index) { + if (isVirtual) { + if ($wrapperEl.children(`.${swiperParams.slideClass}[data-swiper-slide-index="${index}"]`).length) { + return true; + } + } else if (slides[index]) return true; + + return false; + } + + function slideIndex(slideEl) { + if (isVirtual) { + return $(slideEl).attr('data-swiper-slide-index'); + } + + return $(slideEl).index(); + } + + if (!initialImageLoaded) initialImageLoaded = true; + + if (swiper.params.watchSlidesProgress) { + $wrapperEl.children(`.${swiperParams.slideVisibleClass}`).each(slideEl => { + const index = isVirtual ? $(slideEl).attr('data-swiper-slide-index') : $(slideEl).index(); + loadInSlide(index); + }); + } else if (slidesPerView > 1) { + for (let i = activeIndex; i < activeIndex + slidesPerView; i += 1) { + if (slideExist(i)) loadInSlide(i); + } + } else { + loadInSlide(activeIndex); + } + + if (params.loadPrevNext) { + if (slidesPerView > 1 || params.loadPrevNextAmount && params.loadPrevNextAmount > 1) { + const amount = params.loadPrevNextAmount; + const spv = slidesPerView; + const maxIndex = Math.min(activeIndex + spv + Math.max(amount, spv), slides.length); + const minIndex = Math.max(activeIndex - Math.max(spv, amount), 0); // Next Slides + + for (let i = activeIndex + slidesPerView; i < maxIndex; i += 1) { + if (slideExist(i)) loadInSlide(i); + } // Prev Slides + + + for (let i = minIndex; i < activeIndex; i += 1) { + if (slideExist(i)) loadInSlide(i); + } + } else { + const nextSlide = $wrapperEl.children(`.${swiperParams.slideNextClass}`); + if (nextSlide.length > 0) loadInSlide(slideIndex(nextSlide)); + const prevSlide = $wrapperEl.children(`.${swiperParams.slidePrevClass}`); + if (prevSlide.length > 0) loadInSlide(slideIndex(prevSlide)); + } + } + } + + function checkInViewOnLoad() { + const window = getWindow(); + if (!swiper || swiper.destroyed) return; + const $scrollElement = swiper.params.lazy.scrollingElement ? $(swiper.params.lazy.scrollingElement) : $(window); + const isWindow = $scrollElement[0] === window; + const scrollElementWidth = isWindow ? window.innerWidth : $scrollElement[0].offsetWidth; + const scrollElementHeight = isWindow ? window.innerHeight : $scrollElement[0].offsetHeight; + const swiperOffset = swiper.$el.offset(); + const { + rtlTranslate: rtl + } = swiper; + let inView = false; + if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft; + const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiper.width, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiper.height], [swiperOffset.left + swiper.width, swiperOffset.top + swiper.height]]; + + for (let i = 0; i < swiperCoord.length; i += 1) { + const point = swiperCoord[i]; + + if (point[0] >= 0 && point[0] <= scrollElementWidth && point[1] >= 0 && point[1] <= scrollElementHeight) { + if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line + + inView = true; + } + } + + const passiveListener = swiper.touchEvents.start === 'touchstart' && swiper.support.passiveListener && swiper.params.passiveListeners ? { + passive: true, + capture: false + } : false; + + if (inView) { + load(); + $scrollElement.off('scroll', checkInViewOnLoad, passiveListener); + } else if (!scrollHandlerAttached) { + scrollHandlerAttached = true; + $scrollElement.on('scroll', checkInViewOnLoad, passiveListener); + } + } + + on('beforeInit', () => { + if (swiper.params.lazy.enabled && swiper.params.preloadImages) { + swiper.params.preloadImages = false; + } + }); + on('init', () => { + if (swiper.params.lazy.enabled) { + if (swiper.params.lazy.checkInView) { + checkInViewOnLoad(); + } else { + load(); + } + } + }); + on('scroll', () => { + if (swiper.params.freeMode && swiper.params.freeMode.enabled && !swiper.params.freeMode.sticky) { + load(); + } + }); + on('scrollbarDragMove resize _freeModeNoMomentumRelease', () => { + if (swiper.params.lazy.enabled) { + if (swiper.params.lazy.checkInView) { + checkInViewOnLoad(); + } else { + load(); + } + } + }); + on('transitionStart', () => { + if (swiper.params.lazy.enabled) { + if (swiper.params.lazy.loadOnTransitionStart || !swiper.params.lazy.loadOnTransitionStart && !initialImageLoaded) { + if (swiper.params.lazy.checkInView) { + checkInViewOnLoad(); + } else { + load(); + } + } + } + }); + on('transitionEnd', () => { + if (swiper.params.lazy.enabled && !swiper.params.lazy.loadOnTransitionStart) { + if (swiper.params.lazy.checkInView) { + checkInViewOnLoad(); + } else { + load(); + } + } + }); + on('slideChange', () => { + const { + lazy, + cssMode, + watchSlidesProgress, + touchReleaseOnEdges, + resistanceRatio + } = swiper.params; + + if (lazy.enabled && (cssMode || watchSlidesProgress && (touchReleaseOnEdges || resistanceRatio === 0))) { + load(); + } + }); + Object.assign(swiper.lazy, { + load, + loadInSlide + }); + } + + /* eslint no-bitwise: ["error", { "allow": [">>"] }] */ + function Controller({ + swiper, + extendParams, + on + }) { + extendParams({ + controller: { + control: undefined, + inverse: false, + by: 'slide' // or 'container' + + } + }); + swiper.controller = { + control: undefined + }; + + function LinearSpline(x, y) { + const binarySearch = function search() { + let maxIndex; + let minIndex; + let guess; + return (array, val) => { + minIndex = -1; + maxIndex = array.length; + + while (maxIndex - minIndex > 1) { + guess = maxIndex + minIndex >> 1; + + if (array[guess] <= val) { + minIndex = guess; + } else { + maxIndex = guess; + } + } + + return maxIndex; + }; + }(); + + this.x = x; + this.y = y; + this.lastIndex = x.length - 1; // Given an x value (x2), return the expected y2 value: + // (x1,y1) is the known point before given value, + // (x3,y3) is the known point after given value. + + let i1; + let i3; + + this.interpolate = function interpolate(x2) { + if (!x2) return 0; // Get the indexes of x1 and x3 (the array indexes before and after given x2): + + i3 = binarySearch(this.x, x2); + i1 = i3 - 1; // We have our indexes i1 & i3, so we can calculate already: + // y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1 + + return (x2 - this.x[i1]) * (this.y[i3] - this.y[i1]) / (this.x[i3] - this.x[i1]) + this.y[i1]; + }; + + return this; + } // xxx: for now i will just save one spline function to to + + + function getInterpolateFunction(c) { + if (!swiper.controller.spline) { + swiper.controller.spline = swiper.params.loop ? new LinearSpline(swiper.slidesGrid, c.slidesGrid) : new LinearSpline(swiper.snapGrid, c.snapGrid); + } + } + + function setTranslate(_t, byController) { + const controlled = swiper.controller.control; + let multiplier; + let controlledTranslate; + const Swiper = swiper.constructor; + + function setControlledTranslate(c) { + // this will create an Interpolate function based on the snapGrids + // x is the Grid of the scrolled scroller and y will be the controlled scroller + // it makes sense to create this only once and recall it for the interpolation + // the function does a lot of value caching for performance + const translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate; + + if (swiper.params.controller.by === 'slide') { + getInterpolateFunction(c); // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid + // but it did not work out + + controlledTranslate = -swiper.controller.spline.interpolate(-translate); + } + + if (!controlledTranslate || swiper.params.controller.by === 'container') { + multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate()); + controlledTranslate = (translate - swiper.minTranslate()) * multiplier + c.minTranslate(); + } + + if (swiper.params.controller.inverse) { + controlledTranslate = c.maxTranslate() - controlledTranslate; + } + + c.updateProgress(controlledTranslate); + c.setTranslate(controlledTranslate, swiper); + c.updateActiveIndex(); + c.updateSlidesClasses(); + } + + if (Array.isArray(controlled)) { + for (let i = 0; i < controlled.length; i += 1) { + if (controlled[i] !== byController && controlled[i] instanceof Swiper) { + setControlledTranslate(controlled[i]); + } + } + } else if (controlled instanceof Swiper && byController !== controlled) { + setControlledTranslate(controlled); + } + } + + function setTransition(duration, byController) { + const Swiper = swiper.constructor; + const controlled = swiper.controller.control; + let i; + + function setControlledTransition(c) { + c.setTransition(duration, swiper); + + if (duration !== 0) { + c.transitionStart(); + + if (c.params.autoHeight) { + nextTick(() => { + c.updateAutoHeight(); + }); + } + + c.$wrapperEl.transitionEnd(() => { + if (!controlled) return; + + if (c.params.loop && swiper.params.controller.by === 'slide') { + c.loopFix(); + } + + c.transitionEnd(); + }); + } + } + + if (Array.isArray(controlled)) { + for (i = 0; i < controlled.length; i += 1) { + if (controlled[i] !== byController && controlled[i] instanceof Swiper) { + setControlledTransition(controlled[i]); + } + } + } else if (controlled instanceof Swiper && byController !== controlled) { + setControlledTransition(controlled); + } + } + + function removeSpline() { + if (!swiper.controller.control) return; + + if (swiper.controller.spline) { + swiper.controller.spline = undefined; + delete swiper.controller.spline; + } + } + + on('beforeInit', () => { + swiper.controller.control = swiper.params.controller.control; + }); + on('update', () => { + removeSpline(); + }); + on('resize', () => { + removeSpline(); + }); + on('observerUpdate', () => { + removeSpline(); + }); + on('setTranslate', (_s, translate, byController) => { + if (!swiper.controller.control) return; + swiper.controller.setTranslate(translate, byController); + }); + on('setTransition', (_s, duration, byController) => { + if (!swiper.controller.control) return; + swiper.controller.setTransition(duration, byController); + }); + Object.assign(swiper.controller, { + setTranslate, + setTransition + }); + } + + function A11y({ + swiper, + extendParams, + on + }) { + extendParams({ + a11y: { + enabled: true, + notificationClass: 'swiper-notification', + prevSlideMessage: 'Previous slide', + nextSlideMessage: 'Next slide', + firstSlideMessage: 'This is the first slide', + lastSlideMessage: 'This is the last slide', + paginationBulletMessage: 'Go to slide {{index}}', + slideLabelMessage: '{{index}} / {{slidesLength}}', + containerMessage: null, + containerRoleDescriptionMessage: null, + itemRoleDescriptionMessage: null, + slideRole: 'group' + } + }); + let liveRegion = null; + + function notify(message) { + const notification = liveRegion; + if (notification.length === 0) return; + notification.html(''); + notification.html(message); + } + + function getRandomNumber(size = 16) { + const randomChar = () => Math.round(16 * Math.random()).toString(16); + + return 'x'.repeat(size).replace(/x/g, randomChar); + } + + function makeElFocusable($el) { + $el.attr('tabIndex', '0'); + } + + function makeElNotFocusable($el) { + $el.attr('tabIndex', '-1'); + } + + function addElRole($el, role) { + $el.attr('role', role); + } + + function addElRoleDescription($el, description) { + $el.attr('aria-roledescription', description); + } + + function addElControls($el, controls) { + $el.attr('aria-controls', controls); + } + + function addElLabel($el, label) { + $el.attr('aria-label', label); + } + + function addElId($el, id) { + $el.attr('id', id); + } + + function addElLive($el, live) { + $el.attr('aria-live', live); + } + + function disableEl($el) { + $el.attr('aria-disabled', true); + } + + function enableEl($el) { + $el.attr('aria-disabled', false); + } + + function onEnterOrSpaceKey(e) { + if (e.keyCode !== 13 && e.keyCode !== 32) return; + const params = swiper.params.a11y; + const $targetEl = $(e.target); + + if (swiper.navigation && swiper.navigation.$nextEl && $targetEl.is(swiper.navigation.$nextEl)) { + if (!(swiper.isEnd && !swiper.params.loop)) { + swiper.slideNext(); + } + + if (swiper.isEnd) { + notify(params.lastSlideMessage); + } else { + notify(params.nextSlideMessage); + } + } + + if (swiper.navigation && swiper.navigation.$prevEl && $targetEl.is(swiper.navigation.$prevEl)) { + if (!(swiper.isBeginning && !swiper.params.loop)) { + swiper.slidePrev(); + } + + if (swiper.isBeginning) { + notify(params.firstSlideMessage); + } else { + notify(params.prevSlideMessage); + } + } + + if (swiper.pagination && $targetEl.is(classesToSelector(swiper.params.pagination.bulletClass))) { + $targetEl[0].click(); + } + } + + function updateNavigation() { + if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return; + const { + $nextEl, + $prevEl + } = swiper.navigation; + + if ($prevEl && $prevEl.length > 0) { + if (swiper.isBeginning) { + disableEl($prevEl); + makeElNotFocusable($prevEl); + } else { + enableEl($prevEl); + makeElFocusable($prevEl); + } + } + + if ($nextEl && $nextEl.length > 0) { + if (swiper.isEnd) { + disableEl($nextEl); + makeElNotFocusable($nextEl); + } else { + enableEl($nextEl); + makeElFocusable($nextEl); + } + } + } + + function hasPagination() { + return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length; + } + + function hasClickablePagination() { + return hasPagination() && swiper.params.pagination.clickable; + } + + function updatePagination() { + const params = swiper.params.a11y; + if (!hasPagination()) return; + swiper.pagination.bullets.each(bulletEl => { + const $bulletEl = $(bulletEl); + + if (swiper.params.pagination.clickable) { + makeElFocusable($bulletEl); + + if (!swiper.params.pagination.renderBullet) { + addElRole($bulletEl, 'button'); + addElLabel($bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, $bulletEl.index() + 1)); + } + } + + if ($bulletEl.is(`.${swiper.params.pagination.bulletActiveClass}`)) { + $bulletEl.attr('aria-current', 'true'); + } else { + $bulletEl.removeAttr('aria-current'); + } + }); + } + + const initNavEl = ($el, wrapperId, message) => { + makeElFocusable($el); + + if ($el[0].tagName !== 'BUTTON') { + addElRole($el, 'button'); + $el.on('keydown', onEnterOrSpaceKey); + } + + addElLabel($el, message); + addElControls($el, wrapperId); + }; + + function init() { + const params = swiper.params.a11y; + swiper.$el.append(liveRegion); // Container + + const $containerEl = swiper.$el; + + if (params.containerRoleDescriptionMessage) { + addElRoleDescription($containerEl, params.containerRoleDescriptionMessage); + } + + if (params.containerMessage) { + addElLabel($containerEl, params.containerMessage); + } // Wrapper + + + const $wrapperEl = swiper.$wrapperEl; + const wrapperId = $wrapperEl.attr('id') || `swiper-wrapper-${getRandomNumber(16)}`; + const live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite'; + addElId($wrapperEl, wrapperId); + addElLive($wrapperEl, live); // Slide + + if (params.itemRoleDescriptionMessage) { + addElRoleDescription($(swiper.slides), params.itemRoleDescriptionMessage); + } + + addElRole($(swiper.slides), params.slideRole); + const slidesLength = swiper.params.loop ? swiper.slides.filter(el => !el.classList.contains(swiper.params.slideDuplicateClass)).length : swiper.slides.length; + swiper.slides.each((slideEl, index) => { + const $slideEl = $(slideEl); + const slideIndex = swiper.params.loop ? parseInt($slideEl.attr('data-swiper-slide-index'), 10) : index; + const ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength); + addElLabel($slideEl, ariaLabelMessage); + }); // Navigation + + let $nextEl; + let $prevEl; + + if (swiper.navigation && swiper.navigation.$nextEl) { + $nextEl = swiper.navigation.$nextEl; + } + + if (swiper.navigation && swiper.navigation.$prevEl) { + $prevEl = swiper.navigation.$prevEl; + } + + if ($nextEl && $nextEl.length) { + initNavEl($nextEl, wrapperId, params.nextSlideMessage); + } + + if ($prevEl && $prevEl.length) { + initNavEl($prevEl, wrapperId, params.prevSlideMessage); + } // Pagination + + + if (hasClickablePagination()) { + swiper.pagination.$el.on('keydown', classesToSelector(swiper.params.pagination.bulletClass), onEnterOrSpaceKey); + } + } + + function destroy() { + if (liveRegion && liveRegion.length > 0) liveRegion.remove(); + let $nextEl; + let $prevEl; + + if (swiper.navigation && swiper.navigation.$nextEl) { + $nextEl = swiper.navigation.$nextEl; + } + + if (swiper.navigation && swiper.navigation.$prevEl) { + $prevEl = swiper.navigation.$prevEl; + } + + if ($nextEl) { + $nextEl.off('keydown', onEnterOrSpaceKey); + } + + if ($prevEl) { + $prevEl.off('keydown', onEnterOrSpaceKey); + } // Pagination + + + if (hasClickablePagination()) { + swiper.pagination.$el.off('keydown', classesToSelector(swiper.params.pagination.bulletClass), onEnterOrSpaceKey); + } + } + + on('beforeInit', () => { + liveRegion = $(`<span class="${swiper.params.a11y.notificationClass}" aria-live="assertive" aria-atomic="true"></span>`); + }); + on('afterInit', () => { + if (!swiper.params.a11y.enabled) return; + init(); + updateNavigation(); + }); + on('toEdge', () => { + if (!swiper.params.a11y.enabled) return; + updateNavigation(); + }); + on('fromEdge', () => { + if (!swiper.params.a11y.enabled) return; + updateNavigation(); + }); + on('paginationUpdate', () => { + if (!swiper.params.a11y.enabled) return; + updatePagination(); + }); + on('destroy', () => { + if (!swiper.params.a11y.enabled) return; + destroy(); + }); + } + + function History({ + swiper, + extendParams, + on + }) { + extendParams({ + history: { + enabled: false, + root: '', + replaceState: false, + key: 'slides' + } + }); + let initialized = false; + let paths = {}; + + const slugify = text => { + return text.toString().replace(/\s+/g, '-').replace(/[^\w-]+/g, '').replace(/--+/g, '-').replace(/^-+/, '').replace(/-+$/, ''); + }; + + const getPathValues = urlOverride => { + const window = getWindow(); + let location; + + if (urlOverride) { + location = new URL(urlOverride); + } else { + location = window.location; + } + + const pathArray = location.pathname.slice(1).split('/').filter(part => part !== ''); + const total = pathArray.length; + const key = pathArray[total - 2]; + const value = pathArray[total - 1]; + return { + key, + value + }; + }; + + const setHistory = (key, index) => { + const window = getWindow(); + if (!initialized || !swiper.params.history.enabled) return; + let location; + + if (swiper.params.url) { + location = new URL(swiper.params.url); + } else { + location = window.location; + } + + const slide = swiper.slides.eq(index); + let value = slugify(slide.attr('data-history')); + + if (swiper.params.history.root.length > 0) { + let root = swiper.params.history.root; + if (root[root.length - 1] === '/') root = root.slice(0, root.length - 1); + value = `${root}/${key}/${value}`; + } else if (!location.pathname.includes(key)) { + value = `${key}/${value}`; + } + + const currentState = window.history.state; + + if (currentState && currentState.value === value) { + return; + } + + if (swiper.params.history.replaceState) { + window.history.replaceState({ + value + }, null, value); + } else { + window.history.pushState({ + value + }, null, value); + } + }; + + const scrollToSlide = (speed, value, runCallbacks) => { + if (value) { + for (let i = 0, length = swiper.slides.length; i < length; i += 1) { + const slide = swiper.slides.eq(i); + const slideHistory = slugify(slide.attr('data-history')); + + if (slideHistory === value && !slide.hasClass(swiper.params.slideDuplicateClass)) { + const index = slide.index(); + swiper.slideTo(index, speed, runCallbacks); + } + } + } else { + swiper.slideTo(0, speed, runCallbacks); + } + }; + + const setHistoryPopState = () => { + paths = getPathValues(swiper.params.url); + scrollToSlide(swiper.params.speed, swiper.paths.value, false); + }; + + const init = () => { + const window = getWindow(); + if (!swiper.params.history) return; + + if (!window.history || !window.history.pushState) { + swiper.params.history.enabled = false; + swiper.params.hashNavigation.enabled = true; + return; + } + + initialized = true; + paths = getPathValues(swiper.params.url); + if (!paths.key && !paths.value) return; + scrollToSlide(0, paths.value, swiper.params.runCallbacksOnInit); + + if (!swiper.params.history.replaceState) { + window.addEventListener('popstate', setHistoryPopState); + } + }; + + const destroy = () => { + const window = getWindow(); + + if (!swiper.params.history.replaceState) { + window.removeEventListener('popstate', setHistoryPopState); + } + }; + + on('init', () => { + if (swiper.params.history.enabled) { + init(); + } + }); + on('destroy', () => { + if (swiper.params.history.enabled) { + destroy(); + } + }); + on('transitionEnd _freeModeNoMomentumRelease', () => { + if (initialized) { + setHistory(swiper.params.history.key, swiper.activeIndex); + } + }); + on('slideChange', () => { + if (initialized && swiper.params.cssMode) { + setHistory(swiper.params.history.key, swiper.activeIndex); + } + }); + } + + function HashNavigation({ + swiper, + extendParams, + emit, + on + }) { + let initialized = false; + const document = getDocument(); + const window = getWindow(); + extendParams({ + hashNavigation: { + enabled: false, + replaceState: false, + watchState: false + } + }); + + const onHashChange = () => { + emit('hashChange'); + const newHash = document.location.hash.replace('#', ''); + const activeSlideHash = swiper.slides.eq(swiper.activeIndex).attr('data-hash'); + + if (newHash !== activeSlideHash) { + const newIndex = swiper.$wrapperEl.children(`.${swiper.params.slideClass}[data-hash="${newHash}"]`).index(); + if (typeof newIndex === 'undefined') return; + swiper.slideTo(newIndex); + } + }; + + const setHash = () => { + if (!initialized || !swiper.params.hashNavigation.enabled) return; + + if (swiper.params.hashNavigation.replaceState && window.history && window.history.replaceState) { + window.history.replaceState(null, null, `#${swiper.slides.eq(swiper.activeIndex).attr('data-hash')}` || ''); + emit('hashSet'); + } else { + const slide = swiper.slides.eq(swiper.activeIndex); + const hash = slide.attr('data-hash') || slide.attr('data-history'); + document.location.hash = hash || ''; + emit('hashSet'); + } + }; + + const init = () => { + if (!swiper.params.hashNavigation.enabled || swiper.params.history && swiper.params.history.enabled) return; + initialized = true; + const hash = document.location.hash.replace('#', ''); + + if (hash) { + const speed = 0; + + for (let i = 0, length = swiper.slides.length; i < length; i += 1) { + const slide = swiper.slides.eq(i); + const slideHash = slide.attr('data-hash') || slide.attr('data-history'); + + if (slideHash === hash && !slide.hasClass(swiper.params.slideDuplicateClass)) { + const index = slide.index(); + swiper.slideTo(index, speed, swiper.params.runCallbacksOnInit, true); + } + } + } + + if (swiper.params.hashNavigation.watchState) { + $(window).on('hashchange', onHashChange); + } + }; + + const destroy = () => { + if (swiper.params.hashNavigation.watchState) { + $(window).off('hashchange', onHashChange); + } + }; + + on('init', () => { + if (swiper.params.hashNavigation.enabled) { + init(); + } + }); + on('destroy', () => { + if (swiper.params.hashNavigation.enabled) { + destroy(); + } + }); + on('transitionEnd _freeModeNoMomentumRelease', () => { + if (initialized) { + setHash(); + } + }); + on('slideChange', () => { + if (initialized && swiper.params.cssMode) { + setHash(); + } + }); + } + + /* eslint no-underscore-dangle: "off" */ + function Autoplay({ + swiper, + extendParams, + on, + emit + }) { + let timeout; + swiper.autoplay = { + running: false, + paused: false + }; + extendParams({ + autoplay: { + enabled: false, + delay: 3000, + waitForTransition: true, + disableOnInteraction: true, + stopOnLastSlide: false, + reverseDirection: false, + pauseOnMouseEnter: false + } + }); + + function run() { + const $activeSlideEl = swiper.slides.eq(swiper.activeIndex); + let delay = swiper.params.autoplay.delay; + + if ($activeSlideEl.attr('data-swiper-autoplay')) { + delay = $activeSlideEl.attr('data-swiper-autoplay') || swiper.params.autoplay.delay; + } + + clearTimeout(timeout); + timeout = nextTick(() => { + let autoplayResult; + + if (swiper.params.autoplay.reverseDirection) { + if (swiper.params.loop) { + swiper.loopFix(); + autoplayResult = swiper.slidePrev(swiper.params.speed, true, true); + emit('autoplay'); + } else if (!swiper.isBeginning) { + autoplayResult = swiper.slidePrev(swiper.params.speed, true, true); + emit('autoplay'); + } else if (!swiper.params.autoplay.stopOnLastSlide) { + autoplayResult = swiper.slideTo(swiper.slides.length - 1, swiper.params.speed, true, true); + emit('autoplay'); + } else { + stop(); + } + } else if (swiper.params.loop) { + swiper.loopFix(); + autoplayResult = swiper.slideNext(swiper.params.speed, true, true); + emit('autoplay'); + } else if (!swiper.isEnd) { + autoplayResult = swiper.slideNext(swiper.params.speed, true, true); + emit('autoplay'); + } else if (!swiper.params.autoplay.stopOnLastSlide) { + autoplayResult = swiper.slideTo(0, swiper.params.speed, true, true); + emit('autoplay'); + } else { + stop(); + } + + if (swiper.params.cssMode && swiper.autoplay.running) run();else if (autoplayResult === false) { + run(); + } + }, delay); + } + + function start() { + if (typeof timeout !== 'undefined') return false; + if (swiper.autoplay.running) return false; + swiper.autoplay.running = true; + emit('autoplayStart'); + run(); + return true; + } + + function stop() { + if (!swiper.autoplay.running) return false; + if (typeof timeout === 'undefined') return false; + + if (timeout) { + clearTimeout(timeout); + timeout = undefined; + } + + swiper.autoplay.running = false; + emit('autoplayStop'); + return true; + } + + function pause(speed) { + if (!swiper.autoplay.running) return; + if (swiper.autoplay.paused) return; + if (timeout) clearTimeout(timeout); + swiper.autoplay.paused = true; + + if (speed === 0 || !swiper.params.autoplay.waitForTransition) { + swiper.autoplay.paused = false; + run(); + } else { + ['transitionend', 'webkitTransitionEnd'].forEach(event => { + swiper.$wrapperEl[0].addEventListener(event, onTransitionEnd); + }); + } + } + + function onVisibilityChange() { + const document = getDocument(); + + if (document.visibilityState === 'hidden' && swiper.autoplay.running) { + pause(); + } + + if (document.visibilityState === 'visible' && swiper.autoplay.paused) { + run(); + swiper.autoplay.paused = false; + } + } + + function onTransitionEnd(e) { + if (!swiper || swiper.destroyed || !swiper.$wrapperEl) return; + if (e.target !== swiper.$wrapperEl[0]) return; + ['transitionend', 'webkitTransitionEnd'].forEach(event => { + swiper.$wrapperEl[0].removeEventListener(event, onTransitionEnd); + }); + swiper.autoplay.paused = false; + + if (!swiper.autoplay.running) { + stop(); + } else { + run(); + } + } + + function onMouseEnter() { + if (swiper.params.autoplay.disableOnInteraction) { + stop(); + } else { + pause(); + } + + ['transitionend', 'webkitTransitionEnd'].forEach(event => { + swiper.$wrapperEl[0].removeEventListener(event, onTransitionEnd); + }); + } + + function onMouseLeave() { + if (swiper.params.autoplay.disableOnInteraction) { + return; + } + + swiper.autoplay.paused = false; + run(); + } + + function attachMouseEvents() { + if (swiper.params.autoplay.pauseOnMouseEnter) { + swiper.$el.on('mouseenter', onMouseEnter); + swiper.$el.on('mouseleave', onMouseLeave); + } + } + + function detachMouseEvents() { + swiper.$el.off('mouseenter', onMouseEnter); + swiper.$el.off('mouseleave', onMouseLeave); + } + + on('init', () => { + if (swiper.params.autoplay.enabled) { + start(); + const document = getDocument(); + document.addEventListener('visibilitychange', onVisibilityChange); + attachMouseEvents(); + } + }); + on('beforeTransitionStart', (_s, speed, internal) => { + if (swiper.autoplay.running) { + if (internal || !swiper.params.autoplay.disableOnInteraction) { + swiper.autoplay.pause(speed); + } else { + stop(); + } + } + }); + on('sliderFirstMove', () => { + if (swiper.autoplay.running) { + if (swiper.params.autoplay.disableOnInteraction) { + stop(); + } else { + pause(); + } + } + }); + on('touchEnd', () => { + if (swiper.params.cssMode && swiper.autoplay.paused && !swiper.params.autoplay.disableOnInteraction) { + run(); + } + }); + on('destroy', () => { + detachMouseEvents(); + + if (swiper.autoplay.running) { + stop(); + } + + const document = getDocument(); + document.removeEventListener('visibilitychange', onVisibilityChange); + }); + Object.assign(swiper.autoplay, { + pause, + run, + start, + stop + }); + } + + function Thumb({ + swiper, + extendParams, + on + }) { + extendParams({ + thumbs: { + swiper: null, + multipleActiveThumbs: true, + autoScrollOffset: 0, + slideThumbActiveClass: 'swiper-slide-thumb-active', + thumbsContainerClass: 'swiper-thumbs' + } + }); + let initialized = false; + let swiperCreated = false; + swiper.thumbs = { + swiper: null + }; + + function onThumbClick() { + const thumbsSwiper = swiper.thumbs.swiper; + if (!thumbsSwiper) return; + const clickedIndex = thumbsSwiper.clickedIndex; + const clickedSlide = thumbsSwiper.clickedSlide; + if (clickedSlide && $(clickedSlide).hasClass(swiper.params.thumbs.slideThumbActiveClass)) return; + if (typeof clickedIndex === 'undefined' || clickedIndex === null) return; + let slideToIndex; + + if (thumbsSwiper.params.loop) { + slideToIndex = parseInt($(thumbsSwiper.clickedSlide).attr('data-swiper-slide-index'), 10); + } else { + slideToIndex = clickedIndex; + } + + if (swiper.params.loop) { + let currentIndex = swiper.activeIndex; + + if (swiper.slides.eq(currentIndex).hasClass(swiper.params.slideDuplicateClass)) { + swiper.loopFix(); // eslint-disable-next-line + + swiper._clientLeft = swiper.$wrapperEl[0].clientLeft; + currentIndex = swiper.activeIndex; + } + + const prevIndex = swiper.slides.eq(currentIndex).prevAll(`[data-swiper-slide-index="${slideToIndex}"]`).eq(0).index(); + const nextIndex = swiper.slides.eq(currentIndex).nextAll(`[data-swiper-slide-index="${slideToIndex}"]`).eq(0).index(); + if (typeof prevIndex === 'undefined') slideToIndex = nextIndex;else if (typeof nextIndex === 'undefined') slideToIndex = prevIndex;else if (nextIndex - currentIndex < currentIndex - prevIndex) slideToIndex = nextIndex;else slideToIndex = prevIndex; + } + + swiper.slideTo(slideToIndex); + } + + function init() { + const { + thumbs: thumbsParams + } = swiper.params; + if (initialized) return false; + initialized = true; + const SwiperClass = swiper.constructor; + + if (thumbsParams.swiper instanceof SwiperClass) { + swiper.thumbs.swiper = thumbsParams.swiper; + Object.assign(swiper.thumbs.swiper.originalParams, { + watchSlidesProgress: true, + slideToClickedSlide: false + }); + Object.assign(swiper.thumbs.swiper.params, { + watchSlidesProgress: true, + slideToClickedSlide: false + }); + } else if (isObject(thumbsParams.swiper)) { + const thumbsSwiperParams = Object.assign({}, thumbsParams.swiper); + Object.assign(thumbsSwiperParams, { + watchSlidesProgress: true, + slideToClickedSlide: false + }); + swiper.thumbs.swiper = new SwiperClass(thumbsSwiperParams); + swiperCreated = true; + } + + swiper.thumbs.swiper.$el.addClass(swiper.params.thumbs.thumbsContainerClass); + swiper.thumbs.swiper.on('tap', onThumbClick); + return true; + } + + function update(initial) { + const thumbsSwiper = swiper.thumbs.swiper; + if (!thumbsSwiper) return; + const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView; + const autoScrollOffset = swiper.params.thumbs.autoScrollOffset; + const useOffset = autoScrollOffset && !thumbsSwiper.params.loop; + + if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) { + let currentThumbsIndex = thumbsSwiper.activeIndex; + let newThumbsIndex; + let direction; + + if (thumbsSwiper.params.loop) { + if (thumbsSwiper.slides.eq(currentThumbsIndex).hasClass(thumbsSwiper.params.slideDuplicateClass)) { + thumbsSwiper.loopFix(); // eslint-disable-next-line + + thumbsSwiper._clientLeft = thumbsSwiper.$wrapperEl[0].clientLeft; + currentThumbsIndex = thumbsSwiper.activeIndex; + } // Find actual thumbs index to slide to + + + const prevThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).prevAll(`[data-swiper-slide-index="${swiper.realIndex}"]`).eq(0).index(); + const nextThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).nextAll(`[data-swiper-slide-index="${swiper.realIndex}"]`).eq(0).index(); + + if (typeof prevThumbsIndex === 'undefined') { + newThumbsIndex = nextThumbsIndex; + } else if (typeof nextThumbsIndex === 'undefined') { + newThumbsIndex = prevThumbsIndex; + } else if (nextThumbsIndex - currentThumbsIndex === currentThumbsIndex - prevThumbsIndex) { + newThumbsIndex = thumbsSwiper.params.slidesPerGroup > 1 ? nextThumbsIndex : currentThumbsIndex; + } else if (nextThumbsIndex - currentThumbsIndex < currentThumbsIndex - prevThumbsIndex) { + newThumbsIndex = nextThumbsIndex; + } else { + newThumbsIndex = prevThumbsIndex; + } + + direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev'; + } else { + newThumbsIndex = swiper.realIndex; + direction = newThumbsIndex > swiper.previousIndex ? 'next' : 'prev'; + } + + if (useOffset) { + newThumbsIndex += direction === 'next' ? autoScrollOffset : -1 * autoScrollOffset; + } + + if (thumbsSwiper.visibleSlidesIndexes && thumbsSwiper.visibleSlidesIndexes.indexOf(newThumbsIndex) < 0) { + if (thumbsSwiper.params.centeredSlides) { + if (newThumbsIndex > currentThumbsIndex) { + newThumbsIndex = newThumbsIndex - Math.floor(slidesPerView / 2) + 1; + } else { + newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1; + } + } else if (newThumbsIndex > currentThumbsIndex && thumbsSwiper.params.slidesPerGroup === 1) ; + + thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined); + } + } // Activate thumbs + + + let thumbsToActivate = 1; + const thumbActiveClass = swiper.params.thumbs.slideThumbActiveClass; + + if (swiper.params.slidesPerView > 1 && !swiper.params.centeredSlides) { + thumbsToActivate = swiper.params.slidesPerView; + } + + if (!swiper.params.thumbs.multipleActiveThumbs) { + thumbsToActivate = 1; + } + + thumbsToActivate = Math.floor(thumbsToActivate); + thumbsSwiper.slides.removeClass(thumbActiveClass); + + if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled) { + for (let i = 0; i < thumbsToActivate; i += 1) { + thumbsSwiper.$wrapperEl.children(`[data-swiper-slide-index="${swiper.realIndex + i}"]`).addClass(thumbActiveClass); + } + } else { + for (let i = 0; i < thumbsToActivate; i += 1) { + thumbsSwiper.slides.eq(swiper.realIndex + i).addClass(thumbActiveClass); + } + } + } + + on('beforeInit', () => { + const { + thumbs + } = swiper.params; + if (!thumbs || !thumbs.swiper) return; + init(); + update(true); + }); + on('slideChange update resize observerUpdate', () => { + if (!swiper.thumbs.swiper) return; + update(); + }); + on('setTransition', (_s, duration) => { + const thumbsSwiper = swiper.thumbs.swiper; + if (!thumbsSwiper) return; + thumbsSwiper.setTransition(duration); + }); + on('beforeDestroy', () => { + const thumbsSwiper = swiper.thumbs.swiper; + if (!thumbsSwiper) return; + + if (swiperCreated && thumbsSwiper) { + thumbsSwiper.destroy(); + } + }); + Object.assign(swiper.thumbs, { + init, + update + }); + } + + function freeMode({ + swiper, + extendParams, + emit, + once + }) { + extendParams({ + freeMode: { + enabled: false, + momentum: true, + momentumRatio: 1, + momentumBounce: true, + momentumBounceRatio: 1, + momentumVelocityRatio: 1, + sticky: false, + minimumVelocity: 0.02 + } + }); + + function onTouchMove() { + const { + touchEventsData: data, + touches + } = swiper; // Velocity + + if (data.velocities.length === 0) { + data.velocities.push({ + position: touches[swiper.isHorizontal() ? 'startX' : 'startY'], + time: data.touchStartTime + }); + } + + data.velocities.push({ + position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'], + time: now() + }); + } + + function onTouchEnd({ + currentPos + }) { + const { + params, + $wrapperEl, + rtlTranslate: rtl, + snapGrid, + touchEventsData: data + } = swiper; // Time diff + + const touchEndTime = now(); + const timeDiff = touchEndTime - data.touchStartTime; + + if (currentPos < -swiper.minTranslate()) { + swiper.slideTo(swiper.activeIndex); + return; + } + + if (currentPos > -swiper.maxTranslate()) { + if (swiper.slides.length < snapGrid.length) { + swiper.slideTo(snapGrid.length - 1); + } else { + swiper.slideTo(swiper.slides.length - 1); + } + + return; + } + + if (params.freeMode.momentum) { + if (data.velocities.length > 1) { + const lastMoveEvent = data.velocities.pop(); + const velocityEvent = data.velocities.pop(); + const distance = lastMoveEvent.position - velocityEvent.position; + const time = lastMoveEvent.time - velocityEvent.time; + swiper.velocity = distance / time; + swiper.velocity /= 2; + + if (Math.abs(swiper.velocity) < params.freeMode.minimumVelocity) { + swiper.velocity = 0; + } // this implies that the user stopped moving a finger then released. + // There would be no events with distance zero, so the last event is stale. + + + if (time > 150 || now() - lastMoveEvent.time > 300) { + swiper.velocity = 0; + } + } else { + swiper.velocity = 0; + } + + swiper.velocity *= params.freeMode.momentumVelocityRatio; + data.velocities.length = 0; + let momentumDuration = 1000 * params.freeMode.momentumRatio; + const momentumDistance = swiper.velocity * momentumDuration; + let newPosition = swiper.translate + momentumDistance; + if (rtl) newPosition = -newPosition; + let doBounce = false; + let afterBouncePosition; + const bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeMode.momentumBounceRatio; + let needsLoopFix; + + if (newPosition < swiper.maxTranslate()) { + if (params.freeMode.momentumBounce) { + if (newPosition + swiper.maxTranslate() < -bounceAmount) { + newPosition = swiper.maxTranslate() - bounceAmount; + } + + afterBouncePosition = swiper.maxTranslate(); + doBounce = true; + data.allowMomentumBounce = true; + } else { + newPosition = swiper.maxTranslate(); + } + + if (params.loop && params.centeredSlides) needsLoopFix = true; + } else if (newPosition > swiper.minTranslate()) { + if (params.freeMode.momentumBounce) { + if (newPosition - swiper.minTranslate() > bounceAmount) { + newPosition = swiper.minTranslate() + bounceAmount; + } + + afterBouncePosition = swiper.minTranslate(); + doBounce = true; + data.allowMomentumBounce = true; + } else { + newPosition = swiper.minTranslate(); + } + + if (params.loop && params.centeredSlides) needsLoopFix = true; + } else if (params.freeMode.sticky) { + let nextSlide; + + for (let j = 0; j < snapGrid.length; j += 1) { + if (snapGrid[j] > -newPosition) { + nextSlide = j; + break; + } + } + + if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') { + newPosition = snapGrid[nextSlide]; + } else { + newPosition = snapGrid[nextSlide - 1]; + } + + newPosition = -newPosition; + } + + if (needsLoopFix) { + once('transitionEnd', () => { + swiper.loopFix(); + }); + } // Fix duration + + + if (swiper.velocity !== 0) { + if (rtl) { + momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity); + } else { + momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity); + } + + if (params.freeMode.sticky) { + // If freeMode.sticky is active and the user ends a swipe with a slow-velocity + // event, then durations can be 20+ seconds to slide one (or zero!) slides. + // It's easy to see this when simulating touch with mouse events. To fix this, + // limit single-slide swipes to the default slide duration. This also has the + // nice side effect of matching slide speed if the user stopped moving before + // lifting finger or mouse vs. moving slowly before lifting the finger/mouse. + // For faster swipes, also apply limits (albeit higher ones). + const moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate); + const currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex]; + + if (moveDistance < currentSlideSize) { + momentumDuration = params.speed; + } else if (moveDistance < 2 * currentSlideSize) { + momentumDuration = params.speed * 1.5; + } else { + momentumDuration = params.speed * 2.5; + } + } + } else if (params.freeMode.sticky) { + swiper.slideToClosest(); + return; + } + + if (params.freeMode.momentumBounce && doBounce) { + swiper.updateProgress(afterBouncePosition); + swiper.setTransition(momentumDuration); + swiper.setTranslate(newPosition); + swiper.transitionStart(true, swiper.swipeDirection); + swiper.animating = true; + $wrapperEl.transitionEnd(() => { + if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return; + emit('momentumBounce'); + swiper.setTransition(params.speed); + setTimeout(() => { + swiper.setTranslate(afterBouncePosition); + $wrapperEl.transitionEnd(() => { + if (!swiper || swiper.destroyed) return; + swiper.transitionEnd(); + }); + }, 0); + }); + } else if (swiper.velocity) { + emit('_freeModeNoMomentumRelease'); + swiper.updateProgress(newPosition); + swiper.setTransition(momentumDuration); + swiper.setTranslate(newPosition); + swiper.transitionStart(true, swiper.swipeDirection); + + if (!swiper.animating) { + swiper.animating = true; + $wrapperEl.transitionEnd(() => { + if (!swiper || swiper.destroyed) return; + swiper.transitionEnd(); + }); + } + } else { + swiper.updateProgress(newPosition); + } + + swiper.updateActiveIndex(); + swiper.updateSlidesClasses(); + } else if (params.freeMode.sticky) { + swiper.slideToClosest(); + return; + } else if (params.freeMode) { + emit('_freeModeNoMomentumRelease'); + } + + if (!params.freeMode.momentum || timeDiff >= params.longSwipesMs) { + swiper.updateProgress(); + swiper.updateActiveIndex(); + swiper.updateSlidesClasses(); + } + } + + Object.assign(swiper, { + freeMode: { + onTouchMove, + onTouchEnd + } + }); + } + + function Grid({ + swiper, + extendParams + }) { + extendParams({ + grid: { + rows: 1, + fill: 'column' + } + }); + let slidesNumberEvenToRows; + let slidesPerRow; + let numFullColumns; + + const initSlides = slidesLength => { + const { + slidesPerView + } = swiper.params; + const { + rows, + fill + } = swiper.params.grid; + slidesPerRow = slidesNumberEvenToRows / rows; + numFullColumns = Math.floor(slidesLength / rows); + + if (Math.floor(slidesLength / rows) === slidesLength / rows) { + slidesNumberEvenToRows = slidesLength; + } else { + slidesNumberEvenToRows = Math.ceil(slidesLength / rows) * rows; + } + + if (slidesPerView !== 'auto' && fill === 'row') { + slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, slidesPerView * rows); + } + }; + + const updateSlide = (i, slide, slidesLength, getDirectionLabel) => { + const { + slidesPerGroup, + spaceBetween + } = swiper.params; + const { + rows, + fill + } = swiper.params.grid; // Set slides order + + let newSlideOrderIndex; + let column; + let row; + + if (fill === 'row' && slidesPerGroup > 1) { + const groupIndex = Math.floor(i / (slidesPerGroup * rows)); + const slideIndexInGroup = i - rows * slidesPerGroup * groupIndex; + const columnsInGroup = groupIndex === 0 ? slidesPerGroup : Math.min(Math.ceil((slidesLength - groupIndex * rows * slidesPerGroup) / rows), slidesPerGroup); + row = Math.floor(slideIndexInGroup / columnsInGroup); + column = slideIndexInGroup - row * columnsInGroup + groupIndex * slidesPerGroup; + newSlideOrderIndex = column + row * slidesNumberEvenToRows / rows; + slide.css({ + '-webkit-order': newSlideOrderIndex, + order: newSlideOrderIndex + }); + } else if (fill === 'column') { + column = Math.floor(i / rows); + row = i - column * rows; + + if (column > numFullColumns || column === numFullColumns && row === rows - 1) { + row += 1; + + if (row >= rows) { + row = 0; + column += 1; + } + } + } else { + row = Math.floor(i / slidesPerRow); + column = i - row * slidesPerRow; + } + + slide.css(getDirectionLabel('margin-top'), row !== 0 ? spaceBetween && `${spaceBetween}px` : ''); + }; + + const updateWrapperSize = (slideSize, snapGrid, getDirectionLabel) => { + const { + spaceBetween, + centeredSlides, + roundLengths + } = swiper.params; + const { + rows + } = swiper.params.grid; + swiper.virtualSize = (slideSize + spaceBetween) * slidesNumberEvenToRows; + swiper.virtualSize = Math.ceil(swiper.virtualSize / rows) - spaceBetween; + swiper.$wrapperEl.css({ + [getDirectionLabel('width')]: `${swiper.virtualSize + spaceBetween}px` + }); + + if (centeredSlides) { + snapGrid.splice(0, snapGrid.length); + const newSlidesGrid = []; + + for (let i = 0; i < snapGrid.length; i += 1) { + let slidesGridItem = snapGrid[i]; + if (roundLengths) slidesGridItem = Math.floor(slidesGridItem); + if (snapGrid[i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem); + } + + snapGrid.push(...newSlidesGrid); + } + }; + + swiper.grid = { + initSlides, + updateSlide, + updateWrapperSize + }; + } + + function appendSlide(slides) { + const swiper = this; + const { + $wrapperEl, + params + } = swiper; + + if (params.loop) { + swiper.loopDestroy(); + } + + if (typeof slides === 'object' && 'length' in slides) { + for (let i = 0; i < slides.length; i += 1) { + if (slides[i]) $wrapperEl.append(slides[i]); + } + } else { + $wrapperEl.append(slides); + } + + if (params.loop) { + swiper.loopCreate(); + } + + if (!params.observer) { + swiper.update(); + } + } + + function prependSlide(slides) { + const swiper = this; + const { + params, + $wrapperEl, + activeIndex + } = swiper; + + if (params.loop) { + swiper.loopDestroy(); + } + + let newActiveIndex = activeIndex + 1; + + if (typeof slides === 'object' && 'length' in slides) { + for (let i = 0; i < slides.length; i += 1) { + if (slides[i]) $wrapperEl.prepend(slides[i]); + } + + newActiveIndex = activeIndex + slides.length; + } else { + $wrapperEl.prepend(slides); + } + + if (params.loop) { + swiper.loopCreate(); + } + + if (!params.observer) { + swiper.update(); + } + + swiper.slideTo(newActiveIndex, 0, false); + } + + function addSlide(index, slides) { + const swiper = this; + const { + $wrapperEl, + params, + activeIndex + } = swiper; + let activeIndexBuffer = activeIndex; + + if (params.loop) { + activeIndexBuffer -= swiper.loopedSlides; + swiper.loopDestroy(); + swiper.slides = $wrapperEl.children(`.${params.slideClass}`); + } + + const baseLength = swiper.slides.length; + + if (index <= 0) { + swiper.prependSlide(slides); + return; + } + + if (index >= baseLength) { + swiper.appendSlide(slides); + return; + } + + let newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer; + const slidesBuffer = []; + + for (let i = baseLength - 1; i >= index; i -= 1) { + const currentSlide = swiper.slides.eq(i); + currentSlide.remove(); + slidesBuffer.unshift(currentSlide); + } + + if (typeof slides === 'object' && 'length' in slides) { + for (let i = 0; i < slides.length; i += 1) { + if (slides[i]) $wrapperEl.append(slides[i]); + } + + newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer; + } else { + $wrapperEl.append(slides); + } + + for (let i = 0; i < slidesBuffer.length; i += 1) { + $wrapperEl.append(slidesBuffer[i]); + } + + if (params.loop) { + swiper.loopCreate(); + } + + if (!params.observer) { + swiper.update(); + } + + if (params.loop) { + swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false); + } else { + swiper.slideTo(newActiveIndex, 0, false); + } + } + + function removeSlide(slidesIndexes) { + const swiper = this; + const { + params, + $wrapperEl, + activeIndex + } = swiper; + let activeIndexBuffer = activeIndex; + + if (params.loop) { + activeIndexBuffer -= swiper.loopedSlides; + swiper.loopDestroy(); + swiper.slides = $wrapperEl.children(`.${params.slideClass}`); + } + + let newActiveIndex = activeIndexBuffer; + let indexToRemove; + + if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) { + for (let i = 0; i < slidesIndexes.length; i += 1) { + indexToRemove = slidesIndexes[i]; + if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove(); + if (indexToRemove < newActiveIndex) newActiveIndex -= 1; + } + + newActiveIndex = Math.max(newActiveIndex, 0); + } else { + indexToRemove = slidesIndexes; + if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove(); + if (indexToRemove < newActiveIndex) newActiveIndex -= 1; + newActiveIndex = Math.max(newActiveIndex, 0); + } + + if (params.loop) { + swiper.loopCreate(); + } + + if (!params.observer) { + swiper.update(); + } + + if (params.loop) { + swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false); + } else { + swiper.slideTo(newActiveIndex, 0, false); + } + } + + function removeAllSlides() { + const swiper = this; + const slidesIndexes = []; + + for (let i = 0; i < swiper.slides.length; i += 1) { + slidesIndexes.push(i); + } + + swiper.removeSlide(slidesIndexes); + } + + function Manipulation({ + swiper + }) { + Object.assign(swiper, { + appendSlide: appendSlide.bind(swiper), + prependSlide: prependSlide.bind(swiper), + addSlide: addSlide.bind(swiper), + removeSlide: removeSlide.bind(swiper), + removeAllSlides: removeAllSlides.bind(swiper) + }); + } + + function effectInit(params) { + const { + effect, + swiper, + on, + setTranslate, + setTransition, + overwriteParams, + perspective + } = params; + on('beforeInit', () => { + if (swiper.params.effect !== effect) return; + swiper.classNames.push(`${swiper.params.containerModifierClass}${effect}`); + + if (perspective && perspective()) { + swiper.classNames.push(`${swiper.params.containerModifierClass}3d`); + } + + const overwriteParamsResult = overwriteParams ? overwriteParams() : {}; + Object.assign(swiper.params, overwriteParamsResult); + Object.assign(swiper.originalParams, overwriteParamsResult); + }); + on('setTranslate', () => { + if (swiper.params.effect !== effect) return; + setTranslate(); + }); + on('setTransition', (_s, duration) => { + if (swiper.params.effect !== effect) return; + setTransition(duration); + }); + } + + function effectTarget(effectParams, $slideEl) { + if (effectParams.transformEl) { + return $slideEl.find(effectParams.transformEl).css({ + 'backface-visibility': 'hidden', + '-webkit-backface-visibility': 'hidden' + }); + } + + return $slideEl; + } + + function effectVirtualTransitionEnd({ + swiper, + duration, + transformEl, + allSlides + }) { + const { + slides, + activeIndex, + $wrapperEl + } = swiper; + + if (swiper.params.virtualTranslate && duration !== 0) { + let eventTriggered = false; + let $transitionEndTarget; + + if (allSlides) { + $transitionEndTarget = transformEl ? slides.find(transformEl) : slides; + } else { + $transitionEndTarget = transformEl ? slides.eq(activeIndex).find(transformEl) : slides.eq(activeIndex); + } + + $transitionEndTarget.transitionEnd(() => { + if (eventTriggered) return; + if (!swiper || swiper.destroyed) return; + eventTriggered = true; + swiper.animating = false; + const triggerEvents = ['webkitTransitionEnd', 'transitionend']; + + for (let i = 0; i < triggerEvents.length; i += 1) { + $wrapperEl.trigger(triggerEvents[i]); + } + }); + } + } + + function EffectFade({ + swiper, + extendParams, + on + }) { + extendParams({ + fadeEffect: { + crossFade: false, + transformEl: null + } + }); + + const setTranslate = () => { + const { + slides + } = swiper; + const params = swiper.params.fadeEffect; + + for (let i = 0; i < slides.length; i += 1) { + const $slideEl = swiper.slides.eq(i); + const offset = $slideEl[0].swiperSlideOffset; + let tx = -offset; + if (!swiper.params.virtualTranslate) tx -= swiper.translate; + let ty = 0; + + if (!swiper.isHorizontal()) { + ty = tx; + tx = 0; + } + + const slideOpacity = swiper.params.fadeEffect.crossFade ? Math.max(1 - Math.abs($slideEl[0].progress), 0) : 1 + Math.min(Math.max($slideEl[0].progress, -1), 0); + const $targetEl = effectTarget(params, $slideEl); + $targetEl.css({ + opacity: slideOpacity + }).transform(`translate3d(${tx}px, ${ty}px, 0px)`); + } + }; + + const setTransition = duration => { + const { + transformEl + } = swiper.params.fadeEffect; + const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; + $transitionElements.transition(duration); + effectVirtualTransitionEnd({ + swiper, + duration, + transformEl, + allSlides: true + }); + }; + + effectInit({ + effect: 'fade', + swiper, + on, + setTranslate, + setTransition, + overwriteParams: () => ({ + slidesPerView: 1, + slidesPerGroup: 1, + watchSlidesProgress: true, + spaceBetween: 0, + virtualTranslate: !swiper.params.cssMode + }) + }); + } + + function EffectCube({ + swiper, + extendParams, + on + }) { + extendParams({ + cubeEffect: { + slideShadows: true, + shadow: true, + shadowOffset: 20, + shadowScale: 0.94 + } + }); + + const setTranslate = () => { + const { + $el, + $wrapperEl, + slides, + width: swiperWidth, + height: swiperHeight, + rtlTranslate: rtl, + size: swiperSize, + browser + } = swiper; + const params = swiper.params.cubeEffect; + const isHorizontal = swiper.isHorizontal(); + const isVirtual = swiper.virtual && swiper.params.virtual.enabled; + let wrapperRotate = 0; + let $cubeShadowEl; + + if (params.shadow) { + if (isHorizontal) { + $cubeShadowEl = $wrapperEl.find('.swiper-cube-shadow'); + + if ($cubeShadowEl.length === 0) { + $cubeShadowEl = $('<div class="swiper-cube-shadow"></div>'); + $wrapperEl.append($cubeShadowEl); + } + + $cubeShadowEl.css({ + height: `${swiperWidth}px` + }); + } else { + $cubeShadowEl = $el.find('.swiper-cube-shadow'); + + if ($cubeShadowEl.length === 0) { + $cubeShadowEl = $('<div class="swiper-cube-shadow"></div>'); + $el.append($cubeShadowEl); + } + } + } + + for (let i = 0; i < slides.length; i += 1) { + const $slideEl = slides.eq(i); + let slideIndex = i; + + if (isVirtual) { + slideIndex = parseInt($slideEl.attr('data-swiper-slide-index'), 10); + } + + let slideAngle = slideIndex * 90; + let round = Math.floor(slideAngle / 360); + + if (rtl) { + slideAngle = -slideAngle; + round = Math.floor(-slideAngle / 360); + } + + const progress = Math.max(Math.min($slideEl[0].progress, 1), -1); + let tx = 0; + let ty = 0; + let tz = 0; + + if (slideIndex % 4 === 0) { + tx = -round * 4 * swiperSize; + tz = 0; + } else if ((slideIndex - 1) % 4 === 0) { + tx = 0; + tz = -round * 4 * swiperSize; + } else if ((slideIndex - 2) % 4 === 0) { + tx = swiperSize + round * 4 * swiperSize; + tz = swiperSize; + } else if ((slideIndex - 3) % 4 === 0) { + tx = -swiperSize; + tz = 3 * swiperSize + swiperSize * 4 * round; + } + + if (rtl) { + tx = -tx; + } + + if (!isHorizontal) { + ty = tx; + tx = 0; + } + + const transform = `rotateX(${isHorizontal ? 0 : -slideAngle}deg) rotateY(${isHorizontal ? slideAngle : 0}deg) translate3d(${tx}px, ${ty}px, ${tz}px)`; + + if (progress <= 1 && progress > -1) { + wrapperRotate = slideIndex * 90 + progress * 90; + if (rtl) wrapperRotate = -slideIndex * 90 - progress * 90; + } + + $slideEl.transform(transform); + + if (params.slideShadows) { + // Set shadows + let shadowBefore = isHorizontal ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top'); + let shadowAfter = isHorizontal ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom'); + + if (shadowBefore.length === 0) { + shadowBefore = $(`<div class="swiper-slide-shadow-${isHorizontal ? 'left' : 'top'}"></div>`); + $slideEl.append(shadowBefore); + } + + if (shadowAfter.length === 0) { + shadowAfter = $(`<div class="swiper-slide-shadow-${isHorizontal ? 'right' : 'bottom'}"></div>`); + $slideEl.append(shadowAfter); + } + + if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0); + if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0); + } + } + + $wrapperEl.css({ + '-webkit-transform-origin': `50% 50% -${swiperSize / 2}px`, + 'transform-origin': `50% 50% -${swiperSize / 2}px` + }); + + if (params.shadow) { + if (isHorizontal) { + $cubeShadowEl.transform(`translate3d(0px, ${swiperWidth / 2 + params.shadowOffset}px, ${-swiperWidth / 2}px) rotateX(90deg) rotateZ(0deg) scale(${params.shadowScale})`); + } else { + const shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90; + const multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2); + const scale1 = params.shadowScale; + const scale2 = params.shadowScale / multiplier; + const offset = params.shadowOffset; + $cubeShadowEl.transform(`scale3d(${scale1}, 1, ${scale2}) translate3d(0px, ${swiperHeight / 2 + offset}px, ${-swiperHeight / 2 / scale2}px) rotateX(-90deg)`); + } + } + + const zFactor = browser.isSafari || browser.isWebView ? -swiperSize / 2 : 0; + $wrapperEl.transform(`translate3d(0px,0,${zFactor}px) rotateX(${swiper.isHorizontal() ? 0 : wrapperRotate}deg) rotateY(${swiper.isHorizontal() ? -wrapperRotate : 0}deg)`); + }; + + const setTransition = duration => { + const { + $el, + slides + } = swiper; + slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration); + + if (swiper.params.cubeEffect.shadow && !swiper.isHorizontal()) { + $el.find('.swiper-cube-shadow').transition(duration); + } + }; + + effectInit({ + effect: 'cube', + swiper, + on, + setTranslate, + setTransition, + perspective: () => true, + overwriteParams: () => ({ + slidesPerView: 1, + slidesPerGroup: 1, + watchSlidesProgress: true, + resistanceRatio: 0, + spaceBetween: 0, + centeredSlides: false, + virtualTranslate: true + }) + }); + } + + function createShadow(params, $slideEl, side) { + const shadowClass = `swiper-slide-shadow${side ? `-${side}` : ''}`; + const $shadowContainer = params.transformEl ? $slideEl.find(params.transformEl) : $slideEl; + let $shadowEl = $shadowContainer.children(`.${shadowClass}`); + + if (!$shadowEl.length) { + $shadowEl = $(`<div class="swiper-slide-shadow${side ? `-${side}` : ''}"></div>`); + $shadowContainer.append($shadowEl); + } + + return $shadowEl; + } + + function EffectFlip({ + swiper, + extendParams, + on + }) { + extendParams({ + flipEffect: { + slideShadows: true, + limitRotation: true, + transformEl: null + } + }); + + const setTranslate = () => { + const { + slides, + rtlTranslate: rtl + } = swiper; + const params = swiper.params.flipEffect; + + for (let i = 0; i < slides.length; i += 1) { + const $slideEl = slides.eq(i); + let progress = $slideEl[0].progress; + + if (swiper.params.flipEffect.limitRotation) { + progress = Math.max(Math.min($slideEl[0].progress, 1), -1); + } + + const offset = $slideEl[0].swiperSlideOffset; + const rotate = -180 * progress; + let rotateY = rotate; + let rotateX = 0; + let tx = swiper.params.cssMode ? -offset - swiper.translate : -offset; + let ty = 0; + + if (!swiper.isHorizontal()) { + ty = tx; + tx = 0; + rotateX = -rotateY; + rotateY = 0; + } else if (rtl) { + rotateY = -rotateY; + } + + $slideEl[0].style.zIndex = -Math.abs(Math.round(progress)) + slides.length; + + if (params.slideShadows) { + // Set shadows + let shadowBefore = swiper.isHorizontal() ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top'); + let shadowAfter = swiper.isHorizontal() ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom'); + + if (shadowBefore.length === 0) { + shadowBefore = createShadow(params, $slideEl, swiper.isHorizontal() ? 'left' : 'top'); + } + + if (shadowAfter.length === 0) { + shadowAfter = createShadow(params, $slideEl, swiper.isHorizontal() ? 'right' : 'bottom'); + } + + if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0); + if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0); + } + + const transform = `translate3d(${tx}px, ${ty}px, 0px) rotateX(${rotateX}deg) rotateY(${rotateY}deg)`; + const $targetEl = effectTarget(params, $slideEl); + $targetEl.transform(transform); + } + }; + + const setTransition = duration => { + const { + transformEl + } = swiper.params.flipEffect; + const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; + $transitionElements.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration); + effectVirtualTransitionEnd({ + swiper, + duration, + transformEl + }); + }; + + effectInit({ + effect: 'flip', + swiper, + on, + setTranslate, + setTransition, + perspective: () => true, + overwriteParams: () => ({ + slidesPerView: 1, + slidesPerGroup: 1, + watchSlidesProgress: true, + spaceBetween: 0, + virtualTranslate: !swiper.params.cssMode + }) + }); + } + + function EffectCoverflow({ + swiper, + extendParams, + on + }) { + extendParams({ + coverflowEffect: { + rotate: 50, + stretch: 0, + depth: 100, + scale: 1, + modifier: 1, + slideShadows: true, + transformEl: null + } + }); + + const setTranslate = () => { + const { + width: swiperWidth, + height: swiperHeight, + slides, + slidesSizesGrid + } = swiper; + const params = swiper.params.coverflowEffect; + const isHorizontal = swiper.isHorizontal(); + const transform = swiper.translate; + const center = isHorizontal ? -transform + swiperWidth / 2 : -transform + swiperHeight / 2; + const rotate = isHorizontal ? params.rotate : -params.rotate; + const translate = params.depth; // Each slide offset from center + + for (let i = 0, length = slides.length; i < length; i += 1) { + const $slideEl = slides.eq(i); + const slideSize = slidesSizesGrid[i]; + const slideOffset = $slideEl[0].swiperSlideOffset; + const offsetMultiplier = (center - slideOffset - slideSize / 2) / slideSize * params.modifier; + let rotateY = isHorizontal ? rotate * offsetMultiplier : 0; + let rotateX = isHorizontal ? 0 : rotate * offsetMultiplier; // var rotateZ = 0 + + let translateZ = -translate * Math.abs(offsetMultiplier); + let stretch = params.stretch; // Allow percentage to make a relative stretch for responsive sliders + + if (typeof stretch === 'string' && stretch.indexOf('%') !== -1) { + stretch = parseFloat(params.stretch) / 100 * slideSize; + } + + let translateY = isHorizontal ? 0 : stretch * offsetMultiplier; + let translateX = isHorizontal ? stretch * offsetMultiplier : 0; + let scale = 1 - (1 - params.scale) * Math.abs(offsetMultiplier); // Fix for ultra small values + + if (Math.abs(translateX) < 0.001) translateX = 0; + if (Math.abs(translateY) < 0.001) translateY = 0; + if (Math.abs(translateZ) < 0.001) translateZ = 0; + if (Math.abs(rotateY) < 0.001) rotateY = 0; + if (Math.abs(rotateX) < 0.001) rotateX = 0; + if (Math.abs(scale) < 0.001) scale = 0; + const slideTransform = `translate3d(${translateX}px,${translateY}px,${translateZ}px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) scale(${scale})`; + const $targetEl = effectTarget(params, $slideEl); + $targetEl.transform(slideTransform); + $slideEl[0].style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1; + + if (params.slideShadows) { + // Set shadows + let $shadowBeforeEl = isHorizontal ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top'); + let $shadowAfterEl = isHorizontal ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom'); + + if ($shadowBeforeEl.length === 0) { + $shadowBeforeEl = createShadow(params, $slideEl, isHorizontal ? 'left' : 'top'); + } + + if ($shadowAfterEl.length === 0) { + $shadowAfterEl = createShadow(params, $slideEl, isHorizontal ? 'right' : 'bottom'); + } + + if ($shadowBeforeEl.length) $shadowBeforeEl[0].style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0; + if ($shadowAfterEl.length) $shadowAfterEl[0].style.opacity = -offsetMultiplier > 0 ? -offsetMultiplier : 0; + } + } + }; + + const setTransition = duration => { + const { + transformEl + } = swiper.params.coverflowEffect; + const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; + $transitionElements.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration); + }; + + effectInit({ + effect: 'coverflow', + swiper, + on, + setTranslate, + setTransition, + perspective: () => true, + overwriteParams: () => ({ + watchSlidesProgress: true + }) + }); + } + + function EffectCreative({ + swiper, + extendParams, + on + }) { + extendParams({ + creativeEffect: { + transformEl: null, + limitProgress: 1, + shadowPerProgress: false, + progressMultiplier: 1, + perspective: true, + prev: { + translate: [0, 0, 0], + rotate: [0, 0, 0], + opacity: 1, + scale: 1 + }, + next: { + translate: [0, 0, 0], + rotate: [0, 0, 0], + opacity: 1, + scale: 1 + } + } + }); + + const getTranslateValue = value => { + if (typeof value === 'string') return value; + return `${value}px`; + }; + + const setTranslate = () => { + const { + slides, + $wrapperEl, + slidesSizesGrid + } = swiper; + const params = swiper.params.creativeEffect; + const { + progressMultiplier: multiplier + } = params; + const isCenteredSlides = swiper.params.centeredSlides; + + if (isCenteredSlides) { + const margin = slidesSizesGrid[0] / 2 - swiper.params.slidesOffsetBefore || 0; + $wrapperEl.transform(`translateX(calc(50% - ${margin}px))`); + } + + for (let i = 0; i < slides.length; i += 1) { + const $slideEl = slides.eq(i); + const slideProgress = $slideEl[0].progress; + const progress = Math.min(Math.max($slideEl[0].progress, -params.limitProgress), params.limitProgress); + let originalProgress = progress; + + if (!isCenteredSlides) { + originalProgress = Math.min(Math.max($slideEl[0].originalProgress, -params.limitProgress), params.limitProgress); + } + + const offset = $slideEl[0].swiperSlideOffset; + const t = [swiper.params.cssMode ? -offset - swiper.translate : -offset, 0, 0]; + const r = [0, 0, 0]; + let custom = false; + + if (!swiper.isHorizontal()) { + t[1] = t[0]; + t[0] = 0; + } + + let data = { + translate: [0, 0, 0], + rotate: [0, 0, 0], + scale: 1, + opacity: 1 + }; + + if (progress < 0) { + data = params.next; + custom = true; + } else if (progress > 0) { + data = params.prev; + custom = true; + } // set translate + + + t.forEach((value, index) => { + t[index] = `calc(${value}px + (${getTranslateValue(data.translate[index])} * ${Math.abs(progress * multiplier)}))`; + }); // set rotates + + r.forEach((value, index) => { + r[index] = data.rotate[index] * Math.abs(progress * multiplier); + }); + $slideEl[0].style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length; + const translateString = t.join(', '); + const rotateString = `rotateX(${r[0]}deg) rotateY(${r[1]}deg) rotateZ(${r[2]}deg)`; + const scaleString = originalProgress < 0 ? `scale(${1 + (1 - data.scale) * originalProgress * multiplier})` : `scale(${1 - (1 - data.scale) * originalProgress * multiplier})`; + const opacityString = originalProgress < 0 ? 1 + (1 - data.opacity) * originalProgress * multiplier : 1 - (1 - data.opacity) * originalProgress * multiplier; + const transform = `translate3d(${translateString}) ${rotateString} ${scaleString}`; // Set shadows + + if (custom && data.shadow || !custom) { + let $shadowEl = $slideEl.children('.swiper-slide-shadow'); + + if ($shadowEl.length === 0 && data.shadow) { + $shadowEl = createShadow(params, $slideEl); + } + + if ($shadowEl.length) { + const shadowOpacity = params.shadowPerProgress ? progress * (1 / params.limitProgress) : progress; + $shadowEl[0].style.opacity = Math.min(Math.max(Math.abs(shadowOpacity), 0), 1); + } + } + + const $targetEl = effectTarget(params, $slideEl); + $targetEl.transform(transform).css({ + opacity: opacityString + }); + + if (data.origin) { + $targetEl.css('transform-origin', data.origin); + } + } + }; + + const setTransition = duration => { + const { + transformEl + } = swiper.params.creativeEffect; + const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; + $transitionElements.transition(duration).find('.swiper-slide-shadow').transition(duration); + effectVirtualTransitionEnd({ + swiper, + duration, + transformEl, + allSlides: true + }); + }; + + effectInit({ + effect: 'creative', + swiper, + on, + setTranslate, + setTransition, + perspective: () => swiper.params.creativeEffect.perspective, + overwriteParams: () => ({ + watchSlidesProgress: true, + virtualTranslate: !swiper.params.cssMode + }) + }); + } + + function EffectCards({ + swiper, + extendParams, + on + }) { + extendParams({ + cardsEffect: { + slideShadows: true, + transformEl: null + } + }); + + const setTranslate = () => { + const { + slides, + activeIndex + } = swiper; + const params = swiper.params.cardsEffect; + const { + startTranslate, + isTouched + } = swiper.touchEventsData; + const currentTranslate = swiper.translate; + + for (let i = 0; i < slides.length; i += 1) { + const $slideEl = slides.eq(i); + const slideProgress = $slideEl[0].progress; + const progress = Math.min(Math.max(slideProgress, -4), 4); + let offset = $slideEl[0].swiperSlideOffset; + + if (swiper.params.centeredSlides && !swiper.params.cssMode) { + swiper.$wrapperEl.transform(`translateX(${swiper.minTranslate()}px)`); + } + + if (swiper.params.centeredSlides && swiper.params.cssMode) { + offset -= slides[0].swiperSlideOffset; + } + + let tX = swiper.params.cssMode ? -offset - swiper.translate : -offset; + let tY = 0; + const tZ = -100 * Math.abs(progress); + let scale = 1; + let rotate = -2 * progress; + let tXAdd = 8 - Math.abs(progress) * 0.75; + const isSwipeToNext = (i === activeIndex || i === activeIndex - 1) && progress > 0 && progress < 1 && (isTouched || swiper.params.cssMode) && currentTranslate < startTranslate; + const isSwipeToPrev = (i === activeIndex || i === activeIndex + 1) && progress < 0 && progress > -1 && (isTouched || swiper.params.cssMode) && currentTranslate > startTranslate; + + if (isSwipeToNext || isSwipeToPrev) { + const subProgress = (1 - Math.abs((Math.abs(progress) - 0.5) / 0.5)) ** 0.5; + rotate += -28 * progress * subProgress; + scale += -0.5 * subProgress; + tXAdd += 96 * subProgress; + tY = `${-25 * subProgress * Math.abs(progress)}%`; + } + + if (progress < 0) { + // next + tX = `calc(${tX}px + (${tXAdd * Math.abs(progress)}%))`; + } else if (progress > 0) { + // prev + tX = `calc(${tX}px + (-${tXAdd * Math.abs(progress)}%))`; + } else { + tX = `${tX}px`; + } + + if (!swiper.isHorizontal()) { + const prevY = tY; + tY = tX; + tX = prevY; + } + + const scaleString = progress < 0 ? `${1 + (1 - scale) * progress}` : `${1 - (1 - scale) * progress}`; + const transform = ` + translate3d(${tX}, ${tY}, ${tZ}px) + rotateZ(${rotate}deg) + scale(${scaleString}) + `; + + if (params.slideShadows) { + // Set shadows + let $shadowEl = $slideEl.find('.swiper-slide-shadow'); + + if ($shadowEl.length === 0) { + $shadowEl = createShadow(params, $slideEl); + } + + if ($shadowEl.length) $shadowEl[0].style.opacity = Math.min(Math.max((Math.abs(progress) - 0.5) / 0.5, 0), 1); + } + + $slideEl[0].style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length; + const $targetEl = effectTarget(params, $slideEl); + $targetEl.transform(transform); + } + }; + + const setTransition = duration => { + const { + transformEl + } = swiper.params.cardsEffect; + const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; + $transitionElements.transition(duration).find('.swiper-slide-shadow').transition(duration); + effectVirtualTransitionEnd({ + swiper, + duration, + transformEl + }); + }; + + effectInit({ + effect: 'cards', + swiper, + on, + setTranslate, + setTransition, + perspective: () => true, + overwriteParams: () => ({ + watchSlidesProgress: true, + virtualTranslate: !swiper.params.cssMode + }) + }); + } + + // Swiper Class + const modules = [Virtual, Keyboard, Mousewheel, Navigation, Pagination, Scrollbar, Parallax, Zoom, Lazy, Controller, A11y, History, HashNavigation, Autoplay, Thumb, freeMode, Grid, Manipulation, EffectFade, EffectCube, EffectFlip, EffectCoverflow, EffectCreative, EffectCards]; + Swiper.use(modules); + + return Swiper; + +}))); +//# sourceMappingURL=swiper-bundle.js.map Property changes on: base3.10/src/main/webapp/js/user/swiper-bundle.js ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/js/user/animation.gsap.js =================================================================== --- base3.10/src/main/webapp/js/user/animation.gsap.js (nonexistent) +++ base3.10/src/main/webapp/js/user/animation.gsap.js (revision 34) @@ -0,0 +1,333 @@ +/*! + * ScrollMagic v2.0.8 (2020-08-14) + * The javascript library for magical scroll interactions. + * (c) 2020 Jan Paepke (@janpaepke) + * Project Website: http://scrollmagic.io + * + * @version 2.0.8 + * @license Dual licensed under MIT license and GPL. + * @author Jan Paepke - e-mail@janpaepke.de + * + * @file ScrollMagic GSAP Animation Plugin. + * + * requires: GSAP ~1.14 + * Powered by the Greensock Animation Platform (GSAP): http://www.greensock.com/js + * Greensock License info at http://www.greensock.com/licensing/ + */ +/** + * This plugin is meant to be used in conjunction with the Greensock Animation Plattform. + * It offers an easy API to trigger Tweens or synchronize them to the scrollbar movement. + * + * Both the `lite` and the `max` versions of the GSAP library are supported. + * The most basic requirement is `TweenLite`. + * + * To have access to this extension, please include `plugins/animation.gsap.js`. + * @requires {@link http://greensock.com/gsap|GSAP ~1.14.x} + * @mixin animation.GSAP + */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ScrollMagic', 'gsap', 'TweenMax', 'TimelineMax'], factory); + } else if (typeof exports === 'object') { + // CommonJS + // Loads whole gsap package onto global scope. + var gsap = require("gsap/dist/gsap") || require("gsap"); + + // TweenMax/TimelineMax will be global in v2. In v3, they will be on the gsap object + factory(require('scrollmagic'), gsap, TweenMax || gsap, TimelineMax || gsap); + } else { + // Browser globals + factory(root.ScrollMagic || (root.jQuery && root.jQuery.ScrollMagic), root.gsap, root.gsap || root.TweenMax || root.TweenLite, root.gsap || root.TimelineMax || root.TimelineLite); + } +}(this, function (ScrollMagic, Gsap, Tween, Timeline) { + "use strict"; + var NAMESPACE = "animation.gsap"; + var GSAP3_OR_GREATER = Gsap && parseFloat(Gsap.version) >= 3; + + var + console = window.console || {}, + err = Function.prototype.bind.call(console.error || console.log || function () {}, console); + if (!ScrollMagic) { + err("(" + NAMESPACE + ") -> ERROR: The ScrollMagic main module could not be found. Please make sure it's loaded before this plugin or use an asynchronous loader like requirejs."); + } + if (!Tween) { + err("(" + NAMESPACE + ") -> ERROR: TweenLite or TweenMax could not be found. Please make sure GSAP is loaded before ScrollMagic or use an asynchronous loader like requirejs."); + } + + /* + * ---------------------------------------------------------------- + * Extensions for Scene + * ---------------------------------------------------------------- + */ + /** + * Every instance of ScrollMagic.Scene now accepts an additional option. + * See {@link ScrollMagic.Scene} for a complete list of the standard options. + * @memberof! animation.GSAP# + * @method new ScrollMagic.Scene(options) + * @example + * var scene = new ScrollMagic.Scene({tweenChanges: true}); + * + * @param {object} [options] - Options for the Scene. The options can be updated at any time. + * @param {boolean} [options.tweenChanges=false] - Tweens Animation to the progress target instead of setting it. + Does not affect animations where duration is `0`. + */ + /** + * **Get** or **Set** the tweenChanges option value. + * This only affects scenes with a duration. If `tweenChanges` is `true`, the progress update when scrolling will not be immediate, but instead the animation will smoothly animate to the target state. + * For a better understanding, try enabling and disabling this option in the [Scene Manipulation Example](../examples/basic/scene_manipulation.html). + * @memberof! animation.GSAP# + * @method Scene.tweenChanges + * + * @example + * // get the current tweenChanges option + * var tweenChanges = scene.tweenChanges(); + * + * // set new tweenChanges option + * scene.tweenChanges(true); + * + * @fires {@link Scene.change}, when used as setter + * @param {boolean} [newTweenChanges] - The new tweenChanges setting of the scene. + * @returns {boolean} `get` - Current tweenChanges option value. + * @returns {Scene} `set` - Parent object for chaining. + */ + // add option (TODO: DOC (private for dev)) + ScrollMagic.Scene.addOption( + "tweenChanges", // name + false, // default + function (val) { // validation callback + return !!val; + } + ); + // extend scene + ScrollMagic.Scene.extend(function () { + var Scene = this, + _tween; + + var log = function () { + if (Scene._log) { // not available, when main source minified + Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ")", "->"); + Scene._log.apply(this, arguments); + } + }; + + // set listeners + Scene.on("progress.plugin_gsap", function () { + updateTweenProgress(); + }); + Scene.on("destroy.plugin_gsap", function (e) { + Scene.removeTween(e.reset); + }); + + /** + * Update the tween progress to current position. + * @private + */ + var updateTweenProgress = function () { + if (_tween) { + var + progress = Scene.progress(), + state = Scene.state(); + if (_tween.repeat && _tween.repeat() === -1) { + // infinite loop, so not in relation to progress + if (state === 'DURING' && _tween.paused()) { + _tween.play(); + } else if (state !== 'DURING' && !_tween.paused()) { + _tween.pause(); + } + } else if (progress != _tween.progress()) { // do we even need to update the progress? + // no infinite loop - so should we just play or go to a specific point in time? + if (Scene.duration() === 0) { + // play the animation + if (progress > 0) { // play from 0 to 1 + _tween.play(); + } else { // play from 1 to 0 + _tween.reverse(); + } + } else { + // go to a specific point in time + if (Scene.tweenChanges() && _tween.tweenTo) { + // go smooth + _tween.tweenTo(progress * _tween.duration()); + } else { + // just hard set it + _tween.progress(progress).pause(); + } + } + } + } + }; + + /** + * Add a tween to the scene. + * If you want to add multiple tweens, add them into a GSAP Timeline object and supply it instead (see example below). + * + * If the scene has a duration, the tween's duration will be projected to the scroll distance of the scene, meaning its progress will be synced to scrollbar movement. + * For a scene with a duration of `0`, the tween will be triggered when scrolling forward past the scene's trigger position and reversed, when scrolling back. + * To gain better understanding, check out the [Simple Tweening example](../examples/basic/simple_tweening.html). + * + * Instead of supplying a tween this method can also be used as a shorthand for `TweenMax.to()` (see example below). + * @memberof! animation.GSAP# + * + * @example + * // add a single tween directly + * scene.setTween(TweenMax.to("obj"), 1, {x: 100}); + * + * // add a single tween via variable + * var tween = TweenMax.to("obj"), 1, {x: 100}; + * scene.setTween(tween); + * + * // add multiple tweens, wrapped in a timeline. + * var timeline = new TimelineMax(); + * var tween1 = TweenMax.from("obj1", 1, {x: 100}); + * var tween2 = TweenMax.to("obj2", 1, {y: 100}); + * timeline + * .add(tween1) + * .add(tween2); + * scene.addTween(timeline); + * + * // short hand to add a TweenMax.to() tween + * scene.setTween("obj3", 0.5, {y: 100}); + * + * // short hand to add a TweenMax.to() tween for 1 second + * // this is useful, when the scene has a duration and the tween duration isn't important anyway + * scene.setTween("obj3", {y: 100}); + * + * @param {(object|string)} TweenObject - A TweenMax, TweenLite, TimelineMax or TimelineLite object that should be animated in the scene. Can also be a Dom Element or Selector, when using direct tween definition (see examples). + * @param {(number|object)} duration - A duration for the tween, or tween parameters. If an object containing parameters are supplied, a default duration of 1 will be used. + * @param {object} params - The parameters for the tween + * @returns {Scene} Parent object for chaining. + */ + Scene.setTween = function (TweenObject, duration, params) { + var newTween; + + if (arguments.length > 1) { + var durationIsSet = typeof arguments['1'] === 'number'; + + if (GSAP3_OR_GREATER) { + // If we're using gsap 3 with proper gsap 3 syntax of 2 arguments + if (!durationIsSet) { + params = duration; + } + // Add a duration is there isn't one + if (!params.hasOwnProperty('duration')) { + params.duration = durationIsSet ? duration : 1; + } + } else { + // If we're using gsap 2 or earlier syntax + if (arguments.length < 3) { + params = duration; + duration = 1; + } + } + + // 2 arguments should be gsap 3 syntax, and 3 arguments for + TweenObject = GSAP3_OR_GREATER ? Tween.to(TweenObject, params) : Tween.to(TweenObject, duration, params); + } + try { + // wrap Tween into a Timeline Object if not gsap 3 or greater and available to include delay and repeats in the duration and standardize methods. + if (Timeline && !GSAP3_OR_GREATER) { + newTween = new Timeline({ + smoothChildTiming: true + }) + .add(TweenObject); + } else { + newTween = TweenObject; + } + newTween.pause(); + } catch (e) { + log(1, "ERROR calling method 'setTween()': Supplied argument is not a valid TweenObject"); + return Scene; + } + if (_tween) { // kill old tween? + Scene.removeTween(); + } + _tween = newTween; + + // some properties need to be transferred it to the wrapper, otherwise they would get lost. + if (TweenObject.repeat && TweenObject.repeat() === -1) { // TweenMax or TimelineMax Object? + _tween.repeat(-1); + _tween.yoyo(TweenObject.yoyo()); + } + // Some tween validations and debugging helpers + + if (Scene.tweenChanges() && !_tween.tweenTo) { + log(2, "WARNING: tweenChanges will only work if the TimelineMax object is available for ScrollMagic."); + } + + // check if there are position tweens defined for the trigger and warn about it :) + if (_tween && Scene.controller() && Scene.triggerElement() && Scene.loglevel() >= 2) { // controller is needed to know scroll direction. + var + triggerTweens = Tween.getTweensOf(Scene.triggerElement()), + vertical = Scene.controller().info("vertical"); + triggerTweens.forEach(function (value, index) { + var + tweenvars = value.vars.css || value.vars, + condition = vertical ? (tweenvars.top !== undefined || tweenvars.bottom !== undefined) : (tweenvars.left !== undefined || tweenvars.right !== undefined); + if (condition) { + log(2, "WARNING: Tweening the position of the trigger element affects the scene timing and should be avoided!"); + return false; + } + }); + } + + // warn about tween overwrites, when an element is tweened multiple times + if (parseFloat(TweenLite.version) >= 1.14) { // onOverwrite only present since GSAP v1.14.0 + var + // However, onInterrupt deprecated onOverwrite in GSAP v3 + methodUsed = GSAP3_OR_GREATER ? 'onInterrupt' : 'onOverwrite', + list = _tween.getChildren ? _tween.getChildren(true, true, false) : [_tween], // get all nested tween objects + newCallback = function () { + log(2, "WARNING: tween was overwritten by another. To learn how to avoid this issue see here: https://github.com/janpaepke/ScrollMagic/wiki/WARNING:-tween-was-overwritten-by-another"); + }; + for (var i = 0, thisTween, oldCallback; i < list.length; i++) { + /*jshint loopfunc: true */ + thisTween = list[i]; + if (oldCallback !== newCallback) { // if tweens is added more than once + oldCallback = thisTween.vars[methodUsed]; + thisTween.vars[methodUsed] = function () { + if (oldCallback) { + oldCallback.apply(this, arguments); + } + newCallback.apply(this, arguments); + }; + } + } + } + log(3, "added tween"); + + updateTweenProgress(); + return Scene; + }; + + /** + * Remove the tween from the scene. + * This will terminate the control of the Scene over the tween. + * + * Using the reset option you can decide if the tween should remain in the current state or be rewound to set the target elements back to the state they were in before the tween was added to the scene. + * @memberof! animation.GSAP# + * + * @example + * // remove the tween from the scene without resetting it + * scene.removeTween(); + * + * // remove the tween from the scene and reset it to initial position + * scene.removeTween(true); + * + * @param {boolean} [reset=false] - If `true` the tween will be reset to its initial values. + * @returns {Scene} Parent object for chaining. + */ + Scene.removeTween = function (reset) { + if (_tween) { + if (reset) { + _tween.progress(0).pause(); + } + _tween.kill(); + _tween = undefined; + log(3, "removed tween (reset: " + (reset ? "true" : "false") + ")"); + } + return Scene; + }; + + }); +})); \ No newline at end of file Property changes on: base3.10/src/main/webapp/js/user/animation.gsap.js ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/js/user/ScrollMagic.js =================================================================== --- base3.10/src/main/webapp/js/user/ScrollMagic.js (nonexistent) +++ base3.10/src/main/webapp/js/user/ScrollMagic.js (revision 34) @@ -0,0 +1,2818 @@ +/*! + * ScrollMagic v2.0.8 (2020-08-14) + * The javascript library for magical scroll interactions. + * (c) 2020 Jan Paepke (@janpaepke) + * Project Website: http://scrollmagic.io + * + * @version 2.0.8 + * @license Dual licensed under MIT license and GPL. + * @author Jan Paepke - e-mail@janpaepke.de + * + * @file ScrollMagic main library. + */ +/** + * @namespace ScrollMagic + */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(factory); + } else if (typeof exports === 'object') { + // CommonJS + module.exports = factory(); + } else { + // Browser global + root.ScrollMagic = factory(); + } +}(this, function () { + "use strict"; + + var ScrollMagic = function () { + _util.log(2, '(COMPATIBILITY NOTICE) -> As of ScrollMagic 2.0.0 you need to use \'new ScrollMagic.Controller()\' to create a new controller instance. Use \'new ScrollMagic.Scene()\' to instance a scene.'); + }; + + ScrollMagic.version = "2.0.8"; + + // TODO: temporary workaround for chrome's scroll jitter bug + if (typeof (window) !== 'undefined') { + window.addEventListener("mousewheel", void(0)); + } + + // global const + var PIN_SPACER_ATTRIBUTE = "data-scrollmagic-pin-spacer"; + + /** + * The main class that is needed once per scroll container. + * + * @class + * + * @example + * // basic initialization + * var controller = new ScrollMagic.Controller(); + * + * // passing options + * var controller = new ScrollMagic.Controller({container: "#myContainer", loglevel: 3}); + * + * @param {object} [options] - An object containing one or more options for the controller. + * @param {(string|object)} [options.container=window] - A selector, DOM object that references the main container for scrolling. + * @param {boolean} [options.vertical=true] - Sets the scroll mode to vertical (`true`) or horizontal (`false`) scrolling. + * @param {object} [options.globalSceneOptions={}] - These options will be passed to every Scene that is added to the controller using the addScene method. For more information on Scene options see {@link ScrollMagic.Scene}. + * @param {number} [options.loglevel=2] Loglevel for debugging. Note that logging is disabled in the minified version of ScrollMagic. + ** `0` => silent + ** `1` => errors + ** `2` => errors, warnings + ** `3` => errors, warnings, debuginfo + * @param {boolean} [options.refreshInterval=100] - Some changes don't call events by default, like changing the container size or moving a scene trigger element. + This interval polls these parameters to fire the necessary events. + If you don't use custom containers, trigger elements or have static layouts, where the positions of the trigger elements don't change, you can set this to 0 disable interval checking and improve performance. + * + */ + ScrollMagic.Controller = function (options) { + /* + * ---------------------------------------------------------------- + * settings + * ---------------------------------------------------------------- + */ + var + NAMESPACE = 'ScrollMagic.Controller', + SCROLL_DIRECTION_FORWARD = 'FORWARD', + SCROLL_DIRECTION_REVERSE = 'REVERSE', + SCROLL_DIRECTION_PAUSED = 'PAUSED', + DEFAULT_OPTIONS = CONTROLLER_OPTIONS.defaults; + + /* + * ---------------------------------------------------------------- + * private vars + * ---------------------------------------------------------------- + */ + var + Controller = this, + _options = _util.extend({}, DEFAULT_OPTIONS, options), + _sceneObjects = [], + _updateScenesOnNextCycle = false, // can be boolean (true => all scenes) or an array of scenes to be updated + _scrollPos = 0, + _scrollDirection = SCROLL_DIRECTION_PAUSED, + _isDocument = true, + _viewPortSize = 0, + _enabled = true, + _updateTimeout, + _refreshTimeout; + + /* + * ---------------------------------------------------------------- + * private functions + * ---------------------------------------------------------------- + */ + + /** + * Internal constructor function of the ScrollMagic Controller + * @private + */ + var construct = function () { + for (var key in _options) { + if (!DEFAULT_OPTIONS.hasOwnProperty(key)) { + log(2, "WARNING: Unknown option \"" + key + "\""); + delete _options[key]; + } + } + _options.container = _util.get.elements(_options.container)[0]; + // check ScrollContainer + if (!_options.container) { + log(1, "ERROR creating object " + NAMESPACE + ": No valid scroll container supplied"); + throw NAMESPACE + " init failed."; // cancel + } + _isDocument = _options.container === window || _options.container === document.body || !document.body.contains(_options.container); + // normalize to window + if (_isDocument) { + _options.container = window; + } + // update container size immediately + _viewPortSize = getViewportSize(); + // set event handlers + _options.container.addEventListener("resize", onChange); + _options.container.addEventListener("scroll", onChange); + + var ri = parseInt(_options.refreshInterval, 10); + _options.refreshInterval = _util.type.Number(ri) ? ri : DEFAULT_OPTIONS.refreshInterval; + scheduleRefresh(); + + log(3, "added new " + NAMESPACE + " controller (v" + ScrollMagic.version + ")"); + }; + + /** + * Schedule the next execution of the refresh function + * @private + */ + var scheduleRefresh = function () { + if (_options.refreshInterval > 0) { + _refreshTimeout = window.setTimeout(refresh, _options.refreshInterval); + } + }; + + /** + * Default function to get scroll pos - overwriteable using `Controller.scrollPos(newFunction)` + * @private + */ + var getScrollPos = function () { + return _options.vertical ? _util.get.scrollTop(_options.container) : _util.get.scrollLeft(_options.container); + }; + + /** + * Returns the current viewport Size (width vor horizontal, height for vertical) + * @private + */ + var getViewportSize = function () { + return _options.vertical ? _util.get.height(_options.container) : _util.get.width(_options.container); + }; + + /** + * Default function to set scroll pos - overwriteable using `Controller.scrollTo(newFunction)` + * Make available publicly for pinned mousewheel workaround. + * @private + */ + var setScrollPos = this._setScrollPos = function (pos) { + if (_options.vertical) { + if (_isDocument) { + window.scrollTo(_util.get.scrollLeft(), pos); + } else { + _options.container.scrollTop = pos; + } + } else { + if (_isDocument) { + window.scrollTo(pos, _util.get.scrollTop()); + } else { + _options.container.scrollLeft = pos; + } + } + }; + + /** + * Handle updates in cycles instead of on scroll (performance) + * @private + */ + var updateScenes = function () { + if (_enabled && _updateScenesOnNextCycle) { + // determine scenes to update + var scenesToUpdate = _util.type.Array(_updateScenesOnNextCycle) ? _updateScenesOnNextCycle : _sceneObjects.slice(0); + // reset scenes + _updateScenesOnNextCycle = false; + var oldScrollPos = _scrollPos; + // update scroll pos now instead of onChange, as it might have changed since scheduling (i.e. in-browser smooth scroll) + _scrollPos = Controller.scrollPos(); + var deltaScroll = _scrollPos - oldScrollPos; + if (deltaScroll !== 0) { // scroll position changed? + _scrollDirection = (deltaScroll > 0) ? SCROLL_DIRECTION_FORWARD : SCROLL_DIRECTION_REVERSE; + } + // reverse order of scenes if scrolling reverse + if (_scrollDirection === SCROLL_DIRECTION_REVERSE) { + scenesToUpdate.reverse(); + } + // update scenes + scenesToUpdate.forEach(function (scene, index) { + log(3, "updating Scene " + (index + 1) + "/" + scenesToUpdate.length + " (" + _sceneObjects.length + " total)"); + scene.update(true); + }); + if (scenesToUpdate.length === 0 && _options.loglevel >= 3) { + log(3, "updating 0 Scenes (nothing added to controller)"); + } + } + }; + + /** + * Initializes rAF callback + * @private + */ + var debounceUpdate = function () { + _updateTimeout = _util.rAF(updateScenes); + }; + + /** + * Handles Container changes + * @private + */ + var onChange = function (e) { + log(3, "event fired causing an update:", e.type); + if (e.type == "resize") { + // resize + _viewPortSize = getViewportSize(); + _scrollDirection = SCROLL_DIRECTION_PAUSED; + } + // schedule update + if (_updateScenesOnNextCycle !== true) { + _updateScenesOnNextCycle = true; + debounceUpdate(); + } + }; + + var refresh = function () { + if (!_isDocument) { + // simulate resize event. Only works for viewport relevant param (performance) + if (_viewPortSize != getViewportSize()) { + var resizeEvent; + try { + resizeEvent = new Event('resize', { + bubbles: false, + cancelable: false + }); + } catch (e) { // stupid IE + resizeEvent = document.createEvent("Event"); + resizeEvent.initEvent("resize", false, false); + } + _options.container.dispatchEvent(resizeEvent); + } + } + _sceneObjects.forEach(function (scene, index) { // refresh all scenes + scene.refresh(); + }); + scheduleRefresh(); + }; + + /** + * Send a debug message to the console. + * provided publicly with _log for plugins + * @private + * + * @param {number} loglevel - The loglevel required to initiate output for the message. + * @param {...mixed} output - One or more variables that should be passed to the console. + */ + var log = this._log = function (loglevel, output) { + if (_options.loglevel >= loglevel) { + Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ") ->"); + _util.log.apply(window, arguments); + } + }; + // for scenes we have getters for each option, but for the controller we don't, so we need to make it available externally for plugins + this._options = _options; + + /** + * Sort scenes in ascending order of their start offset. + * @private + * + * @param {array} ScenesArray - an array of ScrollMagic Scenes that should be sorted + * @return {array} The sorted array of Scenes. + */ + var sortScenes = function (ScenesArray) { + if (ScenesArray.length <= 1) { + return ScenesArray; + } else { + var scenes = ScenesArray.slice(0); + scenes.sort(function (a, b) { + return a.scrollOffset() > b.scrollOffset() ? 1 : -1; + }); + return scenes; + } + }; + + /** + * ---------------------------------------------------------------- + * public functions + * ---------------------------------------------------------------- + */ + + /** + * Add one ore more scene(s) to the controller. + * This is the equivalent to `Scene.addTo(controller)`. + * @public + * @example + * // with a previously defined scene + * controller.addScene(scene); + * + * // with a newly created scene. + * controller.addScene(new ScrollMagic.Scene({duration : 0})); + * + * // adding multiple scenes + * controller.addScene([scene, scene2, new ScrollMagic.Scene({duration : 0})]); + * + * @param {(ScrollMagic.Scene|array)} newScene - ScrollMagic Scene or Array of Scenes to be added to the controller. + * @return {Controller} Parent object for chaining. + */ + this.addScene = function (newScene) { + if (_util.type.Array(newScene)) { + newScene.forEach(function (scene, index) { + Controller.addScene(scene); + }); + } else if (newScene instanceof ScrollMagic.Scene) { + if (newScene.controller() !== Controller) { + newScene.addTo(Controller); + } else if (_sceneObjects.indexOf(newScene) < 0) { + // new scene + _sceneObjects.push(newScene); // add to array + _sceneObjects = sortScenes(_sceneObjects); // sort + newScene.on("shift.controller_sort", function () { // resort whenever scene moves + _sceneObjects = sortScenes(_sceneObjects); + }); + // insert Global defaults. + for (var key in _options.globalSceneOptions) { + if (newScene[key]) { + newScene[key].call(newScene, _options.globalSceneOptions[key]); + } + } + log(3, "adding Scene (now " + _sceneObjects.length + " total)"); + } + } else { + log(1, "ERROR: invalid argument supplied for '.addScene()'"); + } + return Controller; + }; + + /** + * Remove one ore more scene(s) from the controller. + * This is the equivalent to `Scene.remove()`. + * @public + * @example + * // remove a scene from the controller + * controller.removeScene(scene); + * + * // remove multiple scenes from the controller + * controller.removeScene([scene, scene2, scene3]); + * + * @param {(ScrollMagic.Scene|array)} Scene - ScrollMagic Scene or Array of Scenes to be removed from the controller. + * @returns {Controller} Parent object for chaining. + */ + this.removeScene = function (Scene) { + if (_util.type.Array(Scene)) { + Scene.forEach(function (scene, index) { + Controller.removeScene(scene); + }); + } else { + var index = _sceneObjects.indexOf(Scene); + if (index > -1) { + Scene.off("shift.controller_sort"); + _sceneObjects.splice(index, 1); + log(3, "removing Scene (now " + _sceneObjects.length + " left)"); + Scene.remove(); + } + } + return Controller; + }; + + /** + * Update one ore more scene(s) according to the scroll position of the container. + * This is the equivalent to `Scene.update()`. + * The update method calculates the scene's start and end position (based on the trigger element, trigger hook, duration and offset) and checks it against the current scroll position of the container. + * It then updates the current scene state accordingly (or does nothing, if the state is already correct) – Pins will be set to their correct position and tweens will be updated to their correct progress. + * _**Note:** This method gets called constantly whenever Controller detects a change. The only application for you is if you change something outside of the realm of ScrollMagic, like moving the trigger or changing tween parameters._ + * @public + * @example + * // update a specific scene on next cycle + * controller.updateScene(scene); + * + * // update a specific scene immediately + * controller.updateScene(scene, true); + * + * // update multiple scenes scene on next cycle + * controller.updateScene([scene1, scene2, scene3]); + * + * @param {ScrollMagic.Scene} Scene - ScrollMagic Scene or Array of Scenes that is/are supposed to be updated. + * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle. + This is useful when changing multiple properties of the scene - this way it will only be updated once all new properties are set (updateScenes). + * @return {Controller} Parent object for chaining. + */ + this.updateScene = function (Scene, immediately) { + if (_util.type.Array(Scene)) { + Scene.forEach(function (scene, index) { + Controller.updateScene(scene, immediately); + }); + } else { + if (immediately) { + Scene.update(true); + } else if (_updateScenesOnNextCycle !== true && Scene instanceof ScrollMagic.Scene) { // if _updateScenesOnNextCycle is true, all connected scenes are already scheduled for update + // prep array for next update cycle + _updateScenesOnNextCycle = _updateScenesOnNextCycle || []; + if (_updateScenesOnNextCycle.indexOf(Scene) == -1) { + _updateScenesOnNextCycle.push(Scene); + } + _updateScenesOnNextCycle = sortScenes(_updateScenesOnNextCycle); // sort + debounceUpdate(); + } + } + return Controller; + }; + + /** + * Updates the controller params and calls updateScene on every scene, that is attached to the controller. + * See `Controller.updateScene()` for more information about what this means. + * In most cases you will not need this function, as it is called constantly, whenever ScrollMagic detects a state change event, like resize or scroll. + * The only application for this method is when ScrollMagic fails to detect these events. + * One application is with some external scroll libraries (like iScroll) that move an internal container to a negative offset instead of actually scrolling. In this case the update on the controller needs to be called whenever the child container's position changes. + * For this case there will also be the need to provide a custom function to calculate the correct scroll position. See `Controller.scrollPos()` for details. + * @public + * @example + * // update the controller on next cycle (saves performance due to elimination of redundant updates) + * controller.update(); + * + * // update the controller immediately + * controller.update(true); + * + * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle (better performance) + * @return {Controller} Parent object for chaining. + */ + this.update = function (immediately) { + onChange({ + type: "resize" + }); // will update size and set _updateScenesOnNextCycle to true + if (immediately) { + updateScenes(); + } + return Controller; + }; + + /** + * Scroll to a numeric scroll offset, a DOM element, the start of a scene or provide an alternate method for scrolling. + * For vertical controllers it will change the top scroll offset and for horizontal applications it will change the left offset. + * @public + * + * @since 1.1.0 + * @example + * // scroll to an offset of 100 + * controller.scrollTo(100); + * + * // scroll to a DOM element + * controller.scrollTo("#anchor"); + * + * // scroll to the beginning of a scene + * var scene = new ScrollMagic.Scene({offset: 200}); + * controller.scrollTo(scene); + * + * // define a new scroll position modification function (jQuery animate instead of jump) + * controller.scrollTo(function (newScrollPos) { + * $("html, body").animate({scrollTop: newScrollPos}); + * }); + * controller.scrollTo(100); // call as usual, but the new function will be used instead + * + * // define a new scroll function with an additional parameter + * controller.scrollTo(function (newScrollPos, message) { + * console.log(message); + * $(this).animate({scrollTop: newScrollPos}); + * }); + * // call as usual, but supply an extra parameter to the defined custom function + * controller.scrollTo(100, "my message"); + * + * // define a new scroll function with an additional parameter containing multiple variables + * controller.scrollTo(function (newScrollPos, options) { + * someGlobalVar = options.a + options.b; + * $(this).animate({scrollTop: newScrollPos}); + * }); + * // call as usual, but supply an extra parameter containing multiple options + * controller.scrollTo(100, {a: 1, b: 2}); + * + * // define a new scroll function with a callback supplied as an additional parameter + * controller.scrollTo(function (newScrollPos, callback) { + * $(this).animate({scrollTop: newScrollPos}, 400, "swing", callback); + * }); + * // call as usual, but supply an extra parameter, which is used as a callback in the previously defined custom scroll function + * controller.scrollTo(100, function() { + * console.log("scroll has finished."); + * }); + * + * @param {mixed} scrollTarget - The supplied argument can be one of these types: + * 1. `number` -> The container will scroll to this new scroll offset. + * 2. `string` or `object` -> Can be a selector or a DOM object. + * The container will scroll to the position of this element. + * 3. `ScrollMagic Scene` -> The container will scroll to the start of this scene. + * 4. `function` -> This function will be used for future scroll position modifications. + * This provides a way for you to change the behaviour of scrolling and adding new behaviour like animation. The function receives the new scroll position as a parameter and a reference to the container element using `this`. + * It may also optionally receive an optional additional parameter (see below) + * _**NOTE:** + * All other options will still work as expected, using the new function to scroll._ + * @param {mixed} [additionalParameter] - If a custom scroll function was defined (see above 4.), you may want to supply additional parameters to it, when calling it. You can do this using this parameter – see examples for details. Please note, that this parameter will have no effect, if you use the default scrolling function. + * @returns {Controller} Parent object for chaining. + */ + this.scrollTo = function (scrollTarget, additionalParameter) { + if (_util.type.Number(scrollTarget)) { // excecute + setScrollPos.call(_options.container, scrollTarget, additionalParameter); + } else if (scrollTarget instanceof ScrollMagic.Scene) { // scroll to scene + if (scrollTarget.controller() === Controller) { // check if the controller is associated with this scene + Controller.scrollTo(scrollTarget.scrollOffset(), additionalParameter); + } else { + log(2, "scrollTo(): The supplied scene does not belong to this controller. Scroll cancelled.", scrollTarget); + } + } else if (_util.type.Function(scrollTarget)) { // assign new scroll function + setScrollPos = scrollTarget; + } else { // scroll to element + var elem = _util.get.elements(scrollTarget)[0]; + if (elem) { + // if parent is pin spacer, use spacer position instead so correct start position is returned for pinned elements. + while (elem.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) { + elem = elem.parentNode; + } + + var + param = _options.vertical ? "top" : "left", // which param is of interest ? + containerOffset = _util.get.offset(_options.container), // container position is needed because element offset is returned in relation to document, not in relation to container. + elementOffset = _util.get.offset(elem); + + if (!_isDocument) { // container is not the document root, so substract scroll Position to get correct trigger element position relative to scrollcontent + containerOffset[param] -= Controller.scrollPos(); + } + + Controller.scrollTo(elementOffset[param] - containerOffset[param], additionalParameter); + } else { + log(2, "scrollTo(): The supplied argument is invalid. Scroll cancelled.", scrollTarget); + } + } + return Controller; + }; + + /** + * **Get** the current scrollPosition or **Set** a new method to calculate it. + * -> **GET**: + * When used as a getter this function will return the current scroll position. + * To get a cached value use Controller.info("scrollPos"), which will be updated in the update cycle. + * For vertical controllers it will return the top scroll offset and for horizontal applications it will return the left offset. + * + * -> **SET**: + * When used as a setter this method prodes a way to permanently overwrite the controller's scroll position calculation. + * A typical usecase is when the scroll position is not reflected by the containers scrollTop or scrollLeft values, but for example by the inner offset of a child container. + * Moving a child container inside a parent is a commonly used method for several scrolling frameworks, including iScroll. + * By providing an alternate calculation function you can make sure ScrollMagic receives the correct scroll position. + * Please also bear in mind that your function should return y values for vertical scrolls an x for horizontals. + * + * To change the current scroll position please use `Controller.scrollTo()`. + * @public + * + * @example + * // get the current scroll Position + * var scrollPos = controller.scrollPos(); + * + * // set a new scroll position calculation method + * controller.scrollPos(function () { + * return this.info("vertical") ? -mychildcontainer.y : -mychildcontainer.x + * }); + * + * @param {function} [scrollPosMethod] - The function to be used for the scroll position calculation of the container. + * @returns {(number|Controller)} Current scroll position or parent object for chaining. + */ + this.scrollPos = function (scrollPosMethod) { + if (!arguments.length) { // get + return getScrollPos.call(Controller); + } else { // set + if (_util.type.Function(scrollPosMethod)) { + getScrollPos = scrollPosMethod; + } else { + log(2, "Provided value for method 'scrollPos' is not a function. To change the current scroll position use 'scrollTo()'."); + } + } + return Controller; + }; + + /** + * **Get** all infos or one in particular about the controller. + * @public + * @example + * // returns the current scroll position (number) + * var scrollPos = controller.info("scrollPos"); + * + * // returns all infos as an object + * var infos = controller.info(); + * + * @param {string} [about] - If passed only this info will be returned instead of an object containing all. + Valid options are: + ** `"size"` => the current viewport size of the container + ** `"vertical"` => true if vertical scrolling, otherwise false + ** `"scrollPos"` => the current scroll position + ** `"scrollDirection"` => the last known direction of the scroll + ** `"container"` => the container element + ** `"isDocument"` => true if container element is the document. + * @returns {(mixed|object)} The requested info(s). + */ + this.info = function (about) { + var values = { + size: _viewPortSize, // contains height or width (in regard to orientation); + vertical: _options.vertical, + scrollPos: _scrollPos, + scrollDirection: _scrollDirection, + container: _options.container, + isDocument: _isDocument + }; + if (!arguments.length) { // get all as an object + return values; + } else if (values[about] !== undefined) { + return values[about]; + } else { + log(1, "ERROR: option \"" + about + "\" is not available"); + return; + } + }; + + /** + * **Get** or **Set** the current loglevel option value. + * @public + * + * @example + * // get the current value + * var loglevel = controller.loglevel(); + * + * // set a new value + * controller.loglevel(3); + * + * @param {number} [newLoglevel] - The new loglevel setting of the Controller. `[0-3]` + * @returns {(number|Controller)} Current loglevel or parent object for chaining. + */ + this.loglevel = function (newLoglevel) { + if (!arguments.length) { // get + return _options.loglevel; + } else if (_options.loglevel != newLoglevel) { // set + _options.loglevel = newLoglevel; + } + return Controller; + }; + + /** + * **Get** or **Set** the current enabled state of the controller. + * This can be used to disable all Scenes connected to the controller without destroying or removing them. + * @public + * + * @example + * // get the current value + * var enabled = controller.enabled(); + * + * // disable the controller + * controller.enabled(false); + * + * @param {boolean} [newState] - The new enabled state of the controller `true` or `false`. + * @returns {(boolean|Controller)} Current enabled state or parent object for chaining. + */ + this.enabled = function (newState) { + if (!arguments.length) { // get + return _enabled; + } else if (_enabled != newState) { // set + _enabled = !!newState; + Controller.updateScene(_sceneObjects, true); + } + return Controller; + }; + + /** + * Destroy the Controller, all Scenes and everything. + * @public + * + * @example + * // without resetting the scenes + * controller = controller.destroy(); + * + * // with scene reset + * controller = controller.destroy(true); + * + * @param {boolean} [resetScenes=false] - If `true` the pins and tweens (if existent) of all scenes will be reset. + * @returns {null} Null to unset handler variables. + */ + this.destroy = function (resetScenes) { + window.clearTimeout(_refreshTimeout); + var i = _sceneObjects.length; + while (i--) { + _sceneObjects[i].destroy(resetScenes); + } + _options.container.removeEventListener("resize", onChange); + _options.container.removeEventListener("scroll", onChange); + _util.cAF(_updateTimeout); + log(3, "destroyed " + NAMESPACE + " (reset: " + (resetScenes ? "true" : "false") + ")"); + return null; + }; + + // INIT + construct(); + return Controller; + }; + + // store pagewide controller options + var CONTROLLER_OPTIONS = { + defaults: { + container: window, + vertical: true, + globalSceneOptions: {}, + loglevel: 2, + refreshInterval: 100 + } + }; + /* + * method used to add an option to ScrollMagic Scenes. + */ + ScrollMagic.Controller.addOption = function (name, defaultValue) { + CONTROLLER_OPTIONS.defaults[name] = defaultValue; + }; + // instance extension function for plugins + ScrollMagic.Controller.extend = function (extension) { + var oldClass = this; + ScrollMagic.Controller = function () { + oldClass.apply(this, arguments); + this.$super = _util.extend({}, this); // copy parent state + return extension.apply(this, arguments) || this; + }; + _util.extend(ScrollMagic.Controller, oldClass); // copy properties + ScrollMagic.Controller.prototype = oldClass.prototype; // copy prototype + ScrollMagic.Controller.prototype.constructor = ScrollMagic.Controller; // restore constructor + }; + + + /** + * A Scene defines where the controller should react and how. + * + * @class + * + * @example + * // create a standard scene and add it to a controller + * new ScrollMagic.Scene() + * .addTo(controller); + * + * // create a scene with custom options and assign a handler to it. + * var scene = new ScrollMagic.Scene({ + * duration: 100, + * offset: 200, + * triggerHook: "onEnter", + * reverse: false + * }); + * + * @param {object} [options] - Options for the Scene. The options can be updated at any time. + Instead of setting the options for each scene individually you can also set them globally in the controller as the controllers `globalSceneOptions` option. The object accepts the same properties as the ones below. + When a scene is added to the controller the options defined using the Scene constructor will be overwritten by those set in `globalSceneOptions`. + * @param {(number|string|function)} [options.duration=0] - The duration of the scene. + Please see `Scene.duration()` for details. + * @param {number} [options.offset=0] - Offset Value for the Trigger Position. If no triggerElement is defined this will be the scroll distance from the start of the page, after which the scene will start. + * @param {(string|object)} [options.triggerElement=null] - Selector or DOM object that defines the start of the scene. If undefined the scene will start right at the start of the page (unless an offset is set). + * @param {(number|string)} [options.triggerHook="onCenter"] - Can be a number between 0 and 1 defining the position of the trigger Hook in relation to the viewport. + Can also be defined using a string: + ** `"onEnter"` => `1` + ** `"onCenter"` => `0.5` + ** `"onLeave"` => `0` + * @param {boolean} [options.reverse=true] - Should the scene reverse, when scrolling up? + * @param {number} [options.loglevel=2] - Loglevel for debugging. Note that logging is disabled in the minified version of ScrollMagic. + ** `0` => silent + ** `1` => errors + ** `2` => errors, warnings + ** `3` => errors, warnings, debuginfo + * + */ + ScrollMagic.Scene = function (options) { + + /* + * ---------------------------------------------------------------- + * settings + * ---------------------------------------------------------------- + */ + + var + NAMESPACE = 'ScrollMagic.Scene', + SCENE_STATE_BEFORE = 'BEFORE', + SCENE_STATE_DURING = 'DURING', + SCENE_STATE_AFTER = 'AFTER', + DEFAULT_OPTIONS = SCENE_OPTIONS.defaults; + + /* + * ---------------------------------------------------------------- + * private vars + * ---------------------------------------------------------------- + */ + + var + Scene = this, + _options = _util.extend({}, DEFAULT_OPTIONS, options), + _state = SCENE_STATE_BEFORE, + _progress = 0, + _scrollOffset = { + start: 0, + end: 0 + }, // reflects the controllers's scroll position for the start and end of the scene respectively + _triggerPos = 0, + _enabled = true, + _durationUpdateMethod, + _controller; + + /** + * Internal constructor function of the ScrollMagic Scene + * @private + */ + var construct = function () { + for (var key in _options) { // check supplied options + if (!DEFAULT_OPTIONS.hasOwnProperty(key)) { + log(2, "WARNING: Unknown option \"" + key + "\""); + delete _options[key]; + } + } + // add getters/setters for all possible options + for (var optionName in DEFAULT_OPTIONS) { + addSceneOption(optionName); + } + // validate all options + validateOption(); + }; + + /* + * ---------------------------------------------------------------- + * Event Management + * ---------------------------------------------------------------- + */ + + var _listeners = {}; + /** + * Scene start event. + * Fires whenever the scroll position its the starting point of the scene. + * It will also fire when scrolling back up going over the start position of the scene. If you want something to happen only when scrolling down/right, use the scrollDirection parameter passed to the callback. + * + * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. + * + * @event ScrollMagic.Scene#start + * + * @example + * scene.on("start", function (event) { + * console.log("Hit start point of scene."); + * }); + * + * @property {object} event - The event Object passed to each callback + * @property {string} event.type - The name of the event + * @property {Scene} event.target - The Scene object that triggered this event + * @property {number} event.progress - Reflects the current progress of the scene + * @property {string} event.state - The current state of the scene `"BEFORE"` or `"DURING"` + * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` + */ + /** + * Scene end event. + * Fires whenever the scroll position its the ending point of the scene. + * It will also fire when scrolling back up from after the scene and going over its end position. If you want something to happen only when scrolling down/right, use the scrollDirection parameter passed to the callback. + * + * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. + * + * @event ScrollMagic.Scene#end + * + * @example + * scene.on("end", function (event) { + * console.log("Hit end point of scene."); + * }); + * + * @property {object} event - The event Object passed to each callback + * @property {string} event.type - The name of the event + * @property {Scene} event.target - The Scene object that triggered this event + * @property {number} event.progress - Reflects the current progress of the scene + * @property {string} event.state - The current state of the scene `"DURING"` or `"AFTER"` + * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` + */ + /** + * Scene enter event. + * Fires whenever the scene enters the "DURING" state. + * Keep in mind that it doesn't matter if the scene plays forward or backward: This event always fires when the scene enters its active scroll timeframe, regardless of the scroll-direction. + * + * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. + * + * @event ScrollMagic.Scene#enter + * + * @example + * scene.on("enter", function (event) { + * console.log("Scene entered."); + * }); + * + * @property {object} event - The event Object passed to each callback + * @property {string} event.type - The name of the event + * @property {Scene} event.target - The Scene object that triggered this event + * @property {number} event.progress - Reflects the current progress of the scene + * @property {string} event.state - The current state of the scene - always `"DURING"` + * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` + */ + /** + * Scene leave event. + * Fires whenever the scene's state goes from "DURING" to either "BEFORE" or "AFTER". + * Keep in mind that it doesn't matter if the scene plays forward or backward: This event always fires when the scene leaves its active scroll timeframe, regardless of the scroll-direction. + * + * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. + * + * @event ScrollMagic.Scene#leave + * + * @example + * scene.on("leave", function (event) { + * console.log("Scene left."); + * }); + * + * @property {object} event - The event Object passed to each callback + * @property {string} event.type - The name of the event + * @property {Scene} event.target - The Scene object that triggered this event + * @property {number} event.progress - Reflects the current progress of the scene + * @property {string} event.state - The current state of the scene `"BEFORE"` or `"AFTER"` + * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` + */ + /** + * Scene update event. + * Fires whenever the scene is updated (but not necessarily changes the progress). + * + * @event ScrollMagic.Scene#update + * + * @example + * scene.on("update", function (event) { + * console.log("Scene updated."); + * }); + * + * @property {object} event - The event Object passed to each callback + * @property {string} event.type - The name of the event + * @property {Scene} event.target - The Scene object that triggered this event + * @property {number} event.startPos - The starting position of the scene (in relation to the conainer) + * @property {number} event.endPos - The ending position of the scene (in relation to the conainer) + * @property {number} event.scrollPos - The current scroll position of the container + */ + /** + * Scene progress event. + * Fires whenever the progress of the scene changes. + * + * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. + * + * @event ScrollMagic.Scene#progress + * + * @example + * scene.on("progress", function (event) { + * console.log("Scene progress changed to " + event.progress); + * }); + * + * @property {object} event - The event Object passed to each callback + * @property {string} event.type - The name of the event + * @property {Scene} event.target - The Scene object that triggered this event + * @property {number} event.progress - Reflects the current progress of the scene + * @property {string} event.state - The current state of the scene `"BEFORE"`, `"DURING"` or `"AFTER"` + * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` + */ + /** + * Scene change event. + * Fires whenvever a property of the scene is changed. + * + * @event ScrollMagic.Scene#change + * + * @example + * scene.on("change", function (event) { + * console.log("Scene Property \"" + event.what + "\" changed to " + event.newval); + * }); + * + * @property {object} event - The event Object passed to each callback + * @property {string} event.type - The name of the event + * @property {Scene} event.target - The Scene object that triggered this event + * @property {string} event.what - Indicates what value has been changed + * @property {mixed} event.newval - The new value of the changed property + */ + /** + * Scene shift event. + * Fires whenvever the start or end **scroll offset** of the scene change. + * This happens explicitely, when one of these values change: `offset`, `duration` or `triggerHook`. + * It will fire implicitly when the `triggerElement` changes, if the new element has a different position (most cases). + * It will also fire implicitly when the size of the container changes and the triggerHook is anything other than `onLeave`. + * + * @event ScrollMagic.Scene#shift + * @since 1.1.0 + * + * @example + * scene.on("shift", function (event) { + * console.log("Scene moved, because the " + event.reason + " has changed.)"); + * }); + * + * @property {object} event - The event Object passed to each callback + * @property {string} event.type - The name of the event + * @property {Scene} event.target - The Scene object that triggered this event + * @property {string} event.reason - Indicates why the scene has shifted + */ + /** + * Scene destroy event. + * Fires whenvever the scene is destroyed. + * This can be used to tidy up custom behaviour used in events. + * + * @event ScrollMagic.Scene#destroy + * @since 1.1.0 + * + * @example + * scene.on("enter", function (event) { + * // add custom action + * $("#my-elem").left("200"); + * }) + * .on("destroy", function (event) { + * // reset my element to start position + * if (event.reset) { + * $("#my-elem").left("0"); + * } + * }); + * + * @property {object} event - The event Object passed to each callback + * @property {string} event.type - The name of the event + * @property {Scene} event.target - The Scene object that triggered this event + * @property {boolean} event.reset - Indicates if the destroy method was called with reset `true` or `false`. + */ + /** + * Scene add event. + * Fires when the scene is added to a controller. + * This is mostly used by plugins to know that change might be due. + * + * @event ScrollMagic.Scene#add + * @since 2.0.0 + * + * @example + * scene.on("add", function (event) { + * console.log('Scene was added to a new controller.'); + * }); + * + * @property {object} event - The event Object passed to each callback + * @property {string} event.type - The name of the event + * @property {Scene} event.target - The Scene object that triggered this event + * @property {boolean} event.controller - The controller object the scene was added to. + */ + /** + * Scene remove event. + * Fires when the scene is removed from a controller. + * This is mostly used by plugins to know that change might be due. + * + * @event ScrollMagic.Scene#remove + * @since 2.0.0 + * + * @example + * scene.on("remove", function (event) { + * console.log('Scene was removed from its controller.'); + * }); + * + * @property {object} event - The event Object passed to each callback + * @property {string} event.type - The name of the event + * @property {Scene} event.target - The Scene object that triggered this event + */ + + /** + * Add one ore more event listener. + * The callback function will be fired at the respective event, and an object containing relevant data will be passed to the callback. + * @method ScrollMagic.Scene#on + * + * @example + * function callback (event) { + * console.log("Event fired! (" + event.type + ")"); + * } + * // add listeners + * scene.on("change update progress start end enter leave", callback); + * + * @param {string} names - The name or names of the event the callback should be attached to. + * @param {function} callback - A function that should be executed, when the event is dispatched. An event object will be passed to the callback. + * @returns {Scene} Parent object for chaining. + */ + this.on = function (names, callback) { + if (_util.type.Function(callback)) { + names = names.trim().split(' '); + names.forEach(function (fullname) { + var + nameparts = fullname.split('.'), + eventname = nameparts[0], + namespace = nameparts[1]; + if (eventname != "*") { // disallow wildcards + if (!_listeners[eventname]) { + _listeners[eventname] = []; + } + _listeners[eventname].push({ + namespace: namespace || '', + callback: callback + }); + } + }); + } else { + log(1, "ERROR when calling '.on()': Supplied callback for '" + names + "' is not a valid function!"); + } + return Scene; + }; + + /** + * Remove one or more event listener. + * @method ScrollMagic.Scene#off + * + * @example + * function callback (event) { + * console.log("Event fired! (" + event.type + ")"); + * } + * // add listeners + * scene.on("change update", callback); + * // remove listeners + * scene.off("change update", callback); + * + * @param {string} names - The name or names of the event that should be removed. + * @param {function} [callback] - A specific callback function that should be removed. If none is passed all callbacks to the event listener will be removed. + * @returns {Scene} Parent object for chaining. + */ + this.off = function (names, callback) { + if (!names) { + log(1, "ERROR: Invalid event name supplied."); + return Scene; + } + names = names.trim().split(' '); + names.forEach(function (fullname, key) { + var + nameparts = fullname.split('.'), + eventname = nameparts[0], + namespace = nameparts[1] || '', + removeList = eventname === '*' ? Object.keys(_listeners) : [eventname]; + removeList.forEach(function (remove) { + var + list = _listeners[remove] || [], + i = list.length; + while (i--) { + var listener = list[i]; + if (listener && (namespace === listener.namespace || namespace === '*') && (!callback || callback == listener.callback)) { + list.splice(i, 1); + } + } + if (!list.length) { + delete _listeners[remove]; + } + }); + }); + return Scene; + }; + + /** + * Trigger an event. + * @method ScrollMagic.Scene#trigger + * + * @example + * this.trigger("change"); + * + * @param {string} name - The name of the event that should be triggered. + * @param {object} [vars] - An object containing info that should be passed to the callback. + * @returns {Scene} Parent object for chaining. + */ + this.trigger = function (name, vars) { + if (name) { + var + nameparts = name.trim().split('.'), + eventname = nameparts[0], + namespace = nameparts[1], + listeners = _listeners[eventname]; + log(3, 'event fired:', eventname, vars ? "->" : '', vars || ''); + if (listeners) { + listeners.forEach(function (listener, key) { + if (!namespace || namespace === listener.namespace) { + listener.callback.call(Scene, new ScrollMagic.Event(eventname, listener.namespace, Scene, vars)); + } + }); + } + } else { + log(1, "ERROR: Invalid event name supplied."); + } + return Scene; + }; + + // set event listeners + Scene + .on("change.internal", function (e) { + if (e.what !== "loglevel" && e.what !== "tweenChanges") { // no need for a scene update scene with these options... + if (e.what === "triggerElement") { + updateTriggerElementPosition(); + } else if (e.what === "reverse") { // the only property left that may have an impact on the current scene state. Everything else is handled by the shift event. + Scene.update(); + } + } + }) + .on("shift.internal", function (e) { + updateScrollOffset(); + Scene.update(); // update scene to reflect new position + }); + + /** + * Send a debug message to the console. + * @private + * but provided publicly with _log for plugins + * + * @param {number} loglevel - The loglevel required to initiate output for the message. + * @param {...mixed} output - One or more variables that should be passed to the console. + */ + var log = this._log = function (loglevel, output) { + if (_options.loglevel >= loglevel) { + Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ") ->"); + _util.log.apply(window, arguments); + } + }; + + /** + * Add the scene to a controller. + * This is the equivalent to `Controller.addScene(scene)`. + * @method ScrollMagic.Scene#addTo + * + * @example + * // add a scene to a ScrollMagic Controller + * scene.addTo(controller); + * + * @param {ScrollMagic.Controller} controller - The controller to which the scene should be added. + * @returns {Scene} Parent object for chaining. + */ + this.addTo = function (controller) { + if (!(controller instanceof ScrollMagic.Controller)) { + log(1, "ERROR: supplied argument of 'addTo()' is not a valid ScrollMagic Controller"); + } else if (_controller != controller) { + // new controller + if (_controller) { // was associated to a different controller before, so remove it... + _controller.removeScene(Scene); + } + _controller = controller; + validateOption(); + updateDuration(true); + updateTriggerElementPosition(true); + updateScrollOffset(); + _controller.info("container").addEventListener('resize', onContainerResize); + controller.addScene(Scene); + Scene.trigger("add", { + controller: _controller + }); + log(3, "added " + NAMESPACE + " to controller"); + Scene.update(); + } + return Scene; + }; + + /** + * **Get** or **Set** the current enabled state of the scene. + * This can be used to disable this scene without removing or destroying it. + * @method ScrollMagic.Scene#enabled + * + * @example + * // get the current value + * var enabled = scene.enabled(); + * + * // disable the scene + * scene.enabled(false); + * + * @param {boolean} [newState] - The new enabled state of the scene `true` or `false`. + * @returns {(boolean|Scene)} Current enabled state or parent object for chaining. + */ + this.enabled = function (newState) { + if (!arguments.length) { // get + return _enabled; + } else if (_enabled != newState) { // set + _enabled = !!newState; + Scene.update(true); + } + return Scene; + }; + + /** + * Remove the scene from the controller. + * This is the equivalent to `Controller.removeScene(scene)`. + * The scene will not be updated anymore until you readd it to a controller. + * To remove the pin or the tween you need to call removeTween() or removePin() respectively. + * @method ScrollMagic.Scene#remove + * @example + * // remove the scene from its controller + * scene.remove(); + * + * @returns {Scene} Parent object for chaining. + */ + this.remove = function () { + if (_controller) { + _controller.info("container").removeEventListener('resize', onContainerResize); + var tmpParent = _controller; + _controller = undefined; + tmpParent.removeScene(Scene); + Scene.trigger("remove"); + log(3, "removed " + NAMESPACE + " from controller"); + } + return Scene; + }; + + /** + * Destroy the scene and everything. + * @method ScrollMagic.Scene#destroy + * @example + * // destroy the scene without resetting the pin and tween to their initial positions + * scene = scene.destroy(); + * + * // destroy the scene and reset the pin and tween + * scene = scene.destroy(true); + * + * @param {boolean} [reset=false] - If `true` the pin and tween (if existent) will be reset. + * @returns {null} Null to unset handler variables. + */ + this.destroy = function (reset) { + Scene.trigger("destroy", { + reset: reset + }); + Scene.remove(); + Scene.off("*.*"); + log(3, "destroyed " + NAMESPACE + " (reset: " + (reset ? "true" : "false") + ")"); + return null; + }; + + + /** + * Updates the Scene to reflect the current state. + * This is the equivalent to `Controller.updateScene(scene, immediately)`. + * The update method calculates the scene's start and end position (based on the trigger element, trigger hook, duration and offset) and checks it against the current scroll position of the container. + * It then updates the current scene state accordingly (or does nothing, if the state is already correct) – Pins will be set to their correct position and tweens will be updated to their correct progress. + * This means an update doesn't necessarily result in a progress change. The `progress` event will be fired if the progress has indeed changed between this update and the last. + * _**NOTE:** This method gets called constantly whenever ScrollMagic detects a change. The only application for you is if you change something outside of the realm of ScrollMagic, like moving the trigger or changing tween parameters._ + * @method ScrollMagic.Scene#update + * @example + * // update the scene on next tick + * scene.update(); + * + * // update the scene immediately + * scene.update(true); + * + * @fires Scene.update + * + * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle (better performance). + * @returns {Scene} Parent object for chaining. + */ + this.update = function (immediately) { + if (_controller) { + if (immediately) { + if (_controller.enabled() && _enabled) { + var + scrollPos = _controller.info("scrollPos"), + newProgress; + + if (_options.duration > 0) { + newProgress = (scrollPos - _scrollOffset.start) / (_scrollOffset.end - _scrollOffset.start); + } else { + newProgress = scrollPos >= _scrollOffset.start ? 1 : 0; + } + + Scene.trigger("update", { + startPos: _scrollOffset.start, + endPos: _scrollOffset.end, + scrollPos: scrollPos + }); + + Scene.progress(newProgress); + } else if (_pin && _state === SCENE_STATE_DURING) { + updatePinState(true); // unpin in position + } + } else { + _controller.updateScene(Scene, false); + } + } + return Scene; + }; + + /** + * Updates dynamic scene variables like the trigger element position or the duration. + * This method is automatically called in regular intervals from the controller. See {@link ScrollMagic.Controller} option `refreshInterval`. + * + * You can call it to minimize lag, for example when you intentionally change the position of the triggerElement. + * If you don't it will simply be updated in the next refresh interval of the container, which is usually sufficient. + * + * @method ScrollMagic.Scene#refresh + * @since 1.1.0 + * @example + * scene = new ScrollMagic.Scene({triggerElement: "#trigger"}); + * + * // change the position of the trigger + * $("#trigger").css("top", 500); + * // immediately let the scene know of this change + * scene.refresh(); + * + * @fires {@link Scene.shift}, if the trigger element position or the duration changed + * @fires {@link Scene.change}, if the duration changed + * + * @returns {Scene} Parent object for chaining. + */ + this.refresh = function () { + updateDuration(); + updateTriggerElementPosition(); + // update trigger element position + return Scene; + }; + + /** + * **Get** or **Set** the scene's progress. + * Usually it shouldn't be necessary to use this as a setter, as it is set automatically by scene.update(). + * The order in which the events are fired depends on the duration of the scene: + * 1. Scenes with `duration == 0`: + * Scenes that have no duration by definition have no ending. Thus the `end` event will never be fired. + * When the trigger position of the scene is passed the events are always fired in this order: + * `enter`, `start`, `progress` when scrolling forward + * and + * `progress`, `start`, `leave` when scrolling in reverse + * 2. Scenes with `duration > 0`: + * Scenes with a set duration have a defined start and end point. + * When scrolling past the start position of the scene it will fire these events in this order: + * `enter`, `start`, `progress` + * When continuing to scroll and passing the end point it will fire these events: + * `progress`, `end`, `leave` + * When reversing through the end point these events are fired: + * `enter`, `end`, `progress` + * And when continuing to scroll past the start position in reverse it will fire: + * `progress`, `start`, `leave` + * In between start and end the `progress` event will be called constantly, whenever the progress changes. + * + * In short: + * `enter` events will always trigger **before** the progress update and `leave` envents will trigger **after** the progress update. + * `start` and `end` will always trigger at their respective position. + * + * Please review the event descriptions for details on the events and the event object that is passed to the callback. + * + * @method ScrollMagic.Scene#progress + * @example + * // get the current scene progress + * var progress = scene.progress(); + * + * // set new scene progress + * scene.progress(0.3); + * + * @fires {@link Scene.enter}, when used as setter + * @fires {@link Scene.start}, when used as setter + * @fires {@link Scene.progress}, when used as setter + * @fires {@link Scene.end}, when used as setter + * @fires {@link Scene.leave}, when used as setter + * + * @param {number} [progress] - The new progress value of the scene `[0-1]`. + * @returns {number} `get` - Current scene progress. + * @returns {Scene} `set` - Parent object for chaining. + */ + this.progress = function (progress) { + if (!arguments.length) { // get + return _progress; + } else { // set + var + doUpdate = false, + oldState = _state, + scrollDirection = _controller ? _controller.info("scrollDirection") : 'PAUSED', + reverseOrForward = _options.reverse || progress >= _progress; + if (_options.duration === 0) { + // zero duration scenes + doUpdate = _progress != progress; + _progress = progress < 1 && reverseOrForward ? 0 : 1; + _state = _progress === 0 ? SCENE_STATE_BEFORE : SCENE_STATE_DURING; + } else { + // scenes with start and end + if (progress < 0 && _state !== SCENE_STATE_BEFORE && reverseOrForward) { + // go back to initial state + _progress = 0; + _state = SCENE_STATE_BEFORE; + doUpdate = true; + } else if (progress >= 0 && progress < 1 && reverseOrForward) { + _progress = progress; + _state = SCENE_STATE_DURING; + doUpdate = true; + } else if (progress >= 1 && _state !== SCENE_STATE_AFTER) { + _progress = 1; + _state = SCENE_STATE_AFTER; + doUpdate = true; + } else if (_state === SCENE_STATE_DURING && !reverseOrForward) { + updatePinState(); // in case we scrolled backwards mid-scene and reverse is disabled => update the pin position, so it doesn't move back as well. + } + } + if (doUpdate) { + // fire events + var + eventVars = { + progress: _progress, + state: _state, + scrollDirection: scrollDirection + }, + stateChanged = _state != oldState; + + var trigger = function (eventName) { // tmp helper to simplify code + Scene.trigger(eventName, eventVars); + }; + + if (stateChanged) { // enter events + if (oldState !== SCENE_STATE_DURING) { + trigger("enter"); + trigger(oldState === SCENE_STATE_BEFORE ? "start" : "end"); + } + } + trigger("progress"); + if (stateChanged) { // leave events + if (_state !== SCENE_STATE_DURING) { + trigger(_state === SCENE_STATE_BEFORE ? "start" : "end"); + trigger("leave"); + } + } + } + + return Scene; + } + }; + + + /** + * Update the start and end scrollOffset of the container. + * The positions reflect what the controller's scroll position will be at the start and end respectively. + * Is called, when: + * - Scene event "change" is called with: offset, triggerHook, duration + * - scroll container event "resize" is called + * - the position of the triggerElement changes + * - the controller changes -> addTo() + * @private + */ + var updateScrollOffset = function () { + _scrollOffset = { + start: _triggerPos + _options.offset + }; + if (_controller && _options.triggerElement) { + // take away triggerHook portion to get relative to top + _scrollOffset.start -= _controller.info("size") * _options.triggerHook; + } + _scrollOffset.end = _scrollOffset.start + _options.duration; + }; + + /** + * Updates the duration if set to a dynamic function. + * This method is called when the scene is added to a controller and in regular intervals from the controller through scene.refresh(). + * + * @fires {@link Scene.change}, if the duration changed + * @fires {@link Scene.shift}, if the duration changed + * + * @param {boolean} [suppressEvents=false] - If true the shift event will be suppressed. + * @private + */ + var updateDuration = function (suppressEvents) { + // update duration + if (_durationUpdateMethod) { + var varname = "duration"; + if (changeOption(varname, _durationUpdateMethod.call(Scene)) && !suppressEvents) { // set + Scene.trigger("change", { + what: varname, + newval: _options[varname] + }); + Scene.trigger("shift", { + reason: varname + }); + } + } + }; + + /** + * Updates the position of the triggerElement, if present. + * This method is called ... + * - ... when the triggerElement is changed + * - ... when the scene is added to a (new) controller + * - ... in regular intervals from the controller through scene.refresh(). + * + * @fires {@link Scene.shift}, if the position changed + * + * @param {boolean} [suppressEvents=false] - If true the shift event will be suppressed. + * @private + */ + var updateTriggerElementPosition = function (suppressEvents) { + var + elementPos = 0, + telem = _options.triggerElement; + if (_controller && (telem || _triggerPos > 0)) { // either an element exists or was removed and the triggerPos is still > 0 + if (telem) { // there currently a triggerElement set + if (telem.parentNode) { // check if element is still attached to DOM + var + controllerInfo = _controller.info(), + containerOffset = _util.get.offset(controllerInfo.container), // container position is needed because element offset is returned in relation to document, not in relation to container. + param = controllerInfo.vertical ? "top" : "left"; // which param is of interest ? + + // if parent is spacer, use spacer position instead so correct start position is returned for pinned elements. + while (telem.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) { + telem = telem.parentNode; + } + + var elementOffset = _util.get.offset(telem); + + if (!controllerInfo.isDocument) { // container is not the document root, so substract scroll Position to get correct trigger element position relative to scrollcontent + containerOffset[param] -= _controller.scrollPos(); + } + + elementPos = elementOffset[param] - containerOffset[param]; + + } else { // there was an element, but it was removed from DOM + log(2, "WARNING: triggerElement was removed from DOM and will be reset to", undefined); + Scene.triggerElement(undefined); // unset, so a change event is triggered + } + } + + var changed = elementPos != _triggerPos; + _triggerPos = elementPos; + if (changed && !suppressEvents) { + Scene.trigger("shift", { + reason: "triggerElementPosition" + }); + } + } + }; + + /** + * Trigger a shift event, when the container is resized and the triggerHook is > 1. + * @private + */ + var onContainerResize = function (e) { + if (_options.triggerHook > 0) { + Scene.trigger("shift", { + reason: "containerResize" + }); + } + }; + + + var _validate = _util.extend(SCENE_OPTIONS.validate, { + // validation for duration handled internally for reference to private var _durationMethod + duration: function (val) { + if (_util.type.String(val) && val.match(/^(\.|\d)*\d+%$/)) { + // percentage value + var perc = parseFloat(val) / 100; + val = function () { + return _controller ? _controller.info("size") * perc : 0; + }; + } + if (_util.type.Function(val)) { + // function + _durationUpdateMethod = val; + try { + val = parseFloat(_durationUpdateMethod.call(Scene)); + } catch (e) { + val = -1; // will cause error below + } + } + // val has to be float + val = parseFloat(val); + if (!_util.type.Number(val) || val < 0) { + if (_durationUpdateMethod) { + _durationUpdateMethod = undefined; + throw ["Invalid return value of supplied function for option \"duration\":", val]; + } else { + throw ["Invalid value for option \"duration\":", val]; + } + } + return val; + } + }); + + /** + * Checks the validity of a specific or all options and reset to default if neccessary. + * @private + */ + var validateOption = function (check) { + check = arguments.length ? [check] : Object.keys(_validate); + check.forEach(function (optionName, key) { + var value; + if (_validate[optionName]) { // there is a validation method for this option + try { // validate value + value = _validate[optionName](_options[optionName]); + } catch (e) { // validation failed -> reset to default + value = DEFAULT_OPTIONS[optionName]; + var logMSG = _util.type.String(e) ? [e] : e; + if (_util.type.Array(logMSG)) { + logMSG[0] = "ERROR: " + logMSG[0]; + logMSG.unshift(1); // loglevel 1 for error msg + log.apply(this, logMSG); + } else { + log(1, "ERROR: Problem executing validation callback for option '" + optionName + "':", e.message); + } + } finally { + _options[optionName] = value; + } + } + }); + }; + + /** + * Helper used by the setter/getters for scene options + * @private + */ + var changeOption = function (varname, newval) { + var + changed = false, + oldval = _options[varname]; + if (_options[varname] != newval) { + _options[varname] = newval; + validateOption(varname); // resets to default if necessary + changed = oldval != _options[varname]; + } + return changed; + }; + + // generate getters/setters for all options + var addSceneOption = function (optionName) { + if (!Scene[optionName]) { + Scene[optionName] = function (newVal) { + if (!arguments.length) { // get + return _options[optionName]; + } else { + if (optionName === "duration") { // new duration is set, so any previously set function must be unset + _durationUpdateMethod = undefined; + } + if (changeOption(optionName, newVal)) { // set + Scene.trigger("change", { + what: optionName, + newval: _options[optionName] + }); + if (SCENE_OPTIONS.shifts.indexOf(optionName) > -1) { + Scene.trigger("shift", { + reason: optionName + }); + } + } + } + return Scene; + }; + } + }; + + /** + * **Get** or **Set** the duration option value. + * + * As a **setter** it accepts three types of parameters: + * 1. `number`: Sets the duration of the scene to exactly this amount of pixels. + * This means the scene will last for exactly this amount of pixels scrolled. Sub-Pixels are also valid. + * A value of `0` means that the scene is 'open end' and no end will be triggered. Pins will never unpin and animations will play independently of scroll progress. + * 2. `string`: Always updates the duration relative to parent scroll container. + * For example `"100%"` will keep the duration always exactly at the inner height of the scroll container. + * When scrolling vertically the width is used for reference respectively. + * 3. `function`: The supplied function will be called to return the scene duration. + * This is useful in setups where the duration depends on other elements who might change size. By supplying a function you can return a value instead of updating potentially multiple scene durations. + * The scene can be referenced inside the callback using `this`. + * _**WARNING:** This is an easy way to kill performance, as the callback will be executed every time `Scene.refresh()` is called, which happens a lot. The interval is defined by the controller (see ScrollMagic.Controller option `refreshInterval`). + * It's recomended to avoid calculations within the function and use cached variables as return values. + * This counts double if you use the same function for multiple scenes._ + * + * @method ScrollMagic.Scene#duration + * @example + * // get the current duration value + * var duration = scene.duration(); + * + * // set a new duration + * scene.duration(300); + * + * // set duration responsively to container size + * scene.duration("100%"); + * + * // use a function to randomize the duration for some reason. + * var durationValueCache; + * function durationCallback () { + * return durationValueCache; + * } + * function updateDuration () { + * durationValueCache = Math.random() * 100; + * } + * updateDuration(); // set to initial value + * scene.duration(durationCallback); // set duration callback + * + * @fires {@link Scene.change}, when used as setter + * @fires {@link Scene.shift}, when used as setter + * @param {(number|string|function)} [newDuration] - The new duration setting for the scene. + * @returns {number} `get` - Current scene duration. + * @returns {Scene} `set` - Parent object for chaining. + */ + + /** + * **Get** or **Set** the offset option value. + * @method ScrollMagic.Scene#offset + * @example + * // get the current offset + * var offset = scene.offset(); + * + * // set a new offset + * scene.offset(100); + * + * @fires {@link Scene.change}, when used as setter + * @fires {@link Scene.shift}, when used as setter + * @param {number} [newOffset] - The new offset of the scene. + * @returns {number} `get` - Current scene offset. + * @returns {Scene} `set` - Parent object for chaining. + */ + + /** + * **Get** or **Set** the triggerElement option value. + * Does **not** fire `Scene.shift`, because changing the trigger Element doesn't necessarily mean the start position changes. This will be determined in `Scene.refresh()`, which is automatically triggered. + * @method ScrollMagic.Scene#triggerElement + * @example + * // get the current triggerElement + * var triggerElement = scene.triggerElement(); + * + * // set a new triggerElement using a selector + * scene.triggerElement("#trigger"); + * // set a new triggerElement using a DOM object + * scene.triggerElement(document.getElementById("trigger")); + * + * @fires {@link Scene.change}, when used as setter + * @param {(string|object)} [newTriggerElement] - The new trigger element for the scene. + * @returns {(string|object)} `get` - Current triggerElement. + * @returns {Scene} `set` - Parent object for chaining. + */ + + /** + * **Get** or **Set** the triggerHook option value. + * @method ScrollMagic.Scene#triggerHook + * @example + * // get the current triggerHook value + * var triggerHook = scene.triggerHook(); + * + * // set a new triggerHook using a string + * scene.triggerHook("onLeave"); + * // set a new triggerHook using a number + * scene.triggerHook(0.7); + * + * @fires {@link Scene.change}, when used as setter + * @fires {@link Scene.shift}, when used as setter + * @param {(number|string)} [newTriggerHook] - The new triggerHook of the scene. See {@link Scene} parameter description for value options. + * @returns {number} `get` - Current triggerHook (ALWAYS numerical). + * @returns {Scene} `set` - Parent object for chaining. + */ + + /** + * **Get** or **Set** the reverse option value. + * @method ScrollMagic.Scene#reverse + * @example + * // get the current reverse option + * var reverse = scene.reverse(); + * + * // set new reverse option + * scene.reverse(false); + * + * @fires {@link Scene.change}, when used as setter + * @param {boolean} [newReverse] - The new reverse setting of the scene. + * @returns {boolean} `get` - Current reverse option value. + * @returns {Scene} `set` - Parent object for chaining. + */ + + /** + * **Get** or **Set** the loglevel option value. + * @method ScrollMagic.Scene#loglevel + * @example + * // get the current loglevel + * var loglevel = scene.loglevel(); + * + * // set new loglevel + * scene.loglevel(3); + * + * @fires {@link Scene.change}, when used as setter + * @param {number} [newLoglevel] - The new loglevel setting of the scene. `[0-3]` + * @returns {number} `get` - Current loglevel. + * @returns {Scene} `set` - Parent object for chaining. + */ + + /** + * **Get** the associated controller. + * @method ScrollMagic.Scene#controller + * @example + * // get the controller of a scene + * var controller = scene.controller(); + * + * @returns {ScrollMagic.Controller} Parent controller or `undefined` + */ + this.controller = function () { + return _controller; + }; + + /** + * **Get** the current state. + * @method ScrollMagic.Scene#state + * @example + * // get the current state + * var state = scene.state(); + * + * @returns {string} `"BEFORE"`, `"DURING"` or `"AFTER"` + */ + this.state = function () { + return _state; + }; + + /** + * **Get** the current scroll offset for the start of the scene. + * Mind, that the scrollOffset is related to the size of the container, if `triggerHook` is bigger than `0` (or `"onLeave"`). + * This means, that resizing the container or changing the `triggerHook` will influence the scene's start offset. + * @method ScrollMagic.Scene#scrollOffset + * @example + * // get the current scroll offset for the start and end of the scene. + * var start = scene.scrollOffset(); + * var end = scene.scrollOffset() + scene.duration(); + * console.log("the scene starts at", start, "and ends at", end); + * + * @returns {number} The scroll offset (of the container) at which the scene will trigger. Y value for vertical and X value for horizontal scrolls. + */ + this.scrollOffset = function () { + return _scrollOffset.start; + }; + + /** + * **Get** the trigger position of the scene (including the value of the `offset` option). + * @method ScrollMagic.Scene#triggerPosition + * @example + * // get the scene's trigger position + * var triggerPosition = scene.triggerPosition(); + * + * @returns {number} Start position of the scene. Top position value for vertical and left position value for horizontal scrolls. + */ + this.triggerPosition = function () { + var pos = _options.offset; // the offset is the basis + if (_controller) { + // get the trigger position + if (_options.triggerElement) { + // Element as trigger + pos += _triggerPos; + } else { + // return the height of the triggerHook to start at the beginning + pos += _controller.info("size") * Scene.triggerHook(); + } + } + return pos; + }; + + + var + _pin, + _pinOptions; + + Scene + .on("shift.internal", function (e) { + var durationChanged = e.reason === "duration"; + if ((_state === SCENE_STATE_AFTER && durationChanged) || (_state === SCENE_STATE_DURING && _options.duration === 0)) { + // if [duration changed after a scene (inside scene progress updates pin position)] or [duration is 0, we are in pin phase and some other value changed]. + updatePinState(); + } + if (durationChanged) { + updatePinDimensions(); + } + }) + .on("progress.internal", function (e) { + updatePinState(); + }) + .on("add.internal", function (e) { + updatePinDimensions(); + }) + .on("destroy.internal", function (e) { + Scene.removePin(e.reset); + }); + /** + * Update the pin state. + * @private + */ + var updatePinState = function (forceUnpin) { + if (_pin && _controller) { + var + containerInfo = _controller.info(), + pinTarget = _pinOptions.spacer.firstChild; // may be pin element or another spacer, if cascading pins + + if (!forceUnpin && _state === SCENE_STATE_DURING) { // during scene or if duration is 0 and we are past the trigger + // pinned state + if (_util.css(pinTarget, "position") != "fixed") { + // change state before updating pin spacer (position changes due to fixed collapsing might occur.) + _util.css(pinTarget, { + "position": "fixed" + }); + // update pin spacer + updatePinDimensions(); + } + + var + fixedPos = _util.get.offset(_pinOptions.spacer, true), // get viewport position of spacer + scrollDistance = _options.reverse || _options.duration === 0 ? + containerInfo.scrollPos - _scrollOffset.start // quicker + : + Math.round(_progress * _options.duration * 10) / 10; // if no reverse and during pin the position needs to be recalculated using the progress + + // add scrollDistance + fixedPos[containerInfo.vertical ? "top" : "left"] += scrollDistance; + + // set new values + _util.css(_pinOptions.spacer.firstChild, { + top: fixedPos.top, + left: fixedPos.left + }); + } else { + // unpinned state + var + newCSS = { + position: _pinOptions.inFlow ? "relative" : "absolute", + top: 0, + left: 0 + }, + change = _util.css(pinTarget, "position") != newCSS.position; + + if (!_pinOptions.pushFollowers) { + newCSS[containerInfo.vertical ? "top" : "left"] = _options.duration * _progress; + } else if (_options.duration > 0) { // only concerns scenes with duration + if (_state === SCENE_STATE_AFTER && parseFloat(_util.css(_pinOptions.spacer, "padding-top")) === 0) { + change = true; // if in after state but havent updated spacer yet (jumped past pin) + } else if (_state === SCENE_STATE_BEFORE && parseFloat(_util.css(_pinOptions.spacer, "padding-bottom")) === 0) { // before + change = true; // jumped past fixed state upward direction + } + } + // set new values + _util.css(pinTarget, newCSS); + if (change) { + // update pin spacer if state changed + updatePinDimensions(); + } + } + } + }; + + /** + * Update the pin spacer and/or element size. + * The size of the spacer needs to be updated whenever the duration of the scene changes, if it is to push down following elements. + * @private + */ + var updatePinDimensions = function () { + if (_pin && _controller && _pinOptions.inFlow) { // no spacerresize, if original position is absolute + var + after = (_state === SCENE_STATE_AFTER), + before = (_state === SCENE_STATE_BEFORE), + during = (_state === SCENE_STATE_DURING), + vertical = _controller.info("vertical"), + pinTarget = _pinOptions.spacer.firstChild, // usually the pined element but can also be another spacer (cascaded pins) + marginCollapse = _util.isMarginCollapseType(_util.css(_pinOptions.spacer, "display")), + css = {}; + + // set new size + // if relsize: spacer -> pin | else: pin -> spacer + if (_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) { + if (during) { + _util.css(_pin, { + "width": _util.get.width(_pinOptions.spacer) + }); + } else { + _util.css(_pin, { + "width": "100%" + }); + } + } else { + // minwidth is needed for cascaded pins. + css["min-width"] = _util.get.width(vertical ? _pin : pinTarget, true, true); + css.width = during ? css["min-width"] : "auto"; + } + if (_pinOptions.relSize.height) { + if (during) { + // the only padding the spacer should ever include is the duration (if pushFollowers = true), so we need to substract that. + _util.css(_pin, { + "height": _util.get.height(_pinOptions.spacer) - (_pinOptions.pushFollowers ? _options.duration : 0) + }); + } else { + _util.css(_pin, { + "height": "100%" + }); + } + } else { + // margin is only included if it's a cascaded pin to resolve an IE9 bug + css["min-height"] = _util.get.height(vertical ? pinTarget : _pin, true, !marginCollapse); // needed for cascading pins + css.height = during ? css["min-height"] : "auto"; + } + + // add space for duration if pushFollowers is true + if (_pinOptions.pushFollowers) { + css["padding" + (vertical ? "Top" : "Left")] = _options.duration * _progress; + css["padding" + (vertical ? "Bottom" : "Right")] = _options.duration * (1 - _progress); + } + _util.css(_pinOptions.spacer, css); + } + }; + + /** + * Updates the Pin state (in certain scenarios) + * If the controller container is not the document and we are mid-pin-phase scrolling or resizing the main document can result to wrong pin positions. + * So this function is called on resize and scroll of the document. + * @private + */ + var updatePinInContainer = function () { + if (_controller && _pin && _state === SCENE_STATE_DURING && !_controller.info("isDocument")) { + updatePinState(); + } + }; + + /** + * Updates the Pin spacer size state (in certain scenarios) + * If container is resized during pin and relatively sized the size of the pin might need to be updated... + * So this function is called on resize of the container. + * @private + */ + var updateRelativePinSpacer = function () { + if (_controller && _pin && // well, duh + _state === SCENE_STATE_DURING && // element in pinned state? + ( // is width or height relatively sized, but not in relation to body? then we need to recalc. + ((_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) && _util.get.width(window) != _util.get.width(_pinOptions.spacer.parentNode)) || + (_pinOptions.relSize.height && _util.get.height(window) != _util.get.height(_pinOptions.spacer.parentNode)) + ) + ) { + updatePinDimensions(); + } + }; + + /** + * Is called, when the mousewhel is used while over a pinned element inside a div container. + * If the scene is in fixed state scroll events would be counted towards the body. This forwards the event to the scroll container. + * @private + */ + var onMousewheelOverPin = function (e) { + if (_controller && _pin && _state === SCENE_STATE_DURING && !_controller.info("isDocument")) { // in pin state + e.preventDefault(); + _controller._setScrollPos(_controller.info("scrollPos") - ((e.wheelDelta || e[_controller.info("vertical") ? "wheelDeltaY" : "wheelDeltaX"]) / 3 || -e.detail * 30)); + } + }; + + /** + * Pin an element for the duration of the scene. + * If the scene duration is 0 the element will only be unpinned, if the user scrolls back past the start position. + * Make sure only one pin is applied to an element at the same time. + * An element can be pinned multiple times, but only successively. + * _**NOTE:** The option `pushFollowers` has no effect, when the scene duration is 0._ + * @method ScrollMagic.Scene#setPin + * @example + * // pin element and push all following elements down by the amount of the pin duration. + * scene.setPin("#pin"); + * + * // pin element and keeping all following elements in their place. The pinned element will move past them. + * scene.setPin("#pin", {pushFollowers: false}); + * + * @param {(string|object)} element - A Selector targeting an element or a DOM object that is supposed to be pinned. + * @param {object} [settings] - settings for the pin + * @param {boolean} [settings.pushFollowers=true] - If `true` following elements will be "pushed" down for the duration of the pin, if `false` the pinned element will just scroll past them. + Ignored, when duration is `0`. + * @param {string} [settings.spacerClass="scrollmagic-pin-spacer"] - Classname of the pin spacer element, which is used to replace the element. + * + * @returns {Scene} Parent object for chaining. + */ + this.setPin = function (element, settings) { + var + defaultSettings = { + pushFollowers: true, + spacerClass: "scrollmagic-pin-spacer" + }; + var pushFollowersActivelySet = settings && settings.hasOwnProperty('pushFollowers'); + settings = _util.extend({}, defaultSettings, settings); + + // validate Element + element = _util.get.elements(element)[0]; + if (!element) { + log(1, "ERROR calling method 'setPin()': Invalid pin element supplied."); + return Scene; // cancel + } else if (_util.css(element, "position") === "fixed") { + log(1, "ERROR calling method 'setPin()': Pin does not work with elements that are positioned 'fixed'."); + return Scene; // cancel + } + + if (_pin) { // preexisting pin? + if (_pin === element) { + // same pin we already have -> do nothing + return Scene; // cancel + } else { + // kill old pin + Scene.removePin(); + } + + } + _pin = element; + + var + parentDisplay = _pin.parentNode.style.display, + boundsParams = ["top", "left", "bottom", "right", "margin", "marginLeft", "marginRight", "marginTop", "marginBottom"]; + + _pin.parentNode.style.display = 'none'; // hack start to force css to return stylesheet values instead of calculated px values. + var + inFlow = _util.css(_pin, "position") != "absolute", + pinCSS = _util.css(_pin, boundsParams.concat(["display"])), + sizeCSS = _util.css(_pin, ["width", "height"]); + _pin.parentNode.style.display = parentDisplay; // hack end. + + if (!inFlow && settings.pushFollowers) { + log(2, "WARNING: If the pinned element is positioned absolutely pushFollowers will be disabled."); + settings.pushFollowers = false; + } + window.setTimeout(function () { // wait until all finished, because with responsive duration it will only be set after scene is added to controller + if (_pin && _options.duration === 0 && pushFollowersActivelySet && settings.pushFollowers) { + log(2, "WARNING: pushFollowers =", true, "has no effect, when scene duration is 0."); + } + }, 0); + + // create spacer and insert + var + spacer = _pin.parentNode.insertBefore(document.createElement('div'), _pin), + spacerCSS = _util.extend(pinCSS, { + position: inFlow ? "relative" : "absolute", + boxSizing: "content-box", + mozBoxSizing: "content-box", + webkitBoxSizing: "content-box" + }); + + if (!inFlow) { // copy size if positioned absolutely, to work for bottom/right positioned elements. + _util.extend(spacerCSS, _util.css(_pin, ["width", "height"])); + } + + _util.css(spacer, spacerCSS); + spacer.setAttribute(PIN_SPACER_ATTRIBUTE, ""); + _util.addClass(spacer, settings.spacerClass); + + // set the pin Options + _pinOptions = { + spacer: spacer, + relSize: { // save if size is defined using % values. if so, handle spacer resize differently... + width: sizeCSS.width.slice(-1) === "%", + height: sizeCSS.height.slice(-1) === "%", + autoFullWidth: sizeCSS.width === "auto" && inFlow && _util.isMarginCollapseType(pinCSS.display) + }, + pushFollowers: settings.pushFollowers, + inFlow: inFlow, // stores if the element takes up space in the document flow + }; + + if (!_pin.___origStyle) { + _pin.___origStyle = {}; + var + pinInlineCSS = _pin.style, + copyStyles = boundsParams.concat(["width", "height", "position", "boxSizing", "mozBoxSizing", "webkitBoxSizing"]); + copyStyles.forEach(function (val) { + _pin.___origStyle[val] = pinInlineCSS[val] || ""; + }); + } + + // if relative size, transfer it to spacer and make pin calculate it... + if (_pinOptions.relSize.width) { + _util.css(spacer, { + width: sizeCSS.width + }); + } + if (_pinOptions.relSize.height) { + _util.css(spacer, { + height: sizeCSS.height + }); + } + + // now place the pin element inside the spacer + spacer.appendChild(_pin); + // and set new css + _util.css(_pin, { + position: inFlow ? "relative" : "absolute", + margin: "auto", + top: "auto", + left: "auto", + bottom: "auto", + right: "auto" + }); + + if (_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) { + _util.css(_pin, { + boxSizing: "border-box", + mozBoxSizing: "border-box", + webkitBoxSizing: "border-box" + }); + } + + // add listener to document to update pin position in case controller is not the document. + window.addEventListener('scroll', updatePinInContainer); + window.addEventListener('resize', updatePinInContainer); + window.addEventListener('resize', updateRelativePinSpacer); + // add mousewheel listener to catch scrolls over fixed elements + _pin.addEventListener("mousewheel", onMousewheelOverPin); + _pin.addEventListener("DOMMouseScroll", onMousewheelOverPin); + + log(3, "added pin"); + + // finally update the pin to init + updatePinState(); + + return Scene; + }; + + /** + * Remove the pin from the scene. + * @method ScrollMagic.Scene#removePin + * @example + * // remove the pin from the scene without resetting it (the spacer is not removed) + * scene.removePin(); + * + * // remove the pin from the scene and reset the pin element to its initial position (spacer is removed) + * scene.removePin(true); + * + * @param {boolean} [reset=false] - If `false` the spacer will not be removed and the element's position will not be reset. + * @returns {Scene} Parent object for chaining. + */ + this.removePin = function (reset) { + if (_pin) { + if (_state === SCENE_STATE_DURING) { + updatePinState(true); // force unpin at position + } + if (reset || !_controller) { // if there's no controller no progress was made anyway... + var pinTarget = _pinOptions.spacer.firstChild; // usually the pin element, but may be another spacer (cascaded pins)... + if (pinTarget.hasAttribute(PIN_SPACER_ATTRIBUTE)) { // copy margins to child spacer + var + style = _pinOptions.spacer.style, + values = ["margin", "marginLeft", "marginRight", "marginTop", "marginBottom"], + margins = {}; + values.forEach(function (val) { + margins[val] = style[val] || ""; + }); + _util.css(pinTarget, margins); + } + _pinOptions.spacer.parentNode.insertBefore(pinTarget, _pinOptions.spacer); + _pinOptions.spacer.parentNode.removeChild(_pinOptions.spacer); + if (!_pin.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) { // if it's the last pin for this element -> restore inline styles + // TODO: only correctly set for first pin (when cascading) - how to fix? + _util.css(_pin, _pin.___origStyle); + delete _pin.___origStyle; + } + } + window.removeEventListener('scroll', updatePinInContainer); + window.removeEventListener('resize', updatePinInContainer); + window.removeEventListener('resize', updateRelativePinSpacer); + _pin.removeEventListener("mousewheel", onMousewheelOverPin); + _pin.removeEventListener("DOMMouseScroll", onMousewheelOverPin); + _pin = undefined; + log(3, "removed pin (reset: " + (reset ? "true" : "false") + ")"); + } + return Scene; + }; + + + var + _cssClasses, + _cssClassElems = []; + + Scene + .on("destroy.internal", function (e) { + Scene.removeClassToggle(e.reset); + }); + /** + * Define a css class modification while the scene is active. + * When the scene triggers the classes will be added to the supplied element and removed, when the scene is over. + * If the scene duration is 0 the classes will only be removed if the user scrolls back past the start position. + * @method ScrollMagic.Scene#setClassToggle + * @example + * // add the class 'myclass' to the element with the id 'my-elem' for the duration of the scene + * scene.setClassToggle("#my-elem", "myclass"); + * + * // add multiple classes to multiple elements defined by the selector '.classChange' + * scene.setClassToggle(".classChange", "class1 class2 class3"); + * + * @param {(string|object)} element - A Selector targeting one or more elements or a DOM object that is supposed to be modified. + * @param {string} classes - One or more Classnames (separated by space) that should be added to the element during the scene. + * + * @returns {Scene} Parent object for chaining. + */ + this.setClassToggle = function (element, classes) { + var elems = _util.get.elements(element); + if (elems.length === 0 || !_util.type.String(classes)) { + log(1, "ERROR calling method 'setClassToggle()': Invalid " + (elems.length === 0 ? "element" : "classes") + " supplied."); + return Scene; + } + if (_cssClassElems.length > 0) { + // remove old ones + Scene.removeClassToggle(); + } + _cssClasses = classes; + _cssClassElems = elems; + Scene.on("enter.internal_class leave.internal_class", function (e) { + var toggle = e.type === "enter" ? _util.addClass : _util.removeClass; + _cssClassElems.forEach(function (elem, key) { + toggle(elem, _cssClasses); + }); + }); + return Scene; + }; + + /** + * Remove the class binding from the scene. + * @method ScrollMagic.Scene#removeClassToggle + * @example + * // remove class binding from the scene without reset + * scene.removeClassToggle(); + * + * // remove class binding and remove the changes it caused + * scene.removeClassToggle(true); + * + * @param {boolean} [reset=false] - If `false` and the classes are currently active, they will remain on the element. If `true` they will be removed. + * @returns {Scene} Parent object for chaining. + */ + this.removeClassToggle = function (reset) { + if (reset) { + _cssClassElems.forEach(function (elem, key) { + _util.removeClass(elem, _cssClasses); + }); + } + Scene.off("start.internal_class end.internal_class"); + _cssClasses = undefined; + _cssClassElems = []; + return Scene; + }; + + // INIT + construct(); + return Scene; + }; + + // store pagewide scene options + var SCENE_OPTIONS = { + defaults: { + duration: 0, + offset: 0, + triggerElement: undefined, + triggerHook: 0.5, + reverse: true, + loglevel: 2 + }, + validate: { + offset: function (val) { + val = parseFloat(val); + if (!_util.type.Number(val)) { + throw ["Invalid value for option \"offset\":", val]; + } + return val; + }, + triggerElement: function (val) { + val = val || undefined; + if (val) { + var elem = _util.get.elements(val)[0]; + if (elem && elem.parentNode) { + val = elem; + } else { + throw ["Element defined in option \"triggerElement\" was not found:", val]; + } + } + return val; + }, + triggerHook: function (val) { + var translate = { + "onCenter": 0.5, + "onEnter": 1, + "onLeave": 0 + }; + if (_util.type.Number(val)) { + val = Math.max(0, Math.min(parseFloat(val), 1)); // make sure its betweeen 0 and 1 + } else if (val in translate) { + val = translate[val]; + } else { + throw ["Invalid value for option \"triggerHook\": ", val]; + } + return val; + }, + reverse: function (val) { + return !!val; // force boolean + }, + loglevel: function (val) { + val = parseInt(val); + if (!_util.type.Number(val) || val < 0 || val > 3) { + throw ["Invalid value for option \"loglevel\":", val]; + } + return val; + } + }, // holder for validation methods. duration validation is handled in 'getters-setters.js' + shifts: ["duration", "offset", "triggerHook"], // list of options that trigger a `shift` event + }; + /* + * method used to add an option to ScrollMagic Scenes. + * TODO: DOC (private for dev) + */ + ScrollMagic.Scene.addOption = function (name, defaultValue, validationCallback, shifts) { + if (!(name in SCENE_OPTIONS.defaults)) { + SCENE_OPTIONS.defaults[name] = defaultValue; + SCENE_OPTIONS.validate[name] = validationCallback; + if (shifts) { + SCENE_OPTIONS.shifts.push(name); + } + } else { + ScrollMagic._util.log(1, "[static] ScrollMagic.Scene -> Cannot add Scene option '" + name + "', because it already exists."); + } + }; + // instance extension function for plugins + // TODO: DOC (private for dev) + ScrollMagic.Scene.extend = function (extension) { + var oldClass = this; + ScrollMagic.Scene = function () { + oldClass.apply(this, arguments); + this.$super = _util.extend({}, this); // copy parent state + return extension.apply(this, arguments) || this; + }; + _util.extend(ScrollMagic.Scene, oldClass); // copy properties + ScrollMagic.Scene.prototype = oldClass.prototype; // copy prototype + ScrollMagic.Scene.prototype.constructor = ScrollMagic.Scene; // restore constructor + }; + + + + /** + * TODO: DOCS (private for dev) + * @class + * @private + */ + + ScrollMagic.Event = function (type, namespace, target, vars) { + vars = vars || {}; + for (var key in vars) { + this[key] = vars[key]; + } + this.type = type; + this.target = this.currentTarget = target; + this.namespace = namespace || ''; + this.timeStamp = this.timestamp = Date.now(); + return this; + }; + + /* + * TODO: DOCS (private for dev) + */ + + var _util = ScrollMagic._util = (function (window) { + var U = {}, + i; + + /** + * ------------------------------ + * internal helpers + * ------------------------------ + */ + + // parse float and fall back to 0. + var floatval = function (number) { + return parseFloat(number) || 0; + }; + // get current style IE safe (otherwise IE would return calculated values for 'auto') + var _getComputedStyle = function (elem) { + return elem.currentStyle ? elem.currentStyle : window.getComputedStyle(elem); + }; + + // get element dimension (width or height) + var _dimension = function (which, elem, outer, includeMargin) { + elem = (elem === document) ? window : elem; + if (elem === window) { + includeMargin = false; + } else if (!_type.DomElement(elem)) { + return 0; + } + which = which.charAt(0).toUpperCase() + which.substr(1).toLowerCase(); + var dimension = (outer ? elem['offset' + which] || elem['outer' + which] : elem['client' + which] || elem['inner' + which]) || 0; + if (outer && includeMargin) { + var style = _getComputedStyle(elem); + dimension += which === 'Height' ? floatval(style.marginTop) + floatval(style.marginBottom) : floatval(style.marginLeft) + floatval(style.marginRight); + } + return dimension; + }; + // converts 'margin-top' into 'marginTop' + var _camelCase = function (str) { + return str.replace(/^[^a-z]+([a-z])/g, '$1').replace(/-([a-z])/g, function (g) { + return g[1].toUpperCase(); + }); + }; + + /** + * ------------------------------ + * external helpers + * ------------------------------ + */ + + // extend obj – same as jQuery.extend({}, objA, objB) + U.extend = function (obj) { + obj = obj || {}; + for (i = 1; i < arguments.length; i++) { + if (!arguments[i]) { + continue; + } + for (var key in arguments[i]) { + if (arguments[i].hasOwnProperty(key)) { + obj[key] = arguments[i][key]; + } + } + } + return obj; + }; + + // check if a css display type results in margin-collapse or not + U.isMarginCollapseType = function (str) { + return ["block", "flex", "list-item", "table", "-webkit-box"].indexOf(str) > -1; + }; + + // implementation of requestAnimationFrame + // based on https://gist.github.com/paulirish/1579671 + var + lastTime = 0, + vendors = ['ms', 'moz', 'webkit', 'o']; + var _requestAnimationFrame = window.requestAnimationFrame; + var _cancelAnimationFrame = window.cancelAnimationFrame; + // try vendor prefixes if the above doesn't work + for (i = 0; !_requestAnimationFrame && i < vendors.length; ++i) { + _requestAnimationFrame = window[vendors[i] + 'RequestAnimationFrame']; + _cancelAnimationFrame = window[vendors[i] + 'CancelAnimationFrame'] || window[vendors[i] + 'CancelRequestAnimationFrame']; + } + + // fallbacks + if (!_requestAnimationFrame) { + _requestAnimationFrame = function (callback) { + var + currTime = new Date().getTime(), + timeToCall = Math.max(0, 16 - (currTime - lastTime)), + id = window.setTimeout(function () { + callback(currTime + timeToCall); + }, timeToCall); + lastTime = currTime + timeToCall; + return id; + }; + } + if (!_cancelAnimationFrame) { + _cancelAnimationFrame = function (id) { + window.clearTimeout(id); + }; + } + U.rAF = _requestAnimationFrame.bind(window); + U.cAF = _cancelAnimationFrame.bind(window); + + var + loglevels = ["error", "warn", "log"], + console = window.console || {}; + + console.log = console.log || function () {}; // no console log, well - do nothing then... + // make sure methods for all levels exist. + for (i = 0; i < loglevels.length; i++) { + var method = loglevels[i]; + if (!console[method]) { + console[method] = console.log; // prefer .log over nothing + } + } + U.log = function (loglevel) { + if (loglevel > loglevels.length || loglevel <= 0) loglevel = loglevels.length; + var now = new Date(), + time = ("0" + now.getHours()).slice(-2) + ":" + ("0" + now.getMinutes()).slice(-2) + ":" + ("0" + now.getSeconds()).slice(-2) + ":" + ("00" + now.getMilliseconds()).slice(-3), + method = loglevels[loglevel - 1], + args = Array.prototype.splice.call(arguments, 1), + func = Function.prototype.bind.call(console[method], console); + args.unshift(time); + func.apply(console, args); + }; + + /** + * ------------------------------ + * type testing + * ------------------------------ + */ + + var _type = U.type = function (v) { + return Object.prototype.toString.call(v).replace(/^\[object (.+)\]$/, "$1").toLowerCase(); + }; + _type.String = function (v) { + return _type(v) === 'string'; + }; + _type.Function = function (v) { + return _type(v) === 'function'; + }; + _type.Array = function (v) { + return Array.isArray(v); + }; + _type.Number = function (v) { + return !_type.Array(v) && (v - parseFloat(v) + 1) >= 0; + }; + _type.DomElement = function (o) { + return ( + typeof HTMLElement === "object" || typeof HTMLElement === "function" ? o instanceof HTMLElement || o instanceof SVGElement : //DOM2 + o && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string" + ); + }; + + /** + * ------------------------------ + * DOM Element info + * ------------------------------ + */ + // always returns a list of matching DOM elements, from a selector, a DOM element or an list of elements or even an array of selectors + var _get = U.get = {}; + _get.elements = function (selector) { + var arr = []; + if (_type.String(selector)) { + try { + selector = document.querySelectorAll(selector); + } catch (e) { // invalid selector + return arr; + } + } + if (_type(selector) === 'nodelist' || _type.Array(selector) || selector instanceof NodeList) { + for (var i = 0, ref = arr.length = selector.length; i < ref; i++) { // list of elements + var elem = selector[i]; + arr[i] = _type.DomElement(elem) ? elem : _get.elements(elem); // if not an element, try to resolve recursively + } + } else if (_type.DomElement(selector) || selector === document || selector === window) { + arr = [selector]; // only the element + } + return arr; + }; + // get scroll top value + _get.scrollTop = function (elem) { + return (elem && typeof elem.scrollTop === 'number') ? elem.scrollTop : window.pageYOffset || 0; + }; + // get scroll left value + _get.scrollLeft = function (elem) { + return (elem && typeof elem.scrollLeft === 'number') ? elem.scrollLeft : window.pageXOffset || 0; + }; + // get element height + _get.width = function (elem, outer, includeMargin) { + return _dimension('width', elem, outer, includeMargin); + }; + // get element width + _get.height = function (elem, outer, includeMargin) { + return _dimension('height', elem, outer, includeMargin); + }; + + // get element position (optionally relative to viewport) + _get.offset = function (elem, relativeToViewport) { + var offset = { + top: 0, + left: 0 + }; + if (elem && elem.getBoundingClientRect) { // check if available + var rect = elem.getBoundingClientRect(); + offset.top = rect.top; + offset.left = rect.left; + if (!relativeToViewport) { // clientRect is by default relative to viewport... + offset.top += _get.scrollTop(); + offset.left += _get.scrollLeft(); + } + } + return offset; + }; + + /** + * ------------------------------ + * DOM Element manipulation + * ------------------------------ + */ + + U.addClass = function (elem, classname) { + if (classname) { + if (elem.classList) + elem.classList.add(classname); + else + elem.className += ' ' + classname; + } + }; + U.removeClass = function (elem, classname) { + if (classname) { + if (elem.classList) + elem.classList.remove(classname); + else + elem.className = elem.className.replace(new RegExp('(^|\\b)' + classname.split(' ').join('|') + '(\\b|$)', 'gi'), ' '); + } + }; + // if options is string -> returns css value + // if options is array -> returns object with css value pairs + // if options is object -> set new css values + U.css = function (elem, options) { + if (_type.String(options)) { + return _getComputedStyle(elem)[_camelCase(options)]; + } else if (_type.Array(options)) { + var + obj = {}, + style = _getComputedStyle(elem); + options.forEach(function (option, key) { + obj[option] = style[_camelCase(option)]; + }); + return obj; + } else { + for (var option in options) { + var val = options[option]; + if (val == parseFloat(val)) { // assume pixel for seemingly numerical values + val += 'px'; + } + elem.style[_camelCase(option)] = val; + } + } + }; + + return U; + }(window || {})); + + + ScrollMagic.Scene.prototype.addIndicators = function () { + ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling addIndicators() due to missing Plugin \'debug.addIndicators\'. Please make sure to include plugins/debug.addIndicators.js'); + return this; + } + ScrollMagic.Scene.prototype.removeIndicators = function () { + ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling removeIndicators() due to missing Plugin \'debug.addIndicators\'. Please make sure to include plugins/debug.addIndicators.js'); + return this; + } + ScrollMagic.Scene.prototype.setTween = function () { + ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling setTween() due to missing Plugin \'animation.gsap\'. Please make sure to include plugins/animation.gsap.js'); + return this; + } + ScrollMagic.Scene.prototype.removeTween = function () { + ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling removeTween() due to missing Plugin \'animation.gsap\'. Please make sure to include plugins/animation.gsap.js'); + return this; + } + ScrollMagic.Scene.prototype.setVelocity = function () { + ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling setVelocity() due to missing Plugin \'animation.velocity\'. Please make sure to include plugins/animation.velocity.js'); + return this; + } + ScrollMagic.Scene.prototype.removeVelocity = function () { + ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling removeVelocity() due to missing Plugin \'animation.velocity\'. Please make sure to include plugins/animation.velocity.js'); + return this; + } + + return ScrollMagic; +})); \ No newline at end of file Property changes on: base3.10/src/main/webapp/js/user/ScrollMagic.js ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/js/user/jquery.easeScroll.js =================================================================== --- base3.10/src/main/webapp/js/user/jquery.easeScroll.js (nonexistent) +++ base3.10/src/main/webapp/js/user/jquery.easeScroll.js (revision 34) @@ -0,0 +1,256 @@ +$.fn.easeScroll = function(options) { + ! function() { + function e() { + var e = !1; + e && c("keydown", r), v.keyboardSupport && !e && u("keydown", r) + } + + function t() { + if (document.body) { + var t = document.body, + o = document.documentElement, + n = window.innerHeight, + r = t.scrollHeight; + if (S = document.compatMode.indexOf("CSS") >= 0 ? o : t, w = t, e(), x = !0, top != self) y = !0; + else if (r > n && (t.offsetHeight <= n || o.offsetHeight <= n)) { + var a = !1, + i = function() { + a || o.scrollHeight == document.height || (a = !0, setTimeout(function() { + o.style.height = document.height + "px", a = !1 + }, 100)) + }; + if (o.style.height = "auto", setTimeout(i, 10), S.offsetHeight <= n) { + var l = document.createElement("div"); + l.style.clear = "both", t.appendChild(l) + } + } + v.fixedBackground || b || (t.style.backgroundAttachment = "scroll", o.style.backgroundAttachment = "scroll") + } + } + + function o(e, t, o, n) { + if (n || (n = 1e3), d(t, o), 1 != v.accelerationMax) { + var r = +new Date, + a = r - C; + if (a < v.accelerationDelta) { + var i = (1 + 30 / a) / 2; + i > 1 && (i = Math.min(i, v.accelerationMax), t *= i, o *= i) + } + C = +new Date + } + if (M.push({ + x: t, + y: o, + lastX: 0 > t ? .99 : -.99, + lastY: 0 > o ? .99 : -.99, + start: +new Date + }), !T) { + var l = e === document.body, + u = function() { + for (var r = +new Date, a = 0, i = 0, c = 0; c < M.length; c++) { + var s = M[c], + d = r - s.start, + f = d >= v.animationTime, + h = f ? 1 : d / v.animationTime; + v.pulseAlgorithm && (h = p(h)); + var m = s.x * h - s.lastX >> 0, + w = s.y * h - s.lastY >> 0; + a += m, i += w, s.lastX += m, s.lastY += w, f && (M.splice(c, 1), c--) + } + l ? window.scrollBy(a, i) : (a && (e.scrollLeft += a), i && (e.scrollTop += i)), t || o || (M = []), M.length ? E(u, e, n / v.frameRate + 1) : T = !1 + }; + E(u, e, 0), T = !0 + } + } + + function n(e) { + x || t(); + var n = e.target, + r = l(n); + if (!r || e.defaultPrevented || s(w, "embed") || s(n, "embed") && /\.pdf/i.test(n.src)) return !0; + var a = e.wheelDeltaX || 0, + i = e.wheelDeltaY || 0; + return a || i || (i = e.wheelDelta || 0), !v.touchpadSupport && f(i) ? !0 : (Math.abs(a) > 1.2 && (a *= v.stepSize / 120), Math.abs(i) > 1.2 && (i *= v.stepSize / 120), o(r, -a, -i), void e.preventDefault()) + } + + function r(e) { + var t = e.target, + n = e.ctrlKey || e.altKey || e.metaKey || e.shiftKey && e.keyCode !== H.spacebar; + if (/input|textarea|select|embed/i.test(t.nodeName) || t.isContentEditable || e.defaultPrevented || n) return !0; + if (s(t, "button") && e.keyCode === H.spacebar) return !0; + var r, a = 0, + i = 0, + u = l(w), + c = u.clientHeight; + switch (u == document.body && (c = window.innerHeight), e.keyCode) { + case H.up: + i = -v.arrowScroll; + break; + case H.down: + i = v.arrowScroll; + break; + case H.spacebar: + r = e.shiftKey ? 1 : -1, i = -r * c * .9; + break; + case H.pageup: + i = .9 * -c; + break; + case H.pagedown: + i = .9 * c; + break; + case H.home: + i = -u.scrollTop; + break; + case H.end: + var d = u.scrollHeight - u.scrollTop - c; + i = d > 0 ? d + 10 : 0; + break; + case H.left: + a = -v.arrowScroll; + break; + case H.right: + a = v.arrowScroll; + break; + default: + return !0 + } + o(u, a, i), e.preventDefault() + } + + function a(e) { + w = e.target + } + + function i(e, t) { + for (var o = e.length; o--;) z[N(e[o])] = t; + return t + } + + function l(e) { + var t = [], + o = S.scrollHeight; + do { + var n = z[N(e)]; + if (n) return i(t, n); + if (t.push(e), o === e.scrollHeight) { + if (!y || S.clientHeight + 10 < o) return i(t, document.body) + } else if (e.clientHeight + 10 < e.scrollHeight && (overflow = getComputedStyle(e, "").getPropertyValue("overflow-y"), "scroll" === overflow || "auto" === overflow)) return i(t, e) + } while (e = e.parentNode) + } + + function u(e, t, o) { + window.addEventListener(e, t, o || !1) + } + + function c(e, t, o) { + window.removeEventListener(e, t, o || !1) + } + + function s(e, t) { + return (e.nodeName || "").toLowerCase() === t.toLowerCase() + } + + function d(e, t) { + e = e > 0 ? 1 : -1, t = t > 0 ? 1 : -1, (k.x !== e || k.y !== t) && (k.x = e, k.y = t, M = [], C = 0) + } + + function f(e) { + if (e) { + e = Math.abs(e), D.push(e), D.shift(), clearTimeout(A); + var t = D[0] == D[1] && D[1] == D[2], + o = h(D[0], 120) && h(D[1], 120) && h(D[2], 120); + return !(t || o) + } + } + + function h(e, t) { + return Math.floor(e / t) == e / t + } + + function m(e) { + var t, o, n; + return e *= v.pulseScale, 1 > e ? t = e - (1 - Math.exp(-e)) : (o = Math.exp(-1), e -= 1, n = 1 - Math.exp(-e), t = o + n * (1 - o)), t * v.pulseNormalize + } + + function p(e) { + return e >= 1 ? 1 : 0 >= e ? 0 : (1 == v.pulseNormalize && (v.pulseNormalize /= m(1)), m(e)) + } + + var settings = $.extend({ + // These are the defaults. + frameRate: 60, + animationTime: 1000, + stepSize: 120, + pulseAlgorithm: !0, + pulseScale: 8, + pulseNormalize: 1, + accelerationDelta: 20, + accelerationMax: 1, + keyboardSupport: !0, + arrowScroll: 50, + touchpadSupport: !0, + fixedBackground: !0 + }, options ); + + var w, g = { + frameRate: settings.frameRate, + animationTime: settings.animationTime, + stepSize: settings.stepSize, + pulseAlgorithm: settings.pulseAlgorithm, + pulseScale: settings.pulseScale, + pulseNormalize: settings.pulseNormalize, + accelerationDelta: settings.accelerationDelta, + accelerationMax: settings.accelerationMax, + keyboardSupport: settings.keyboardSupport, + arrowScroll: settings.arrowScroll, + touchpadSupport: settings.touchpadSupport, + fixedBackground: settings.fixedBackground, + excluded: "" + }, + v = g, + b = !1, + y = !1, + k = { + x: 0, + y: 0 + }, + x = !1, + S = document.documentElement, + D = [120, 120, 120], + H = { + left: 37, + up: 38, + right: 39, + down: 40, + spacebar: 32, + pageup: 33, + pagedown: 34, + end: 35, + home: 36 + }, + v = g, + M = [], + T = !1, + C = +new Date, + z = {}; + setInterval(function() { + z = {} + }, 1e4); + var A, N = function() { + var e = 0; + return function(t) { + return t.uniqueID || (t.uniqueID = e++) + } + }(), + E = function() { + return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(e, t, o) { + window.setTimeout(e, o || 1e3 / 60) + } + }(), + K = /chrome|iPad/i.test(window.navigator.userAgent), + L = "onmousewheel" in document; + L && K && (u("mousedown", a), u("mousewheel", n), u("load", t)) + }(); +} + + Property changes on: base3.10/src/main/webapp/js/user/jquery.easeScroll.js ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/js/user/debug.addIndicators.js =================================================================== --- base3.10/src/main/webapp/js/user/debug.addIndicators.js (nonexistent) +++ base3.10/src/main/webapp/js/user/debug.addIndicators.js (revision 34) @@ -0,0 +1,680 @@ +/*! + * ScrollMagic v2.0.8 (2020-08-14) + * The javascript library for magical scroll interactions. + * (c) 2020 Jan Paepke (@janpaepke) + * Project Website: http://scrollmagic.io + * + * @version 2.0.8 + * @license Dual licensed under MIT license and GPL. + * @author Jan Paepke - e-mail@janpaepke.de + * + * @file Debug Extension for ScrollMagic. + */ +/** + * This plugin was formerly known as the ScrollMagic debug extension. + * + * It enables you to add visual indicators to your page, to be able to see exactly when a scene is triggered. + * + * To have access to this extension, please include `plugins/debug.addIndicators.js`. + * @mixin debug.addIndicators + */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ScrollMagic'], factory); + } else if (typeof exports === 'object') { + // CommonJS + factory(require('scrollmagic')); + } else { + // no browser global export needed, just execute + factory(root.ScrollMagic || (root.jQuery && root.jQuery.ScrollMagic)); + } +}(this, function (ScrollMagic) { + "use strict"; + var NAMESPACE = "debug.addIndicators"; + + var + console = window.console || {}, + err = Function.prototype.bind.call(console.error || console.log || function () {}, console); + if (!ScrollMagic) { + err("(" + NAMESPACE + ") -> ERROR: The ScrollMagic main module could not be found. Please make sure it's loaded before this plugin or use an asynchronous loader like requirejs."); + } + + // plugin settings + var + FONT_SIZE = "0.85em", + ZINDEX = "9999", + EDGE_OFFSET = 15; // minimum edge distance, added to indentation + + // overall vars + var + _util = ScrollMagic._util, + _autoindex = 0; + + + + ScrollMagic.Scene.extend(function () { + var + Scene = this, + _indicator; + + var log = function () { + if (Scene._log) { // not available, when main source minified + Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ")", "->"); + Scene._log.apply(this, arguments); + } + }; + + /** + * Add visual indicators for a ScrollMagic.Scene. + * @memberof! debug.addIndicators# + * + * @example + * // add basic indicators + * scene.addIndicators() + * + * // passing options + * scene.addIndicators({name: "pin scene", colorEnd: "#FFFFFF"}); + * + * @param {object} [options] - An object containing one or more options for the indicators. + * @param {(string|object)} [options.parent] - A selector, DOM Object or a jQuery object that the indicators should be added to. + If undefined, the controller's container will be used. + * @param {number} [options.name=""] - This string will be displayed at the start and end indicators of the scene for identification purposes. If no name is supplied an automatic index will be used. + * @param {number} [options.indent=0] - Additional position offset for the indicators (useful, when having multiple scenes starting at the same position). + * @param {string} [options.colorStart=green] - CSS color definition for the start indicator. + * @param {string} [options.colorEnd=red] - CSS color definition for the end indicator. + * @param {string} [options.colorTrigger=blue] - CSS color definition for the trigger indicator. + */ + Scene.addIndicators = function (options) { + if (!_indicator) { + var + DEFAULT_OPTIONS = { + name: "", + indent: 0, + parent: undefined, + colorStart: "green", + colorEnd: "red", + colorTrigger: "blue", + }; + + options = _util.extend({}, DEFAULT_OPTIONS, options); + + _autoindex++; + _indicator = new Indicator(Scene, options); + + Scene.on("add.plugin_addIndicators", _indicator.add); + Scene.on("remove.plugin_addIndicators", _indicator.remove); + Scene.on("destroy.plugin_addIndicators", Scene.removeIndicators); + + // it the scene already has a controller we can start right away. + if (Scene.controller()) { + _indicator.add(); + } + } + return Scene; + }; + + /** + * Removes visual indicators from a ScrollMagic.Scene. + * @memberof! debug.addIndicators# + * + * @example + * // remove previously added indicators + * scene.removeIndicators() + * + */ + Scene.removeIndicators = function () { + if (_indicator) { + _indicator.remove(); + this.off("*.plugin_addIndicators"); + _indicator = undefined; + } + return Scene; + }; + + }); + + + /* + * ---------------------------------------------------------------- + * Extension for controller to store and update related indicators + * ---------------------------------------------------------------- + */ + // add option to globally auto-add indicators to scenes + /** + * Every ScrollMagic.Controller instance now accepts an additional option. + * See {@link ScrollMagic.Controller} for a complete list of the standard options. + * @memberof! debug.addIndicators# + * @method new ScrollMagic.Controller(options) + * @example + * // make a controller and add indicators to all scenes attached + * var controller = new ScrollMagic.Controller({addIndicators: true}); + * // this scene will automatically have indicators added to it + * new ScrollMagic.Scene() + * .addTo(controller); + * + * @param {object} [options] - Options for the Controller. + * @param {boolean} [options.addIndicators=false] - If set to `true` every scene that is added to the controller will automatically get indicators added to it. + */ + ScrollMagic.Controller.addOption("addIndicators", false); + // extend Controller + ScrollMagic.Controller.extend(function () { + var + Controller = this, + _info = Controller.info(), + _container = _info.container, + _isDocument = _info.isDocument, + _vertical = _info.vertical, + _indicators = { // container for all indicators and methods + groups: [] + }; + + var log = function () { + if (Controller._log) { // not available, when main source minified + Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ")", "->"); + Controller._log.apply(this, arguments); + } + }; + if (Controller._indicators) { + log(2, "WARNING: Scene already has a property '_indicators', which will be overwritten by plugin."); + } + + // add indicators container + this._indicators = _indicators; + /* + needed updates: + +++++++++++++++ + start/end position on scene shift (handled in Indicator class) + trigger parameters on triggerHook value change (handled in Indicator class) + bounds position on container scroll or resize (to keep alignment to bottom/right) + trigger position on container resize, window resize (if container isn't document) and window scroll (if container isn't document) + */ + + // event handler for when associated bounds markers need to be repositioned + var handleBoundsPositionChange = function () { + _indicators.updateBoundsPositions(); + }; + + // event handler for when associated trigger groups need to be repositioned + var handleTriggerPositionChange = function () { + _indicators.updateTriggerGroupPositions(); + }; + + _container.addEventListener("resize", handleTriggerPositionChange); + if (!_isDocument) { + window.addEventListener("resize", handleTriggerPositionChange); + window.addEventListener("scroll", handleTriggerPositionChange); + } + // update all related bounds containers + _container.addEventListener("resize", handleBoundsPositionChange); + _container.addEventListener("scroll", handleBoundsPositionChange); + + + // updates the position of the bounds container to aligned to the right for vertical containers and to the bottom for horizontal + this._indicators.updateBoundsPositions = function (specificIndicator) { + var // constant for all bounds + groups = specificIndicator ? [_util.extend({}, specificIndicator.triggerGroup, { + members: [specificIndicator] + })] : // create a group with only one element + _indicators.groups, // use all + g = groups.length, + css = {}, + paramPos = _vertical ? "left" : "top", + paramDimension = _vertical ? "width" : "height", + edge = _vertical ? + _util.get.scrollLeft(_container) + _util.get.width(_container) - EDGE_OFFSET : + _util.get.scrollTop(_container) + _util.get.height(_container) - EDGE_OFFSET, + b, triggerSize, group; + while (g--) { // group loop + group = groups[g]; + b = group.members.length; + triggerSize = _util.get[paramDimension](group.element.firstChild); + while (b--) { // indicators loop + css[paramPos] = edge - triggerSize; + _util.css(group.members[b].bounds, css); + } + } + }; + + // updates the positions of all trigger groups attached to a controller or a specific one, if provided + this._indicators.updateTriggerGroupPositions = function (specificGroup) { + var // constant vars + groups = specificGroup ? [specificGroup] : _indicators.groups, + i = groups.length, + container = _isDocument ? document.body : _container, + containerOffset = _isDocument ? { + top: 0, + left: 0 + } : _util.get.offset(container, true), + edge = _vertical ? + _util.get.width(_container) - EDGE_OFFSET : + _util.get.height(_container) - EDGE_OFFSET, + paramDimension = _vertical ? "width" : "height", + paramTransform = _vertical ? "Y" : "X"; + var // changing vars + group, + elem, + pos, + elemSize, + transform; + while (i--) { + group = groups[i]; + elem = group.element; + pos = group.triggerHook * Controller.info("size"); + elemSize = _util.get[paramDimension](elem.firstChild.firstChild); + transform = pos > elemSize ? "translate" + paramTransform + "(-100%)" : ""; + + _util.css(elem, { + top: containerOffset.top + (_vertical ? pos : edge - group.members[0].options.indent), + left: containerOffset.left + (_vertical ? edge - group.members[0].options.indent : pos) + }); + _util.css(elem.firstChild.firstChild, { + "-ms-transform": transform, + "-webkit-transform": transform, + "transform": transform + }); + } + }; + + // updates the label for the group to contain the name, if it only has one member + this._indicators.updateTriggerGroupLabel = function (group) { + var + text = "trigger" + (group.members.length > 1 ? "" : " " + group.members[0].options.name), + elem = group.element.firstChild.firstChild, + doUpdate = elem.textContent !== text; + if (doUpdate) { + elem.textContent = text; + if (_vertical) { // bounds position is dependent on text length, so update + _indicators.updateBoundsPositions(); + } + } + }; + + // add indicators if global option is set + this.addScene = function (newScene) { + + if (this._options.addIndicators && newScene instanceof ScrollMagic.Scene && newScene.controller() === Controller) { + newScene.addIndicators(); + } + // call original destroy method + this.$super.addScene.apply(this, arguments); + }; + + // remove all previously set listeners on destroy + this.destroy = function () { + _container.removeEventListener("resize", handleTriggerPositionChange); + if (!_isDocument) { + window.removeEventListener("resize", handleTriggerPositionChange); + window.removeEventListener("scroll", handleTriggerPositionChange); + } + _container.removeEventListener("resize", handleBoundsPositionChange); + _container.removeEventListener("scroll", handleBoundsPositionChange); + // call original destroy method + this.$super.destroy.apply(this, arguments); + }; + return Controller; + + }); + + /* + * ---------------------------------------------------------------- + * Internal class for the construction of Indicators + * ---------------------------------------------------------------- + */ + var Indicator = function (Scene, options) { + var + Indicator = this, + _elemBounds = TPL.bounds(), + _elemStart = TPL.start(options.colorStart), + _elemEnd = TPL.end(options.colorEnd), + _boundsContainer = options.parent && _util.get.elements(options.parent)[0], + _vertical, + _ctrl; + + var log = function () { + if (Scene._log) { // not available, when main source minified + Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ")", "->"); + Scene._log.apply(this, arguments); + } + }; + + options.name = options.name || _autoindex; + + // prepare bounds elements + _elemStart.firstChild.textContent += " " + options.name; + _elemEnd.textContent += " " + options.name; + _elemBounds.appendChild(_elemStart); + _elemBounds.appendChild(_elemEnd); + + // set public variables + Indicator.options = options; + Indicator.bounds = _elemBounds; + // will be set later + Indicator.triggerGroup = undefined; + + // add indicators to DOM + this.add = function () { + _ctrl = Scene.controller(); + _vertical = _ctrl.info("vertical"); + + var isDocument = _ctrl.info("isDocument"); + + if (!_boundsContainer) { + // no parent supplied or doesnt exist + _boundsContainer = isDocument ? document.body : _ctrl.info("container"); // check if window/document (then use body) + } + if (!isDocument && _util.css(_boundsContainer, "position") === 'static') { + // position mode needed for correct positioning of indicators + _util.css(_boundsContainer, { + position: "relative" + }); + } + + // add listeners for updates + Scene.on("change.plugin_addIndicators", handleTriggerParamsChange); + Scene.on("shift.plugin_addIndicators", handleBoundsParamsChange); + + // updates trigger & bounds (will add elements if needed) + updateTriggerGroup(); + updateBounds(); + + setTimeout(function () { // do after all execution is finished otherwise sometimes size calculations are off + _ctrl._indicators.updateBoundsPositions(Indicator); + }, 0); + + log(3, "added indicators"); + }; + + // remove indicators from DOM + this.remove = function () { + if (Indicator.triggerGroup) { // if not set there's nothing to remove + Scene.off("change.plugin_addIndicators", handleTriggerParamsChange); + Scene.off("shift.plugin_addIndicators", handleBoundsParamsChange); + + if (Indicator.triggerGroup.members.length > 1) { + // just remove from memberlist of old group + var group = Indicator.triggerGroup; + group.members.splice(group.members.indexOf(Indicator), 1); + _ctrl._indicators.updateTriggerGroupLabel(group); + _ctrl._indicators.updateTriggerGroupPositions(group); + Indicator.triggerGroup = undefined; + } else { + // remove complete group + removeTriggerGroup(); + } + removeBounds(); + + log(3, "removed indicators"); + } + }; + + /* + * ---------------------------------------------------------------- + * internal Event Handlers + * ---------------------------------------------------------------- + */ + + // event handler for when bounds params change + var handleBoundsParamsChange = function () { + updateBounds(); + }; + + // event handler for when trigger params change + var handleTriggerParamsChange = function (e) { + if (e.what === "triggerHook") { + updateTriggerGroup(); + } + }; + + /* + * ---------------------------------------------------------------- + * Bounds (start / stop) management + * ---------------------------------------------------------------- + */ + + // adds an new bounds elements to the array and to the DOM + var addBounds = function () { + var v = _ctrl.info("vertical"); + // apply stuff we didn't know before... + _util.css(_elemStart.firstChild, { + "border-bottom-width": v ? 1 : 0, + "border-right-width": v ? 0 : 1, + "bottom": v ? -1 : options.indent, + "right": v ? options.indent : -1, + "padding": v ? "0 8px" : "2px 4px", + }); + _util.css(_elemEnd, { + "border-top-width": v ? 1 : 0, + "border-left-width": v ? 0 : 1, + "top": v ? "100%" : "", + "right": v ? options.indent : "", + "bottom": v ? "" : options.indent, + "left": v ? "" : "100%", + "padding": v ? "0 8px" : "2px 4px" + }); + // append + _boundsContainer.appendChild(_elemBounds); + }; + + // remove bounds from list and DOM + var removeBounds = function () { + _elemBounds.parentNode.removeChild(_elemBounds); + }; + + // update the start and end positions of the scene + var updateBounds = function () { + if (_elemBounds.parentNode !== _boundsContainer) { + addBounds(); // Add Bounds elements (start/end) + } + var css = {}; + css[_vertical ? "top" : "left"] = Scene.triggerPosition(); + css[_vertical ? "height" : "width"] = Scene.duration(); + _util.css(_elemBounds, css); + _util.css(_elemEnd, { + display: Scene.duration() > 0 ? "" : "none" + }); + }; + + /* + * ---------------------------------------------------------------- + * trigger and trigger group management + * ---------------------------------------------------------------- + */ + + // adds an new trigger group to the array and to the DOM + var addTriggerGroup = function () { + var triggerElem = TPL.trigger(options.colorTrigger); // new trigger element + var css = {}; + css[_vertical ? "right" : "bottom"] = 0; + css[_vertical ? "border-top-width" : "border-left-width"] = 1; + _util.css(triggerElem.firstChild, css); + _util.css(triggerElem.firstChild.firstChild, { + padding: _vertical ? "0 8px 3px 8px" : "3px 4px" + }); + document.body.appendChild(triggerElem); // directly add to body + var newGroup = { + triggerHook: Scene.triggerHook(), + element: triggerElem, + members: [Indicator] + }; + _ctrl._indicators.groups.push(newGroup); + Indicator.triggerGroup = newGroup; + // update right away + _ctrl._indicators.updateTriggerGroupLabel(newGroup); + _ctrl._indicators.updateTriggerGroupPositions(newGroup); + }; + + var removeTriggerGroup = function () { + _ctrl._indicators.groups.splice(_ctrl._indicators.groups.indexOf(Indicator.triggerGroup), 1); + Indicator.triggerGroup.element.parentNode.removeChild(Indicator.triggerGroup.element); + Indicator.triggerGroup = undefined; + }; + + // updates the trigger group -> either join existing or add new one + /* + * Logic: + * 1 if a trigger group exist, check if it's in sync with Scene settings – if so, nothing else needs to happen + * 2 try to find an existing one that matches Scene parameters + * 2.1 If a match is found check if already assigned to an existing group + * If so: + * A: it was the last member of existing group -> kill whole group + * B: the existing group has other members -> just remove from member list + * 2.2 Assign to matching group + * 3 if no new match could be found, check if assigned to existing group + * A: yes, and it's the only member -> just update parameters and positions and keep using this group + * B: yes but there are other members -> remove from member list and create a new one + * C: no, so create a new one + */ + var updateTriggerGroup = function () { + var + triggerHook = Scene.triggerHook(), + closeEnough = 0.0001; + + // Have a group, check if it still matches + if (Indicator.triggerGroup) { + if (Math.abs(Indicator.triggerGroup.triggerHook - triggerHook) < closeEnough) { + // _util.log(0, "trigger", options.name, "->", "no need to change, still in sync"); + return; // all good + } + } + // Don't have a group, check if a matching one exists + // _util.log(0, "trigger", options.name, "->", "out of sync!"); + var + groups = _ctrl._indicators.groups, + group, + i = groups.length; + while (i--) { + group = groups[i]; + if (Math.abs(group.triggerHook - triggerHook) < closeEnough) { + // found a match! + // _util.log(0, "trigger", options.name, "->", "found match"); + if (Indicator.triggerGroup) { // do I have an old group that is out of sync? + if (Indicator.triggerGroup.members.length === 1) { // is it the only remaining group? + // _util.log(0, "trigger", options.name, "->", "kill"); + // was the last member, remove the whole group + removeTriggerGroup(); + } else { + Indicator.triggerGroup.members.splice(Indicator.triggerGroup.members.indexOf(Indicator), 1); // just remove from memberlist of old group + _ctrl._indicators.updateTriggerGroupLabel(Indicator.triggerGroup); + _ctrl._indicators.updateTriggerGroupPositions(Indicator.triggerGroup); + // _util.log(0, "trigger", options.name, "->", "removing from previous member list"); + } + } + // join new group + group.members.push(Indicator); + Indicator.triggerGroup = group; + _ctrl._indicators.updateTriggerGroupLabel(group); + return; + } + } + + // at this point I am obviously out of sync and don't match any other group + if (Indicator.triggerGroup) { + if (Indicator.triggerGroup.members.length === 1) { + // _util.log(0, "trigger", options.name, "->", "updating existing"); + // out of sync but i'm the only member => just change and update + Indicator.triggerGroup.triggerHook = triggerHook; + _ctrl._indicators.updateTriggerGroupPositions(Indicator.triggerGroup); + return; + } else { + // _util.log(0, "trigger", options.name, "->", "removing from previous member list"); + Indicator.triggerGroup.members.splice(Indicator.triggerGroup.members.indexOf(Indicator), 1); // just remove from memberlist of old group + _ctrl._indicators.updateTriggerGroupLabel(Indicator.triggerGroup); + _ctrl._indicators.updateTriggerGroupPositions(Indicator.triggerGroup); + Indicator.triggerGroup = undefined; // need a brand new group... + } + } + // _util.log(0, "trigger", options.name, "->", "add a new one"); + // did not find any match, make new trigger group + addTriggerGroup(); + }; + }; + + /* + * ---------------------------------------------------------------- + * Templates for the indicators + * ---------------------------------------------------------------- + */ + var TPL = { + start: function (color) { + // inner element (for bottom offset -1, while keeping top position 0) + var inner = document.createElement("div"); + inner.textContent = "start"; + _util.css(inner, { + position: "absolute", + overflow: "visible", + "border-width": 0, + "border-style": "solid", + color: color, + "border-color": color + }); + var e = document.createElement('div'); + // wrapper + _util.css(e, { + position: "absolute", + overflow: "visible", + width: 0, + height: 0 + }); + e.appendChild(inner); + return e; + }, + end: function (color) { + var e = document.createElement('div'); + e.textContent = "end"; + _util.css(e, { + position: "absolute", + overflow: "visible", + "border-width": 0, + "border-style": "solid", + color: color, + "border-color": color + }); + return e; + }, + bounds: function () { + var e = document.createElement('div'); + _util.css(e, { + position: "absolute", + overflow: "visible", + "white-space": "nowrap", + "pointer-events": "none", + "font-size": FONT_SIZE + }); + e.style.zIndex = ZINDEX; + return e; + }, + trigger: function (color) { + // inner to be above or below line but keep position + var inner = document.createElement('div'); + inner.textContent = "trigger"; + _util.css(inner, { + position: "relative", + }); + // inner wrapper for right: 0 and main element has no size + var w = document.createElement('div'); + _util.css(w, { + position: "absolute", + overflow: "visible", + "border-width": 0, + "border-style": "solid", + color: color, + "border-color": color + }); + w.appendChild(inner); + // wrapper + var e = document.createElement('div'); + _util.css(e, { + position: "fixed", + overflow: "visible", + "white-space": "nowrap", + "pointer-events": "none", + "font-size": FONT_SIZE + }); + e.style.zIndex = ZINDEX; + e.appendChild(w); + return e; + }, + }; + +})); \ No newline at end of file Property changes on: base3.10/src/main/webapp/js/user/debug.addIndicators.js ___________________________________________________________________ Added: svn:mime-type + text/plain Index: base3.10/src/main/webapp/js/user/rellax.js =================================================================== --- base3.10/src/main/webapp/js/user/rellax.js (nonexistent) +++ base3.10/src/main/webapp/js/user/rellax.js (revision 34) @@ -0,0 +1,497 @@ + +// ------------------------------------------ +// Rellax.js +// Buttery smooth parallax library +// Copyright (c) 2016 Moe Amaya (@moeamaya) +// MIT license +// +// Thanks to Paraxify.js and Jaime Cabllero +// for parallax concepts +// ------------------------------------------ + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define([], factory); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } else { + // Browser globals (root is window) + root.Rellax = factory(); + } +}(typeof window !== "undefined" ? window : global, function () { + var Rellax = function(el, options){ + "use strict"; + + var self = Object.create(Rellax.prototype); + + var posY = 0; + var screenY = 0; + var posX = 0; + var screenX = 0; + var blocks = []; + var pause = true; + + // check what requestAnimationFrame to use, and if + // it's not supported, use the onscroll event + var loop = window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.msRequestAnimationFrame || + window.oRequestAnimationFrame || + function(callback){ return setTimeout(callback, 1000 / 60); }; + + // store the id for later use + var loopId = null; + + // Test via a getter in the options object to see if the passive property is accessed + var supportsPassive = false; + try { + var opts = Object.defineProperty({}, 'passive', { + get: function() { + supportsPassive = true; + } + }); + window.addEventListener("testPassive", null, opts); + window.removeEventListener("testPassive", null, opts); + } catch (e) {} + + // check what cancelAnimation method to use + var clearLoop = window.cancelAnimationFrame || window.mozCancelAnimationFrame || clearTimeout; + + // check which transform property to use + var transformProp = window.transformProp || (function(){ + var testEl = document.createElement('div'); + if (testEl.style.transform === null) { + var vendors = ['Webkit', 'Moz', 'ms']; + for (var vendor in vendors) { + if (testEl.style[ vendors[vendor] + 'Transform' ] !== undefined) { + return vendors[vendor] + 'Transform'; + } + } + } + return 'transform'; + })(); + + // Default Settings + self.options = { + speed: -2, + verticalSpeed: null, + horizontalSpeed: null, + breakpoints: [576, 768, 1201], + center: false, + wrapper: null, + relativeToWrapper: false, + round: true, + vertical: true, + horizontal: false, + verticalScrollAxis: "y", + horizontalScrollAxis: "x", + callback: function() {}, + }; + + // User defined options (might have more in the future) + if (options){ + Object.keys(options).forEach(function(key){ + self.options[key] = options[key]; + }); + } + + function validateCustomBreakpoints () { + if (self.options.breakpoints.length === 3 && Array.isArray(self.options.breakpoints)) { + var isAscending = true; + var isNumerical = true; + var lastVal; + self.options.breakpoints.forEach(function (i) { + if (typeof i !== 'number') isNumerical = false; + if (lastVal !== null) { + if (i < lastVal) isAscending = false; + } + lastVal = i; + }); + if (isAscending && isNumerical) return; + } + // revert defaults if set incorrectly + self.options.breakpoints = [576, 768, 1201]; + console.warn("Rellax: You must pass an array of 3 numbers in ascending order to the breakpoints option. Defaults reverted"); + } + + if (options && options.breakpoints) { + validateCustomBreakpoints(); + } + + // By default, rellax class + if (!el) { + el = '.rellax'; + } + + // check if el is a className or a node + var elements = typeof el === 'string' ? document.querySelectorAll(el) : [el]; + + // Now query selector + if (elements.length > 0) { + self.elems = elements; + } + + // The elements don't exist + else { + console.warn("Rellax: The elements you're trying to select don't exist."); + return; + } + + // Has a wrapper and it exists + if (self.options.wrapper) { + if (!self.options.wrapper.nodeType) { + var wrapper = document.querySelector(self.options.wrapper); + + if (wrapper) { + self.options.wrapper = wrapper; + } else { + console.warn("Rellax: The wrapper you're trying to use doesn't exist."); + return; + } + } + } + + // set a placeholder for the current breakpoint + var currentBreakpoint; + + // helper to determine current breakpoint + var getCurrentBreakpoint = function (w) { + var bp = self.options.breakpoints; + if (w < bp[0]) return 'xs'; + if (w >= bp[0] && w < bp[1]) return 'sm'; + if (w >= bp[1] && w < bp[2]) return 'md'; + return 'lg'; + }; + + // Get and cache initial position of all elements + var cacheBlocks = function() { + for (var i = 0; i < self.elems.length; i++){ + var block = createBlock(self.elems[i]); + blocks.push(block); + } + }; + + + // Let's kick this script off + // Build array for cached element values + var init = function() { + for (var i = 0; i < blocks.length; i++){ + self.elems[i].style.cssText = blocks[i].style; + } + + blocks = []; + + screenY = window.innerHeight; + screenX = window.innerWidth; + currentBreakpoint = getCurrentBreakpoint(screenX); + + setPosition(); + + cacheBlocks(); + + animate(); + + // If paused, unpause and set listener for window resizing events + if (pause) { + window.addEventListener('resize', init); + pause = false; + // Start the loop + update(); + } + }; + + // We want to cache the parallax blocks' + // values: base, top, height, speed + // el: is dom object, return: el cache values + var createBlock = function(el) { + var dataPercentage = el.getAttribute( 'data-rellax-percentage' ); + var dataSpeed = el.getAttribute( 'data-rellax-speed' ); + var dataXsSpeed = el.getAttribute( 'data-rellax-xs-speed' ); + var dataMobileSpeed = el.getAttribute( 'data-rellax-mobile-speed' ); + var dataTabletSpeed = el.getAttribute( 'data-rellax-tablet-speed' ); + var dataDesktopSpeed = el.getAttribute( 'data-rellax-desktop-speed' ); + var dataVerticalSpeed = el.getAttribute('data-rellax-vertical-speed'); + var dataHorizontalSpeed = el.getAttribute('data-rellax-horizontal-speed'); + var dataVericalScrollAxis = el.getAttribute('data-rellax-vertical-scroll-axis'); + var dataHorizontalScrollAxis = el.getAttribute('data-rellax-horizontal-scroll-axis'); + var dataZindex = el.getAttribute( 'data-rellax-zindex' ) || 0; + var dataMin = el.getAttribute( 'data-rellax-min' ); + var dataMax = el.getAttribute( 'data-rellax-max' ); + var dataMinX = el.getAttribute('data-rellax-min-x'); + var dataMaxX = el.getAttribute('data-rellax-max-x'); + var dataMinY = el.getAttribute('data-rellax-min-y'); + var dataMaxY = el.getAttribute('data-rellax-max-y'); + var mapBreakpoints; + var breakpoints = true; + + if (!dataXsSpeed && !dataMobileSpeed && !dataTabletSpeed && !dataDesktopSpeed) { + breakpoints = false; + } else { + mapBreakpoints = { + 'xs': dataXsSpeed, + 'sm': dataMobileSpeed, + 'md': dataTabletSpeed, + 'lg': dataDesktopSpeed + }; + } + + // initializing at scrollY = 0 (top of browser), scrollX = 0 (left of browser) + // ensures elements are positioned based on HTML layout. + // + // If the element has the percentage attribute, the posY and posX needs to be + // the current scroll position's value, so that the elements are still positioned based on HTML layout + var wrapperPosY = self.options.wrapper ? self.options.wrapper.scrollTop : (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); + // If the option relativeToWrapper is true, use the wrappers offset to top, subtracted from the current page scroll. + if (self.options.relativeToWrapper) { + var scrollPosY = (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); + wrapperPosY = scrollPosY - self.options.wrapper.offsetTop; + } + var posY = self.options.vertical ? ( dataPercentage || self.options.center ? wrapperPosY : 0 ) : 0; + var posX = self.options.horizontal ? ( dataPercentage || self.options.center ? self.options.wrapper ? self.options.wrapper.scrollLeft : (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft) : 0 ) : 0; + + var blockTop = posY + el.getBoundingClientRect().top; + var blockHeight = el.clientHeight || el.offsetHeight || el.scrollHeight; + + var blockLeft = posX + el.getBoundingClientRect().left; + var blockWidth = el.clientWidth || el.offsetWidth || el.scrollWidth; + + // apparently parallax equation everyone uses + var percentageY = dataPercentage ? dataPercentage : (posY - blockTop + screenY) / (blockHeight + screenY); + var percentageX = dataPercentage ? dataPercentage : (posX - blockLeft + screenX) / (blockWidth + screenX); + if(self.options.center){ percentageX = 0.5; percentageY = 0.5; } + + // Optional individual block speed as data attr, otherwise global speed + var speed = (breakpoints && mapBreakpoints[currentBreakpoint] !== null) ? Number(mapBreakpoints[currentBreakpoint]) : (dataSpeed ? dataSpeed : self.options.speed); + var verticalSpeed = dataVerticalSpeed ? dataVerticalSpeed : self.options.verticalSpeed; + var horizontalSpeed = dataHorizontalSpeed ? dataHorizontalSpeed : self.options.horizontalSpeed; + + // Optional individual block movement axis direction as data attr, otherwise global movement direction + var verticalScrollAxis = dataVericalScrollAxis ? dataVericalScrollAxis : self.options.verticalScrollAxis; + var horizontalScrollAxis = dataHorizontalScrollAxis ? dataHorizontalScrollAxis : self.options.horizontalScrollAxis; + + var bases = updatePosition(percentageX, percentageY, speed, verticalSpeed, horizontalSpeed); + + // ~~Store non-translate3d transforms~~ + // Store inline styles and extract transforms + var style = el.style.cssText; + var transform = ''; + + // Check if there's an inline styled transform + var searchResult = /transform\s*:/i.exec(style); + if (searchResult) { + // Get the index of the transform + var index = searchResult.index; + + // Trim the style to the transform point and get the following semi-colon index + var trimmedStyle = style.slice(index); + var delimiter = trimmedStyle.indexOf(';'); + + // Remove "transform" string and save the attribute + if (delimiter) { + transform = " " + trimmedStyle.slice(11, delimiter).replace(/\s/g,''); + } else { + transform = " " + trimmedStyle.slice(11).replace(/\s/g,''); + } + } + + return { + baseX: bases.x, + baseY: bases.y, + top: blockTop, + left: blockLeft, + height: blockHeight, + width: blockWidth, + speed: speed, + verticalSpeed: verticalSpeed, + horizontalSpeed: horizontalSpeed, + verticalScrollAxis: verticalScrollAxis, + horizontalScrollAxis: horizontalScrollAxis, + style: style, + transform: transform, + zindex: dataZindex, + min: dataMin, + max: dataMax, + minX: dataMinX, + maxX: dataMaxX, + minY: dataMinY, + maxY: dataMaxY + }; + }; + + // set scroll position (posY, posX) + // side effect method is not ideal, but okay for now + // returns true if the scroll changed, false if nothing happened + var setPosition = function() { + var oldY = posY; + var oldX = posX; + + posY = self.options.wrapper ? self.options.wrapper.scrollTop : (document.documentElement || document.body.parentNode || document.body).scrollTop || window.pageYOffset; + posX = self.options.wrapper ? self.options.wrapper.scrollLeft : (document.documentElement || document.body.parentNode || document.body).scrollLeft || window.pageXOffset; + // If option relativeToWrapper is true, use relative wrapper value instead. + if (self.options.relativeToWrapper) { + var scrollPosY = (document.documentElement || document.body.parentNode || document.body).scrollTop || window.pageYOffset; + posY = scrollPosY - self.options.wrapper.offsetTop; + } + + + if (oldY != posY && self.options.vertical) { + // scroll changed, return true + return true; + } + + if (oldX != posX && self.options.horizontal) { + // scroll changed, return true + return true; + } + + // scroll did not change + return false; + }; + + // Ahh a pure function, gets new transform value + // based on scrollPosition and speed + // Allow for decimal pixel values + var updatePosition = function(percentageX, percentageY, speed, verticalSpeed, horizontalSpeed) { + var result = {}; + var valueX = ((horizontalSpeed ? horizontalSpeed : speed) * (100 * (1 - percentageX))); + var valueY = ((verticalSpeed ? verticalSpeed : speed) * (100 * (1 - percentageY))); + + result.x = self.options.round ? Math.round(valueX) : Math.round(valueX * 100) / 100; + result.y = self.options.round ? Math.round(valueY) : Math.round(valueY * 100) / 100; + + return result; + }; + + // Remove event listeners and loop again + var deferredUpdate = function() { + window.removeEventListener('resize', deferredUpdate); + window.removeEventListener('orientationchange', deferredUpdate); + (self.options.wrapper ? self.options.wrapper : window).removeEventListener('scroll', deferredUpdate); + (self.options.wrapper ? self.options.wrapper : document).removeEventListener('touchmove', deferredUpdate); + + // loop again + loopId = loop(update); + }; + + // Loop + var update = function() { + if (setPosition() && pause === false) { + animate(); + + // loop again + loopId = loop(update); + } else { + loopId = null; + + // Don't animate until we get a position updating event + window.addEventListener('resize', deferredUpdate); + window.addEventListener('orientationchange', deferredUpdate); + (self.options.wrapper ? self.options.wrapper : window).addEventListener('scroll', deferredUpdate, supportsPassive ? { passive: true } : false); + (self.options.wrapper ? self.options.wrapper : document).addEventListener('touchmove', deferredUpdate, supportsPassive ? { passive: true } : false); + } + }; + + // Transform3d on parallax element + var animate = function() { + var positions; + for (var i = 0; i < self.elems.length; i++){ + // Determine relevant movement directions + var verticalScrollAxis = blocks[i].verticalScrollAxis.toLowerCase(); + var horizontalScrollAxis = blocks[i].horizontalScrollAxis.toLowerCase(); + var verticalScrollX = verticalScrollAxis.indexOf("x") != -1 ? posY : 0; + var verticalScrollY = verticalScrollAxis.indexOf("y") != -1 ? posY : 0; + var horizontalScrollX = horizontalScrollAxis.indexOf("x") != -1 ? posX : 0; + var horizontalScrollY = horizontalScrollAxis.indexOf("y") != -1 ? posX : 0; + + var percentageY = ((verticalScrollY + horizontalScrollY - blocks[i].top + screenY) / (blocks[i].height + screenY)); + var percentageX = ((verticalScrollX + horizontalScrollX - blocks[i].left + screenX) / (blocks[i].width + screenX)); + + // Subtracting initialize value, so element stays in same spot as HTML + positions = updatePosition(percentageX, percentageY, blocks[i].speed, blocks[i].verticalSpeed, blocks[i].horizontalSpeed); + var positionY = positions.y - blocks[i].baseY; + var positionX = positions.x - blocks[i].baseX; + + // The next two "if" blocks go like this: + // Check if a limit is defined (first "min", then "max"); + // Check if we need to change the Y or the X + // (Currently working only if just one of the axes is enabled) + // Then, check if the new position is inside the allowed limit + // If so, use new position. If not, set position to limit. + + // Check if a min limit is defined + if (blocks[i].min !== null) { + if (self.options.vertical && !self.options.horizontal) { + positionY = positionY <= blocks[i].min ? blocks[i].min : positionY; + } + if (self.options.horizontal && !self.options.vertical) { + positionX = positionX <= blocks[i].min ? blocks[i].min : positionX; + } + } + + // Check if directional min limits are defined + if (blocks[i].minY != null) { + positionY = positionY <= blocks[i].minY ? blocks[i].minY : positionY; + } + if (blocks[i].minX != null) { + positionX = positionX <= blocks[i].minX ? blocks[i].minX : positionX; + } + + // Check if a max limit is defined + if (blocks[i].max !== null) { + if (self.options.vertical && !self.options.horizontal) { + positionY = positionY >= blocks[i].max ? blocks[i].max : positionY; + } + if (self.options.horizontal && !self.options.vertical) { + positionX = positionX >= blocks[i].max ? blocks[i].max : positionX; + } + } + + // Check if directional max limits are defined + if (blocks[i].maxY != null) { + positionY = positionY >= blocks[i].maxY ? blocks[i].maxY : positionY; + } + if (blocks[i].maxX != null) { + positionX = positionX >= blocks[i].maxX ? blocks[i].maxX : positionX; + } + + var zindex = blocks[i].zindex; + + // Move that element + // (Set the new translation and append initial inline transforms.) + var translate = 'translate3d(' + (self.options.horizontal ? positionX : '0') + 'px,' + (self.options.vertical ? positionY : '0') + 'px,' + zindex + 'px) ' + blocks[i].transform; + self.elems[i].style[transformProp] = translate; + } + self.options.callback(positions); + }; + + self.destroy = function() { + for (var i = 0; i < self.elems.length; i++){ + self.elems[i].style.cssText = blocks[i].style; + } + + // Remove resize event listener if not pause, and pause + if (!pause) { + window.removeEventListener('resize', init); + pause = true; + } + + // Clear the animation loop to prevent possible memory leak + clearLoop(loopId); + loopId = null; + }; + + // Init + init(); + + // Allow to recalculate the initial values whenever we want + self.refresh = init; + + return self; + }; + return Rellax; +})); Property changes on: base3.10/src/main/webapp/js/user/rellax.js ___________________________________________________________________ Added: svn:mime-type + text/plain
Add a comment
List