Skip to content

Commit

Permalink
更新说明文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Alice-Jie committed Nov 12, 2017
1 parent abed13c commit b411e4f
Show file tree
Hide file tree
Showing 11 changed files with 985 additions and 195 deletions.
2 changes: 1 addition & 1 deletion js/jquery.audiovisualizer.circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@
outerDistance: 0, // 外环距离(px)
connectionMode: 'connection', // 连接模式
initialAngle: 90, // 初始角度(deg)
endAngle: 180, // 终止角度(deg)
endAngle: 360, // 终止角度(deg)
ringRotation: 0, // 圆环旋转(deg)
milliSec: 30, // 重绘间隔(ms)
// 小球参数
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.logo.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,8 @@

// 默认参数
Logo.DEFAULTS = {
isLogo: false, // 显示标志
// 基础参数
isLogo: false, // 显示标志
isCircular: true, // 圆形标志
opacity: 0.9, // 不透明度
isStroke: false, // 描边开关
Expand All @@ -446,7 +446,7 @@
isRotation: false, // 是否旋转
rotationAngle: 0.5, // 旋转角度
milliSec: 30, // 重绘间隔
// 标志滤镜
// 滤镜参数
blur: 0, // 模糊
brightness: 100, // 亮度
contrast: 100, // 对比度
Expand Down
48 changes: 24 additions & 24 deletions js/jquery.slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -954,12 +954,14 @@
this.isAudioPlay = options.isAudioPlay; // 是否播放Audio
this.isAudioLoop = options.isAudioLoop; // 是否循环播放
this.audioVolume = options.audioVolume; // Audio音量
// 滤镜参数
this.isBackgourndBlur = options.isBackgourndBlur; // 是否背景模糊
// 变换参数
this.isRotate3D = options.isRotate3D; // 是否3D旋转

this.degSize = options.degSize; // 角度大小
this.isBackgroundZoom = options.isBackgroundZoom; // 是否背景缩放
this.isBackgourndBlur = options.isBackgourndBlur; // 是否背景模糊
this.perspective = options.perspective; // 透视效果
this.width = options.width; // 平面宽度(%)
this.height = options.height; // 平面高度(%)

// 创建并初始化canvas
canvas = document.createElement('canvas');
Expand Down Expand Up @@ -1045,9 +1047,9 @@

// 默认参数
Slider.DEFAULTS = {
// 幻灯片参数
sliderMode: 'wallpaper', // 背景模式
isLinearGradient: false, // 线性背景开关
// 幻灯片参数
sliderStyle: 'css', // 背景切换模式
readStyle: 'sequential', // 读取模式
timeUnits: 'sec', // 时间单位
Expand All @@ -1057,28 +1059,26 @@
imgBGColor: '255,255,255', // IMG背景颜色
canvasFit: 'fill', // canvas适应方式
canvasBGColor: '255,255,255', // canvas背景颜色
// video参数
// Video参数
videoProgress: 0, // Video进度
isVideoPlay: true, // 是否播放Video
videoVolume: 0.75, // Video音量
playbackRate: 1.0, // Video播放速度
playbackRate: 1.00, // Video播放速度
videoFit: 'fill', // Video适应方式
videoBGColor: '255,255,255', // Video背景颜色
// audio参数
// Audio参数
audioProgress: 0, // Audio进度
isAudioPlay: false, // 是否播放Audio
isAudioLoop: false, // 是否循环播放
audioVolume: 0.75, // Audio音量
// 滤镜参数
isBackgroundBlur: false, // 是否背景缩放
// 变换参数
isRotate3D: false, // 是否3D旋转
degSize: 5, // 角度大小
isBackgroundZoom: false, // 是否背景模糊
isBackgroundBlur: false, // 是否背景缩放
perspective: 0, // 透视效果
width: 1.00, // 平面宽度(%)
height: 1.00, // 平面高度(%)
degSize: 5, // 角度大小
isRotate3D: false, // 是否3D旋转
isBackgroundZoom: false // 是否背景模糊

height: 1.00 // 平面高度(%)
};

// 公共方法
Expand Down Expand Up @@ -1681,7 +1681,7 @@

/** 改变滑动模式 */
changeSliderStyle: function () {
if (this.sliderMode === 'Directory') {
if (this.sliderMode === 'directory') {
switch (this.sliderStyle) {
case 'css':
this.clearCanvas();
Expand All @@ -1701,7 +1701,7 @@

/** 使用imgList当前图片 */
changeSlider: function () {
if (this.sliderMode === 'Directory') {
if (this.sliderMode === 'directory') {
switch (this.sliderStyle) {
case 'css':
this.changeBackground();
Expand Down Expand Up @@ -1730,7 +1730,7 @@
clearTimeout(timer);
timer = setTimeout(
()=> {
if (this.sliderMode === 'Directory' && imgList.length > 1) {
if (this.sliderMode === 'directory' && imgList.length > 1) {
// 更新oldIndex
oldIndex = imgIndex;
// 按读取顺序更新imgIndex
Expand Down Expand Up @@ -1758,7 +1758,7 @@

/** 开始背景切换 */
startSlider: function () {
if (this.sliderMode === 'Directory') {
if (this.sliderMode === 'directory') {
this.changeSliderStyle();
this.changeSlider();
this.runSliderTimer();
Expand Down Expand Up @@ -2023,21 +2023,21 @@
/** 初始化模式所需要的环境 */
initSlider: function () {
switch (this.sliderMode) {
case 'Color':
case 'color':
this.delVideo();
this.stopSliderTimer();
this.isLinearGradient ? this.cssLinearGradient() : this.cssUserColor();
break;
case 'Wallpaper':
case 'wallpaper':
this.delVideo();
this.stopSliderTimer();
userImg ? this.cssUserImg() : this.cssDefaultImg();
break;
case 'Directory':
case 'directory':
this.delVideo();
this.startSlider();
break;
case 'Video':
case 'video':
this.stopSliderTimer();
this.addVideo();
userVideo ? this.videoSrcUserVideo() : this.videoSrcDefaultVideo();
Expand Down Expand Up @@ -2099,7 +2099,7 @@
case 'canvasFit':
case 'canvasBGColor':
this[property] = value;
if (this.sliderMode === 'Directory' && this.sliderStyle === 'canvas') {
if (this.sliderMode === 'directory' && this.sliderStyle === 'canvas') {
this.drawBackground();
}
break;
Expand All @@ -2111,7 +2111,7 @@
case 'sliderStyle':
this.sliderStyle = value;
this.changeSliderStyle();
if (this.sliderMode === 'Directory') {
if (this.sliderMode === 'directory') {
this.changeSlider();
}
break;
Expand Down
40 changes: 20 additions & 20 deletions js/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

// 背景/幻灯片/视频配置
let slider = {
mode: 'Color', // 背景模式
mode: 'wallpaper', // 背景模式
isLinearGradient: false, // 线性开关
Color: '255,255,255', // 背景颜色
GradientDeg: 120, // 线性角度
Expand Down Expand Up @@ -986,23 +986,23 @@
// 初始化对应模式的所需环境
switch (properties.slider_mode.value) {
case 1:
slider.mode = 'Color';
slider.mode = 'color';
wallpaper.slider('set', 'sliderMode', slider.mode)
.slider('set', 'isLinearGradient', slider.isLinearGradient);
break;
case 2:
slider.mode = 'Wallpaper';
slider.mode = 'wallpaper';
wallpaper.slider('set', 'sliderMode', slider.mode);
break;
case 3:
slider.mode = 'Directory';
slider.mode = 'directory';
wallpaper.slider('set', 'sliderMode', slider.mode)
.slider('set', 'sliderStyle', directory.sliderStyle)
.slider('set', 'timeUnits', directory.timeUnits)
.slider('set', 'pauseTime', directory.pauseTime);
break;
case 4:
slider.mode = 'Video';
slider.mode = 'video';
wallpaper.slider('set', 'sliderMode', slider.mode);
break;
// no default
Expand All @@ -1016,38 +1016,38 @@
if (properties.slider_color_color) {
slider.Color = getColor(properties.slider_color_color.value);
wallpaper.slider('setUserColor', slider.Color);
if (slider.mode === 'Color') {
if (slider.mode === 'color') {
wallpaper.slider('cssUserColor');
}
}
// 线性颜色开关
if (properties.slider_color_isLinearGradient) {
slider.isLinearGradient = properties.slider_color_isLinearGradient.value;
if (slider.mode === 'Color') {
if (slider.mode === 'color') {
wallpaper.slider('set', 'isLinearGradient', slider.isLinearGradient);
}
}
// 线性颜色1
if (properties.slider_color_linearGradientColor1) {
slider.GradientColor1 = getColor(properties.slider_color_linearGradientColor1.value);
wallpaper.slider('setUserLinearGradient', slider.GradientDeg, slider.GradientColor1, slider.GradientColor2);
if (slider.mode === 'Color' && slider.isLinearGradient) {
if (slider.mode === 'color' && slider.isLinearGradient) {
wallpaper.slider('cssLinearGradient');
}
}
// 线性颜色2
if (properties.slider_color_linearGradientColor2) {
slider.GradientColor2 = getColor(properties.slider_color_linearGradientColor2.value);
wallpaper.slider('setUserLinearGradient', slider.GradientDeg, slider.GradientColor1, slider.GradientColor2);
if (slider.mode === 'Color' && slider.isLinearGradient) {
if (slider.mode === 'color' && slider.isLinearGradient) {
wallpaper.slider('cssLinearGradient');
}
}
// 线性角度
if (properties.slider_color_linearGradientDeg) {
slider.GradientDeg = properties.slider_color_linearGradientDeg.value;
wallpaper.slider('setUserLinearGradient', slider.GradientDeg, slider.GradientColor1, slider.GradientColor2);
if (slider.mode === 'Color' && slider.isLinearGradient) {
if (slider.mode === 'color' && slider.isLinearGradient) {
wallpaper.slider('cssLinearGradient');
}
}
Expand All @@ -1060,12 +1060,12 @@
if (properties.slider_wallpaper_file.value) {
slider.file = properties.slider_wallpaper_file.value;
wallpaper.slider('setUserImg', slider.file);
if (slider.mode === 'Wallpaper') {
if (slider.mode === 'wallpaper') {
wallpaper.slider('cssUserImg');
}
} else {
wallpaper.slider('setUserImg', '');
if (slider.mode === 'Wallpaper') {
if (slider.mode === 'wallpaper') {
wallpaper.slider('cssDefaultImg');
}
}
Expand All @@ -1080,14 +1080,14 @@

// 幻灯片目录
if (properties.slider_directory) {
if (slider.mode === 'Directory') {
if (slider.mode === 'directory') {
wallpaper.slider('changeSlider');
}
}
// 滑动样式
if (properties.slider_directory_sliderStyle) {
directory.sliderStyle = setSliderStyle(properties.slider_directory_sliderStyle.value);
if (slider.mode === 'Directory') {
if (slider.mode === 'directory') {
wallpaper.slider('set', 'sliderStyle', directory.sliderStyle);
}
}
Expand Down Expand Up @@ -1118,14 +1118,14 @@
// 选择时间单位
if (properties.slider_directory_timeUnits) {
directory.timeUnits = setTimeUnits(properties.slider_directory_timeUnits.value);
if (slider.mode === 'Directory') {
if (slider.mode === 'directory') {
wallpaper.slider('set', 'timeUnits', directory.timeUnits);
}
}
// 停留时间
if (properties.slider_directory_pauseTime) {
directory.pauseTime = properties.slider_directory_pauseTime.value;
if (slider.mode === 'Directory') {
if (slider.mode === 'directory') {
wallpaper.slider('set', 'pauseTime', directory.pauseTime);
}
}
Expand All @@ -1138,20 +1138,20 @@
if (properties.slider_video_file.value) {
video.file = properties.slider_video_file.value;
wallpaper.slider('setUserVideo', video.file);
if (slider.mode === 'Video') {
if (slider.mode === 'video') {
wallpaper.slider('videoSrcUserVideo');
}
} else {
wallpaper.slider('setUserVideo', '');
if (slider.mode === 'Video') {
if (slider.mode === 'video') {
wallpaper.slider('videoSrcDefaultVideo');
}
}
}
// 视频进度
if (properties.slider_video_progress) {
video.progress = properties.slider_video_progress.value / 100;
if (slider.mode === 'Video') {
if (slider.mode === 'video') {
wallpaper.slider('set', 'videoProgress', video.progress);
}

Expand All @@ -1177,7 +1177,7 @@
// 视频切换播放/暂停
if (properties.slider_video_isPlay) {
video.isPlay = properties.slider_video_isPlay.value;
if (slider.mode === 'Video') {
if (slider.mode === 'video') {
wallpaper.slider('set', 'isVideoPlay', video.isPlay);
}
}
Expand Down
Loading

0 comments on commit b411e4f

Please sign in to comment.