Skip to content

Commit e77e8ec

Browse files
committed
1.1.5 version
1 parent 42fea2e commit e77e8ec

File tree

9 files changed

+116
-14
lines changed

9 files changed

+116
-14
lines changed

manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 3,
33
"name": "uyou 新标签页",
44
"description": "这是一个很好看的新标签页!",
5-
"version": "1.1.4",
5+
"version": "1.1.5",
66
"icons": {
77
"128": "extension.png",
88
"48": "extension.png",

newPage/css/setting.css

+28
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,34 @@
397397
background-color: #035fa5;
398398
}
399399

400+
.apiImgButton{
401+
background-color: #0078d4;
402+
border-radius: 8px;
403+
padding: 10px;
404+
width: 130px;
405+
color: white;
406+
font-size: 15px;
407+
text-align: center;
408+
cursor: pointer;
409+
user-select: none;
410+
margin: 5px;
411+
}
412+
.apiImgButton:active{
413+
background-color: #035fa5
414+
}
415+
#apiImgs{
416+
display: flex;
417+
flex-direction: row;
418+
flex-wrap: wrap;
419+
margin: 0px -5px 0px -5px;
420+
}
421+
#mobileApiImgs{
422+
display: flex;
423+
flex-direction: row;
424+
flex-wrap: wrap;
425+
margin: 0px -5px 0px -5px;
426+
}
427+
400428
.hsFeatureHides{
401429
background-color: #e6e6e6;
402430
border-radius: 8px;

newPage/css/style.css

+15-7
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,20 @@ body{
9696
flex-direction: column;
9797
justify-content: center;
9898
align-items: center;
99-
width: 73px;
100-
padding: 3px;
99+
width: 72px;
100+
padding: 4px;
101101
background-color: #ffffff70;
102102
border-radius: 8px;
103103
height: 100%;
104+
text-align: center;
105+
}
106+
.weatherTime{
107+
background-color: #ffffff70;
108+
padding: 3px;
109+
margin-bottom: 2px;
110+
width: 40px;
111+
text-align: center;
112+
border-radius: 20px;
104113
}
105114

106115
#click{
@@ -148,13 +157,12 @@ body{
148157
outline: 0px;
149158
}
150159
.searchbar img{
151-
height: 30px;
152-
width: 30px;
160+
padding: 5px;
161+
height: 20px;
162+
width: 20px;
153163
margin-right: 10px;
154164
border-radius: 50%;
155-
}
156-
.searchbar img:hover{
157-
background-color: #00000010;
165+
background-color: white;
158166
}
159167

160168
/* This is favourite link style */

newPage/index.html

+14-3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@
107107
</div>
108108
<div id="picError"></div>
109109
<img src="" id="viewImg" style="display: none;">
110+
<div id="apiImg">
111+
<div class="backgroundTitile">自动切换图片</div>
112+
<div id="apiImgs">
113+
<div class="apiImgButton" id="bingImg">Bing 每日一图</div>
114+
<div class="apiImgButton" id="cwImg">东方 Project</div>
115+
</div>
116+
<div id="mobileApiImgs" style="display: none;">
117+
<div class="apiImgButton" id="bingImgMobile">Bing 每日一图</div>
118+
<div class="apiImgButton" id="cwImgMobile">东方 Project</div>
119+
</div>
120+
</div>
110121
<div id="exImg">
111122
<div class="backgroundTitile">本地图片</div>
112123
<div class="exImgs" id="exImgs">
@@ -386,19 +397,19 @@
386397
<div id="todayWeathertemp"></div>
387398
<div class="feaWeather">
388399
<div class="feaWeatherbox">
389-
<div id="time2"></div>
400+
<div id="time2" class="weatherTime"></div>
390401
<div id="day2Weather"></div>
391402
<img src="" id="day2Img" style="width: 30px; height: 30px;">
392403
<div id="day2Temp"></div>
393404
</div>
394405
<div class="feaWeatherbox">
395-
<div id="time3"></div>
406+
<div id="time3" class="weatherTime"></div>
396407
<div id="day3Weather"></div>
397408
<img src="" id="day3Img" style="width: 30px; height: 30px;">
398409
<div id="day3Temp"></div>
399410
</div>
400411
<div class="feaWeatherbox">
401-
<div id="time4"></div>
412+
<div id="time4" class="weatherTime"></div>
402413
<div id="day4Weather"></div>
403414
<img src="" id="day4Img" style="width: 30px; height: 30px;">
404415
<div id="day4Temp"></div>

newPage/js/features/settingMenu.js

+21
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ function settingMenus() {
5858
elemenetGetId('uploadBtn').style.width = settingWidth - 62 + 'px';
5959
elemenetGetId('onlinePicUrl').style.width = settingWidth - 97 + 'px';
6060
elemenetGetId('review').style.width = '70px';
61+
elemenetGetClass('apiImgButton')[2].style.width = settingWidth / 2 - 46.5 + 'px';
62+
elemenetGetClass('apiImgButton')[3].style.width = settingWidth / 2 - 46.5 + 'px';
6163
}
6264
}
6365
elemenetGetId('festuresSettings').onclick = function () {
@@ -173,4 +175,23 @@ function loaclImgChange() {
173175
chrome.storage.local.set({ 'picUrl': "'imgs/mobile/background - 5.jpg'" });
174176
elemenetGetId('background').style.backgroundImage = 'url("imgs/mobile/background - 5.jpg")';
175177
}
178+
}
179+
180+
function apiImg() {
181+
elemenetGetId('bingImg').onclick = function () {
182+
chrome.storage.local.set({ 'picUrl': "https://api.dujin.org/bing/1920.php" });
183+
elemenetGetId('background').style.backgroundImage = 'url("https://api.dujin.org/bing/1920.php")';
184+
}
185+
elemenetGetId('cwImg').onclick = function () {
186+
chrome.storage.local.set({ 'picUrl': "https://img.paulzzh.com/touhou/random" });
187+
elemenetGetId('background').style.backgroundImage = 'url("https://img.paulzzh.com/touhou/random")';
188+
}
189+
elemenetGetId('bingImgMobile').onclick = function () {
190+
chrome.storage.local.set({ 'picUrl': "https://api.dujin.org/bing/m.php" });
191+
elemenetGetId('background').style.backgroundImage = 'url("https://api.dujin.org/bing/m.php")';
192+
}
193+
elemenetGetId('cwImgMobile').onclick = function () {
194+
chrome.storage.local.set({ 'picUrl': "https://img.paulzzh.com/touhou/random?size=wap" });
195+
elemenetGetId('background').style.backgroundImage = 'url("https://img.paulzzh.com/touhou/random?size=wap")';
196+
}
176197
}

newPage/js/features/settings.js

+1
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,5 @@ function settingUse() {
128128
loaclImgChange();
129129
otherFeatures();
130130
moreSearch();
131+
apiImg();
131132
}

newPage/js/features/weather.js

+25-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
function weatherGet(city, day) {
22
var httpRequest = new XMLHttpRequest();
33
day = day - 1;
4+
5+
function dayTo(str) {
6+
return str.match(/\(([^)]*)\)/);
7+
}
8+
function dayTo2(str) {
9+
return str.split(/\(.*?\)/);
10+
}
11+
12+
var weatherTime = '';
13+
414
httpRequest.open('GET', 'https://query.asilu.com/weather/baidu/?city=' + city, true);
515
httpRequest.send();
616

@@ -40,7 +50,14 @@ function weatherGet(city, day) {
4050
} else {
4151
weatherImg = 'imgs/dLinkIcon.png';
4252
}
43-
elemenetGetId('time' + dayfea).innerText = obj.weather[dayfea - 1].date;
53+
54+
if (dayfea < 4) {
55+
weatherTime = dayTo(obj.weather[dayfea - 1].date)[1];
56+
} else {
57+
weatherTime = dayTo2(obj.weather[dayfea - 1].date)[0]
58+
}
59+
60+
elemenetGetId('time' + dayfea).innerText = weatherTime;
4461
elemenetGetId('day' + dayfea + 'Weather').innerText = obj.weather[dayfea - 1].weather;
4562
elemenetGetId('day' + dayfea + 'Img').src = weatherImg;
4663
elemenetGetId('day' + dayfea + 'Temp').innerText = obj.weather[dayfea - 1].temp;
@@ -127,6 +144,13 @@ function weatherUse() {
127144
weatherHide = !weatherHide;
128145
}
129146
} else {
147+
elemenetGetClass('feaWeatherbox')[0].style.marginLeft = '-3px';
148+
elemenetGetClass('feaWeatherbox')[2].style.marginRight = '-3px';
149+
elemenetGetClass('feaWeatherbox')[0].style.width = '74px';
150+
elemenetGetClass('feaWeatherbox')[1].style.width = '74px';
151+
elemenetGetClass('feaWeatherbox')[2].style.width = '74px';
152+
elemenetGetClass('feaWeather')[0].style.marginBottom = '4px';
153+
elemenetGetId('weather').style.height = '250px'
130154
setTimeout(function () {
131155
elemenetGetId('weatherMain').style.display = '';
132156
if (elemenetGetId('button').innerText == '暂时没有有连接到可以访问互联网的网络哦~') {

newPage/js/main/main.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function changeStyle() {
3333
elemenetGetClass('backgroundTitile')[num].style.backgroundColor = '#ffffff70';
3434
elemenetGetClass('backgroundTitile')[num].style.borderRadius = '10px';
3535
elemenetGetClass('backgroundTitile')[num].style.padding = '10px';
36-
if (num == 0 || num == 1 || num == 2) {
36+
if (num == 0 || num == 1 || num == 2 || num == 3) {
3737
elemenetGetClass('backgroundTitile')[num].style.width = 'fit-content';
3838
}
3939
if (num == 1) {
@@ -99,6 +99,8 @@ function changeStyle() {
9999
elemenetGetId('weather').style.transition = '0s';
100100
elemenetGetId('top-right').style.zIndex = 102;
101101
elemenetGetId('weatherImg').style.transition = '0s';
102+
elemenetGetId('apiImgs').style.display = 'none';
103+
elemenetGetId('mobileApiImgs').style.display = '';
102104
elemenetGetClass('mobileExImgs')[0].style.display = '';
103105
elemenetGetClass('donateMsg')[0].style.backgroundColor = '#ffffff70'
104106
elemenetGetClass('donateMsg')[0].style.borderRadius = '10px';
@@ -109,6 +111,7 @@ function changeStyle() {
109111
titleBack(3);
110112
titleBack(4);
111113
titleBack(5);
114+
titleBack(6);
112115
window.onresize = function () {
113116
var nowHeight = document.documentElement.clientHeight;
114117
if (screenHeight - nowHeight > 50) {

popupPage/extension.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,19 @@ <h2>欢迎使用 uyou 新标签页</h2>
1515
<div id="web">前往官网</div>
1616
</div>
1717
<div class="Title new">当前版本:</div>
18+
<div class="message">
19+
<div class="v">版本:1.1.5</div>
20+
<div class="info">新增更多自动切换图片源</div>
21+
<div class="info">优化天气功能显示</div>
22+
<div class="info">优化搜索栏图标</div>
23+
</div>
24+
<div class="Title old">历史版本:</div>
1825
<div class="message">
1926
<div class="v">版本:1.1.4</div>
2027
<div class="info">新增天气功能</div>
2128
<div class="info">新增点击空白区域关闭设置/一言功能</div>
2229
<div class="info">新增点击空白区域关闭关于/历史记录功能</div>
2330
</div>
24-
<div class="Title old">历史版本:</div>
2531
<div class="message">
2632
<div class="v">版本:1.1.3</div>
2733
<div class="info">优化了移动端扩展菜单样式</div>

0 commit comments

Comments
 (0)