|
@@ -49,12 +49,12 @@ var util = {
|
|
|
}
|
|
|
|
|
|
var videoMap = {
|
|
|
- 'primary-start': {vid: 8951717},
|
|
|
- 'primary-turn': {vid: 8951719},
|
|
|
- 'primary-bg': {vid: 8951723},
|
|
|
- 'evaluation-video': {vid: 8951715},
|
|
|
- 'subscribe-video': {vid: 8951909},
|
|
|
- 'evaluation-bg': {vid: 8952341}
|
|
|
+ 'primary-start': {vid: 8953949},
|
|
|
+ 'primary-turn': {vid: 8953951},
|
|
|
+ 'primary-bg': {vid: 8953955},
|
|
|
+ 'evaluation-video': {vid: 8953947},
|
|
|
+ 'subscribe-video': {vid: 8953957},
|
|
|
+ 'evaluation-bg': {vid: 8953953}
|
|
|
}
|
|
|
// 获取视频地址 TODO:上线前删除下方函数
|
|
|
;!function () {
|
|
@@ -84,9 +84,9 @@ var app = new Vue({
|
|
|
data: {
|
|
|
resourceAPI: '//pub.dwstatic.com/zt2018/wxwy1809//',
|
|
|
// resourceAPI: '../..//',
|
|
|
- viewWidth : window.innerHeight,
|
|
|
- viewHeight : window.innerWidth,
|
|
|
- viewTransform : "",
|
|
|
+ viewWidth: window.innerHeight,
|
|
|
+ viewHeight: window.innerWidth,
|
|
|
+ viewTransform: "",
|
|
|
loaded: true,
|
|
|
mainSwiper: {},
|
|
|
mainSwiperIndex: 0,
|
|
@@ -105,6 +105,7 @@ var app = new Vue({
|
|
|
isWorldState: false,
|
|
|
isWorldShow: false,
|
|
|
/****场景页*****/
|
|
|
+ isSceneEnter: false,
|
|
|
sceneList, //场景页场景列表,
|
|
|
currentSceneIndex: 0,
|
|
|
isReading: false, // 场景页播放状态
|
|
@@ -119,6 +120,7 @@ var app = new Vue({
|
|
|
commentVisiable: false,
|
|
|
/*****移动端*****/
|
|
|
isMobile: false,
|
|
|
+ mobileBGMControlerShow: false,
|
|
|
mobileNavBarShow: false,
|
|
|
mobileVideoVisiable: false,
|
|
|
isMobileBGPlaying: true,
|
|
@@ -129,20 +131,17 @@ var app = new Vue({
|
|
|
var self = this;
|
|
|
this.checkOrientation()
|
|
|
this.initSwiper()
|
|
|
- $('.box-mouse').on('click',function(){
|
|
|
- self.mainSwiper.mousewheel.enable();
|
|
|
- })
|
|
|
this.registerWindowEvent()
|
|
|
this.initScene()
|
|
|
this.initEvaluation()
|
|
|
},
|
|
|
- created(){
|
|
|
+ created() {
|
|
|
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
|
|
|
this.isMobile = true
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- initSwiper(){
|
|
|
+ initSwiper() {
|
|
|
var self = this
|
|
|
self.mainSwiper = new Swiper('.main-swiper', {
|
|
|
// initialSlide: 4,
|
|
@@ -150,7 +149,7 @@ var app = new Vue({
|
|
|
speed: 600,
|
|
|
mousewheel: true,
|
|
|
threshold: 50,
|
|
|
- width: self.isMobile ? window.innerHeight :window.innerWidth,
|
|
|
+ width: self.isMobile ? window.innerHeight : window.innerWidth,
|
|
|
height: self.isMobile ? window.innerWidth : window.innerHeight,
|
|
|
on: {
|
|
|
init: function () {
|
|
@@ -159,7 +158,7 @@ var app = new Vue({
|
|
|
self.isMobile ? self.navbarVisible = true : void 0
|
|
|
},
|
|
|
slideChangeTransitionEnd: function () {
|
|
|
- if(this.activeIndex === 1){
|
|
|
+ if (this.activeIndex === 1) {
|
|
|
self.loadSceneResources()
|
|
|
}
|
|
|
},
|
|
@@ -167,109 +166,128 @@ var app = new Vue({
|
|
|
self.mainSwiperIndex = this.activeIndex
|
|
|
self.navbarVisible = self.isMobile || this.activeIndex >= 1;
|
|
|
this.activeIndex === 2 && self.isMobile ? self.isReading = true : self.isReading = false
|
|
|
- if(!this.isMobile && this.activeIndex != 0){
|
|
|
- $('.main-navbar').show();
|
|
|
+ this.activeIndex === 0 ? self.mobileBGMControlerShow = false : self.mobileBGMControlerShow = true
|
|
|
+ if (!self.isMobile && this.activeIndex != 0) {
|
|
|
self.isMobileBGPlaying = false
|
|
|
- }else{
|
|
|
- $('.main-navbar').hide();
|
|
|
}
|
|
|
- var worldOldBgm = null;
|
|
|
if (this.activeIndex >= 1) {
|
|
|
self.isWorldShow = true;
|
|
|
}
|
|
|
+ self.isEvaluationVideoPlaying && (self.isEvaluationVideoPlaying = false)
|
|
|
if (this.activeIndex == 1) {
|
|
|
- V.worldInit();
|
|
|
- if(worldOldBgm != null){
|
|
|
- worldOldBgm.play();
|
|
|
+ if (!self.isMobile) {
|
|
|
+ clearTimeout(bookTimer1);
|
|
|
+ clearTimeout(bookTimer2);
|
|
|
}
|
|
|
- } else {
|
|
|
- var worldAudioLen = $('.page-world audio').length,
|
|
|
- worldAudio = $('.page-world audio');
|
|
|
- for(var i=0;i<worldAudioLen;i++){
|
|
|
- worldAudio[i].pause();
|
|
|
+ if (!self.isWorldState) {
|
|
|
+ self.isWorldState = true;
|
|
|
+ V.worldInit(!self.isMobile);
|
|
|
+ } else {
|
|
|
+ if (!self.isMobile) {
|
|
|
+ $('.worldMp3').get(0).play();
|
|
|
+ $('.video-play').removeClass('pause');
|
|
|
+ $('.world-bgm1').get(0).play();
|
|
|
+ switchTimer();
|
|
|
+ }
|
|
|
}
|
|
|
- if (bookPageCount == 0) {
|
|
|
- $('.worldMp3').get(0).currentTime = 0;
|
|
|
- } else if (bookPageCount == 1) {
|
|
|
- $('.worldMp3').get(0).currentTime = 38;
|
|
|
- } else if (bookPageCount == 2) {
|
|
|
- $('.worldMp3').get(0).currentTime = 68;
|
|
|
+ } else {
|
|
|
+ if (!self.isMobile) {
|
|
|
+ var worldAudioLen = $('.page-world audio').length,
|
|
|
+ worldAudio = $('.page-world audio');
|
|
|
+ for (var i = 0; i < worldAudioLen; i++) {
|
|
|
+ worldAudio[i].pause();
|
|
|
+ }
|
|
|
+ if (bookPageCount == 0) {
|
|
|
+ $('.worldMp3').get(0).currentTime = 0;
|
|
|
+ } else if (bookPageCount == 1) {
|
|
|
+ $('.worldMp3').get(0).currentTime = 38;
|
|
|
+ } else if (bookPageCount == 2) {
|
|
|
+ $('.worldMp3').get(0).currentTime = 68;
|
|
|
+ }
|
|
|
+ clearTimeout(bookTimer1);
|
|
|
+ clearTimeout(bookTimer2);
|
|
|
}
|
|
|
- bookLeaveTime = $('.worldMp3').get(0).currentTime * 1000;
|
|
|
- $('.book-switch').off('click');
|
|
|
- $('.video-play').off('click');
|
|
|
- $('.worldMp3').unbind('ended');
|
|
|
- clearTimeout(bookTimer1);
|
|
|
- clearTimeout(bookTimer2);
|
|
|
}
|
|
|
if (this.activeIndex >= 2) {
|
|
|
self.isRoleShow = true;
|
|
|
}
|
|
|
+ if (this.activeIndex === 2) {
|
|
|
+ self.isSceneEnter = true
|
|
|
+ }
|
|
|
if (this.activeIndex == 3) {
|
|
|
self.isRoleListEnter = true
|
|
|
if (!self.roleIntoState) {
|
|
|
self.roleIntoState = true;
|
|
|
- setTimeout(function(){
|
|
|
- V.roleInit();
|
|
|
- },100);
|
|
|
- }
|
|
|
- var $pageRole = $('.page-role'),
|
|
|
- $roleInfo = $pageRole.find('.role-info'),
|
|
|
- $roleItem = $roleInfo.find('.info-item.is-current'),
|
|
|
- roleDescActive = $roleItem.find('.role-desc.actived').length;
|
|
|
- if(roleDescActive > 0){
|
|
|
- $roleItem.find('.desc-audio-play').addClass('is-active');
|
|
|
+ setTimeout(function () {
|
|
|
+ V.roleInit(!self.isMobile);
|
|
|
+ }, 100);
|
|
|
}
|
|
|
- if (!$roleInfo.is(':hidden') && $roleItem.find('.attr-list li.is-active').index() == 2) {
|
|
|
- $roleItem.find('.desc-box audio').get(0).currentTime = 0;
|
|
|
- $roleItem.find('.desc-box audio').get(0).play();
|
|
|
+ if (!self.isMobile) {
|
|
|
+ var $pageRole = $('.page-role'),
|
|
|
+ $roleInfo = $pageRole.find('.role-info'),
|
|
|
+ $roleItem = $roleInfo.find('.info-item.is-current'),
|
|
|
+ roleDescActive = $roleItem.find('.role-desc.actived').length;
|
|
|
+ if (roleDescActive > 0) {
|
|
|
+ $roleItem.find('.desc-audio-play').addClass('is-active');
|
|
|
+ }
|
|
|
+ if (!$roleInfo.is(':hidden') && $roleItem.find('.attr-list li.is-active').index() == 2) {
|
|
|
+ $roleItem.find('.desc-box audio').get(0).currentTime = 0;
|
|
|
+ $roleItem.find('.desc-box audio').get(0).play();
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
self.isRoleListEnter = false
|
|
|
- var roleAudioLen = $('.page-role audio').length,
|
|
|
- roleAudio = $('.page-role audio');
|
|
|
- for (var i = 0; i < roleAudioLen; i++) {
|
|
|
- roleAudio[i].pause();
|
|
|
- roleAudio[i].currentTime = 0;
|
|
|
+ if (!self.isMobile) {
|
|
|
+ var roleAudioLen = $('.page-role audio').length,
|
|
|
+ roleAudio = $('.page-role audio');
|
|
|
+ for (var i = 0; i < roleAudioLen; i++) {
|
|
|
+ roleAudio[i].pause();
|
|
|
+ roleAudio[i].currentTime = 0;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- if(this.activeIndex == 2 || this.activeIndex == 3){
|
|
|
- sceneRoleBgm(true);
|
|
|
- }else{
|
|
|
- sceneRoleBgm(false);
|
|
|
+ if (!self.isMobile) {
|
|
|
+ if (this.activeIndex == 2 || this.activeIndex == 3) {
|
|
|
+ sceneRoleBgm(true);
|
|
|
+ } else {
|
|
|
+ sceneRoleBgm(false);
|
|
|
+ }
|
|
|
}
|
|
|
- function sceneRoleBgm(state){
|
|
|
+
|
|
|
+ function sceneRoleBgm(state) {
|
|
|
var sceneRoleBgm = $('.scene-role-bgm audio');
|
|
|
- for(var i=0,l=sceneRoleBgm.length;i<l;i++){
|
|
|
+ for (var i = 0, l = sceneRoleBgm.length; i < l; i++) {
|
|
|
sceneRoleBgm[i].pause();
|
|
|
sceneRoleBgm[i].currentTime = 0;
|
|
|
}
|
|
|
- if(state){
|
|
|
+ if (state) {
|
|
|
var oldIndex = 0,
|
|
|
- oldPlay = $('.scene-role-bgm audio');
|
|
|
- oldPlay.get(oldIndex).play();
|
|
|
+ oldPlay = $('.scene-role-bgm audio');
|
|
|
+ oldPlay.get(oldIndex).play();
|
|
|
$('.scene-role-bgm audio').eq(oldIndex).addClass('actived');
|
|
|
- $('.scene-role-bgm audio').bind('ended',function(){
|
|
|
+ $('.scene-role-bgm audio').bind('ended', function () {
|
|
|
oldIndex++;
|
|
|
- if(oldIndex > 2){
|
|
|
+ if (oldIndex > 2) {
|
|
|
oldIndex = 0;
|
|
|
- }x
|
|
|
+ }
|
|
|
$('.scene-role-bgm audio').get(oldIndex).play();
|
|
|
$('.scene-role-bgm audio').eq(oldIndex).addClass('actived').siblings().removeClass('actived');
|
|
|
})
|
|
|
- }else{
|
|
|
- for(var i=0,l=sceneRoleBgm.length;i<l;i++){
|
|
|
+ } else {
|
|
|
+ for (var i = 0, l = sceneRoleBgm.length; i < l; i++) {
|
|
|
sceneRoleBgm[i].pause();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
self.bottomVisible = false
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- $('.box-mouse').on('click',function(){
|
|
|
- self.mainSwiper.mousewheel.enable();
|
|
|
- })
|
|
|
+ self.mainSwiper.mousewheel.disable()
|
|
|
+ $('.box-mouse').on('click', function () {
|
|
|
+ self.mainSwiper.mousewheel.enable();
|
|
|
+ })
|
|
|
;!function () {
|
|
|
var sliders = document.querySelectorAll('.swiper-slide')
|
|
|
Array.prototype.forEach.call(sliders, function (slider) {
|
|
@@ -280,7 +298,7 @@ var app = new Vue({
|
|
|
mainSwiperSlideTo: function (index, speed, runCallbacks) {
|
|
|
this.mainSwiper.slideTo(index, speed, runCallbacks)
|
|
|
},
|
|
|
- registerWindowEvent(){
|
|
|
+ registerWindowEvent() {
|
|
|
var self = this
|
|
|
var touchStartY
|
|
|
window.addEventListener('resize', function (event) {
|
|
@@ -300,6 +318,10 @@ var app = new Vue({
|
|
|
ev.changedTouches[0].screenY - touchStartY > 50 && self.mainSwiper.slidePrev()
|
|
|
touchStartY - ev.changedTouches[0].screenY > 50 && self.mainSwiper.slideNext()
|
|
|
})
|
|
|
+ // 阻止微信浏览器默认下拉
|
|
|
+ document.body.addEventListener('touchmove', function (ev) {
|
|
|
+ ev.preventDefault()
|
|
|
+ }, {passive: false})
|
|
|
},
|
|
|
// 首页灯塔点击事件处理函数
|
|
|
handleTowerClick() {
|
|
@@ -342,12 +364,15 @@ var app = new Vue({
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ toggleShareShow() {
|
|
|
+ this.isMobile && (this.shareShow = !this.shareShow)
|
|
|
+ },
|
|
|
// 场景页初始化
|
|
|
initScene() {
|
|
|
!this.isMobile && new Parallax(this.$refs['scene-wrapper'])
|
|
|
},
|
|
|
// 加载场景页图片
|
|
|
- loadSceneResources(){
|
|
|
+ loadSceneResources() {
|
|
|
var that = this
|
|
|
this.sceneList.forEach(function (scene, index) {
|
|
|
var image = that.$refs['scene' + (index + 1)][0]
|
|
@@ -359,13 +384,13 @@ var app = new Vue({
|
|
|
initEvaluation() {
|
|
|
!this.isMobile && new Parallax(this.$refs['charactor-wrapper'])
|
|
|
},
|
|
|
- getOrientationViewSize(flag){
|
|
|
+ getOrientationViewSize(flag) {
|
|
|
var winWidth = window.innerWidth
|
|
|
var winHeight = window.innerHeight
|
|
|
|
|
|
- if(flag) { //竖屏
|
|
|
- var translateX = winHeight - (winWidth+winHeight)/2 //屏幕旋转90deg-x轴偏移量
|
|
|
- var translateY = winHeight - (winWidth+winHeight)/2 //屏幕旋转90deg-y轴偏移量
|
|
|
+ if (flag) { //竖屏
|
|
|
+ var translateX = winHeight - (winWidth + winHeight) / 2 //屏幕旋转90deg-x轴偏移量
|
|
|
+ var translateY = winHeight - (winWidth + winHeight) / 2 //屏幕旋转90deg-y轴偏移量
|
|
|
|
|
|
this.viewWidth = winHeight
|
|
|
this.viewHeight = winWidth
|
|
@@ -376,14 +401,14 @@ var app = new Vue({
|
|
|
this.viewTransform = ""
|
|
|
}
|
|
|
},
|
|
|
- checkOrientation(){
|
|
|
+ checkOrientation() {
|
|
|
var orientation = window.matchMedia("(orientation: portrait)");
|
|
|
|
|
|
this.getOrientationViewSize(orientation.matches)
|
|
|
this.initSwiper()
|
|
|
|
|
|
// 添加一个媒体查询改变监听者
|
|
|
- orientation.addListener((m) =>{
|
|
|
+ orientation.addListener((m) => {
|
|
|
this.getOrientationViewSize(m.matches)
|
|
|
});
|
|
|
},
|
|
@@ -402,21 +427,26 @@ var app = new Vue({
|
|
|
|
|
|
},
|
|
|
isReading(newVal) {
|
|
|
- newVal ? this.$refs['scene-audio-player'].play() : this.$refs['scene-audio-player'].pause()
|
|
|
+ newVal && !this.isMobile ? this.$refs['scene-audio-player'].play() : this.$refs['scene-audio-player'].pause()
|
|
|
},
|
|
|
currentSceneIndex(newVal) {
|
|
|
+ if(this.isMobile) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$refs['scene-audio-player'].src = 'http://pub.dwstatic.com/zt2018/wxwy1809/audio/scenes/scene' + (newVal + 1) + '.mp3'
|
|
|
this.isReading && this.$refs['scene-audio-player'].play()
|
|
|
- console.log('播放了')
|
|
|
},
|
|
|
isEvaluationVideoPlaying(newVal) {
|
|
|
newVal ? this.$refs['evaluation-video'].play() : this.$refs['evaluation-video'].pause()
|
|
|
},
|
|
|
- mobileVideoVisiable(newVal){
|
|
|
- newVal ? void 0 : this.$refs['primary-mobile-video'].pause()
|
|
|
+ mobileVideoVisiable(newVal) {
|
|
|
+ newVal ? this.isMobileBGPlaying = false : this.$refs['primary-mobile-video'].pause()
|
|
|
},
|
|
|
- isMobileBGPlaying(newVal){
|
|
|
+ isMobileBGPlaying(newVal) {
|
|
|
newVal ? this.$refs['mobile-bgm'].play() : this.$refs['mobile-bgm'].pause()
|
|
|
+ },
|
|
|
+ isSceneEnter(newval){
|
|
|
+ newval && (this.isReading = true)
|
|
|
}
|
|
|
},
|
|
|
directives: {
|
|
@@ -430,66 +460,92 @@ var app = new Vue({
|
|
|
|
|
|
|
|
|
// 世界观变量
|
|
|
-var bookIndex = 1, bookLen = $('.book-wrap li').length, bookTimer1 = null, bookTimer2 = null, bookPlayCount = 0,
|
|
|
- bookLeaveTime = 0, bookPageCount = 0;
|
|
|
-$(function(){
|
|
|
- for (var i = 0; i < bookLen; i++) {
|
|
|
- var _index = bookLen - i;
|
|
|
- if (i == 0 || i == bookLen - 1) {
|
|
|
- _index = 'auto';
|
|
|
- }
|
|
|
- $('.book-wrap li').eq(i).css('z-index', _index);
|
|
|
- $('.book-wrap li').eq(i).removeClass('topaging');
|
|
|
- }
|
|
|
-})
|
|
|
+var bookTimer1 = null, bookTimer2 = null, bookPageCount = 0, bookLen = $('.book-wrap li').length, switchTimer = null;
|
|
|
var V = {
|
|
|
- worldInit: function () {
|
|
|
- $('.world-bgm1').get(0).volume = 0.2;
|
|
|
- $('.world-bgm2').get(0).volume = 0.2;
|
|
|
- $('.world-bgm1').get(0).play();
|
|
|
- $('.world-bgm').bind('ended', function () {
|
|
|
- $('.world-bgm').get(1-$(this).index()).play();
|
|
|
- });
|
|
|
- $('.book-switch.prev').on('click',function () {
|
|
|
- clearTimeout(bookTimer1);
|
|
|
- clearTimeout(bookTimer2);
|
|
|
+ worldInit: function (mobileFlag) {
|
|
|
+ var bookIndex = 1, bookPlayCount = 0, playIndex = 0, pauseTime = 0;
|
|
|
+ if (mobileFlag) {
|
|
|
+ $('.world-bgm1').get(0).volume = 0.2;
|
|
|
+ $('.world-bgm2').get(0).volume = 0.2;
|
|
|
+ $('.world-bgm1').get(0).play();
|
|
|
+ $('.worldMp3').get(0).play();
|
|
|
+ $('.world-bgm').bind('ended', function () {
|
|
|
+ $('.world-bgm').get(1 - $(this).index()).play();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ $('.book-switch.prev').on('click', function () {
|
|
|
if (bookIndex > 1) {
|
|
|
- bookPlayCount--;
|
|
|
- $('.pagingMp3').get(0).play();
|
|
|
+ clearTimeout(bookTimer1);
|
|
|
+ clearTimeout(bookTimer2);
|
|
|
+ bookPageCount--;
|
|
|
+ if (mobileFlag) {
|
|
|
+ $('.pagingMp3').get(0).play();
|
|
|
+ $('.video-play').removeClass('pause');
|
|
|
+ playIndex = 0;
|
|
|
+ }
|
|
|
var $current = $('.book-wrap li').eq(bookIndex - 1);
|
|
|
$current.prev().css('z-index', bookLen - $current.index() + 1)
|
|
|
$current.css('z-index', bookLen - $current.index())
|
|
|
$current.add($current.prev()).removeClass('topaging');
|
|
|
- $('.worldMp3').get(0).pause();
|
|
|
- if (bookPlayCount == 0) {
|
|
|
- $('.worldMp3').get(0).currentTime = 2
|
|
|
- $('.worldMp3').get(0).play();
|
|
|
- }
|
|
|
- if (bookPlayCount == 1) {
|
|
|
- $('.worldMp3').get(0).currentTime = 38
|
|
|
- $('.worldMp3').get(0).play();
|
|
|
+ if (mobileFlag) {
|
|
|
+ $('.worldMp3').get(0).pause();
|
|
|
+ judgePage();
|
|
|
+ setTimer();
|
|
|
}
|
|
|
- restartTimer();
|
|
|
bookIndex -= 2;
|
|
|
- bookPageCount--;
|
|
|
}
|
|
|
});
|
|
|
- $('.book-switch.next').on('click',function () {
|
|
|
+ $('.book-switch.next').on('click', function () {
|
|
|
if (bookIndex < bookLen - 1) {
|
|
|
- bookPlayCount++;
|
|
|
- $('.worldMp3').get(0).pause();
|
|
|
- if (bookPlayCount == 1) {
|
|
|
- $('.worldMp3').get(0).currentTime = 38
|
|
|
- $('.worldMp3').get(0).play();
|
|
|
- }
|
|
|
- if (bookPlayCount == 2) {
|
|
|
- $('.worldMp3').get(0).currentTime = 68
|
|
|
- $('.worldMp3').get(0).play();
|
|
|
+ clearTimeout(bookTimer1);
|
|
|
+ clearTimeout(bookTimer2);
|
|
|
+ bookNext();
|
|
|
+ if (mobileFlag) {
|
|
|
+ $('.worldMp3').get(0).pause();
|
|
|
+ judgePage();
|
|
|
+ setTimer();
|
|
|
}
|
|
|
- restartTimer();
|
|
|
}
|
|
|
- bookNext();
|
|
|
});
|
|
|
+ if (mobileFlag) {
|
|
|
+ $('.video-play').on('click', function () {
|
|
|
+ clearTimeout(bookTimer1);
|
|
|
+ clearTimeout(bookTimer2);
|
|
|
+ if (playIndex == 0) {
|
|
|
+ $('.worldMp3').get(0).pause();
|
|
|
+ $(this).addClass('pause');
|
|
|
+ playIndex = 1;
|
|
|
+ } else {
|
|
|
+ pauseTime = $('.worldMp3').get(0).currentTime;
|
|
|
+ $(this).removeClass('pause');
|
|
|
+ judgePage();
|
|
|
+ setTimer();
|
|
|
+ playIndex = 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('.worldMp3').bind('ended', function () {
|
|
|
+ $('.video-play').addClass('pause');
|
|
|
+ clearTimeout(bookTimer1);
|
|
|
+ clearTimeout(bookTimer2);
|
|
|
+ playIndex = 1;
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function judgePage() {
|
|
|
+ if (bookPageCount == 0) {
|
|
|
+ $('.worldMp3').get(0).currentTime = 0
|
|
|
+ $('.worldMp3').get(0).play();
|
|
|
+ }
|
|
|
+ if (bookPageCount == 1) {
|
|
|
+ $('.worldMp3').get(0).currentTime = 38
|
|
|
+ $('.worldMp3').get(0).play();
|
|
|
+ }
|
|
|
+ if (bookPageCount == 2) {
|
|
|
+ $('.worldMp3').get(0).currentTime = 68
|
|
|
+ $('.worldMp3').get(0).play();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
function bookNext() {
|
|
|
if (bookIndex < bookLen - 1) {
|
|
@@ -498,71 +554,41 @@ var V = {
|
|
|
setTimeout(function () {
|
|
|
$current.add($current.next()).css("z-index", "auto");
|
|
|
}, 500)
|
|
|
- $('.pagingMp3').get(0).play();
|
|
|
+ if (mobileFlag) {
|
|
|
+ $('.pagingMp3').get(0).play();
|
|
|
+ }
|
|
|
bookIndex += 2;
|
|
|
bookPageCount++;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $('.worldMp3').get(0).play();
|
|
|
-
|
|
|
- function setTime(time) {
|
|
|
- if (38000 - time <= 0) {
|
|
|
- clearTimeout(bookTimer1);
|
|
|
- } else {
|
|
|
+ function setTimer() {
|
|
|
+ if (bookPageCount < 1) {
|
|
|
bookTimer1 = setTimeout(() => {
|
|
|
bookNext();
|
|
|
- }, 38000 - time);
|
|
|
+ }, 38000);
|
|
|
+ } else {
|
|
|
+ clearTimeout(bookTimer1);
|
|
|
}
|
|
|
- if (68000 - time <= 0) {
|
|
|
+ if (bookPageCount > 1) {
|
|
|
clearTimeout(bookTimer2);
|
|
|
} else {
|
|
|
+ var timer2Time = 68000;
|
|
|
+ if (bookPageCount == 1) {
|
|
|
+ timer2Time = 68000 - 38000;
|
|
|
+ }
|
|
|
bookTimer2 = setTimeout(() => {
|
|
|
bookNext();
|
|
|
- }, 68000 - time);
|
|
|
+ }, timer2Time);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- setTime(bookLeaveTime);
|
|
|
- var playIndex = 0;
|
|
|
- $('.video-play').removeClass('pause');
|
|
|
- $('.video-play').on('click',function () {
|
|
|
- if (playIndex == 0) {
|
|
|
- $('.worldMp3').get(0).pause();
|
|
|
- $(this).addClass('pause');
|
|
|
- clearTimeout(bookTimer1);
|
|
|
- clearTimeout(bookTimer2);
|
|
|
- playIndex = 1;
|
|
|
- } else {
|
|
|
- $('.worldMp3').get(0).play();
|
|
|
- $(this).removeClass('pause');
|
|
|
- restartTimer();
|
|
|
- playIndex = 0;
|
|
|
- if (Math.ceil($('.worldMp3').get(0).currentTime) == 0) {
|
|
|
- bookIndex = 1, bookPlayCount = 0, bookLeaveTime = 0, bookPageCount = 0;
|
|
|
- for (var i = 0; i < bookLen; i++) {
|
|
|
- var _index = bookLen - i;
|
|
|
- if (i == 0 || i == bookLen - 1) {
|
|
|
- _index = 'auto';
|
|
|
- }
|
|
|
- }
|
|
|
- setTime(bookLeaveTime);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- $('.worldMp3').bind('ended', function () {
|
|
|
- $('.video-play').addClass('pause');
|
|
|
- clearTimeout(bookTimer1);
|
|
|
- clearTimeout(bookTimer2);
|
|
|
- playIndex = 1;
|
|
|
- });
|
|
|
-
|
|
|
- function restartTimer() {
|
|
|
- setTime(Math.ceil($('.worldMp3').get(0).currentTime) * 1000);
|
|
|
+ if (mobileFlag) {
|
|
|
+ setTimer();
|
|
|
+ switchTimer = setTimer;
|
|
|
}
|
|
|
},
|
|
|
- roleInit: function(){
|
|
|
+ roleInit: function (mobileFlag) {
|
|
|
var $parent = $('.page-role'),
|
|
|
roleListLen = $('.role-bigList li').length,
|
|
|
roleUlLen = $('.role-list ul').length,
|
|
@@ -571,111 +597,129 @@ var V = {
|
|
|
currentIndex = 0;
|
|
|
$('.role-list .role-bot-arrow').delay(roleListDelay).fadeIn().addClass('moveUp');
|
|
|
// 点击角色目录跳转
|
|
|
- $('.role-list li').on('click',function(){
|
|
|
+ $('.role-list li').on('click', function () {
|
|
|
var ulIndex = $(this).parents('ul').index(),
|
|
|
_index = $(this).index();
|
|
|
- currentIndex = ulIndex * 5 + _index;
|
|
|
+ currentIndex = ulIndex * 5 + _index;
|
|
|
$('.role-bot-arrow').fadeOut();
|
|
|
bigListShow(currentIndex);
|
|
|
- allRoleDescMusic();
|
|
|
+ if (mobileFlag) {
|
|
|
+ allRoleDescMusic();
|
|
|
+ }
|
|
|
changeRoleInfoBg($('.info-item.is-current').find('.attr-box li.is-active').attr('data-bg'));
|
|
|
})
|
|
|
// 角色目录底部箭头
|
|
|
var ulChangeState = true;
|
|
|
- $('.role-bot-arrow').on('click',function(){
|
|
|
- if(ulChangeState){
|
|
|
+ $('.role-bot-arrow').on('click', function () {
|
|
|
+ if (ulChangeState) {
|
|
|
ulChangeState = false;
|
|
|
- $('.role-list ul').eq(ulCurrentIndex).find('li').each(function(){
|
|
|
+ $('.role-list ul').eq(ulCurrentIndex).find('li').each(function () {
|
|
|
$(this).removeClass('fadeInDown').addClass('fadeOutDown');
|
|
|
})
|
|
|
ulCurrentIndex++;
|
|
|
- if(ulCurrentIndex > roleUlLen - 1){
|
|
|
+ if (ulCurrentIndex > roleUlLen - 1) {
|
|
|
ulCurrentIndex = 0;
|
|
|
}
|
|
|
$('.role-list ul').eq(ulCurrentIndex).addClass('is-active');
|
|
|
- setTimeout(function(){
|
|
|
+ setTimeout(function () {
|
|
|
$('.role-list ul').eq(ulCurrentIndex).siblings().removeClass('is-active');
|
|
|
- $('.role-list ul').eq(ulCurrentIndex).siblings().find('li').each(function(){
|
|
|
+ $('.role-list ul').eq(ulCurrentIndex).siblings().find('li').each(function () {
|
|
|
$(this).removeClass('fadeOutDown').addClass('fadeInDown');
|
|
|
});
|
|
|
ulChangeState = true;
|
|
|
- },roleListDelay + 1000);
|
|
|
+ }, roleListDelay + 1000);
|
|
|
}
|
|
|
});
|
|
|
// 角色切换
|
|
|
- $('.role-switch').on('click',function(ev){
|
|
|
+ $('.role-switch').on('click', function (ev) {
|
|
|
stopBubble(ev);
|
|
|
- if($(this).hasClass('prev')){
|
|
|
+ if ($(this).hasClass('prev')) {
|
|
|
currentIndex--;
|
|
|
- if(currentIndex < 0){
|
|
|
+ if (currentIndex < 0) {
|
|
|
currentIndex = roleListLen - 1;
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
currentIndex++;
|
|
|
- if(currentIndex > roleListLen - 1){
|
|
|
+ if (currentIndex > roleListLen - 1) {
|
|
|
currentIndex = 0;
|
|
|
}
|
|
|
}
|
|
|
roleBigSwitch(currentIndex);
|
|
|
- allRoleDescMusic();
|
|
|
- stopCvMusic();
|
|
|
+ if (mobileFlag) {
|
|
|
+ allRoleDescMusic();
|
|
|
+ stopCvMusic();
|
|
|
+ }
|
|
|
changeRoleInfoBg($('.info-item.is-current').find('.attr-box li.is-active').attr('data-bg'));
|
|
|
});
|
|
|
// 返回角色目录
|
|
|
- $('.role-back').on('click',function(ev){
|
|
|
+ $('.role-back').on('click', function (ev) {
|
|
|
stopBubble(ev);
|
|
|
$('.role-bot-arrow').fadeIn();
|
|
|
$('.role-bigList').fadeOut();
|
|
|
$('.role-info').fadeOut();
|
|
|
- $('.role-list ul').eq(ulCurrentIndex).find('li').each(function(){
|
|
|
+ $('.role-list ul').eq(ulCurrentIndex).find('li').each(function () {
|
|
|
$(this).removeClass('fadeOutDown').addClass('fadeInDown');
|
|
|
});
|
|
|
$('.role-bigList li').removeClass('bigmode');
|
|
|
- $('.role-back-m').get(0).currentTime = 0;
|
|
|
- $('.role-back-m').get(0).play();
|
|
|
- roleDescMusicOff(currentIndex);
|
|
|
- stopCvMusic();
|
|
|
+ if (mobileFlag) {
|
|
|
+ $('.role-back-m').get(0).currentTime = 0;
|
|
|
+ $('.role-back-m').get(0).play();
|
|
|
+ roleDescMusicOff(currentIndex);
|
|
|
+ stopCvMusic();
|
|
|
+ }
|
|
|
});
|
|
|
// 进入角色立绘
|
|
|
- $('.role-info-left').on('click',function(){
|
|
|
+ $('.role-info-left').on('click', function () {
|
|
|
$('.role-info').fadeOut();
|
|
|
- $('.role-bigList li').addClass('bigmode');
|
|
|
- $('.role-uihide-m').get(0).currentTime = 0;
|
|
|
- $('.role-uihide-m').get(0).play();
|
|
|
- roleDescMusicOff(currentIndex);
|
|
|
- stopCvMusic();
|
|
|
+ $('.role-bigList li').eq(currentIndex).addClass('bigmode');
|
|
|
+ if (mobileFlag) {
|
|
|
+ $('.role-uihide-m').get(0).currentTime = 0;
|
|
|
+ $('.role-uihide-m').get(0).play();
|
|
|
+ roleDescMusicOff(currentIndex);
|
|
|
+ stopCvMusic();
|
|
|
+ }
|
|
|
});
|
|
|
// 点击大图返回角色页
|
|
|
- $('.role-bigList li').on('click',function(){
|
|
|
+ $('.role-bigList li').on('click', function () {
|
|
|
$('.role-info').fadeIn();
|
|
|
- $('.role-bigList li').removeClass('bigmode');
|
|
|
- $('.role-uihide-m').get(0).currentTime = 0;
|
|
|
- $('.role-uihide-m').get(0).play();
|
|
|
- allRoleDescMusic();
|
|
|
+ $('.role-bigList li').eq(currentIndex).removeClass('bigmode');
|
|
|
+ if (mobileFlag) {
|
|
|
+ $('.role-uihide-m').get(0).currentTime = 0;
|
|
|
+ $('.role-uihide-m').get(0).play();
|
|
|
+ allRoleDescMusic();
|
|
|
+ }
|
|
|
});
|
|
|
// tab切换
|
|
|
- $('[role-tab]').each(function(){
|
|
|
+ $('[role-tab]').each(function () {
|
|
|
var $this = $(this),
|
|
|
$tabData = $this.attr('role-tab'),
|
|
|
$tabParent = $this.parents('[role-wrap]'),
|
|
|
$tabContent = $tabParent.find('[role-content="' + $tabData + '"]');
|
|
|
- $this.find('li').on('click',function(){
|
|
|
+ $this.find('li').on('click', function () {
|
|
|
var _index = $(this).index();
|
|
|
- if($tabData == 'skillTab'){
|
|
|
- $('.role-skill-m').get(0).play();
|
|
|
+ if ($tabData == 'skillTab') {
|
|
|
+ if (mobileFlag) {
|
|
|
+ if (mobileFlag) {
|
|
|
+ $('.role-skill-m').get(0).play();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- if($tabData == 'attrTab'){
|
|
|
+ if ($tabData == 'attrTab') {
|
|
|
changeRoleInfoBg($(this).attr('data-bg'));
|
|
|
- if($(this).index() == 2){
|
|
|
- $tabParent.find('.desc-box audio').get(0).play();
|
|
|
- $tabParent.find('.desc-box audio').addClass('actived');
|
|
|
- $tabParent.find('.desc-audio-play').addClass('is-active');
|
|
|
- }else{
|
|
|
+ if ($(this).index() == 2) {
|
|
|
+ if (mobileFlag) {
|
|
|
+ $tabParent.find('.desc-box audio').get(0).play();
|
|
|
+ $tabParent.find('.desc-box audio').addClass('actived');
|
|
|
+ $tabParent.find('.desc-audio-play').addClass('is-active');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
var infoItemIndex = $(this).parents('.info-item').index();
|
|
|
- roleDescMusicOff($(this).parents('.info-item').index());
|
|
|
- $('.info-item').eq(infoItemIndex).find('.desc-box audio').removeClass('actived');
|
|
|
+ if (mobileFlag) {
|
|
|
+ roleDescMusicOff($(this).parents('.info-item').index());
|
|
|
+ $('.info-item').eq(infoItemIndex).find('.desc-box audio').removeClass('actived');
|
|
|
+ }
|
|
|
}
|
|
|
- if($(this).index() != 1){
|
|
|
+ if ($(this).index() != 1 && mobileFlag) {
|
|
|
stopCvMusic();
|
|
|
}
|
|
|
}
|
|
@@ -684,65 +728,73 @@ var V = {
|
|
|
});
|
|
|
});
|
|
|
// 点击喇叭播放cv声音
|
|
|
- $('.role-cv .horn').on('click',function(){
|
|
|
- var $cvParent = $(this).parents('.role-cv'),
|
|
|
- cvLen = $cvParent.find('.cv-audio audio').length,
|
|
|
- randomNum = Math.floor(Math.random() * cvLen);
|
|
|
- $cvParent.find('.cv-audio audio').get(randomNum).play();
|
|
|
- if(cvLen > 1){
|
|
|
- $cvParent.find('.cv-audio audio').get(1 - randomNum).pause();
|
|
|
- $cvParent.find('.cv-audio audio').get(1 - randomNum).currentTime = 0;
|
|
|
- }
|
|
|
- });
|
|
|
- // 角色介绍页停止音乐按钮
|
|
|
- $('.desc-audio-play').each(function(){
|
|
|
- $(this).on('click',function(){
|
|
|
- if($(this).hasClass('is-active')){
|
|
|
- $(this).removeClass('is-active');
|
|
|
- $(this).parents('.desc-box').find('audio').get(0).pause();
|
|
|
- }else{
|
|
|
- $(this).addClass('is-active');
|
|
|
- $(this).parents('.desc-box').find('audio').get(0).play();
|
|
|
+ if (mobileFlag) {
|
|
|
+ $('.role-cv .horn').on('click', function () {
|
|
|
+ var $cvParent = $(this).parents('.role-cv'),
|
|
|
+ cvLen = $cvParent.find('.cv-audio audio').length,
|
|
|
+ randomNum = Math.floor(Math.random() * cvLen);
|
|
|
+ $cvParent.find('.cv-audio audio').get(randomNum).play();
|
|
|
+ if (cvLen > 1) {
|
|
|
+ $cvParent.find('.cv-audio audio').get(1 - randomNum).pause();
|
|
|
+ $cvParent.find('.cv-audio audio').get(1 - randomNum).currentTime = 0;
|
|
|
}
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 角色介绍页停止音乐按钮
|
|
|
+ if (mobileFlag) {
|
|
|
+ $('.desc-audio-play').each(function () {
|
|
|
+ $(this).on('click', function () {
|
|
|
+ if ($(this).hasClass('is-active')) {
|
|
|
+ $(this).removeClass('is-active');
|
|
|
+ $(this).parents('.desc-box').find('audio').get(0).pause();
|
|
|
+ } else {
|
|
|
+ $(this).addClass('is-active');
|
|
|
+ $(this).parents('.desc-box').find('audio').get(0).play();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ $('.role-desc').bind('ended', function () {
|
|
|
+ $(this).parents('.desc-box').find('.desc-audio-play').removeClass('is-active');
|
|
|
})
|
|
|
- });
|
|
|
- $('.role-desc').bind('ended',function(){
|
|
|
- $(this).parents('.desc-box').find('.desc-audio-play').removeClass('is-active');
|
|
|
- })
|
|
|
+ }
|
|
|
+
|
|
|
// 关闭cv音乐播放
|
|
|
- function stopCvMusic(){
|
|
|
- for(var i=0;i<roleListLen;i++){
|
|
|
+ function stopCvMusic() {
|
|
|
+ for (var i = 0; i < roleListLen; i++) {
|
|
|
var itemCv = $parent.find('.info-item').eq(i).find('.cv-audio audio'),
|
|
|
itemCvLen = $parent.find('.info-item').eq(i).find('.cv-audio audio').length;
|
|
|
- for(var j=0;j<itemCvLen;j++){
|
|
|
+ for (var j = 0; j < itemCvLen; j++) {
|
|
|
itemCv[j].pause();
|
|
|
itemCv[j].currentTime = 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// 离开角色介绍页时关闭并重置音乐播放
|
|
|
- function roleDescMusicOff(mParentsIndex){
|
|
|
+ function roleDescMusicOff(mParentsIndex) {
|
|
|
$parent.find('.info-item').eq(mParentsIndex).find('.desc-box audio').get(0).pause();
|
|
|
$parent.find('.info-item').eq(mParentsIndex).find('.desc-box audio').get(0).currentTime = 0;
|
|
|
$parent.find('.info-item').eq(mParentsIndex).find('.desc-audio-play').removeClass('is-active');
|
|
|
}
|
|
|
- function allRoleDescMusic(){
|
|
|
+
|
|
|
+ function allRoleDescMusic() {
|
|
|
var infoItemLen = $parent.find('.info-item').length,
|
|
|
descMusicState = $parent.find('.role-info-right .info-item').eq(currentIndex).find('.desc-box audio.actived').length;
|
|
|
- for(var i=0;i<infoItemLen;i++){
|
|
|
+ for (var i = 0; i < infoItemLen; i++) {
|
|
|
$parent.find('.info-item').eq(i).find('.desc-box audio').get(0).pause();
|
|
|
$parent.find('.info-item').eq(i).find('.desc-box audio').get(0).currentTime = 0;
|
|
|
}
|
|
|
- if(descMusicState > 0){
|
|
|
+ if (descMusicState > 0) {
|
|
|
$parent.find('.info-item').eq(currentIndex).find('.desc-audio-play').addClass('is-active');
|
|
|
$parent.find('.info-item').eq(currentIndex).find('.desc-box audio').get(0).currentTime = 0;
|
|
|
$parent.find('.info-item').eq(currentIndex).find('.desc-box audio').get(0).play();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// 显示大图
|
|
|
- function bigListShow(_index){
|
|
|
+ function bigListShow(_index) {
|
|
|
$('.role-bigList li').eq(_index).removeClass('ml').siblings().addClass('ml');
|
|
|
- $('.role-list ul').eq(ulCurrentIndex).find('li').each(function(){
|
|
|
+ $('.role-list ul').eq(ulCurrentIndex).find('li').each(function () {
|
|
|
$(this).removeClass('fadeInDown').addClass('fadeOutDown');
|
|
|
})
|
|
|
$('.role-bigList').delay(roleListDelay).fadeIn();
|
|
@@ -750,24 +802,31 @@ var V = {
|
|
|
$parent.find('.info-item').eq(_index).addClass('is-current').siblings().removeClass('is-current');
|
|
|
$parent.find('.role-info-right .info-item').eq(_index).fadeIn().siblings().fadeOut();
|
|
|
$parent.find('.role-info-left').eq(0).dataIndex = _index;
|
|
|
- $parent.find('.role-bigList').find('li').eq(_index).css({'display':'block','z-index':2}).siblings().css({'display':'none','z-index':1});
|
|
|
+ $parent.find('.role-bigList').find('li').eq(_index).css({
|
|
|
+ 'display': 'block',
|
|
|
+ 'z-index': 2
|
|
|
+ }).siblings().css({'display': 'none', 'z-index': 1});
|
|
|
}
|
|
|
+
|
|
|
// 阻止冒泡
|
|
|
- function stopBubble(e){
|
|
|
+ function stopBubble(e) {
|
|
|
e = e || window.event;
|
|
|
- if(e.stopPropagation){
|
|
|
+ if (e.stopPropagation) {
|
|
|
e.stopPropagation();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
e.cancelBubble = true;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// 大图切换
|
|
|
- function roleBigSwitch(_index){
|
|
|
+ function roleBigSwitch(_index) {
|
|
|
var $bigListDom = $parent.find('.role-bigList li');
|
|
|
- $('.role-switch-m').get(0).play();
|
|
|
- $('.info-mask').fadeIn('normal',function(){
|
|
|
+ if (mobileFlag) {
|
|
|
+ $('.role-switch-m').get(0).play();
|
|
|
+ }
|
|
|
+ $('.info-mask').fadeIn('normal', function () {
|
|
|
$bigListDom.eq(_index).siblings().addClass('ml');
|
|
|
- $bigListDom.eq(_index).siblings().fadeOut('',function(){
|
|
|
+ $bigListDom.eq(_index).siblings().fadeOut('', function () {
|
|
|
$('.info-mask').fadeOut();
|
|
|
$bigListDom.eq(_index).fadeIn().removeClass('ml');
|
|
|
});
|
|
@@ -776,10 +835,12 @@ var V = {
|
|
|
$parent.find('.info-item').eq(_index).addClass('is-current').siblings().removeClass('is-current');
|
|
|
$parent.find('.role-info-right .info-item').eq(_index).show().siblings().hide();
|
|
|
}
|
|
|
+
|
|
|
// 切换角色信息背景
|
|
|
- function changeRoleInfoBg(_index){
|
|
|
+ function changeRoleInfoBg(_index) {
|
|
|
$('.role-info-bg').eq(_index).addClass('is-active').siblings().removeClass('is-active');
|
|
|
}
|
|
|
+
|
|
|
// 设置滚动条
|
|
|
$('[data-role="scrollTeam"]').niceScroll({
|
|
|
cursorcolor: '#e4cc72',
|
|
@@ -792,15 +853,24 @@ var V = {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-$(function(){
|
|
|
+$(function () {
|
|
|
+ // 世界观书页样式设置
|
|
|
+ for (var i = 0; i < bookLen; i++) {
|
|
|
+ var _index = bookLen - i;
|
|
|
+ if (i == 0 || i == bookLen - 1) {
|
|
|
+ _index = 'auto';
|
|
|
+ }
|
|
|
+ $('.book-wrap li').eq(i).css('z-index', _index);
|
|
|
+ $('.book-wrap li').eq(i).removeClass('topaging');
|
|
|
+ }
|
|
|
// 设置animate延迟时间
|
|
|
- $('[animate-delay]').each(function(){
|
|
|
+ $('[animate-delay]').each(function () {
|
|
|
var delay = parseInt(parseFloat($(this).attr('animate-delay')) * 100) / 100 + 's';
|
|
|
this.animateDelay = delay;
|
|
|
- $(this).css('animation-delay',delay).removeAttr('animate-delay');
|
|
|
+ $(this).css('animation-delay', delay).removeAttr('animate-delay');
|
|
|
});
|
|
|
// 背景音乐音量调整
|
|
|
- $('.bgm-volume').each(function(){
|
|
|
+ $('.bgm-volume').each(function () {
|
|
|
var volumeSize = $(this).attr('data-volume') ? $(this).attr('data-volume') : 0.2;
|
|
|
$('.bgm-volume').get($(this).index()).volume = volumeSize;
|
|
|
});
|