Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev/ui' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyueyi committed Jun 23, 2022
2 parents e21181c + 102ef14 commit 333cd65
Show file tree
Hide file tree
Showing 46 changed files with 2,200 additions and 800 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@ yarn.lock
package-lock.json

ssl

upload.sh
110 changes: 83 additions & 27 deletions assets/fonts/iconfont/iconfont.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

yarn generate

tar -zcvf tool.tar.gz dist
23 changes: 19 additions & 4 deletions components/Favorites.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<template>
<nya-container v-if="favorites.length" title="收藏夹" icon="star-outline">
<nuxt-link
<nya-link
v-for="(tool, index) in favorites"
:key="index"
:to="tool.path"
class="nya-btn"
>
class="nya-btn">
<nya-icon :icon="tool.icon" style="width: 1.2em; height: 1.2em;" v-if="icoIcon(tool.icon)"></nya-icon>
<i v-else-if="evaIcon(tool.icon)" :class="'eva eva-1x eva-' + tool.icon"></i>
{{ tool.name }}
</nuxt-link>
</nya-link>
</nya-container>
</template>

Expand All @@ -18,6 +19,7 @@ export default {
toolsList() {
let arr = [];
this.$store.state.tools.forEach(tool => {
tool.list.forEach(item => item['category'] = tool['title']);
arr = arr.concat(tool.list);
});
return arr;
Expand All @@ -33,6 +35,19 @@ export default {
});
return results;
}
},
methods: {
evaIcon(icon) {
return icon;
},
icoIcon(icon) {
if (!icon) {
return false;
}
return !!icon.startsWith("#icon");
},
}
};
</script>
71 changes: 21 additions & 50 deletions components/Footer.vue
Original file line number Diff line number Diff line change
@@ -1,43 +1,26 @@
<template>
<div class="vfooter">
<!-- <a title="QQ群" href="https://jq.qq.com/?_wv=1027&k=5aPVskX" target="_blank" rel="noopener noreferrer">-->
<!-- <svg class="icon" aria-hidden="true">-->
<!-- <use xlink:href="#icon-QQ" />-->
<!-- </svg>-->
<!-- </a>-->

<!-- <a title="Twitter" href="https://twitter.com/Ice_Hazymoon" target="_blank" rel="noopener noreferrer">-->
<!-- <svg class="icon" aria-hidden="true">-->
<!-- <use xlink:href="#icon-twitter" />-->
<!-- </svg>-->
<!-- </a>-->

<a title="GitHub" href="https://github.com/liuyueyi/quick-tools" target="_blank" rel="noopener noreferrer">
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-github" />
</svg>
</a>

<!-- <a title="blog" href="https://hhui.top" target="_blank" rel="noopener noreferrer">-->
<!-- <svg class="icon" aria-hidden="true">-->
<!-- <use xlink:href="#icon-telegram" />-->
<!-- </svg>-->
<!-- </a>-->

<!-- <a title="微博" href="http://weibo.com/u/2169825577" target="_blank" rel="noopener noreferrer">-->
<!-- <svg class="icon" aria-hidden="true">-->
<!-- <use xlink:href="#icon-weibo" />-->
<!-- </svg>-->
<!-- </a>-->
<div>
<span style="margin:4px;font-size:.8em">
© 2022 <a target="_blank" href="https://github.com/liuyueyi">一灰灰Blog</a> 版权所有 |
<a href="http://www.beian.miit.gov.cn" target="_blank">鄂ICP备18017282号</a>
</span>
</div>
<div>
<span> {{ this.nowTime }} </span>
</div>
</div>
</template>

<script>
if (process.browser) {
require('../assets/fonts/iconfont/iconfont');
}
export default {
name: 'Vfooter'
name: 'Vfooter',
props: {
nowTime: {
type: String,
default: String(new Date())
},
}
};
</script>

Expand All @@ -48,24 +31,12 @@ export default {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
flex-wrap: wrap;
a {
color: inherit;
}
.icon {
cursor: pointer;
$iconSize: 25px;
width: $iconSize;
height: $iconSize;
margin: 0 7px;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
background-color: rgba($color: #fff, $alpha: 0.65);
color: #222831;
border-radius: 50%;
padding: 5px;
box-shadow: 8px 14px 38px rgba(39, 44, 49, 0.06),
1px 3px 8px rgba(39, 44, 49, 0.03);
color: #38b7ea;
text-decoration: none;
}
}
</style>
138 changes: 97 additions & 41 deletions components/Navbar.vue
Original file line number Diff line number Diff line change
@@ -1,62 +1,118 @@
<template>
<div class="navbar">
<header>
<h1 class="title">
<nuxt-link to="/">
Quick - 工具箱
</nuxt-link>
</h1>
<Panel />
</header>
</div>
<nav class="navbar navbar-expand-md fixed-top"
:class="$store.state.dark ? ' navbar-dark nav-bg-dark' : ' navbar-light nav-bg-light'">
<a class="navbar-brand" href="/">
<img src="/icon.svg" width="30" height="30" alt="" loading="lazy">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav mr-auto">
<li class="nav-item" :class="subTitleChecked('/')">
<a class="nav-link" href="/"> 工具箱</a>
</li>
<li class="nav-item" :class="subTitleChecked('/wechat')">
<a class="nav-link" href="https://wechat.hhui.top">微信公众号编辑器</a>
</li>
<li class="nav-item" :class="subTitleChecked('/favorite')">
<a class="nav-link" href="/favorite">收藏</a>
</li>
<li class="nav-item" :class="subTitleChecked('/setting')">
<a class="nav-link" href="/setting">设置</a>
</li>
<li class="nav-item" :class="subTitleChecked('/links')">
<a class="nav-link" href="/links">友链</a>
</li>
</ul>
<!-- 搜索,只有非主页时才显示 -->
<form class="form-inline my-md-0" action="/search" method="get" target="_blank"
v-if="this.$route.path !== '/'">
<input name="key" required class="form-control mr-sm-2" type="text" placeholder="搜索">
</form>
<ul class="navbar-nav my-md-0">
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="modal" data-target="#loginModal">登录</a>
</li>
</ul>
</div>
</nav>
</template>

<script>
import Panel from '~/components/Panel';
import Search from "./Search";
const TAB_LINK = [
"/setting", "/links", "/wechat", "/favorite"
];
export default {
name: 'Navbar',
components: {
Search,
Panel
},
methods: {
inTabLink(path) {
for (let i = 0; i < TAB_LINK.length; i++) {
if (TAB_LINK[i] === path) {
return true;
}
}
return false;
},
subTitleChecked(path) {
const localPath = this.$route.path;
let res;
if (this.inTabLink(path)) {
res = localPath.startsWith(path) ? 'active' : '';
} else {
let otherTabChoose = false;
for (let i = 0; i < TAB_LINK.length; i++) {
if (localPath.startsWith(TAB_LINK[i])) {
res = '';
otherTabChoose = true;
break
}
}
if (!otherTabChoose) {
// 若当前路径非TAB_LINK中页面,则将工具箱设置为选中
res = 'active';
}
}
return res;
}
}
};
</script>


<style lang="scss">
.navbar {
box-sizing: border-box;
padding-top: 20px;
padding-bottom: 10px;
h2 {
font-size: 20px;
margin-top: -40px;
.nav-bg-light {
background-color: #fff;
border-bottom: 1px solid #f2f6fc;
}
.nav-bg-dark {
background-color: #333;
border-bottom: 1px solid #32363c;
}
nav {
.selected-domain {
border-bottom: 1px solid #28a745;
}
.selected-domain a .nav-link {
color: #004fc4;
}
button {
a {
font-weight: bold;
font-size: .9em;
}
header {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
.title {
margin-bottom: 5px;
display: flex;
align-items: center;
color: var(--t1);
cursor: pointer;
text-shadow: 1px 1px 1px rgba($color: #000000, $alpha: 0.15);
a {
color: var(--t1);
cursor: pointer;
display: flex;
align-items: center;
&:hover {
text-decoration: none;
}
}
}
.active {
font-size: 1.1em;
}
}
</style>
33 changes: 18 additions & 15 deletions components/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,16 @@ export default {
computed: {
toolsList() {
let arr = [];
this.$store.state.tools.forEach(tool => {
// 更新每个工具的分类
let tools = this.$store.state.tools;
for (let i = 0; i < tools.length; i++) {
const tool = tools[i];
const category = tool['title'];
for (let j = 0; j < tool.list.length; j++) {
tool.list[j]['category'] = category;
}
arr = arr.concat(tool.list);
});
}
return arr;
},
searchList() {
Expand All @@ -56,22 +63,18 @@ export default {
this.toolsList.forEach(tool => {
if (this.$route.path !== '/hide_tool' && !this.showBtn(tool))
return false;
if (
tool.pinyin.first.find(i => {
return i.indexOf(value) >= 0;
})
) {
if (tool.pinyin.first.find(i => { return i.indexOf(value) >= 0;})) {
return results.push(tool);
}
if (
tool.pinyin.pinyin.find(i => {
return i.indexOf(value) >= 0;
})
) {
} else if (tool.pinyin.pinyin.find(i => {return i.indexOf(value) >= 0;})) {
return results.push(tool);
}
if (tool.name.toLowerCase().indexOf(value) >= 0)
} else if (tool.name.toLowerCase().indexOf(value) >= 0) {
// 拼音搜索
results.push(tool);
} else if (tool.en_name.toLowerCase().indexOf(value) >= 0) {
// 英文搜索
results.push(tool);
}
});
return results;
}
Expand Down
6 changes: 3 additions & 3 deletions components/SetBackground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<nya-radio value="anime" label="随机动漫图片" />
<nya-radio value="bing" label="必应每日壁纸" />
<nya-radio value="custom" label="自定义来源" />
<nya-radio value="upload" label="上传壁纸" />
<!-- <nya-radio value="upload" label="上传壁纸" />-->
</nya-radio-group>
</div>

<nya-input v-show="$store.state.setting.bg.type === 'custom'" :value="$store.state.setting.bg.customUrl" label="输入壁纸链接" :placeholder="`${$store.state.env.url}/icon.png`" autocomplete="off" fullwidth @change="handleChange('setting.bg.customUrl', $event.target.value)" @keyup.enter="handleChange('setting.bg.customUrl', $event.target.value)" />

<div v-show="$store.state.setting.bg.type === 'upload'">
<div class="inputbtn">
<nya-input
Expand Down Expand Up @@ -45,7 +45,7 @@
<hr>

<nya-checkbox :checked="$store.state.setting.bg.transparentEl" label="元素半透明" @change="handleChange('setting.bg.transparentEl', $event)" />

<div class="nya-subtitle">
高斯模糊
</div>
Expand Down
Loading

0 comments on commit 333cd65

Please sign in to comment.