├── .gitignore
├── LICENSE
├── README.md
├── api
├── index.php
└── php
│ ├── config.php
│ └── index.php
├── css
├── detail.css
├── index.css
└── main.css
├── gulpfile.js
├── html
└── detail.html
├── img
├── screenshot-bing.mcloc.cn-2020.09.09-18_59_14.jpg
└── screenshot-bing.mcloc.cn-2020.09.09-20_19_38.jpg
├── index.html
├── js
├── detail.js
├── index.js
└── main.js
├── lib
├── Valine.min.js
├── bootstrap.min.css
├── bootstrap.min.css.map
├── bootstrap.min.js
├── bootstrap.min.js.map
├── jquery-1.11.0.js
├── layer
│ ├── layer.js
│ ├── mobile
│ │ ├── layer.js
│ │ └── need
│ │ │ └── layer.css
│ └── theme
│ │ └── default
│ │ ├── icon-ext.png
│ │ ├── icon.png
│ │ ├── layer.css
│ │ ├── loading-0.gif
│ │ ├── loading-1.gif
│ │ └── loading-2.gif
├── progressive-image.css
└── progressive-image.js
├── package.json
├── src
├── html
│ └── detail.html
├── index.html
├── js
│ ├── detail.js
│ ├── index.js
│ └── main.js
├── lib
│ ├── Valine.min.js
│ ├── bootstrap.min.css
│ ├── bootstrap.min.css.map
│ ├── bootstrap.min.js
│ ├── bootstrap.min.js.map
│ ├── jquery-1.11.0.js
│ ├── layer
│ │ ├── layer.js
│ │ ├── mobile
│ │ │ ├── layer.js
│ │ │ └── need
│ │ │ │ └── layer.css
│ │ └── theme
│ │ │ └── default
│ │ │ ├── icon-ext.png
│ │ │ ├── icon.png
│ │ │ ├── layer.css
│ │ │ ├── loading-0.gif
│ │ │ ├── loading-1.gif
│ │ │ └── loading-2.gif
│ ├── progressive-image.css
│ └── progressive-image.js
├── sass
│ ├── detail.scss
│ ├── index.scss
│ └── main.scss
└── static
│ └── upyun_logo5.png
└── static
└── upyun_logo5.png
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Bing-upyun
2 | # 轻量必应每日一图接口/前端,支持上传到又拍云调用
3 |
4 |
5 |
6 | > ### :warning: 注意:此项目已停止维护!
7 | >
8 | > 若有需要,请移步: [bing](https://github.com/androidmumo/bing),使用vue3构建的必应每日一图。
9 | >
10 | > 此项目以后不会添加新功能,但可能会有修复bug的更新。
11 | >
12 | > 若为得到较好的CDN优化,此项目仍然是个好选择。
13 |
14 |
15 |
16 | ### 1.简介
17 |
18 | - 轻量、迅速、无占用
19 | - 优雅的响应式前端界面,可静态部署
20 |
21 | - 前后端分离,后端接口可单独部署
22 | - 又拍云存储加速
23 | - 丰富的接口功能
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | 众所周知,必应搜索官网每天会更新一张高质量的背景图。许多同学想在接口中调用它们,但必应的服务器在国内不算特别稳定(>500ms)。Bing-upyun 可以把每天的必应图片上传至又拍云,提供支持图片处理、回溯的接口(又拍云直链,实测从请求到图片接收完成耗时300ms左右,视网络情况而不同),并可选部署优雅的前端页面。
32 |
33 | 目前有很多优秀的必应每日一图接口,可以将图片在服务器本地化存储并提供调用接口,但大都需要常驻后台运行。另外,目前几乎没有采用又拍云储存图片的同类接口。因此便有了下面的项目。
34 |
35 |
36 |
37 | > 诗曰:“ 沉舟侧畔千帆过,病树前头万木春。”
38 | >
39 | > 请跟随必应的脚步,带您领略世界之美。
40 |
41 |
42 |
43 | ### 2.前端
44 |
45 | ##### 2.1 前端 DEMO
46 |
47 | ```
48 | https://bing.nxingcloud.co/
49 | ```
50 |
51 |
52 |
53 | ##### 2.2 前端效果(首页)
54 |
55 |
56 |
57 |
58 |
59 | ##### 2.3 前端特性
60 |
61 | 用到的库或者框架有:Bootstrap4、jQuery1.11.0、Valine、[progressive-image](https://github.com/ccforward/progressive-image)。
62 |
63 | - 响应式
64 |
65 | - 图片懒加载
66 |
67 | - 图片渐进加载(模糊到清晰)
68 |
69 | - 无后台评论系统
70 |
71 |
72 |
73 | ### 3.后端
74 |
75 | ##### 3.1 接口文档
76 |
77 | | 参数名 | 是否必须 | 参数 | 返回结果 | 备注 |
78 | | :-------: | :----------: | :------------------------: | :-----------------------------: | :----------------------------------------------------------: |
79 | | type | 否 | json或其他 | json数据 | 参数除json外,其余都无效(输出图片) |
80 | | blur | 否 | 5/15/25 | 返回高斯模糊程度不同的图片 | 只支持5/15/25三个等级 |
81 | | gray | 否 | true/false | 灰阶图片/正常色彩图片 | - |
82 | | day | 否 | 数字n(大于等于0的正整数) | n天前的图片 | n的范围取决于程序运行天数 |
83 | | thumbnail | 否 | 1/25 | 16×9像素或以25%比例缩放的缩略图 | 只支持1/25两个等级,16×9像素的缩略图用来实现前端图片的渐进加载 |
84 | | random | 否 | true/false | - | 随机返回自网站开始运行至当前时间任意一天的图片 |
85 |
86 | 注意:`day` 和 `random` 两者之间只能选择一个参数,这两者参数和其余参数可以组合使用,除此之外的其他参数之间暂不支持组合使用。例如,不能返回灰阶的高斯模糊图片,可以返回n天前的高斯模糊图片。
87 |
88 |
89 |
90 | ##### json数据格式:
91 |
92 | ```
93 | {
94 | "bing_id": "21",
95 | "bing_title": "日落时分中央海岸入口海滩上的救生员小屋,澳大利亚新南威尔士州 (© Yury Prokopenko/Getty Images)",
96 | "bing_imgurl": "https://upyuns.mcloc.cn/bing/15-Sep-2020/15-Sep-2020.jpg",
97 | "bing_imgurlcom_25": "https://upyuns.mcloc.cn/bing/15-Sep-2020/15-Sep-2020-compress_25.jpg",
98 | "bing_imgurluhd": "https://cn.bing.com/th?id=OHR.LifeguardEntrance_ZH-CN7394984988_UHD.jpg",
99 | "bing_imgname": "LifeguardEntrance_ZH-CN7394984988",
100 | "bing_hsh": "a8712ff7ed3690123f96c2f95830b9f6",
101 | "submission_date": "15-Sep-2020",
102 | "submission_fulldate": "15-Sep-2020 00:01:01",
103 | "bing_imgbase64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsK\r\nCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQU\r\nFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAAJABADAREA\r\nAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAgMHCP/EACUQAAEEAQMCBwAAAAAAAAAAAAECAwQF\r\nEQAGEgcxNDdhc3Sxs//EABcBAAMBAAAAAAAAAAAAAAAAAAMFBgT/xAAnEQABAwIEBQUAAAAAAAAA\r\nAAABAAIDESEEEnGREzI0grExYXKBof/aAAwDAQACEQMRAD8ALpfa2VFBdK26liOlAdczeMFsN8iA\r\noBSVcRkEA5HbQ8bNhwQDMAdKn8KosCcrXF0VR8qDYhJuJx3Nf2KLawiSYrLCVsR2JraXIzKSAQt5\r\nZwvuMEJHoDjS5mJcM2V7aXob1P0AKblbomwSPdx2kelqiw9yTfZZz2L5Ebz+cz9alJ+rj0Q4eil1\r\nCpEjwF57VZ+Wlw5m93lNhySdvhf/2Q==\r\n",
104 | "other": "0",
105 | "bing_did": "20200915"
106 | }
107 | ```
108 |
109 | | 字段 | 值 | 备注 |
110 | | :-----------------: | :-----------------------: | :------------------------------: |
111 | | bing_id | ID | |
112 | | bing_title | 图片标题 | |
113 | | bing_imgurl | 1920×1080 图片地址 | |
114 | | bing_imgurlcom_25 | 480×270 图片地址 | |
115 | | bing_imgurluhd | UHD超高清 图片地址 | 注意:分辨率不固定、无又拍云加速 |
116 | | bing_imgname | 图片文件原始名字 | 注意:与又拍云中的文件名不一致 |
117 | | bing_hsh | 哈希值 | |
118 | | submission_date | 提交保存时间 | |
119 | | submission_fulldate | 详细提交保存时间 | |
120 | | bing_imgbase64 | 16px×9px 缩略图base64编码 | 一般用于图片渐进加载 |
121 | | other | 保留字段 | |
122 | | bing_did | 唯一图片ID | 格式为保存日期 |
123 |
124 |
125 |
126 | ##### 3.2 接口DEMO
127 |
128 | ```
129 | https://bing.nxingcloud.co/api
130 | ```
131 |
132 | 此接口为[小马奔腾](https://blog.mcloc.cn/)免费提供,支持最新的特性(可能含有Beta版功能),请合理使用。
133 |
134 |
135 |
136 | ### 4.部署
137 |
138 | #### 4.1 后端部署
139 |
140 | ##### 4.1.1 准备工作
141 |
142 | 在开始之前,请确保您具备以下必要条件:
143 |
144 | 1. 又拍云存储库
145 |
146 | 2. MySQL数据库
147 |
148 | 3. PHP运行环境
149 |
150 | 4. 在又拍云中创建图片处理服务
151 |
152 | 在您的又拍云存储库-图片处理-创建缩略图版本中创建版本名称分别为bing1和bing25的自定义图片处理服务,其中:
153 |
154 | - bing1:缩略方式选择限定宽度,高度自适应,限定尺寸为16px,图片质量为100%,其它不变。
155 |
156 | - bing25:缩略方式选择限定宽度,高度自适应,限定尺寸为480px,图片质量为100%,其它不变。
157 |
158 | 如图所示:
159 |
160 | 
161 |
162 |
163 |
164 | ##### 4.1.2 目录结构
165 |
166 | 若要在服务器上同时部署前后端,您的目录结构看起来应该是下面这样:
167 |
168 | (若只需要后端接口,则只部署 `api` 下的文件即可)
169 |
170 | ├── api
171 | │ ├── php
172 | │ │ ├── bing // 图片缓存文件夹
173 | │ │ ├── config.php // 配置文件
174 | │ │ └── index.php // 后台图片处理程序
175 | │ └── index.php // 图片调用接口
176 | ├── css
177 | │ ├── detail.css // 详情页样式表
178 | │ ├── index.css // 首页样式表
179 | │ └── main.css // 主样式表
180 | ├── html
181 | │ └── detail.html // 详情页
182 | ├── js
183 | │ ├── detail.js // 详情页js
184 | │ ├── index.js // 首页js
185 | │ └── main.js // 主js
186 | ├── lib //第三方库
187 | │ ├── layer
188 | │ ├── Valine.min.js
189 | │ ├── bootstrap.min.css.map
190 | │ ├── bootstrap.min.css
191 | │ ├── bootstrap.min.js.map
192 | │ ├── bootstrap.min.js
193 | │ ├── jquery-1.11.0.js
194 | │ ├── progressive-image.css
195 | │ └── progressive-image.js
196 | ├── static //静态资源
197 | │ └── upyun_logo5.png
198 | └── index.html // 首页
199 |
200 |
201 | ##### 4.1.3 配置信息
202 |
203 | 在 `api/php/config.php` 中修改:
204 |
205 | ```php
206 | //又拍云连接信息
207 | $config['bucketName'] = '********'; //你的又拍云存储库
208 | $config['operatorName'] = '********'; //你的存储库操作员
209 | $config['operatorPwd'] = '********'; //你的存储库操作员密码
210 | $config['domainName'] = '********'; //又拍云加速域名。注:结尾的 / 不能省略。如:'https://upyun.yourdom.com/'
211 |
212 | //数据库信息
213 | $config['mysqlHost'] = '********'; //MySQL数据库主机名
214 | $config['mysqlUsername'] = '********'; //MySQL数据库用户名
215 | $config['mysqlPassword'] = '********'; //MySQL数据库密码
216 | $config['mysqlDbname'] = '********'; //MySQL数据库名
217 | ```
218 |
219 |
220 |
221 | ##### 4.1.4 部署文件到服务器
222 |
223 | 部署至可访问目录即可。
224 |
225 | 注意:`/api/php/bing`文件夹需要有写入权限。
226 |
227 |
228 |
229 | ##### 4.1.5 设置定时任务(重要)
230 |
231 | 本程序不会常驻后台,需要定时访问后台图片处理程序所在URL以触发程序执行(每天访问一次)。
232 |
233 | 定时任务访问URL: `网站根目录/api/php/index.php` 或 `网站根目录/api/php`
234 |
235 | 接口调用URL: `网站根目录/api/index.php` 或 `网站根目录/api`
236 |
237 | 为避免时间误差引起的问题,建议**不要**将定时任务设置在每天的 00:00:00 ,推荐将定时任务设置在每日 **00:01:00** ,若如此做,则在完成以上步骤后,不需要额外设置。否则请参照以下规则:
238 |
239 | `api/php/config.php` 中的`$config['delay']`为延时时间,如 `$config['delay'] = 90;` 即调用80s前的图片。这也就意味着,您在每天零点的90s后,才能收到当天最新的图片。在每天的 00:00:00 至 00:01:30 之间,您调用此接口返回的仍然是前一天的图片。
240 |
241 | 注意:此延时时间需比定时任务中访问URL的时间大30s左右(和网络情况有关),否则会长时间返回前一天的图片(太大)或出现404错误(太小)。
242 |
243 |
244 |
245 | #### 4.2 前端部署
246 |
247 | ##### 4.2.1准备工作
248 |
249 | Bing-upyun 的前端可以纯静态部署。
250 |
251 | 为了提升您的访问速度,建议为前端页面部署CDN加速。
252 |
253 | CDN建议的缓存设置如下:
254 |
255 | 缓存7天:
256 |
257 | ```
258 | /*.(htm,html,js,css,png,svg,ico,ttf,otf,woff,woff2,eot,sfnt)
259 | ```
260 |
261 | 不缓存:
262 |
263 | ```
264 | /*.(php,json)
265 | ```
266 |
267 |
268 |
269 | ##### 4.2.2 目录结构
270 |
271 | 目录结构在 4.1.2 中已说明。
272 |
273 |
274 |
275 | ##### 4.2.3 配置
276 |
277 | ###### 4.2.3.1 评论系统
278 |
279 | 请在 `detail.js` 中修改评论系统 Valine 的信息:
280 |
281 | 参考 [Valine 官方文档](https://valine.js.org/)
282 |
283 | ```
284 | appId: '********'
285 | appKey: '********'
286 | ```
287 |
288 |
289 |
290 | ###### 4.2.3.2 域名
291 |
292 | 为了最快的响应速度,Bing-upyun 的前端页面为纯静态,请查找并替换以下文件中的域名:
293 |
294 | ```
295 | index.html
296 | html/detail.html
297 | js/detail.js
298 | js/index.js
299 | js/main.js
300 | ```
301 |
302 | 替换方法:
303 |
304 | 1. 全局搜索替换,将 `https://bing.nxingcloud.co/` 替换为您部署的域名。
305 | 2. 将 `js/main.js` 中的 `https://upyuns.mcloc.cn/` 替换为您的又拍云存储加速域名。
306 |
--------------------------------------------------------------------------------
/api/index.php:
--------------------------------------------------------------------------------
1 | connect_error) {
28 | die("数据库连接失败: " . $conn2->connect_error);
29 | } else {
30 | echo "数据库连接成功
";
31 | }
32 |
33 | //检测数据库/表是否存在---创建数据库/表
34 | // $sql1 = "CREATE DATABASE IF NOT EXISTS $mysqlDbname DEFAULT CHARSET utf8 COLLATE utf8_general_ci";
35 | $sql2 = "CREATE TABLE IF NOT EXISTS `bing_tbl`(
36 | `bing_id` INT UNSIGNED AUTO_INCREMENT,
37 | `bing_title` VARCHAR(1000),
38 | `bing_imgurl` VARCHAR(500),
39 | `bing_imgurlcom_25` VARCHAR(500),
40 | `bing_imgurluhd` VARCHAR(500),
41 | `bing_imgname` VARCHAR(500),
42 | `bing_hsh` VARCHAR(500),
43 | `submission_date` VARCHAR(500),
44 | `submission_fulldate` VARCHAR(500),
45 | `bing_imgbase64` VARCHAR(10000),
46 | `other` VARCHAR(1000),
47 | `bing_did` INT,
48 | PRIMARY KEY ( `bing_id` )
49 | )ENGINE=InnoDB DEFAULT CHARSET=utf8;";
50 | // $retval1 = mysqli_query($conn1, $sql1);
51 | // mysqli_close($conn1);
52 | if ($conn2->query($sql2) === TRUE) {
53 | echo "数据表 bing_tbl 连接成功
";
54 | } else {
55 | echo "创建数据表错误: " . $conn2->error;
56 | }
57 | //数据库准备完成
58 |
59 | //获取图片链接
60 | $json_content = file_get_contents('https://cn.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=zh-CN');
61 | $json_content = json_decode($json_content, true);
62 | $imgurl = 'https://cn.bing.com' . $json_content['images'][0]['url'];
63 |
64 | //获取其他信息
65 | $bingTitle = $json_content["images"][0]["copyright"];
66 | $bingImageName = $json_content["images"][0]["urlbase"];
67 | $bingImageName = preg_replace("/^\/th\?id=OHR\./", "", $bingImageName);
68 | $bingHsh = $json_content["images"][0]["hsh"];
69 | $bingDid = $json_content["images"][0]["enddate"];
70 |
71 | //获取当前时间
72 | $dateToday = gmdate('d-M-Y', time() + 3600 * 8);
73 | $dateTodayFull = gmdate('d-M-Y H:i:s', time() + 3600 * 8);
74 |
75 | //如果不存在则创建缓存文件夹
76 | if (!is_dir("bing")) {
77 | mkdir("bing", 0755, true);
78 | }
79 |
80 | /*
81 | * 图片转换为 base64格式编码 函数
82 | * image_file:本地图片
83 | */
84 | function base64EncodeImage($image_file)
85 | {
86 | $base64_image = '';
87 | $image_info = getimagesize($image_file);
88 | $image_data = fread(fopen($image_file, 'r'), filesize($image_file));
89 | $base64_image = 'data:' . $image_info['mime'] . ';base64,' . chunk_split(base64_encode($image_data));
90 | // $base64_image = chunk_split(base64_encode($image_data));
91 | return $base64_image;
92 | }
93 |
94 |
95 | //保存图片函数
96 | function saveImage($image_name, $url_path)
97 | {
98 | ob_start();
99 | readfile($url_path);
100 | $img = ob_get_contents();
101 | ob_end_clean();
102 | //$image_name就是要保存到什么路径,默认只写文件名的话保存到根目录
103 | $fp = fopen($image_name, 'w'); //保存的文件名称用的是链接里面的名称
104 | fwrite($fp, $img);
105 | fclose($fp);
106 | }
107 |
108 | //保存原始图片到本地
109 | $image_path_1 = 'bing/' . $dateToday . '.jpg';
110 | saveImage($image_path_1, $imgurl);
111 |
112 | //上传图片到又拍云函数
113 | function upImage($bucketName, $operatorName, $operatorPwd, $localFilePath, $upFilePath)
114 | {
115 | $filePath = $localFilePath;
116 | $fileSize = filesize($filePath);
117 | //文件上传到服务器的服务端路径 修改文件名为日期
118 | $serverPath = $upFilePath;
119 | $uri = "/$bucketName/$serverPath";
120 |
121 | //生成签名时间。得到的日期格式如:Thu, 11 Jul 2014 05:34:12 GMT
122 | $date = gmdate('D, d M Y H:i:s \G\M\T');
123 | $sign = md5("PUT&{$uri}&{$date}&{$fileSize}&" . md5($operatorPwd));
124 |
125 | $ch = curl_init('https://v0.api.upyun.com' . $uri);
126 |
127 | $headers = array(
128 | "Expect:",
129 | "Date: " . $date, // header 中需要使用生成签名的时间
130 | "Authorization: UpYun $operatorName:" . $sign
131 | );
132 | curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
133 | curl_setopt($ch, CURLOPT_PUT, true);
134 |
135 | $fh = fopen($filePath, 'rb');
136 | curl_setopt($ch, CURLOPT_INFILE, $fh);
137 | curl_setopt($ch, CURLOPT_INFILESIZE, $fileSize);
138 | curl_setopt($ch, CURLOPT_TIMEOUT, 60);
139 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
140 |
141 | $result = curl_exec($ch);
142 | if (curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200) {
143 | //"上传成功"
144 | } else {
145 | $errorMessage = sprintf("UPYUN API ERROR:%s", $result);
146 | echo $errorMessage;
147 | }
148 | curl_close($ch);
149 | }
150 |
151 | //上传原始图片
152 | $localFilePath = $image_path_1; //被上传的文件路径
153 | $upFilePath = 'bing/' . $dateToday . '/' . $dateToday . '.jpg'; //文件上传到服务器的服务端路径 修改文件名为日期
154 | upImage($bucketName, $operatorName, $operatorPwd, $localFilePath, $upFilePath);
155 |
156 | //删除本地缓存文件
157 | unlink($image_path_1);
158 |
159 | //保存图片到本地gaussblur-5
160 | $image_path_gaussblur_5 = 'bing/' . $dateToday . '-gaussblur-5' . '.jpg';
161 | $imgurl_gaussblur_5 = $cdnDom . $upFilePath . '!/gaussblur/0x5';
162 | saveImage($image_path_gaussblur_5, $imgurl_gaussblur_5);
163 |
164 | //保存图片到本地gaussblur-15
165 | $image_path_gaussblur_15 = 'bing/' . $dateToday . '-gaussblur-15' . '.jpg';
166 | $imgurl_gaussblur_15 = $cdnDom . $upFilePath . '!/gaussblur/0x15';
167 | saveImage($image_path_gaussblur_15, $imgurl_gaussblur_15);
168 |
169 | //保存图片到本地gaussblur-25
170 | $image_path_gaussblur_25 = 'bing/' . $dateToday . '-gaussblur-25' . '.jpg';
171 | $imgurl_gaussblur_25 = $cdnDom . $upFilePath . '!/gaussblur/0x25';
172 | saveImage($image_path_gaussblur_25, $imgurl_gaussblur_25);
173 |
174 | //保存图片到本地gray
175 | $image_path_gray = 'bing/' . $dateToday . '-gray' . '.jpg';
176 | $imgurl_gray = $cdnDom . $upFilePath . '!/gray/true';
177 | saveImage($image_path_gray, $imgurl_gray);
178 |
179 | //保存图片到本地compress_25
180 | $image_path_compress_25 = 'bing/' . $dateToday . '-compress_25' . '.jpg';
181 | $imgurl_compress_25 = $cdnDom . $upFilePath . '!bing25';
182 | saveImage($image_path_compress_25, $imgurl_compress_25);
183 |
184 | //保存图片到本地compress_1
185 | $image_path_compress_1 = 'bing/' . $dateToday . '-compress_1' . '.jpg';
186 | $imgurl_compress_1 = $cdnDom . $upFilePath . '!bing1';
187 | saveImage($image_path_compress_1, $imgurl_compress_1);
188 |
189 | //上传图片gaussblur-5
190 | $localFilePath_gaussblur_5 = $image_path_gaussblur_5;
191 | $upFilePath_gaussblur_5 = 'bing/' . $dateToday . '/' . $dateToday . '-gaussblur-5' . '.jpg';
192 | upImage($bucketName, $operatorName, $operatorPwd, $localFilePath_gaussblur_5, $upFilePath_gaussblur_5);
193 |
194 | //上传图片gaussblur-15
195 | $localFilePath_gaussblur_15 = $image_path_gaussblur_15;
196 | $upFilePath_gaussblur_15 = 'bing/' . $dateToday . '/' . $dateToday . '-gaussblur-15' . '.jpg';
197 | upImage($bucketName, $operatorName, $operatorPwd, $localFilePath_gaussblur_15, $upFilePath_gaussblur_15);
198 |
199 | //上传图片gaussblur-25
200 | $localFilePath_gaussblur_25 = $image_path_gaussblur_25;
201 | $upFilePath_gaussblur_25 = 'bing/' . $dateToday . '/' . $dateToday . '-gaussblur-25' . '.jpg';
202 | upImage($bucketName, $operatorName, $operatorPwd, $localFilePath_gaussblur_25, $upFilePath_gaussblur_25);
203 |
204 | //上传图片gray
205 | $localFilePath_gray = $image_path_gray;
206 | $upFilePath_gray = 'bing/' . $dateToday . '/' . $dateToday . '-gray' . '.jpg';
207 | upImage($bucketName, $operatorName, $operatorPwd, $localFilePath_gray, $upFilePath_gray);
208 |
209 | //上传图片compress_25
210 | $localFilePath_compress_25 = $image_path_compress_25;
211 | $upFilePath_compress_25 = 'bing/' . $dateToday . '/' . $dateToday . '-compress_25' . '.jpg';
212 | upImage($bucketName, $operatorName, $operatorPwd, $localFilePath_compress_25, $upFilePath_compress_25);
213 |
214 | //上传图片compress_1
215 | $localFilePath_compress_1 = $image_path_compress_1;
216 | $upFilePath_compress_1 = 'bing/' . $dateToday . '/' . $dateToday . '-compress_1' . '.jpg';
217 | upImage($bucketName, $operatorName, $operatorPwd, $localFilePath_compress_1, $upFilePath_compress_1);
218 |
219 | //删除本地缓存文件gaussblur-5
220 | unlink($image_path_gaussblur_5);
221 |
222 | //删除本地缓存文件gaussblur-15
223 | unlink($image_path_gaussblur_15);
224 |
225 | //删除本地缓存文件gaussblur-25
226 | unlink($image_path_gaussblur_25);
227 |
228 | //删除本地缓存文件gray
229 | unlink($image_path_gray);
230 |
231 | //删除本地缓存文件compress_25
232 | unlink($image_path_compress_25);
233 |
234 | //缩略图_1 base64编码
235 | $imgBase64 = base64EncodeImage($image_path_compress_1);
236 |
237 | //删除本地缓存文件compress_1
238 | unlink($image_path_compress_1);
239 |
240 | //服务器端图片完整路径
241 | $bingImgUrl = $cdnDom . $upFilePath;
242 |
243 | //超高清图片路径
244 | $bingImgUrlUhd = "https://cn.bing.com/th?id=OHR." . $bingImageName . "_UHD.jpg";
245 |
246 | //缩略图_25图片路径
247 | $bingImgUrlCom25 = $cdnDom . $upFilePath_compress_25;
248 |
249 | //存入数据库
250 | //检查数据是否存在
251 | $sql3 = "SELECT * FROM bing_tbl WHERE bing_did='$bingDid'";
252 | $result3 = $conn2->query($sql3);
253 | if ($result3->num_rows > 0) {
254 | //更新数据
255 | $sql5 = "UPDATE bing_tbl SET bing_title='$bingTitle', bing_imgurl='$bingImgUrl', bing_imgurlcom_25='$bingImgUrlCom25', bing_imgurluhd='$bingImgUrlUhd', bing_imgname='$bingImageName', bing_hsh='$bingHsh', submission_date='$dateToday', submission_fulldate='$dateTodayFull', bing_imgbase64='$imgBase64', other='0', bing_did='$bingDid'
256 | WHERE bing_did=$bingDid";
257 | if ($conn2->query($sql5) === TRUE) {
258 | echo "记录更新成功";
259 | } else {
260 | echo "Error: " . $sql5 . "
" . $conn2->error;
261 | }
262 | } else {
263 | //插入数据
264 | $sql4 = "INSERT INTO bing_tbl " .
265 | "(bing_title, bing_imgurl, bing_imgurlcom_25, bing_imgurluhd, bing_imgname, bing_hsh, submission_date, submission_fulldate, bing_imgbase64, other, bing_did) " .
266 | "VALUES " .
267 | "('$bingTitle','$bingImgUrl','$bingImgUrlCom25','$bingImgUrlUhd','$bingImageName','$bingHsh','$dateToday','$dateTodayFull','$imgBase64','0','$bingDid')";
268 | if ($conn2->query($sql4) === TRUE) {
269 | echo "新记录插入成功";
270 | } else {
271 | echo "Error: " . $sql4 . "
" . $conn2->error;
272 | }
273 | }
274 |
--------------------------------------------------------------------------------
/css/detail.css:
--------------------------------------------------------------------------------
1 | .bigimg{margin-top:0.8rem}.detail-download{text-align:right}.detail-download .alert{text-align:center}#vcomments{margin-top:10rem}.modal-body p{padding:1rem 0;margin-bottom:-1rem}.bigimg-text{padding:2rem 0}
2 |
3 | /*# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGV0YWlsLmNzcyIsInNvdXJjZXMiOlsiZGV0YWlsLnNjc3MiXSwic291cmNlc0NvbnRlbnQiOlsiLmJpZ2ltZyB7XHJcbiAgICBtYXJnaW4tdG9wOiAwLjhyZW07XHJcbn1cclxuXHJcbi5kZXRhaWwtZG93bmxvYWQge1xyXG4gICAgdGV4dC1hbGlnbjogcmlnaHQ7XHJcblxyXG4gICAgLmFsZXJ0IHtcclxuICAgICAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XHJcbiAgICB9XHJcbn1cclxuXHJcbiN2Y29tbWVudHMge1xyXG4gICAgbWFyZ2luLXRvcDogMTByZW07XHJcbn1cclxuXHJcbi5tb2RhbC1ib2R5IHtcclxuXHJcbiAgICBwIHtcclxuICAgICAgICBwYWRkaW5nOiAxcmVtIDA7XHJcbiAgICAgICAgbWFyZ2luLWJvdHRvbTogLTFyZW07XHJcbiAgICB9XHJcbn1cclxuXHJcbi5iaWdpbWctdGV4dCB7XHJcbiAgICBwYWRkaW5nOiAycmVtIDA7XHJcbn0iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsQUFBQSxPQUFPLEFBQUMsQ0FDSixVQUFVLENBQUUsTUFBTSxDQUNyQixBQUVELEFBQUEsZ0JBQWdCLEFBQUMsQ0FDYixVQUFVLENBQUUsS0FBSyxDQUtwQixBQU5ELEFBR0ksZ0JBSFksQ0FHWixNQUFNLEFBQUMsQ0FDSCxVQUFVLENBQUUsTUFBTSxDQUNyQixBQUdMLEFBQUEsVUFBVSxBQUFDLENBQ1AsVUFBVSxDQUFFLEtBQUssQ0FDcEIsQUFFRCxBQUVJLFdBRk8sQ0FFUCxDQUFDLEFBQUMsQ0FDRSxPQUFPLENBQUUsTUFBTSxDQUNmLGFBQWEsQ0FBRSxLQUFLLENBQ3ZCLEFBR0wsQUFBQSxZQUFZLEFBQUMsQ0FDVCxPQUFPLENBQUUsTUFBTSxDQUNsQiJ9 */
4 |
--------------------------------------------------------------------------------
/css/index.css:
--------------------------------------------------------------------------------
1 | #pic-list{margin-top:0rem}#carouselExampleCaptions{margin-top:0.8rem}#pic-tit{margin-top:5rem}#pic-tit h4 span{font-size:small}.pic-item{padding:1rem;padding-bottom:0;width:22rem;margin:0 auto}#pic-js p span{margin:0 0 0.6rem 0}
2 |
3 | /*# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguY3NzIiwic291cmNlcyI6WyJpbmRleC5zY3NzIl0sInNvdXJjZXNDb250ZW50IjpbIiNwaWMtbGlzdCB7XHJcbiAgICBtYXJnaW4tdG9wOiAwcmVtO1xyXG59XHJcblxyXG4jY2Fyb3VzZWxFeGFtcGxlQ2FwdGlvbnMge1xyXG4gICAgbWFyZ2luLXRvcDogMC44cmVtO1xyXG59XHJcblxyXG4jcGljLXRpdCB7XHJcbiAgICBtYXJnaW4tdG9wOiA1cmVtO1xyXG5cclxuICAgIGg0IHtcclxuXHJcbiAgICAgICAgc3BhbntcclxuICAgICAgICAgICAgZm9udC1zaXplOiBzbWFsbDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuXHJcbi5waWMtaXRlbSB7XHJcbiAgICBwYWRkaW5nOiAxcmVtO1xyXG4gICAgcGFkZGluZy1ib3R0b206IDA7XHJcbiAgICB3aWR0aDogMjJyZW07XHJcbiAgICBtYXJnaW46IDAgYXV0bztcclxufVxyXG5cclxuI3BpYy1qcyB7XHJcblxyXG4gICAgcCB7XHJcblxyXG4gICAgICAgIHNwYW4ge1xyXG4gICAgICAgICAgICBtYXJnaW46IDAgMCAwLjZyZW0gMDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn0iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsQUFBQSxTQUFTLEFBQUMsQ0FDTixVQUFVLENBQUUsSUFBSSxDQUNuQixBQUVELEFBQUEsd0JBQXdCLEFBQUMsQ0FDckIsVUFBVSxDQUFFLE1BQU0sQ0FDckIsQUFFRCxBQUFBLFFBQVEsQUFBQyxDQUNMLFVBQVUsQ0FBRSxJQUFJLENBUW5CLEFBVEQsQUFLUSxRQUxBLENBR0osRUFBRSxDQUVFLElBQUksQUFBQSxDQUNBLFNBQVMsQ0FBRSxLQUFLLENBQ25CLEFBSVQsQUFBQSxTQUFTLEFBQUMsQ0FDTixPQUFPLENBQUUsSUFBSSxDQUNiLGNBQWMsQ0FBRSxDQUFDLENBQ2pCLEtBQUssQ0FBRSxLQUFLLENBQ1osTUFBTSxDQUFFLE1BQU0sQ0FDakIsQUFFRCxBQUlRLE9BSkQsQ0FFSCxDQUFDLENBRUcsSUFBSSxBQUFDLENBQ0QsTUFBTSxDQUFFLFlBQVksQ0FDdkIifQ== */
4 |
--------------------------------------------------------------------------------
/css/main.css:
--------------------------------------------------------------------------------
1 | #header-icon{font-size:32px}#header-text{line-height:58px}footer{min-height:20rem;margin-top:5rem;background:#f8f9fa;overflow:hidden}footer>div>div{margin:2rem 0 0 0}footer #foottext{line-height:30px;font-size:13px}footer #foottext img{height:12px}.links a{color:#fff}
2 |
3 | /*# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5jc3MiLCJzb3VyY2VzIjpbIm1haW4uc2NzcyJdLCJzb3VyY2VzQ29udGVudCI6WyIjaGVhZGVyLWljb24ge1xyXG4gICAgZm9udC1zaXplOiAzMnB4O1xyXG4gICAgLy8gdmVydGljYWwtYWxpZ246IGJvdHRvbTtcclxufVxyXG5cclxuI2hlYWRlci10ZXh0IHtcclxuICAgIGxpbmUtaGVpZ2h0OiA1OHB4O1xyXG4gICAgLy8gdmVydGljYWwtYWxpZ246IG1pZGRsZTtcclxufVxyXG5cclxuZm9vdGVyIHtcclxuICAgIG1pbi1oZWlnaHQ6IDIwcmVtO1xyXG4gICAgbWFyZ2luLXRvcDogNXJlbTtcclxuICAgIGJhY2tncm91bmQ6IHJnYigyNDgsIDI0OSwgMjUwKTtcclxuICAgIG92ZXJmbG93OiBoaWRkZW47XHJcblxyXG4gICAgJj5kaXYge1xyXG5cclxuICAgICAgICAmPmRpdiB7XHJcbiAgICAgICAgICAgIG1hcmdpbjogMnJlbSAwIDAgMDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgI2Zvb3R0ZXh0IHtcclxuICAgICAgICBsaW5lLWhlaWdodDogMzBweDtcclxuICAgICAgICBmb250LXNpemU6IDEzcHg7XHJcblxyXG4gICAgICAgIGltZyB7XHJcbiAgICAgICAgICAgIGhlaWdodDogMTJweDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuXHJcbi5saW5rcyB7XHJcblxyXG4gICAgYSB7XHJcblxyXG4gICAgICAgIGNvbG9yOiAjZmZmO1xyXG4gICAgfVxyXG59Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLEFBQUEsWUFBWSxBQUFDLENBQ1QsU0FBUyxDQUFFLElBQUksQ0FFbEIsQUFFRCxBQUFBLFlBQVksQUFBQyxDQUNULFdBQVcsQ0FBRSxJQUFJLENBRXBCLEFBRUQsQUFBQSxNQUFNLEFBQUMsQ0FDSCxVQUFVLENBQUUsS0FBSyxDQUNqQixVQUFVLENBQUUsSUFBSSxDQUNoQixVQUFVLENBQUUsT0FBa0IsQ0FDOUIsUUFBUSxDQUFFLE1BQU0sQ0FpQm5CLEFBckJELEFBUVEsTUFSRixDQU1BLEdBQUcsQ0FFQyxHQUFHLEFBQUMsQ0FDRixNQUFNLENBQUUsVUFBVSxDQUNyQixBQVZULEFBYUksTUFiRSxDQWFGLFNBQVMsQUFBQyxDQUNOLFdBQVcsQ0FBRSxJQUFJLENBQ2pCLFNBQVMsQ0FBRSxJQUFJLENBS2xCLEFBcEJMLEFBaUJRLE1BakJGLENBYUYsU0FBUyxDQUlMLEdBQUcsQUFBQyxDQUNBLE1BQU0sQ0FBRSxJQUFJLENBQ2YsQUFJVCxBQUVJLE1BRkUsQ0FFRixDQUFDLEFBQUMsQ0FFRSxLQUFLLENBQUUsSUFBSSxDQUNkIn0= */
4 |
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | const gulp = require("gulp");
2 | const connect = require("gulp-connect");
3 | const sass = require("gulp-sass");
4 | const sourcemaps = require("gulp-sourcemaps");
5 | const plumber = require("gulp-plumber");
6 | const babel = require('gulp-babel');
7 | const uglify = require('gulp-uglify');
8 |
9 | gulp.task("html", done => {
10 | gulp.src("src/*.html")
11 | .pipe(gulp.dest("dist"))
12 | .pipe(connect.reload());
13 | done();
14 | });
15 |
16 | gulp.task("html2", done => {
17 | gulp.src("src/html/*.html")
18 | .pipe(gulp.dest("dist/html"))
19 | .pipe(connect.reload());
20 | done();
21 | });
22 |
23 | gulp.task("sass", done => {
24 | gulp.src("src/sass/*.scss")
25 | .pipe(sourcemaps.init())
26 | .pipe(plumber())
27 | .pipe(sass({
28 | "outputStyle": "compressed"
29 | }))
30 | .pipe(sourcemaps.write())
31 | .pipe(gulp.dest("dist/css"))
32 | .pipe(connect.reload());
33 | done();
34 | });
35 |
36 | gulp.task("js", done => {
37 | gulp.src("src/js/*.js")
38 | .pipe(sourcemaps.init())
39 | .pipe(plumber())
40 | .pipe(babel({
41 | presets: ['es2015']
42 | }))
43 | .pipe(uglify())
44 | .pipe(gulp.dest("dist/js"))
45 | .pipe(connect.reload());
46 | done()
47 | })
48 |
49 | gulp.task("static", done => {
50 | gulp.src("src/static/*.*")
51 | .pipe(gulp.dest("dist/static"))
52 | .pipe(connect.reload());
53 | done();
54 | });
55 |
56 | gulp.task("lib", done => {
57 | gulp.src("src/lib/*.*")
58 | .pipe(gulp.dest("dist/lib"))
59 | .pipe(connect.reload());
60 | done();
61 | });
62 |
63 | gulp.task("server", done => {
64 |
65 | connect.server({
66 | root: "dist",
67 | livereload: true
68 | })
69 |
70 | done();
71 | });
72 |
73 | gulp.task("watch", done => {
74 |
75 | gulp.watch("src/*.html", gulp.series("html"));
76 | gulp.watch("src/html/*.html", gulp.series("html2"));
77 | gulp.watch("src/sass/*.scss", gulp.series("sass"));
78 | gulp.watch("src/js/*.js", gulp.series("js"));
79 | gulp.watch("src/static/*.*", gulp.series("static"));
80 | gulp.watch("src/lib/*.*", gulp.series("lib"));
81 |
82 | done();
83 | });
84 |
85 | gulp.task("build", gulp.parallel("html", "html2", "sass", "js", "static", "lib"));
86 |
87 | gulp.task("default", gulp.series("build", "watch", "server"));
--------------------------------------------------------------------------------
/html/detail.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 带您领略世界之美
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
71 |
72 |
73 |
74 |
79 |
...
80 |
81 |
82 |
83 | 本站所有图片均来自Bing搜索官网,版权归图片创作者所有。尊重版权,请勿商用!
84 |
85 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
96 |
97 |
98 |
104 |
105 |
106 |
107 |
108 |
注:HD为又拍云加速(极速下载),UHD为直链(慢速)。手机端请长按上方图片保存
109 |
110 |
111 |
118 |
119 |
120 |
121 |
122 |
123 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
--------------------------------------------------------------------------------
/img/screenshot-bing.mcloc.cn-2020.09.09-18_59_14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androidmumo/Bing-upyun/72f024458570ce1edf6487b4ca6ef2540d47449a/img/screenshot-bing.mcloc.cn-2020.09.09-18_59_14.jpg
--------------------------------------------------------------------------------
/img/screenshot-bing.mcloc.cn-2020.09.09-20_19_38.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androidmumo/Bing-upyun/72f024458570ce1edf6487b4ca6ef2540d47449a/img/screenshot-bing.mcloc.cn-2020.09.09-20_19_38.jpg
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 必应每日一图 - 领略世界之美
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 必应每日一图
19 |
23 |
24 |
25 |
30 |
31 |
32 |
36 |
37 | 离下次图片更新还有
38 | :
39 | :
40 |
41 |
42 |
43 |
44 |
45 |
50 |
51 |
52 |
81 |
82 |
86 |
87 |
88 |
89 |
90 |
131 |
132 |
133 |
134 |
往日图片 HD
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |

145 |
146 |
147 |
148 |
149 |
150 |

152 |
153 |
154 |
155 |
156 |
157 |

159 |
160 |
161 |
162 |
163 |
164 |

166 |
167 |
168 |
169 |
170 |
171 |

173 |
174 |
175 |
176 |
177 |
178 |

180 |
181 |
182 |
183 |
184 |
185 |

187 |
188 |
189 |
190 |
191 |
192 |

194 |
195 |
196 |
197 |
198 |
199 |

201 |
202 |
203 |
204 |
205 |
206 |

208 |
209 |
210 |
211 |
212 |
213 |

216 |
217 |
218 |
219 |
220 |
221 |

224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
292 |
293 |
294 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
--------------------------------------------------------------------------------
/js/detail.js:
--------------------------------------------------------------------------------
1 | "use strict";var daydata=getUrlParam("daydata"),bigImgStr='\n
\n';function getImgMsg(a){var e="";return $.ajax({type:"GET",async:!1,url:"https://bing.nxingcloud.co/api/",data:"type=json&day="+a,success:function(a){e=$.parseJSON(a)}}),e}$("#bigimg-wrap").children(".progressive").empty().append(bigImgStr),imgpro("#bigimg-wrap");var detailMsg=getImgMsg(daydata),imgSubDate=detailMsg.submission_date,imgTit=detailMsg.bing_title,imgUrlHd=detailMsg.bing_imgurl,imgUrlUhd=detailMsg.bing_imgurluhd;$("title").text(imgTit),$(".bigimg-text").empty().append(''+imgSubDate+" "+imgTit),new Valine({el:"#vcomments",appId:"********",appKey:"********",path:""+imgSubDate});var modalImgStr='\n
\n';$(".modal-img-wrap").empty().append(modalImgStr),$("#btnHd").click(function(){var n=new XMLHttpRequest;n.open("GET",imgUrlHd,!0),n.responseType="blob",n.onload=function(a){if(navigator.msSaveBlob){return navigator.msSaveBlob(n.response,"bingHd")}var e=window.URL.createObjectURL(n.response),t=document.createElement("a");t.href=e,t.download=today,t.click()},n.send(),layer.msg("下载已开始")}),$("#btnUhd").click(function(){var n=new XMLHttpRequest;n.open("GET",imgUrlUhd,!0),n.responseType="blob",n.onload=function(a){if(navigator.msSaveBlob){return navigator.msSaveBlob(n.response,"bingUhd")}var e=window.URL.createObjectURL(n.response),t=document.createElement("a");t.href=e,t.download=today,t.click()},n.send(),layer.msg("下载已开始")});
--------------------------------------------------------------------------------
/js/index.js:
--------------------------------------------------------------------------------
1 | "use strict";$("#pic-js").on("click",".pic-item",function(){window.location.href="html/detail.html?daydata="+$(this).attr("data-day")}),imgpro("#carousel-js");for(var i=0;i<12;i++){var ele="#pic-js-son"+i;imgpro(ele)}var dayi=0;function getText1(){$.ajax({type:"GET",async:!0,url:"https://bing.nxingcloud.co/api/",data:"type=json&day="+dayi,success:function(a){var e=$.parseJSON(a).bing_title,t="\n "+e.replace(/\([^\)]*\)/g,"").replace(/\s*$/g,"")+"
\n "+e+"
\n ";$(".carousel-caption").eq(dayi).empty().append(t),1'+i+"
"+(c=c.replace(/\s*$/g,"")),$("#pic-js").children().eq(dayj).children("p").empty().append(c),100;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?''+(f?r.title[0]:r.title)+"
":"";return r.zIndex=s,t([r.shade?'':"",''+(e&&2!=r.type?"":u)+'
'+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
'+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t
'+r.btn[t]+"";return''+e+"
"}():"")+(r.resize?'':"")+" "],u,i('')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:''+function(){var e=t.length,i=1,a="";if(e>0)for(a='- '+(t[0].content||"no content")+"
";i'+(t[i].content||"no content")+"";return a}()+"
",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]
",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);
--------------------------------------------------------------------------------
/lib/layer/mobile/layer.js:
--------------------------------------------------------------------------------
1 | /*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */
2 | ;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?''+(e?n.title[0]:n.title)+"
":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e=''+n.btn[0]+"",2===t&&(e=''+n.btn[1]+""+e),''+e+"
"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content=''+(n.content||"")+"
"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"':"")+'",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;odiv{line-height:22px;padding-top:7px;margin-bottom:20px;font-size:14px}.layui-m-layerbtn{display:box;display:-moz-box;display:-webkit-box;width:100%;height:50px;line-height:50px;font-size:0;border-top:1px solid #D0D0D0;background-color:#F2F2F2}.layui-m-layerbtn span{display:block;-moz-box-flex:1;box-flex:1;-webkit-box-flex:1;font-size:14px;cursor:pointer}.layui-m-layerbtn span[yes]{color:#40AFFE}.layui-m-layerbtn span[no]{border-right:1px solid #D0D0D0;border-radius:0 0 0 5px}.layui-m-layerbtn span:active{background-color:#F6F6F6}.layui-m-layerend{position:absolute;right:7px;top:10px;width:30px;height:30px;border:0;font-weight:400;background:0 0;cursor:pointer;-webkit-appearance:none;font-size:30px}.layui-m-layerend::after,.layui-m-layerend::before{position:absolute;left:5px;top:15px;content:'';width:18px;height:1px;background-color:#999;transform:rotate(45deg);-webkit-transform:rotate(45deg);border-radius:3px}.layui-m-layerend::after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}body .layui-m-layer .layui-m-layer-footer{position:fixed;width:95%;max-width:100%;margin:0 auto;left:0;right:0;bottom:10px;background:0 0}.layui-m-layer-footer .layui-m-layercont{padding:20px;border-radius:5px 5px 0 0;background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn{display:block;height:auto;background:0 0;border-top:none}.layui-m-layer-footer .layui-m-layerbtn span{background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn span[no]{color:#FD482C;border-top:1px solid #c2c2c2;border-radius:0 0 5px 5px}.layui-m-layer-footer .layui-m-layerbtn span[yes]{margin-top:10px;border-radius:5px}body .layui-m-layer .layui-m-layer-msg{width:auto;max-width:90%;margin:0 auto;bottom:-150px;background-color:rgba(0,0,0,.7);color:#fff}.layui-m-layer-msg .layui-m-layercont{padding:10px 20px}
--------------------------------------------------------------------------------
/lib/layer/theme/default/icon-ext.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androidmumo/Bing-upyun/72f024458570ce1edf6487b4ca6ef2540d47449a/lib/layer/theme/default/icon-ext.png
--------------------------------------------------------------------------------
/lib/layer/theme/default/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androidmumo/Bing-upyun/72f024458570ce1edf6487b4ca6ef2540d47449a/lib/layer/theme/default/icon.png
--------------------------------------------------------------------------------
/lib/layer/theme/default/layer.css:
--------------------------------------------------------------------------------
1 | .layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span,.layui-layer-title{text-overflow:ellipsis;white-space:nowrap}html #layuicss-layer{display:none;position:absolute;width:1989px}.layui-layer,.layui-layer-shade{position:fixed;_position:absolute;pointer-events:auto}.layui-layer-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px")}.layui-layer{-webkit-overflow-scrolling:touch;top:150px;left:0;margin:0;padding:0;background-color:#fff;-webkit-background-clip:content;border-radius:2px;box-shadow:1px 1px 50px rgba(0,0,0,.3)}.layui-layer-close{position:absolute}.layui-layer-content{position:relative}.layui-layer-border{border:1px solid #B2B2B2;border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 5px rgba(0,0,0,.2)}.layui-layer-load{background:url(loading-1.gif) center center no-repeat #eee}.layui-layer-ico{background:url(icon.png) no-repeat}.layui-layer-btn a,.layui-layer-dialog .layui-layer-ico,.layui-layer-setwin a{display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-move{display:none;position:fixed;*position:absolute;left:0;top:0;width:100%;height:100%;cursor:move;opacity:0;filter:alpha(opacity=0);background-color:#fff;z-index:2147483647}.layui-layer-resize{position:absolute;width:15px;height:15px;right:0;bottom:0;cursor:se-resize}.layer-anim{-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.3s;animation-duration:.3s}@-webkit-keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-00{-webkit-animation-name:layer-bounceIn;animation-name:layer-bounceIn}@-webkit-keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-01{-webkit-animation-name:layer-zoomInDown;animation-name:layer-zoomInDown}@-webkit-keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layer-anim-02{-webkit-animation-name:layer-fadeInUpBig;animation-name:layer-fadeInUpBig}@-webkit-keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-03{-webkit-animation-name:layer-zoomInLeft;animation-name:layer-zoomInLeft}@-webkit-keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}@keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);-ms-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}.layer-anim-04{-webkit-animation-name:layer-rollIn;animation-name:layer-rollIn}@keyframes layer-fadeIn{0%{opacity:0}100%{opacity:1}}.layer-anim-05{-webkit-animation-name:layer-fadeIn;animation-name:layer-fadeIn}@-webkit-keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:layer-shake;animation-name:layer-shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layui-layer-title{padding:0 80px 0 20px;height:42px;line-height:42px;border-bottom:1px solid #eee;font-size:14px;color:#333;overflow:hidden;background-color:#F8F8F8;border-radius:2px 2px 0 0}.layui-layer-setwin{position:absolute;right:15px;*right:0;top:15px;font-size:0;line-height:initial}.layui-layer-setwin a{position:relative;width:16px;height:16px;margin-left:10px;font-size:12px;_overflow:hidden}.layui-layer-setwin .layui-layer-min cite{position:absolute;width:14px;height:2px;left:0;top:50%;margin-top:-1px;background-color:#2E2D3C;cursor:pointer;_overflow:hidden}.layui-layer-setwin .layui-layer-min:hover cite{background-color:#2D93CA}.layui-layer-setwin .layui-layer-max{background-position:-32px -40px}.layui-layer-setwin .layui-layer-max:hover{background-position:-16px -40px}.layui-layer-setwin .layui-layer-maxmin{background-position:-65px -40px}.layui-layer-setwin .layui-layer-maxmin:hover{background-position:-49px -40px}.layui-layer-setwin .layui-layer-close1{background-position:1px -40px;cursor:pointer}.layui-layer-setwin .layui-layer-close1:hover{opacity:.7}.layui-layer-setwin .layui-layer-close2{position:absolute;right:-28px;top:-28px;width:30px;height:30px;margin-left:0;background-position:-149px -31px;*right:-18px;_display:none}.layui-layer-setwin .layui-layer-close2:hover{background-position:-180px -31px}.layui-layer-btn{text-align:right;padding:0 15px 12px;pointer-events:auto;user-select:none;-webkit-user-select:none}.layui-layer-btn a{height:28px;line-height:28px;margin:5px 5px 0;padding:0 15px;border:1px solid #dedede;background-color:#fff;color:#333;border-radius:2px;font-weight:400;cursor:pointer;text-decoration:none}.layui-layer-btn a:hover{opacity:.9;text-decoration:none}.layui-layer-btn a:active{opacity:.8}.layui-layer-btn .layui-layer-btn0{border-color:#1E9FFF;background-color:#1E9FFF;color:#fff}.layui-layer-btn-l{text-align:left}.layui-layer-btn-c{text-align:center}.layui-layer-dialog{min-width:260px}.layui-layer-dialog .layui-layer-content{position:relative;padding:20px;line-height:24px;word-break:break-all;overflow:hidden;font-size:14px;overflow-x:hidden;overflow-y:auto}.layui-layer-dialog .layui-layer-content .layui-layer-ico{position:absolute;top:16px;left:15px;_left:-40px;width:30px;height:30px}.layui-layer-ico1{background-position:-30px 0}.layui-layer-ico2{background-position:-60px 0}.layui-layer-ico3{background-position:-90px 0}.layui-layer-ico4{background-position:-120px 0}.layui-layer-ico5{background-position:-150px 0}.layui-layer-ico6{background-position:-180px 0}.layui-layer-rim{border:6px solid #8D8D8D;border:6px solid rgba(0,0,0,.3);border-radius:5px;box-shadow:none}.layui-layer-msg{min-width:180px;border:1px solid #D3D4D3;box-shadow:none}.layui-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:rgba(0,0,0,.6);color:#fff;border:none}.layui-layer-hui .layui-layer-content{padding:12px 25px;text-align:center}.layui-layer-dialog .layui-layer-padding{padding:20px 20px 20px 55px;text-align:left}.layui-layer-page .layui-layer-content{position:relative;overflow:auto}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{padding-top:10px}.layui-layer-nobg{background:0 0}.layui-layer-iframe iframe{display:block;width:100%}.layui-layer-loading{border-radius:100%;background:0 0;box-shadow:none;border:none}.layui-layer-loading .layui-layer-content{width:60px;height:24px;background:url(loading-0.gif) no-repeat}.layui-layer-loading .layui-layer-loading1{width:37px;height:37px;background:url(loading-1.gif) no-repeat}.layui-layer-ico16,.layui-layer-loading .layui-layer-loading2{width:32px;height:32px;background:url(loading-2.gif) no-repeat}.layui-layer-tips{background:0 0;box-shadow:none;border:none}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:8px 15px;font-size:12px;_float:left;border-radius:2px;box-shadow:1px 1px 3px rgba(0,0,0,.2);background-color:#000;color:#fff}.layui-layer-tips .layui-layer-close{right:-2px;top:-1px}.layui-layer-tips i.layui-layer-TipsG{position:absolute;width:0;height:0;border-width:8px;border-color:transparent;border-style:dashed;*overflow:hidden}.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{left:5px;border-right-style:solid;border-right-color:#000}.layui-layer-tips i.layui-layer-TipsT{bottom:-8px}.layui-layer-tips i.layui-layer-TipsB{top:-8px}.layui-layer-tips i.layui-layer-TipsL,.layui-layer-tips i.layui-layer-TipsR{top:5px;border-bottom-style:solid;border-bottom-color:#000}.layui-layer-tips i.layui-layer-TipsR{left:-8px}.layui-layer-tips i.layui-layer-TipsL{right:-8px}.layui-layer-lan[type=dialog]{min-width:280px}.layui-layer-lan .layui-layer-title{background:#4476A7;color:#fff;border:none}.layui-layer-lan .layui-layer-btn{padding:5px 10px 10px;text-align:right;border-top:1px solid #E9E7E7}.layui-layer-lan .layui-layer-btn a{background:#fff;border-color:#E9E7E7;color:#333}.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5}.layui-layer-molv .layui-layer-title{background:#009f95;color:#fff;border:none}.layui-layer-molv .layui-layer-btn a{background:#009f95;border-color:#009f95}.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92B8B1}.layui-layer-iconext{background:url(icon-ext.png) no-repeat}.layui-layer-prompt .layui-layer-input{display:block;width:230px;height:36px;margin:0 auto;line-height:30px;padding-left:10px;border:1px solid #e6e6e6;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px;padding:6px 10px}.layui-layer-prompt .layui-layer-content{padding:20px}.layui-layer-prompt .layui-layer-btn{padding-top:0}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:260px;padding:0 20px;text-align:center;overflow:hidden;cursor:pointer}.layui-layer-tab .layui-layer-title span.layui-this{height:43px;border-left:1px solid #eee;border-right:1px solid #eee;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.layui-this{display:block}.layui-layer-photos{-webkit-animation-duration:.8s;animation-duration:.8s}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgbar,.layui-layer-imguide{display:none}.layui-layer-imgnext,.layui-layer-imgprev{position:absolute;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:10px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:10px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:absolute;left:0;bottom:0;width:100%;height:32px;line-height:32px;background-color:rgba(0,0,0,.8);background-color:#000\9;filter:Alpha(opacity=80);color:#fff;overflow:hidden;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px;font-style:normal}@-webkit-keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-close{-webkit-animation-name:layer-bounceOut;animation-name:layer-bounceOut;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s}@media screen and (max-width:1100px){.layui-layer-iframe{overflow-y:auto;-webkit-overflow-scrolling:touch}}
--------------------------------------------------------------------------------
/lib/layer/theme/default/loading-0.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androidmumo/Bing-upyun/72f024458570ce1edf6487b4ca6ef2540d47449a/lib/layer/theme/default/loading-0.gif
--------------------------------------------------------------------------------
/lib/layer/theme/default/loading-1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androidmumo/Bing-upyun/72f024458570ce1edf6487b4ca6ef2540d47449a/lib/layer/theme/default/loading-1.gif
--------------------------------------------------------------------------------
/lib/layer/theme/default/loading-2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androidmumo/Bing-upyun/72f024458570ce1edf6487b4ca6ef2540d47449a/lib/layer/theme/default/loading-2.gif
--------------------------------------------------------------------------------
/lib/progressive-image.css:
--------------------------------------------------------------------------------
1 | .progressive {
2 | position: relative;
3 | display: block;
4 | overflow: hidden;
5 | }
6 | .progressive img {
7 | display: block;
8 | width: 100%;
9 | max-width: 100%;
10 | height: auto;
11 | border: 0 none;
12 | }
13 | .progressive img.preview {
14 | filter: blur(2vw);
15 | transform: scale(1.05);
16 | }
17 | .progressive img.hide {
18 | opacity: 0;
19 | }
20 | .progressive img.origin {
21 | position: absolute;
22 | left: 0;
23 | top: 0;
24 | animation: origin 1.5s ease-out;
25 | }
26 | .progressive img.origin-scale {
27 | position: absolute;
28 | left: 0;
29 | top: 0;
30 | animation: origin-scale 1s ease-out;
31 | }
32 | @-moz-keyframes origin {
33 | 0% {
34 | opacity: 0;
35 | }
36 | 100% {
37 | opacity: 1;
38 | }
39 | }
40 | @-webkit-keyframes origin {
41 | 0% {
42 | opacity: 0;
43 | }
44 | 100% {
45 | opacity: 1;
46 | }
47 | }
48 | @-o-keyframes origin {
49 | 0% {
50 | opacity: 0;
51 | }
52 | 100% {
53 | opacity: 1;
54 | }
55 | }
56 | @keyframes origin {
57 | 0% {
58 | opacity: 0;
59 | }
60 | 100% {
61 | opacity: 1;
62 | }
63 | }
64 | @-moz-keyframes origin-scale {
65 | 0% {
66 | opacity: 0;
67 | transform: scale(1.1);
68 | }
69 | 100% {
70 | opacity: 1;
71 | transform: scale(1);
72 | }
73 | }
74 | @-webkit-keyframes origin-scale {
75 | 0% {
76 | opacity: 0;
77 | transform: scale(1.1);
78 | }
79 | 100% {
80 | opacity: 1;
81 | transform: scale(1);
82 | }
83 | }
84 | @-o-keyframes origin-scale {
85 | 0% {
86 | opacity: 0;
87 | transform: scale(1.1);
88 | }
89 | 100% {
90 | opacity: 1;
91 | transform: scale(1);
92 | }
93 | }
94 | @keyframes origin-scale {
95 | 0% {
96 | opacity: 0;
97 | transform: scale(1.1);
98 | }
99 | 100% {
100 | opacity: 1;
101 | transform: scale(1);
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/lib/progressive-image.js:
--------------------------------------------------------------------------------
1 | !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=24)}([function(e,t,n){e.exports=!n(3)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var n=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(14),i=n(19),o=n(21),u=Object.defineProperty;t.f=n(0)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return u(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(11),o=r(i);t.default=function(){function e(e,t){for(var n=0;n=t?a():n=setTimeout(a,t)}}},on:function(e,t,n){e.addEventListener(t,n)},off:function(e,t,n){e.removeEventListener(t,n)}},this.windowHasBind=!1,this.lazy=this.Util.throttle(function(e){n.fire()},300),this.animationEvent=this.getAnimationEvent()}return u()(e,[{key:"fire",value:function(){this.windowHasBind||(this.windowHasBind=!0,this.events(window,!0));var e=document.querySelectorAll(this.el+" img."+this.lazyClass),t=e.length;if(t>0)for(var n=0;n0&&r.left0&&this.loadImage(e[n])}else this.windowHasBind=!1,this.events(window,!1)}},{key:"events",value:function(e,t){var n=this;t?this.EVENTS.forEach(function(t){n.Util.on(e,t,n.lazy)}):this.EVENTS.forEach(function(t){n.Util.off(e,t,n.lazy)})}},{key:"loadImage",value:function(e){var t=this,n=new Image;e.dataset&&(e.dataset.srcset&&(n.srcset=e.dataset.srcset),e.dataset.sizes&&(n.sizes=e.dataset.sizes)),n.src=e.dataset.src,n.className="origin",this.scale&&(n.className="origin-scale"),e.classList.remove("lazy"),n.onload=function(r){t.mountImage(e,n)},n.onerror=function(t){e.classList.add("lazy")}}},{key:"getAnimationEvent",value:function(){var e=document.createElement("fake"),t={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(var n in t)if(void 0!==e.style[n])return t[n]}},{key:"mountImage",value:function(e,t){var n=this,r=e.parentNode;r.appendChild(t).addEventListener(this.animationEvent,function(t){t.target.alt=e.alt||"",e.classList.add("hide"),n.removePreview&&(r.removeChild(e),t.target.classList.remove("origin"),t.target.classList.remove("origin-scale"))})}}]),e}();"undefined"!=typeof exports?(void 0!==e&&e.exports&&(exports=e.exports=a),exports.Progressive=a):"function"==typeof define&&n(9)?define("Progressive",[],function(){return a}):this.Progressive=a}).call(t,n(10)(e))}])});
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "day00",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "gulpfile.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "devDependencies": {
12 | "babel-core": "^6.26.3",
13 | "babel-preset-es2015": "^6.24.1",
14 | "gulp": "^4.0.2",
15 | "gulp-babel": "^7.0.1",
16 | "gulp-connect": "^5.7.0",
17 | "gulp-plumber": "^1.2.1",
18 | "gulp-sass": "^4.1.0",
19 | "gulp-sourcemaps": "^2.6.5",
20 | "gulp-uglify": "^3.0.2"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/html/detail.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 带您领略世界之美
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 必应每日一图
19 |
23 |
24 |
25 |
26 |
27 |
31 |
32 | 离下次图片更新还有
33 | :
34 | :
35 |
36 |
37 |
38 |
39 |
40 |
45 |
46 |
47 |
69 |
70 |
71 |
72 |
73 |
74 |
79 |
...
80 |
81 |
82 |
83 | 本站所有图片均来自Bing搜索官网,版权归图片创作者所有。尊重版权,请勿商用!
84 |
85 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
96 |
97 |
98 |
104 |
105 |
106 |
107 |
108 |
注:HD为又拍云加速(极速下载),UHD为直链(慢速)。手机端请长按上方图片保存
109 |
110 |
111 |
118 |
119 |
120 |
121 |
122 |
123 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 必应每日一图 - 领略世界之美
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 必应每日一图
19 |
23 |
24 |
25 |
30 |
31 |
32 |
36 |
37 | 离下次图片更新还有
38 | :
39 | :
40 |
41 |
42 |
43 |
44 |
45 |
50 |
51 |
52 |
81 |
82 |
86 |
87 |
88 |
89 |
90 |
131 |
132 |
133 |
134 |
往日图片 HD
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |

145 |
146 |
147 |
148 |
149 |
150 |

152 |
153 |
154 |
155 |
156 |
157 |

159 |
160 |
161 |
162 |
163 |
164 |

166 |
167 |
168 |
169 |
170 |
171 |

173 |
174 |
175 |
176 |
177 |
178 |

180 |
181 |
182 |
183 |
184 |
185 |

187 |
188 |
189 |
190 |
191 |
192 |

194 |
195 |
196 |
197 |
198 |
199 |

201 |
202 |
203 |
204 |
205 |
206 |

208 |
209 |
210 |
211 |
212 |
213 |

216 |
217 |
218 |
219 |
220 |
221 |

224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
291 |
292 |
293 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
--------------------------------------------------------------------------------
/src/js/detail.js:
--------------------------------------------------------------------------------
1 | //获取url参数
2 | let daydata = getUrlParam("daydata");
3 |
4 | //生成bigimg
5 | var bigImgStr = `
6 |
7 | `
8 | $("#bigimg-wrap").children(".progressive").empty().append(bigImgStr);
9 |
10 | //图片渐进式加载
11 | imgpro("#bigimg-wrap");
12 |
13 | /* ajax获取图片信息 */
14 | function getImgMsg(day) {
15 | var imgMsg = "";
16 | $.ajax({
17 | type: "GET",
18 | async: false,
19 | url: "https://bing.nxingcloud.co/api/",
20 | data: `type=json&day=${day}`,
21 | success: function (msg) {
22 | imgMsg = $.parseJSON(msg);
23 | }
24 | });
25 | return imgMsg;
26 | }
27 | /* ajax获取图片信息 end */
28 |
29 | //调用ajax函数 获取此图片信息
30 | var detailMsg = getImgMsg(daydata);
31 | var imgSubDate = detailMsg["submission_date"];
32 | var imgTit = detailMsg["bing_title"];
33 | var imgUrlHd = detailMsg["bing_imgurl"];
34 | var imgUrlUhd = detailMsg["bing_imgurluhd"];
35 |
36 | //改变网页标题
37 | $('title').text(imgTit);
38 |
39 | //添加图片标题
40 | $(".bigimg-text").empty().append(`${imgSubDate} ` + imgTit);
41 |
42 | //评论系统
43 | new Valine({
44 | el: '#vcomments',
45 | appId: '********',
46 | appKey: '********',
47 | path: `${imgSubDate}` //不同图片加载不同的评论
48 | })
49 |
50 | //将数据写入模态框
51 | var modalImgStr = `
52 |
53 | `
54 | $(".modal-img-wrap").empty().append(modalImgStr);
55 |
56 | /* 点击模态框按钮下载图片 */
57 | $("#btnHd").click(function () {
58 | var x = new XMLHttpRequest();
59 |
60 | var resourceUrl = imgUrlHd;
61 | x.open("GET", resourceUrl, true);
62 | x.responseType = 'blob';
63 |
64 | x.onload = function (e) {
65 | // ie10+
66 | if (navigator.msSaveBlob) {
67 | var name1 = "bingHd";
68 | return navigator.msSaveBlob(x.response, name1);
69 | } else {
70 | var url = window.URL.createObjectURL(x.response)
71 | var a = document.createElement('a');
72 | a.href = url;
73 | a.download = today;
74 | a.click();
75 | }
76 | }
77 | x.send();
78 |
79 | //弹窗
80 | layer.msg('下载已开始');
81 | });
82 |
83 | $("#btnUhd").click(function () {
84 | var x = new XMLHttpRequest();
85 |
86 | var resourceUrl = imgUrlUhd;
87 | x.open("GET", resourceUrl, true);
88 | x.responseType = 'blob';
89 |
90 | x.onload = function (e) {
91 | // ie10+
92 | if (navigator.msSaveBlob) {
93 | var name2 = "bingUhd";
94 | return navigator.msSaveBlob(x.response, name2);
95 | } else {
96 | var url = window.URL.createObjectURL(x.response)
97 | var a = document.createElement('a');
98 | a.href = url;
99 | a.download = today;
100 | a.click();
101 | }
102 | }
103 | x.send();
104 |
105 | //弹窗
106 | layer.msg('下载已开始');
107 | });
108 | /* 点击模态框按钮下载图片 end */
--------------------------------------------------------------------------------
/src/js/index.js:
--------------------------------------------------------------------------------
1 | /* 点击图片跳转到详情 */
2 | $("#pic-js").on("click", ".pic-item", function () {
3 | window.location.href = `html/detail.html?daydata=${$(this).attr("data-day")}`;
4 | })
5 | /* 点击图片跳转到详情 end */
6 |
7 | /* 图片渐进式加载 */
8 | imgpro("#carousel-js");
9 |
10 | for (let i = 0; i < 12; i++) {
11 | var ele = `#pic-js-son${i}`;
12 | imgpro(ele);
13 | }
14 | /* 图片渐进式加载 end */
15 |
16 | // /* 生成轮播图文字并插入 */
17 | // for (let i = 0; i < 3; i++) {
18 | // var carouselStr = "";
19 | // var imgMsg = getImgMsg(i);
20 | // var imgTit = imgMsg["bing_title"];
21 | // var imgTitS = imgTit.replace(/\([^\)]*\)/g, ""); //去除括号及空格
22 | // imgTitS = imgTitS.replace(/\s*$/g, "");
23 |
24 | // // var imgUrlDate = getImgUrlHd(todayTimeEn(i)); //生成HD图片url
25 |
26 | // carouselStr = `
27 | // ${imgTitS}
28 | // ${imgTit}
29 | // `
30 | // $(".carousel-caption").eq(i).empty().append(carouselStr);
31 | // }
32 | // /* 生成轮播图文字并插入 end */
33 |
34 | // /* 生成缩略图文字并插入 */
35 | // for (let i = 0; i < 12; i++) {
36 | // var imgMsg = getImgMsg(i);
37 | // var imgTit = imgMsg["bing_title"];
38 | // var imgDate = imgMsg["submission_date"];
39 | // var imgTitS = imgTit.replace(/\([^\)]*\)/g, ""); //去除括号及空格
40 | // imgTitS = imgTitS.replace(/\s*$/g, "");
41 |
42 | // imgTitS = `${imgDate}
` + imgTitS;
43 | // // var imgUrlDate = getImgUrlCom(todayTimeEn(i)); //生成com图片url
44 |
45 | // $("#pic-js").children().eq(i).children("p").empty().append(imgTitS);
46 | // }
47 | // /* 生成缩略图文字并插入 end */
48 |
49 |
50 | /* 轮播图文字 (递归优化) */
51 | var dayi = 0;
52 |
53 | function getText1() {
54 | $.ajax({
55 | type: "GET",
56 | async: true,
57 | url: "https://bing.nxingcloud.co/api/",
58 | data: `type=json&day=${dayi}`,
59 | success: function (msg) {
60 | var imgMsg = $.parseJSON(msg);
61 | var carouselStr = "";
62 | var imgTit = imgMsg["bing_title"];
63 | var imgTitS = imgTit.replace(/\([^\)]*\)/g, ""); //去除括号及空格
64 | imgTitS = imgTitS.replace(/\s*$/g, "");
65 |
66 | // var imgUrlDate = getImgUrlHd(todayTimeEn(i)); //生成HD图片url
67 |
68 | carouselStr = `
69 | ${imgTitS}
70 | ${imgTit}
71 | `
72 | $(".carousel-caption").eq(dayi).empty().append(carouselStr);
73 |
74 | if (dayi > 1) {
75 | return;
76 | } else {
77 | dayi = dayi + 1;
78 | getText1();
79 | }
80 | }
81 | });
82 | }
83 | getText1();
84 | /* 轮播图文字 (递归优化) end */
85 |
86 | /* 缩略图文字 (递归优化) */
87 | var dayj = 0;
88 |
89 | function getText2() {
90 | $.ajax({
91 | type: "GET",
92 | async: true,
93 | url: "https://bing.nxingcloud.co/api/",
94 | data: `type=json&day=${dayj}`,
95 | success: function (msg) {
96 | var imgMsg = $.parseJSON(msg);
97 | var imgTit = imgMsg["bing_title"];
98 | var imgDate = imgMsg["submission_date"];
99 | var imgTitS = imgTit.replace(/\([^\)]*\)/g, ""); //去除括号及空格
100 | imgTitS = imgTitS.replace(/\s*$/g, "");
101 |
102 | imgTitS = `${imgDate}
` + imgTitS;
103 | // var imgUrlDate = getImgUrlCom(todayTimeEn(i)); //生成com图片url
104 |
105 | $("#pic-js").children().eq(dayj).children("p").empty().append(imgTitS);
106 |
107 | if (dayj > 10) {
108 | return;
109 | } else {
110 | dayj = dayj + 1;
111 | getText2();
112 | }
113 | }
114 | });
115 | }
116 | getText2();
117 | /* 缩略图文字 (递归优化) end */
--------------------------------------------------------------------------------
/src/js/main.js:
--------------------------------------------------------------------------------
1 | //定义又拍云图片链接
2 | const upyunDom = "https://upyuns.mcloc.cn/";
3 |
4 | /* 获取指定日期 */
5 | //获取指定日期 英文
6 | function todayTimeEn(day) {
7 | var dt = new Date();
8 | dt.setDate(dt.getDate() - day);
9 | var m = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
10 | var mn = dt.getMonth();
11 | var dn = dt.getDate();
12 | if (dn < 10) {
13 | dn = '0' + dn;
14 | }
15 | var curtime = dn + "-" + m[mn] + "-" + dt.getFullYear();
16 | return curtime;
17 | }
18 |
19 | let today = todayTimeEn(0);
20 | //日期格式 02-Sep-2020
21 | /* 获取今日日期 end*/
22 |
23 | /* 获取指定日期的HD图片url */
24 | //日期格式 02-Sep-2020
25 | function getImgUrlHd(date) {
26 | var imgUrlHd = upyunDom + "bing/" + date + "/" + date + ".jpg";
27 | return imgUrlHd;
28 | }
29 | /* 获取指定日期的HD图片url end*/
30 |
31 | /* 获取指定日期的compress图片url */
32 | //日期格式 02-Sep-2020
33 | function getImgUrlCom(date) {
34 | var imgUrlCom = upyunDom + "bing/" + date + "/" + date + "-compress_25.jpg";
35 | return imgUrlCom;
36 | }
37 | /* 获取指定日期的com图片url end*/
38 |
39 | /* 点击导航栏按钮下载今日图片 */
40 | $("#btnToday").click(function () {
41 | var x = new XMLHttpRequest();
42 |
43 | var resourceUrl = getImgUrlHd(today);
44 | x.open("GET", resourceUrl, true);
45 | x.responseType = 'blob';
46 |
47 | x.onload = function (e) {
48 | // ie10+
49 | if (navigator.msSaveBlob) {
50 | var name = resourceUrl.substr(resourceUrl.lastIndexOf("/") + 1);
51 | return navigator.msSaveBlob(x.response, name);
52 | } else {
53 | var url = window.URL.createObjectURL(x.response)
54 | var a = document.createElement('a');
55 | a.href = url;
56 | a.download = today;
57 | a.click();
58 | }
59 | }
60 | x.send();
61 |
62 | //弹窗
63 | layer.msg('下载已开始');
64 | });
65 | /* 点击导航栏按钮下载今日图片 end */
66 |
67 | //以下函数在index.js中已不再需要,因为需要调用此函数的原代码(/* 生成轮播图文字并插入 */ ~ /* 生成缩略图文字并插入 end */)已被递归方法(/* 轮播图文字 (递归优化) */ ~ /* 缩略图文字 (递归优化) end */)替代。页面加载速度显著加快。
68 | //但在detail.js中仍然需要
69 | // /* ajax获取图片信息 */
70 | // function getImgMsg(day) {
71 | // var imgMsg = "";
72 | // $.ajax({
73 | // type: "GET",
74 | // async: false,
75 | // url: "https://bing.nxingcloud.co/api/",
76 | // data: `type=json&day=${day}`,
77 | // success: function (msg) {
78 | // imgMsg = $.parseJSON(msg);
79 | // }
80 | // });
81 | // return imgMsg;
82 | // }
83 | // /* ajax获取图片信息 end */
84 |
85 | /* 图片渐进式加载 函数 */
86 | function imgpro(ele) {
87 | new Progressive({
88 | el: ele,
89 | lazyClass: 'lazy',
90 | removePreview: true,
91 | scale: true
92 | }).fire()
93 | }
94 | /* 图片渐进式加载 end */
95 |
96 | //返回参数的函数
97 | function getUrlParam(name) {
98 | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
99 | var r = window.location.search.substr(1).match(reg); //匹配目标参数
100 | if (r != null) return unescape(r[2]);
101 | return null; //返回参数值
102 | }
103 |
104 | //计时器&进度条
105 | let keyTime = new Date();
106 | keyTime.setDate(keyTime.getDate() + 1)
107 | keyTime.setHours(0);
108 | keyTime.setMinutes(1);
109 | keyTime.setSeconds(30);
110 | keyTime.setMilliseconds(0);
111 | keyTime = keyTime.getTime();
112 |
113 | function timer(keyTime) {
114 | var nowTime = new Date();
115 | var t = keyTime - nowTime.getTime();
116 | var h = ~~(t / 1000 / 60 / 60 % 24);
117 | if (h < 10) {
118 | h = "0" + h;
119 | }
120 | var m = ~~(t / 1000 / 60 % 60);
121 | if (m < 10) {
122 | m = "0" + m;
123 | }
124 |
125 | var s = ~~(t / 1000 % 60);
126 | if (s < 10) {
127 | s = "0" + s;
128 | }
129 | $("#h").empty().append(h);
130 | $("#m").empty().append(m);
131 | $("#s").empty().append(s);
132 |
133 | //进度条
134 | var barPercentage = Math.floor((1 - t / (24 * 60 * 60 * 1000)) * 10000) / 100;
135 | $("#js-progress").attr("style", `width:${barPercentage}%`);
136 | $("#js-progress").attr("aria-valuenow", barPercentage);
137 | $("#js-progress").empty().append(`${barPercentage}%`);
138 | }
139 | timer(keyTime);
140 | setInterval("timer(keyTime)", 1000);
--------------------------------------------------------------------------------
/src/lib/layer/layer.js:
--------------------------------------------------------------------------------
1 | /*! layer-v3.1.1 Web弹层组件 MIT License http://layer.layui.com/ By 贤心 */
2 | ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?''+(f?r.title[0]:r.title)+"
":"";return r.zIndex=s,t([r.shade?'':"",''+(e&&2!=r.type?"":u)+'
'+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
'+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t
'+r.btn[t]+"";return''+e+"
"}():"")+(r.resize?'':"")+" "],u,i('')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:''+function(){var e=t.length,i=1,a="";if(e>0)for(a='- '+(t[0].content||"no content")+"
";i'+(t[i].content||"no content")+"";return a}()+"
",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]
",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);
--------------------------------------------------------------------------------
/src/lib/layer/mobile/layer.js:
--------------------------------------------------------------------------------
1 | /*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */
2 | ;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?''+(e?n.title[0]:n.title)+"
":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e=''+n.btn[0]+"",2===t&&(e=''+n.btn[1]+""+e),''+e+"
"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content=''+(n.content||"")+"
"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"':"")+'",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;odiv{line-height:22px;padding-top:7px;margin-bottom:20px;font-size:14px}.layui-m-layerbtn{display:box;display:-moz-box;display:-webkit-box;width:100%;height:50px;line-height:50px;font-size:0;border-top:1px solid #D0D0D0;background-color:#F2F2F2}.layui-m-layerbtn span{display:block;-moz-box-flex:1;box-flex:1;-webkit-box-flex:1;font-size:14px;cursor:pointer}.layui-m-layerbtn span[yes]{color:#40AFFE}.layui-m-layerbtn span[no]{border-right:1px solid #D0D0D0;border-radius:0 0 0 5px}.layui-m-layerbtn span:active{background-color:#F6F6F6}.layui-m-layerend{position:absolute;right:7px;top:10px;width:30px;height:30px;border:0;font-weight:400;background:0 0;cursor:pointer;-webkit-appearance:none;font-size:30px}.layui-m-layerend::after,.layui-m-layerend::before{position:absolute;left:5px;top:15px;content:'';width:18px;height:1px;background-color:#999;transform:rotate(45deg);-webkit-transform:rotate(45deg);border-radius:3px}.layui-m-layerend::after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}body .layui-m-layer .layui-m-layer-footer{position:fixed;width:95%;max-width:100%;margin:0 auto;left:0;right:0;bottom:10px;background:0 0}.layui-m-layer-footer .layui-m-layercont{padding:20px;border-radius:5px 5px 0 0;background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn{display:block;height:auto;background:0 0;border-top:none}.layui-m-layer-footer .layui-m-layerbtn span{background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn span[no]{color:#FD482C;border-top:1px solid #c2c2c2;border-radius:0 0 5px 5px}.layui-m-layer-footer .layui-m-layerbtn span[yes]{margin-top:10px;border-radius:5px}body .layui-m-layer .layui-m-layer-msg{width:auto;max-width:90%;margin:0 auto;bottom:-150px;background-color:rgba(0,0,0,.7);color:#fff}.layui-m-layer-msg .layui-m-layercont{padding:10px 20px}
--------------------------------------------------------------------------------
/src/lib/layer/theme/default/icon-ext.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androidmumo/Bing-upyun/72f024458570ce1edf6487b4ca6ef2540d47449a/src/lib/layer/theme/default/icon-ext.png
--------------------------------------------------------------------------------
/src/lib/layer/theme/default/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androidmumo/Bing-upyun/72f024458570ce1edf6487b4ca6ef2540d47449a/src/lib/layer/theme/default/icon.png
--------------------------------------------------------------------------------
/src/lib/layer/theme/default/layer.css:
--------------------------------------------------------------------------------
1 | .layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span,.layui-layer-title{text-overflow:ellipsis;white-space:nowrap}html #layuicss-layer{display:none;position:absolute;width:1989px}.layui-layer,.layui-layer-shade{position:fixed;_position:absolute;pointer-events:auto}.layui-layer-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px")}.layui-layer{-webkit-overflow-scrolling:touch;top:150px;left:0;margin:0;padding:0;background-color:#fff;-webkit-background-clip:content;border-radius:2px;box-shadow:1px 1px 50px rgba(0,0,0,.3)}.layui-layer-close{position:absolute}.layui-layer-content{position:relative}.layui-layer-border{border:1px solid #B2B2B2;border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 5px rgba(0,0,0,.2)}.layui-layer-load{background:url(loading-1.gif) center center no-repeat #eee}.layui-layer-ico{background:url(icon.png) no-repeat}.layui-layer-btn a,.layui-layer-dialog .layui-layer-ico,.layui-layer-setwin a{display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-move{display:none;position:fixed;*position:absolute;left:0;top:0;width:100%;height:100%;cursor:move;opacity:0;filter:alpha(opacity=0);background-color:#fff;z-index:2147483647}.layui-layer-resize{position:absolute;width:15px;height:15px;right:0;bottom:0;cursor:se-resize}.layer-anim{-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.3s;animation-duration:.3s}@-webkit-keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-00{-webkit-animation-name:layer-bounceIn;animation-name:layer-bounceIn}@-webkit-keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-01{-webkit-animation-name:layer-zoomInDown;animation-name:layer-zoomInDown}@-webkit-keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layer-anim-02{-webkit-animation-name:layer-fadeInUpBig;animation-name:layer-fadeInUpBig}@-webkit-keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-03{-webkit-animation-name:layer-zoomInLeft;animation-name:layer-zoomInLeft}@-webkit-keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}@keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);-ms-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}.layer-anim-04{-webkit-animation-name:layer-rollIn;animation-name:layer-rollIn}@keyframes layer-fadeIn{0%{opacity:0}100%{opacity:1}}.layer-anim-05{-webkit-animation-name:layer-fadeIn;animation-name:layer-fadeIn}@-webkit-keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:layer-shake;animation-name:layer-shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layui-layer-title{padding:0 80px 0 20px;height:42px;line-height:42px;border-bottom:1px solid #eee;font-size:14px;color:#333;overflow:hidden;background-color:#F8F8F8;border-radius:2px 2px 0 0}.layui-layer-setwin{position:absolute;right:15px;*right:0;top:15px;font-size:0;line-height:initial}.layui-layer-setwin a{position:relative;width:16px;height:16px;margin-left:10px;font-size:12px;_overflow:hidden}.layui-layer-setwin .layui-layer-min cite{position:absolute;width:14px;height:2px;left:0;top:50%;margin-top:-1px;background-color:#2E2D3C;cursor:pointer;_overflow:hidden}.layui-layer-setwin .layui-layer-min:hover cite{background-color:#2D93CA}.layui-layer-setwin .layui-layer-max{background-position:-32px -40px}.layui-layer-setwin .layui-layer-max:hover{background-position:-16px -40px}.layui-layer-setwin .layui-layer-maxmin{background-position:-65px -40px}.layui-layer-setwin .layui-layer-maxmin:hover{background-position:-49px -40px}.layui-layer-setwin .layui-layer-close1{background-position:1px -40px;cursor:pointer}.layui-layer-setwin .layui-layer-close1:hover{opacity:.7}.layui-layer-setwin .layui-layer-close2{position:absolute;right:-28px;top:-28px;width:30px;height:30px;margin-left:0;background-position:-149px -31px;*right:-18px;_display:none}.layui-layer-setwin .layui-layer-close2:hover{background-position:-180px -31px}.layui-layer-btn{text-align:right;padding:0 15px 12px;pointer-events:auto;user-select:none;-webkit-user-select:none}.layui-layer-btn a{height:28px;line-height:28px;margin:5px 5px 0;padding:0 15px;border:1px solid #dedede;background-color:#fff;color:#333;border-radius:2px;font-weight:400;cursor:pointer;text-decoration:none}.layui-layer-btn a:hover{opacity:.9;text-decoration:none}.layui-layer-btn a:active{opacity:.8}.layui-layer-btn .layui-layer-btn0{border-color:#1E9FFF;background-color:#1E9FFF;color:#fff}.layui-layer-btn-l{text-align:left}.layui-layer-btn-c{text-align:center}.layui-layer-dialog{min-width:260px}.layui-layer-dialog .layui-layer-content{position:relative;padding:20px;line-height:24px;word-break:break-all;overflow:hidden;font-size:14px;overflow-x:hidden;overflow-y:auto}.layui-layer-dialog .layui-layer-content .layui-layer-ico{position:absolute;top:16px;left:15px;_left:-40px;width:30px;height:30px}.layui-layer-ico1{background-position:-30px 0}.layui-layer-ico2{background-position:-60px 0}.layui-layer-ico3{background-position:-90px 0}.layui-layer-ico4{background-position:-120px 0}.layui-layer-ico5{background-position:-150px 0}.layui-layer-ico6{background-position:-180px 0}.layui-layer-rim{border:6px solid #8D8D8D;border:6px solid rgba(0,0,0,.3);border-radius:5px;box-shadow:none}.layui-layer-msg{min-width:180px;border:1px solid #D3D4D3;box-shadow:none}.layui-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:rgba(0,0,0,.6);color:#fff;border:none}.layui-layer-hui .layui-layer-content{padding:12px 25px;text-align:center}.layui-layer-dialog .layui-layer-padding{padding:20px 20px 20px 55px;text-align:left}.layui-layer-page .layui-layer-content{position:relative;overflow:auto}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{padding-top:10px}.layui-layer-nobg{background:0 0}.layui-layer-iframe iframe{display:block;width:100%}.layui-layer-loading{border-radius:100%;background:0 0;box-shadow:none;border:none}.layui-layer-loading .layui-layer-content{width:60px;height:24px;background:url(loading-0.gif) no-repeat}.layui-layer-loading .layui-layer-loading1{width:37px;height:37px;background:url(loading-1.gif) no-repeat}.layui-layer-ico16,.layui-layer-loading .layui-layer-loading2{width:32px;height:32px;background:url(loading-2.gif) no-repeat}.layui-layer-tips{background:0 0;box-shadow:none;border:none}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:8px 15px;font-size:12px;_float:left;border-radius:2px;box-shadow:1px 1px 3px rgba(0,0,0,.2);background-color:#000;color:#fff}.layui-layer-tips .layui-layer-close{right:-2px;top:-1px}.layui-layer-tips i.layui-layer-TipsG{position:absolute;width:0;height:0;border-width:8px;border-color:transparent;border-style:dashed;*overflow:hidden}.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{left:5px;border-right-style:solid;border-right-color:#000}.layui-layer-tips i.layui-layer-TipsT{bottom:-8px}.layui-layer-tips i.layui-layer-TipsB{top:-8px}.layui-layer-tips i.layui-layer-TipsL,.layui-layer-tips i.layui-layer-TipsR{top:5px;border-bottom-style:solid;border-bottom-color:#000}.layui-layer-tips i.layui-layer-TipsR{left:-8px}.layui-layer-tips i.layui-layer-TipsL{right:-8px}.layui-layer-lan[type=dialog]{min-width:280px}.layui-layer-lan .layui-layer-title{background:#4476A7;color:#fff;border:none}.layui-layer-lan .layui-layer-btn{padding:5px 10px 10px;text-align:right;border-top:1px solid #E9E7E7}.layui-layer-lan .layui-layer-btn a{background:#fff;border-color:#E9E7E7;color:#333}.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5}.layui-layer-molv .layui-layer-title{background:#009f95;color:#fff;border:none}.layui-layer-molv .layui-layer-btn a{background:#009f95;border-color:#009f95}.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92B8B1}.layui-layer-iconext{background:url(icon-ext.png) no-repeat}.layui-layer-prompt .layui-layer-input{display:block;width:230px;height:36px;margin:0 auto;line-height:30px;padding-left:10px;border:1px solid #e6e6e6;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px;padding:6px 10px}.layui-layer-prompt .layui-layer-content{padding:20px}.layui-layer-prompt .layui-layer-btn{padding-top:0}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:260px;padding:0 20px;text-align:center;overflow:hidden;cursor:pointer}.layui-layer-tab .layui-layer-title span.layui-this{height:43px;border-left:1px solid #eee;border-right:1px solid #eee;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.layui-this{display:block}.layui-layer-photos{-webkit-animation-duration:.8s;animation-duration:.8s}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgbar,.layui-layer-imguide{display:none}.layui-layer-imgnext,.layui-layer-imgprev{position:absolute;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:10px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:10px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:absolute;left:0;bottom:0;width:100%;height:32px;line-height:32px;background-color:rgba(0,0,0,.8);background-color:#000\9;filter:Alpha(opacity=80);color:#fff;overflow:hidden;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px;font-style:normal}@-webkit-keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-close{-webkit-animation-name:layer-bounceOut;animation-name:layer-bounceOut;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s}@media screen and (max-width:1100px){.layui-layer-iframe{overflow-y:auto;-webkit-overflow-scrolling:touch}}
--------------------------------------------------------------------------------
/src/lib/layer/theme/default/loading-0.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androidmumo/Bing-upyun/72f024458570ce1edf6487b4ca6ef2540d47449a/src/lib/layer/theme/default/loading-0.gif
--------------------------------------------------------------------------------
/src/lib/layer/theme/default/loading-1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androidmumo/Bing-upyun/72f024458570ce1edf6487b4ca6ef2540d47449a/src/lib/layer/theme/default/loading-1.gif
--------------------------------------------------------------------------------
/src/lib/layer/theme/default/loading-2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androidmumo/Bing-upyun/72f024458570ce1edf6487b4ca6ef2540d47449a/src/lib/layer/theme/default/loading-2.gif
--------------------------------------------------------------------------------
/src/lib/progressive-image.css:
--------------------------------------------------------------------------------
1 | .progressive {
2 | position: relative;
3 | display: block;
4 | overflow: hidden;
5 | }
6 | .progressive img {
7 | display: block;
8 | width: 100%;
9 | max-width: 100%;
10 | height: auto;
11 | border: 0 none;
12 | }
13 | .progressive img.preview {
14 | filter: blur(2vw);
15 | transform: scale(1.05);
16 | }
17 | .progressive img.hide {
18 | opacity: 0;
19 | }
20 | .progressive img.origin {
21 | position: absolute;
22 | left: 0;
23 | top: 0;
24 | animation: origin 1.5s ease-out;
25 | }
26 | .progressive img.origin-scale {
27 | position: absolute;
28 | left: 0;
29 | top: 0;
30 | animation: origin-scale 1s ease-out;
31 | }
32 | @-moz-keyframes origin {
33 | 0% {
34 | opacity: 0;
35 | }
36 | 100% {
37 | opacity: 1;
38 | }
39 | }
40 | @-webkit-keyframes origin {
41 | 0% {
42 | opacity: 0;
43 | }
44 | 100% {
45 | opacity: 1;
46 | }
47 | }
48 | @-o-keyframes origin {
49 | 0% {
50 | opacity: 0;
51 | }
52 | 100% {
53 | opacity: 1;
54 | }
55 | }
56 | @keyframes origin {
57 | 0% {
58 | opacity: 0;
59 | }
60 | 100% {
61 | opacity: 1;
62 | }
63 | }
64 | @-moz-keyframes origin-scale {
65 | 0% {
66 | opacity: 0;
67 | transform: scale(1.1);
68 | }
69 | 100% {
70 | opacity: 1;
71 | transform: scale(1);
72 | }
73 | }
74 | @-webkit-keyframes origin-scale {
75 | 0% {
76 | opacity: 0;
77 | transform: scale(1.1);
78 | }
79 | 100% {
80 | opacity: 1;
81 | transform: scale(1);
82 | }
83 | }
84 | @-o-keyframes origin-scale {
85 | 0% {
86 | opacity: 0;
87 | transform: scale(1.1);
88 | }
89 | 100% {
90 | opacity: 1;
91 | transform: scale(1);
92 | }
93 | }
94 | @keyframes origin-scale {
95 | 0% {
96 | opacity: 0;
97 | transform: scale(1.1);
98 | }
99 | 100% {
100 | opacity: 1;
101 | transform: scale(1);
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/src/lib/progressive-image.js:
--------------------------------------------------------------------------------
1 | !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=24)}([function(e,t,n){e.exports=!n(3)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var n=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(14),i=n(19),o=n(21),u=Object.defineProperty;t.f=n(0)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return u(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(11),o=r(i);t.default=function(){function e(e,t){for(var n=0;n=t?a():n=setTimeout(a,t)}}},on:function(e,t,n){e.addEventListener(t,n)},off:function(e,t,n){e.removeEventListener(t,n)}},this.windowHasBind=!1,this.lazy=this.Util.throttle(function(e){n.fire()},300),this.animationEvent=this.getAnimationEvent()}return u()(e,[{key:"fire",value:function(){this.windowHasBind||(this.windowHasBind=!0,this.events(window,!0));var e=document.querySelectorAll(this.el+" img."+this.lazyClass),t=e.length;if(t>0)for(var n=0;n0&&r.left0&&this.loadImage(e[n])}else this.windowHasBind=!1,this.events(window,!1)}},{key:"events",value:function(e,t){var n=this;t?this.EVENTS.forEach(function(t){n.Util.on(e,t,n.lazy)}):this.EVENTS.forEach(function(t){n.Util.off(e,t,n.lazy)})}},{key:"loadImage",value:function(e){var t=this,n=new Image;e.dataset&&(e.dataset.srcset&&(n.srcset=e.dataset.srcset),e.dataset.sizes&&(n.sizes=e.dataset.sizes)),n.src=e.dataset.src,n.className="origin",this.scale&&(n.className="origin-scale"),e.classList.remove("lazy"),n.onload=function(r){t.mountImage(e,n)},n.onerror=function(t){e.classList.add("lazy")}}},{key:"getAnimationEvent",value:function(){var e=document.createElement("fake"),t={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(var n in t)if(void 0!==e.style[n])return t[n]}},{key:"mountImage",value:function(e,t){var n=this,r=e.parentNode;r.appendChild(t).addEventListener(this.animationEvent,function(t){t.target.alt=e.alt||"",e.classList.add("hide"),n.removePreview&&(r.removeChild(e),t.target.classList.remove("origin"),t.target.classList.remove("origin-scale"))})}}]),e}();"undefined"!=typeof exports?(void 0!==e&&e.exports&&(exports=e.exports=a),exports.Progressive=a):"function"==typeof define&&n(9)?define("Progressive",[],function(){return a}):this.Progressive=a}).call(t,n(10)(e))}])});
--------------------------------------------------------------------------------
/src/sass/detail.scss:
--------------------------------------------------------------------------------
1 | .bigimg {
2 | margin-top: 0.8rem;
3 | }
4 |
5 | .detail-download {
6 | text-align: right;
7 |
8 | .alert {
9 | text-align: center;
10 | }
11 | }
12 |
13 | #vcomments {
14 | margin-top: 10rem;
15 | }
16 |
17 | .modal-body {
18 |
19 | p {
20 | padding: 1rem 0;
21 | margin-bottom: -1rem;
22 | }
23 | }
24 |
25 | .bigimg-text {
26 | padding: 2rem 0;
27 | }
--------------------------------------------------------------------------------
/src/sass/index.scss:
--------------------------------------------------------------------------------
1 | #pic-list {
2 | margin-top: 0rem;
3 | }
4 |
5 | #carouselExampleCaptions {
6 | margin-top: 0.8rem;
7 | }
8 |
9 | #pic-tit {
10 | margin-top: 5rem;
11 |
12 | h4 {
13 |
14 | span{
15 | font-size: small;
16 | }
17 | }
18 | }
19 |
20 | .pic-item {
21 | padding: 1rem;
22 | padding-bottom: 0;
23 | width: 22rem;
24 | margin: 0 auto;
25 | }
26 |
27 | #pic-js {
28 |
29 | p {
30 |
31 | span {
32 | margin: 0 0 0.6rem 0;
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/src/sass/main.scss:
--------------------------------------------------------------------------------
1 | #header-icon {
2 | font-size: 32px;
3 | // vertical-align: bottom;
4 | }
5 |
6 | #header-text {
7 | line-height: 58px;
8 | // vertical-align: middle;
9 | }
10 |
11 | footer {
12 | min-height: 20rem;
13 | margin-top: 5rem;
14 | background: rgb(248, 249, 250);
15 | overflow: hidden;
16 |
17 | &>div {
18 |
19 | &>div {
20 | margin: 2rem 0 0 0;
21 | }
22 | }
23 |
24 | #foottext {
25 | line-height: 30px;
26 | font-size: 13px;
27 |
28 | img {
29 | height: 12px;
30 | }
31 | }
32 | }
33 |
34 | .links {
35 |
36 | a {
37 |
38 | color: #fff;
39 | }
40 | }
--------------------------------------------------------------------------------
/src/static/upyun_logo5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androidmumo/Bing-upyun/72f024458570ce1edf6487b4ca6ef2540d47449a/src/static/upyun_logo5.png
--------------------------------------------------------------------------------
/static/upyun_logo5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androidmumo/Bing-upyun/72f024458570ce1edf6487b4ca6ef2540d47449a/static/upyun_logo5.png
--------------------------------------------------------------------------------