Skip to content

Commit

Permalink
v10.0.3 修复一些小问题
Browse files Browse the repository at this point in the history
  • Loading branch information
tjy-gitnub committed Jan 31, 2025
1 parent 5a8641a commit 6d10de2
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 59 deletions.
2 changes: 1 addition & 1 deletion bg-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions desktop.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
--fill: #d3d3d370;
--bgul: url('bg.svg');
--mm: #ffffffc0;
--cm: #fafafabb;
--cm: #f7f7f7bb;
--bar: #efefef37;
--hr: #ccc;
--unfoc: #eaeaea;
Expand Down Expand Up @@ -48,7 +48,7 @@
--fill: #99999970;
--bgul: url('bg-dark.svg');
--mm: #ffffff50;
--cm: #252525bb;
--cm: #292929bb;
--bar: #7272722a;
--hr: #333;
--unfoc: #202020;
Expand Down Expand Up @@ -823,9 +823,9 @@ list>span.focs.cl {
left: calc(50% - 450px);
border-radius: 20px;
background: var(--bg70);
backdrop-filter: blur(60px) saturate(3) contrast(0.6);
backdrop-filter: blur(60px) saturate(3) contrast(0.8);
/* backdrop-filter: blur(80px) saturate(1.3); */
-webkit-backdrop-filter: blur(60px) saturate(3) contrast(0.6);
-webkit-backdrop-filter: blur(60px) saturate(3) contrast(0.8);
opacity: 0.5;
transition: 200ms;
box-shadow: 3px 3px 25px 1px var(--sd);
Expand Down Expand Up @@ -1258,9 +1258,9 @@ input-before {
left: calc(50% - 300px);
border-radius: 20px;
background: var(--bg70);
backdrop-filter: blur(60px) saturate(3) contrast(0.6);
backdrop-filter: blur(60px) saturate(3) contrast(0.8);
/* backdrop-filter: blur(80px) saturate(1.3); */
-webkit-backdrop-filter: blur(60px) saturate(3) contrast(0.6);
-webkit-backdrop-filter: blur(60px) saturate(3) contrast(0.8);
opacity: 0.8;
transition: 200ms;
box-shadow: 3px 3px 15px 1px var(--sd);
Expand Down Expand Up @@ -1417,9 +1417,9 @@ input-before {
left: calc(50% - 500px);
border-radius: 20px;
background: var(--bg70);
backdrop-filter: blur(60px) saturate(3) contrast(0.6);
backdrop-filter: blur(60px) saturate(3) contrast(0.8);
/* backdrop-filter: blur(80px) saturate(1.3); */
-webkit-backdrop-filter: blur(60px) saturate(3) contrast(0.6);
-webkit-backdrop-filter: blur(60px) saturate(3) contrast(0.8);
transition: 200ms;
box-shadow: 3px 3px 15px 1px var(--sd);
border: 1.5px solid #6f6f6f30;
Expand Down Expand Up @@ -1612,8 +1612,8 @@ input-before {
width: 350px;
border-radius: 20px;
background-color: var(--bg50);
backdrop-filter: blur(50px) saturate(3) contrast(0.6);
-webkit-backdrop-filter: blur(50px) saturate(3) contrast(0.6);
backdrop-filter: blur(50px) saturate(3) contrast(0.8);
-webkit-backdrop-filter: blur(50px) saturate(3) contrast(0.8);
transition: 200ms;
box-shadow: 3px 3px 15px 1px var(--sd);
border: 1.5px solid #6f6f6f30;
Expand Down Expand Up @@ -2009,7 +2009,7 @@ input-before {
padding: 0px 6px;
max-height: 0;
width: max-content;
transition: 110ms, max-height 200ms ease-in-out, top 100ms, left 100ms, padding 200ms ease-in-out, box-shadow 1s;
transition: 110ms, max-height 200ms ease-in-out, top 100ms, left 100ms, padding 200ms ease-in-out, box-shadow 700ms;
opacity: 0;
}

Expand Down Expand Up @@ -2341,9 +2341,9 @@ input-before {

.window.foc {
background: var(--bg70);
backdrop-filter: saturate(3.5) contrast(0.6) blur(60px);
backdrop-filter: saturate(3.5) contrast(0.8) blur(60px);
filter: none;
-webkit-backdrop-filter: saturate(3.5) contrast(0.6) blur(60px);
-webkit-backdrop-filter: saturate(3.5) contrast(0.8) blur(60px);
box-shadow: 3px 3px 20px 3px var(--sd);
}

Expand Down
16 changes: 8 additions & 8 deletions desktop.html
Original file line number Diff line number Diff line change
Expand Up @@ -532,15 +532,15 @@
<div class="content">
<div class="template">
<div class="calc">
<div class="wg calc">
<div class="wg calc template">
<div class="titbar">
<a win12_title="更多" onmouseenter="showdescp(event)" onmouseleave="hidedescp(event)" class="a more notip" onclick="$('.wg.calc>.titbar>.menu').toggleClass('show')"><i class="bi bi-three-dots"></i></a>
<div class="menu">
<a win12_title="打开应用" class="a img openapp" onclick="$('.wg.calc>.titbar>.menu').removeClass('show');hide_widgets();openapp('calc')" onmouseenter="showdescp(event)" onmouseleave="hidedescp(event)">
<img src="icon/calc.svg">
</a>
<a class="a move" win12_title="移动" onmouseenter="showdescp(event)" onclick=" hidedescp(event); if (!edit_mode) { editMode(); }" onmouseleave="hidedescp(event)"><i class="bi bi-arrows-move"></i></a>
<a class="a addtodt" win12_title="添加到桌面" onmouseenter="showdescp(event)" onclick="hidedescp(event); widgets.widgets.addToDesktop('calc');" onmouseleave="hidedescp(event)"><i class="bi bi-box-arrow-in-right"></i></a>
<a class="a addtodt" win12_title="添加到桌面" onmouseenter="showdescp(event)" onclick="hidedescp(event); widgets.widgets.remove('calc'); widgets.widgets.addToDesktop('calc');" onmouseleave="hidedescp(event)"><i class="bi bi-box-arrow-in-right"></i></a>
<a class="a delete" win12_title="删除" onmouseenter="showdescp(event)" onmouseleave="hidedescp(event)" onclick="hidedescp(event); $('.wg.calc>.titbar>.menu').removeClass('show'); widgets.widgets.remove('calc');"><i class="bi bi-trash"></i></a>
</div>
</div>
Expand Down Expand Up @@ -606,13 +606,13 @@
</div>
</div>
<div class="weather">
<div class="wg weather">
<div class="wg weather template">
<div class="titbar">
<a win12_title="更多" onmouseenter="showdescp(event)" onmouseleave="hidedescp(event)" class="a more notip" onclick="$('.wg.weather>.titbar>.menu').toggleClass('show')"><i class="bi bi-three-dots"></i></a>
<div class="menu">
<a class="a move" win12_title="移动" onmouseenter="showdescp(event)" onmouseleave="hidedescp(event)" onclick="hidedescp(event); if (!edit_mode) { editMode() }; "><i class="bi bi-arrows-move"></i></a>
<a class="a addtotb" win12_title="添加到任务栏" onmouseenter="showdescp(event)" onmouseleave="hidedescp(event)" onclick="hidedescp(event); widgets.widgets.addToToolbar('weather'); "><i class="bi bi-menu-app"></i></a>
<a class="a addtodt" win12_title="添加到桌面" onmouseenter="showdescp(event)" onclick="hidedescp(event); widgets.widgets.addToDesktop('weather'); " onmouseleave="hidedescp(event)"><i class="bi bi-box-arrow-in-right"></i></a>
<a class="a addtotb" win12_title="添加到任务栏" onmouseenter="showdescp(event)" onmouseleave="hidedescp(event)" onclick="hidedescp(event); widgets.widgets.remove('weather'); widgets.widgets.addToToolbar('weather'); "><i class="bi bi-menu-app"></i></a>
<a class="a addtodt" win12_title="添加到桌面" onmouseenter="showdescp(event)" onclick="hidedescp(event); widgets.widgets.remove('weather'); widgets.widgets.addToDesktop('weather'); " onmouseleave="hidedescp(event)"><i class="bi bi-box-arrow-in-right"></i></a>
<a class="a delete" win12_title="删除" onmouseenter="showdescp(event)" onmouseleave="hidedescp(event)" onclick="hidedescp(event); $('.wg.weather>.titbar>.menu').removeClass('show'); widgets.widgets.remove('weather'); "><i class="bi bi-trash"></i></a>
</div>
</div>
Expand All @@ -626,7 +626,7 @@
</div>
</div>
<div class="monitor">
<div class="wg monitor">
<div class="wg monitor template">
<div class="titbar">
<a win12_title="更多" onmouseenter="showdescp(event)" onmouseleave="hidedescp(event)" class="a more notip" onclick="$('.wg.monitor>.titbar>.menu').toggleClass('show')"><i class="bi bi-three-dots"></i></a>
<div class="menu">
Expand All @@ -635,8 +635,8 @@
</a>
<a class="a chose" win12_title="切换监视器类型" onmouseenter="showdescp(event)" onmouseleave="hidedescp(event)" onclick="showdescp(event); shownotice('widgets.monitor'); "><i class="bi bi-arrow-left-right"></i></a>
<a class="a move" win12_title="移动" onmouseenter="showdescp(event)" onmouseleave="hidedescp(event)" onclick="showdescp(event); if (!edit_mode) { editMode(); } "><i class="bi bi-arrows-move"></i></a>
<a class="a addtotb" win12_title="添加到任务栏" onmouseenter="showdescp(event)" onmouseleave="hidedescp(event)" onclick="showdescp(event); widgets.widgets.addToToolbar('monitor'); "><i class="bi bi-menu-app"></i></a>
<a class="a addtodt" win12_title="添加到桌面" onmouseenter="showdescp(event)" onclick="showdescp(event); widgets.widgets.addToDesktop('monitor'); " onmouseleave="hidedescp(event)"><i class="bi bi-box-arrow-in-right"></i></a>
<a class="a addtotb" win12_title="添加到任务栏" onmouseenter="showdescp(event)" onmouseleave="hidedescp(event)" onclick="showdescp(event); widgets.widgets.remove('monitor'); widgets.widgets.addToToolbar('monitor'); "><i class="bi bi-menu-app"></i></a>
<a class="a addtodt" win12_title="添加到桌面" onmouseenter="showdescp(event)" onclick="showdescp(event); widgets.widgets.remove('monitor'); widgets.widgets.addToDesktop('monitor'); " onmouseleave="hidedescp(event)"><i class="bi bi-box-arrow-in-right"></i></a>
<a class="a delete" win12_title="删除" onmouseenter="showdescp(event)" onmouseleave="hidedescp(event)" onclick="showdescp(event); $('.wg.monitor>.titbar>.menu').removeClass('show'); widgets.widgets.remove('monitor'); "><i class="bi bi-trash"></i></a>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,9 @@ let nts = {
cnt: `
<p class="tit">添加桌面小组件</p>
<list class="new">
<a class="a" onclick="closenotice(); widgets.widgets.add('calc'); widgets.widgets.addToDesktop('calc');">计算器</a>
<a class="a" onclick="closenotice(); widgets.widgets.add('weather'); widgets.widgets.addToDesktop('weather');">天气</a>
<a class="a" onclick="closenotice(); widgets.widgets.add('monitor'); widgets.widgets.addToDesktop('monitor');">系统性能监视器</a>
<a class="a" onclick="closenotice(); widgets.widgets.addToDesktop('calc');">计算器</a>
<a class="a" onclick="closenotice(); widgets.widgets.addToDesktop('weather');">天气</a>
<a class="a" onclick="closenotice(); widgets.widgets.addToDesktop('monitor');">系统性能监视器</a>
</list>`,
btn: [
{ type: 'cancel', text: lang('取消','cancel'), js: 'closenotice();' }
Expand Down
19 changes: 11 additions & 8 deletions module/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let widgets = {
return;
}
$('#widgets>.widgets>.content>.grid')[0].innerHTML += $('#widgets>.widgets>.content>.template>.' + arg).html();
$('#widgets>.widgets>.content>.grid>.wg.' + arg).addClass('menu');
$('#widgets>.widgets>.content>.grid>.wg.' + arg).removeClass('template').addClass('menu');
widgets[arg].init();

},
Expand All @@ -16,30 +16,33 @@ let widgets = {
widgets[arg].remove();
},
addToToolbar: (arg) => {
widgets.widgets.remove(arg);
// widgets.widgets.remove(arg);
if ($('.wg.toolbar.' + arg).length != 0) {
return;
}
$('#toolbar')[0].innerHTML += $('#widgets>.widgets>.content>.template>.' + arg).html();
$('#toolbar>.wg.' + arg).addClass('toolbar');
$('#toolbar>.wg.' + arg).removeClass('template').addClass('toolbar');
widgets[arg].init();
},
addToDesktop: (arg) => {
widgets.widgets.remove(arg);
// widgets.widgets.remove(arg);
if ($('.wg.toolbar.' + arg).length != 0) {
return;
}
$('#desktop-widgets')[0].innerHTML += $('#widgets>.widgets>.content>.template>.' + arg).html();
$('#desktop-widgets>.' + arg).addClass('desktop');
widgets[arg].init();
$('#desktop-widgets>.' + arg).removeClass('template').addClass('desktop');
// setTimeout(() => {
widgets[arg].init();
// }, 5000);
}
},
calc: {
init: () => {
widgetCalculator = new Calculator($('*:not(.template)>*>.wg.calc>.content>.container>#calc-input-widgets')[0], $('*:not(.template)>*>.wg.calc>.content')[0]);
widgetCalculator = new Calculator('.wg.calc:not(.template)>.content>.container>#calc-input-widgets', '.wg.calc:not(.template)>.content');
},
remove: () => {
$('#calc-input-widgets')[0].value = '0';
// $('#calc-input-widgets')[0].value = '0';
$('#calc-input-widgets').val('0');
}
},
weather: {
Expand Down
51 changes: 26 additions & 25 deletions scripts/calculator_kernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,33 @@ class Calculator {
}

get_num() {
return Big(this.elt.value);
return Big($(this.elt)[0].value);
}

number_key(key) {
// key:按下的数字键,int
// id:显示区的id
if (this.elt.value == '0' || this.preview) {
this.elt.value = '';
console.log($(this.elt)[0],$(this.elt)[0].value);
if ($(this.elt)[0].value == '0' || this.preview) {
$(this.elt)[0].value = '';
this.preview = false;
}
this.elt.value += key;
$(this.elt)[0].value += key;
this.uncheck();
}

func_key(key) {
// key:按下的功能键,int,加1,减2,乘3,除4
if (!this.isCheck()) {
if (this.num1 != null) {
this.num2 = Big(this.elt.value);
this.num2 = Big($(this.elt)[0].value);
this.num1 = Big(this._calc(this.num1, this.num2, this.operator));
this.elt.value = this.num1;
$(this.elt)[0].value = this.num1;
this.preview = true;
}
else {
this.num1 = Big(this.elt.value);
this.elt.value = this.num1;
this.num1 = Big($(this.elt)[0].value);
$(this.elt)[0].value = this.num1;
this.preview = true;
}
}
Expand All @@ -48,13 +49,13 @@ class Calculator {
}

uncheck() {
for (const elt of this.keysContainer.children) {
for (const elt of $(this.keysContainer)[0].children) {
elt.classList.remove('checked');
}
}

isCheck() {
for (const elt of this.keysContainer.children) {
for (const elt of $(this.keysContainer)[0].children) {
if (elt.classList.contains('checked')) {
return true;
}
Expand All @@ -63,34 +64,34 @@ class Calculator {
}

point() {
if (this.elt.value == '') {
this.elt.value = '0';
if ($(this.elt)[0].value == '') {
$(this.elt)[0].value = '0';
}
if (!(this.elt.value.includes('.'))) {
this.elt.value += '.';
if (!($(this.elt)[0].value.includes('.'))) {
$(this.elt)[0].value += '.';
}
}

square() {
this.elt.value = Math.pow(Number(this.get_num().toString()), 2);
$(this.elt)[0].value = Math.pow(Number(this.get_num().toString()), 2);
}

squareRoot() {
this.elt.value = Math.sqrt(Number(this.get_num().toString()));
$(this.elt)[0].value = Math.sqrt(Number(this.get_num().toString()));
}

backspace() {
if (this.elt.value.length > 0) {
this.elt.value = this.elt.value.substring(0, this.elt.value.length - 1);
if ($(this.elt)[0].value.length > 0) {
$(this.elt)[0].value = $(this.elt)[0].value.substring(0, $(this.elt)[0].value.length - 1);
}
if (this.elt.value == '') {
this.elt.value = '0';
if ($(this.elt)[0].value == '') {
$(this.elt)[0].value = '0';
}
}


clear_num() {
this.elt.value = '0';
$(this.elt)[0].value = '0';
this.num1 = null, this.num2 = null, this.operator = 0;
this.uncheck();
}
Expand All @@ -100,11 +101,11 @@ class Calculator {
if (this.operator == 0) {
return true;
}
this.num2 = Big(this.elt.value);
this.num2 = Big($(this.elt)[0].value);
var num = this._calc(this.num1, this.num2, this.operator);
this.clear_num();
if (num != null) {
this.elt.value = num;
$(this.elt)[0].value = num;
return true;
}
return false;
Expand All @@ -124,5 +125,5 @@ class Calculator {
}
}

var widgetCalculator = new Calculator($('#calc-input-widgets')[0], $('#widgets .calc>.content')[0]);
var appCalculator = new Calculator($('#calc-input')[0], $('#win-calc>.keyb')[0]);
var widgetCalculator = new Calculator('#calc-input-widgets', '#widgets .calc>.content');
var appCalculator = new Calculator('#calc-input', '#win-calc>.keyb');

0 comments on commit 6d10de2

Please sign in to comment.