Skip to content

Commit

Permalink
update V1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
M-studen committed Feb 20, 2024
1 parent dcec6ca commit 14d9673
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"package": {
"productName": "DnsTools",
"version": "1.2.1"
"version": "1.2.2"
},
"tauri": {
"allowlist": {
Expand Down
56 changes: 56 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,52 @@
<div class="content">
<RouterView></RouterView>
</div>
<div class="zoom" style="zoom: 1 !important;">
{{ "缩放 "+settings.zoom*100+"%"}}
</div>
</n-layout-content>
</n-layout>
</template>

<script setup>
import Menu from "@/components/menu/index.vue";
import { NLayout, NLayoutContent, NLayoutSider, NAffix } from "naive-ui";
import { useSettingsStore } from "./store/settings";
import { ref } from "vue";
import Logo from "@/components/logo/index.vue";
const settings=useSettingsStore()
document.body.style.zoom=settings.zoom
document.addEventListener('keydown', function(event) {
// 检查是否同时按下了Ctrl(Cmd)和'+'或'-'键
if (event.ctrlKey || event.metaKey) { // 在Mac上使用metaKey代替ctrlKey
const zoomIn = event.key === '=';
const zoomOut = event.key === '-';
if (zoomIn || zoomOut) {
// 防止默认行为,比如在输入框中输入'+'或'-'
event.preventDefault();
// 放大或缩小
if (zoomIn) {
if(settings.zoom < 1.7){
settings.zoom = parseFloat((settings.zoom+0.1).toFixed(3)); // 放大10%
}
} else if (zoomOut) {
if(settings.zoom > 0.7){
settings.zoom = parseFloat((settings.zoom-0.1).toFixed(3)); // 缩小10%
}
}
// 设置新的缩放级别
document.body.style.zoom = settings.zoom;
}
}
});
settings.$subscribe((matation,state)=>{
console.log(settings.zoom * 100);
let zoomElement = document.querySelector('.zoom');
zoomElement.classList.add('visible');
setTimeout(function() {
zoomElement.classList.remove('visible');
}, 1000);
})
</script>

<style lang="scss" scoped>
Expand All @@ -35,4 +73,22 @@ import Logo from "@/components/logo/index.vue";
margin-right: 2%;
margin-top: 2%;
}
.zoom {
position: absolute;
top: 0;
right: 0;
margin: 2px 2px;
background-color: rgb(158,158,158);
opacity: 0;
border-radius: 3px;
color: white;
transition: opacity 0.5s linear;
visibility: hidden;
&.visible {
opacity: 0.7;
visibility: visible;
}
}
</style>
3 changes: 2 additions & 1 deletion src/store/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { ref } from 'vue'
export const useSettingsStore = defineStore('settings', {
state: () => ({
filePath: ref("./DnsList.json"),
firstwarn:false
firstwarn:false,
zoom:1
}),
persist:true

Expand Down
35 changes: 19 additions & 16 deletions src/view/about/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@
通过这些特点,为网络用户和专业人士提供了一个实用的工具,能够帮助他们在保持网络性能的同时,确保他们的网络连接不受不必要的干扰。
</n-card>
<n-card title="开发人员" id="kaifa">
<n-avatar
round
size="large"
src="https://pic.imgdb.cn/item/65bdaf56871b83018a17cd21.webp"
/>
<n-avatar round size="large" src="https://pic.imgdb.cn/item/65bdaf56871b83018a17cd21.webp" />
</n-card>
<n-card title="开源及反馈">
<p>GIthub开源地址:<a target="_blank" href="https://github.com/Kukaina/DnsTools/"> https://github.com/Kukaina/DnsTools/</a></p>
<p>
GIthub开源地址:<a target="_blank" href="https://github.com/Kukaina/DnsTools/">
https://github.com/Kukaina/DnsTools/</a>
</p>
<br />
<p>反馈地址:<a href="https://github.com/Kukaina/DnsTools/issues/new" target="_blank"> https://github.com/Kukaina/DnsTools/issues/new</a></p>
<p>
反馈地址:<a href="https://github.com/Kukaina/DnsTools/issues/new" target="_blank">https://github.com/Kukaina/DnsTools/issues/new</a>
</p>
</n-card>
<n-card title="更新日志" id="log">
<h2>V1.2.2_240220</h2>
<span>支持Ctrl +/- 进行缩放</span>
<n-divider />
<h2>V1.2.1_240219</h2>
<span
>新增IPV6 DNS列表,增加消息提醒,优化污染检测功能</span
>
<span>新增IPV6 DNS列表,增加消息提醒,优化污染检测功能</span>
<n-divider />
<h2>V1.2.0_240218</h2>
<span
>新增精简版DNS列表,修复切换页面时测速消失的问题,支持导出为CSV,新增GIthub链接,新增右键复制DNS地址功能</span
>
<span>新增精简版DNS列表,修复切换页面时测速消失的问题,支持导出为CSV,新增GIthub链接,新增右键复制DNS地址功能</span>
<n-divider />
<h2>V1.1.0_240215_beta</h2>
<span>新增设置界面,优化页面结构,新增错误检测</span>
Expand Down Expand Up @@ -70,7 +70,7 @@
</template>

<script setup>
import { NFlex, NCard, NDivider, NAvatar} from "naive-ui";
import { NFlex, NCard, NDivider, NAvatar } from "naive-ui";
</script>

<style lang="scss" scoped>
Expand All @@ -86,13 +86,16 @@ h2 {
font-weight: bold;
margin: 10px 10px;
}
a{
a {
text-decoration: none;
color: black; // 默认文字颜色
border-radius: 5px;
background-color: transparent; // 默认背景透明
transition: background-color 0.3s ease, color 0.3s ease, padding 0.3s ease; // 过渡效果
&:hover, &:focus {
&:hover,
&:focus {
color: white; // 鼠标悬停和聚焦时文字颜色变为白色
background-color: rgb(66, 90, 239); // 鼠标悬停和聚焦时背景颜色变化
border-radius: 5px; // 圆角
Expand Down

0 comments on commit 14d9673

Please sign in to comment.