-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
208 lines (181 loc) · 5.99 KB
/
Copy pathindex.html
File metadata and controls
208 lines (181 loc) · 5.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!DOCTYPE html>
<html lang="en">
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?202c7000d0aa1e44186303467e9847a6";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport"
content="width=device-width, initial-scale=1">
<title>bing wallpaper get from yangpf china</title>
<link rel="stylesheet" href="./css/amazeui.css">
<style>
html, body {
height: 100%;
}
body {
background: #0f3854;
background: -webkit-radial-gradient(center ellipse, #0a2e38 0%, #000000 70%);
background: radial-gradient(ellipse at center, #0a2e38 0%, #000000 70%);
background-size: 100%;
}
p {
margin: 0;
padding: 0;
}
#clock {
font-family: 'Share Tech Mono', monospace;
color: #ffffff;
text-align: center;
position: absolute;
left: 50%;
top: 56%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
color: #daf6ff;
text-shadow: 0 0 20px #0aafe6, 0 0 20px rgba(10, 175, 230, 0);
}
#clock .time {
letter-spacing: 0.05rem;
font-size: 2.5rem;
}
#clock .date {
letter-spacing: 0.1rem;
font-size: 1rem;
}
#clock .text {
letter-spacing: 0.1rem;
font-size: 1rem;
}
/* 以上为vue时钟的样式 */
.ntn{
height: 5rem;
padding: 1rem;
position: relative;
}
.btn1{
float: left;
width: 30%;
}
.btn2{
float: right;
width: 30%;
}
#txt{
font-size: 1rem;
text-align: center;
color: cornsilk;
height: 3rem;
}
#b{
text-align: center;
padding-top: 2rem
}
title{
font-size: 2rem
}
</style>
</head>
<body>
<title> bing wallpaper get</title>
<div class="wallpaper">
<figure data-am-widget="figure"
class="am am-figure am-figure-default "
data-am-figure="{ pureview: 'true' }">
<img id="img" />
<figcaption id="txt" class="am-figure-capition-btm">
</figcaption>
</figure>
<div class="ntn">
<button type="button" id="add" class="btn1 am-btn am-btn-primary am-btn-default am-radius am-btn-secondary">下一张</button>
<div id="clock">
<p class="date">{{ date }}</p>
<p class="time">{{ time }}</p>
<p class="text">戊戌 狗 年</p>
</div>
<button type="button" id="sub" class="btn2 am-btn am-btn-default am-radius am-btn-secondary">上一张</button>
</div>
<p id="b">Copyright 2018-2019 chaofeng.xyz yangpf/2018-02-10</p>
</div>
</body>
</html>
<script src="./js/vue.min.js"></script>
<script src="./js/jquery-3.2.0.min.js"></script>
<script src="./js/amazeui.js"></script>
<script>
var test = document.getElementById('img');
test.dataset.rel = "https://www.bing.com/az/hprichbg/rb/SiberianJay_ZH-CN8167378429_1920x1080.jpg";
$(function () {
$.get("https://bird.ioliu.cn/v1/?url=http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1", function (data) {
var text = data.images[0].copyright;
var imgSrc = 'https://www.bing.com' + data.images[0].url
$('#img').attr('src', imgSrc)
$('.am-img-loaded').attr('src', imgSrc)
$('#txt').html(text)
}, 'json');
});
var urlIndex = 0
$("#add").click(function(){
urlIndex++;
url1 ="http://www.bing.com/HPImageArchive.aspx?format=js&idx=" + urlIndex + "&n=1"
if(urlIndex > 7 ){
$('#add').alert("没有图片了")
urlIndex--;
}else{
$.get('https://bird.ioliu.cn/v1/?url=' + url1, function (data) {
var text = data.images[0].copyright;
var imgSrc = 'https://www.bing.com' + data.images[0].url
$('#img').attr('src', imgSrc)
$('.am-img-loaded').attr('src', imgSrc)
$('#txt').html(text)
}, 'json');
}
})
$("#sub").click(function(){
urlIndex--;
url1 ="http://www.bing.com/HPImageArchive.aspx?format=js&idx=" + urlIndex + "&n=1"
if(urlIndex < -1 ){
urlIndex++
}else{
$.get('https://bird.ioliu.cn/v1/?url=' + url1, function (data) {
var text = data.images[0].copyright;
var imgSrc = 'https://www.bing.com' + data.images[0].url
$('#img').attr('src', imgSrc)
$('.am-img-loaded').attr('src', imgSrc)
$('#txt').html(text)
}, 'json');
}
})
</script>
<script>
var clock = new Vue({
el: '#clock',
data: {
time: '',
date: ''
}
});
var week = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
var timerID = setInterval(updateTime, 1000);
updateTime();
function updateTime() {
var cd = new Date();
clock.time = zeroPadding(cd.getHours(), 2) + ':' + zeroPadding(cd.getMinutes(), 2) + ':' + zeroPadding(cd.getSeconds(), 2);
clock.date = zeroPadding(cd.getFullYear(), 4) + '-' + zeroPadding(cd.getMonth()+1, 2) + '-' + zeroPadding(cd.getDate(), 2) + ' ' + week[cd.getDay()];
};
function zeroPadding(num, digit) {
var zero = '';
for(var i = 0; i < digit; i++) {
zero += '0';
}
return (zero + num).slice(-digit);
}</script>