feat: 完善搜索模块内容
@@ -1,6 +1,9 @@
|
||||
// Naive UI 配置
|
||||
// Naive UI 配置和功能
|
||||
|
||||
import { dateZhCN, zhCN } from 'naive-ui';
|
||||
import {
|
||||
createDiscreteApi,
|
||||
dateZhCN, zhCN,
|
||||
} from 'naive-ui';
|
||||
|
||||
/** @type { import('naive-ui').ConfigProviderProps } */
|
||||
export const configProviderProps = {
|
||||
@@ -44,3 +47,22 @@ export const configProviderProps = {
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
export const {
|
||||
message: $message,
|
||||
notification: $notification,
|
||||
} = createDiscreteApi(
|
||||
[
|
||||
'message',
|
||||
'notification',
|
||||
],
|
||||
{
|
||||
configProviderProps: configProviderProps,
|
||||
messageProviderProps: {
|
||||
closable: true,
|
||||
duration: 2000,
|
||||
keepAliveOnHover: true,
|
||||
placement: 'top',
|
||||
},
|
||||
},
|
||||
);
|
||||
|
210
src/assets/js/search-engine.js
Normal file
@@ -0,0 +1,210 @@
|
||||
// 搜索引擎
|
||||
|
||||
import {
|
||||
ref,
|
||||
} from 'vue';
|
||||
|
||||
import {
|
||||
SKEY_SEARCH_ENGINE_NAME,
|
||||
} from '@/config/storage';
|
||||
|
||||
import {
|
||||
useLocalStorage,
|
||||
} from '@vueuse/core';
|
||||
|
||||
import {
|
||||
$message,
|
||||
} from './naive-ui';
|
||||
|
||||
/** 打开搜索结果页面 */
|
||||
export function openSearchResult() {
|
||||
|
||||
let engine = searchEngineName.value;
|
||||
let keyword = searchKeyword.value;
|
||||
let baseURL = '';
|
||||
let useURL = '';
|
||||
|
||||
// 获取搜索引擎 URL
|
||||
for (let i = 0; i < searchEngineList.length; i++) {
|
||||
|
||||
let category = searchEngineList[i];
|
||||
let engines = category.list;
|
||||
|
||||
for (let j = 0; j < engines.length; j++) {
|
||||
let item = engines[j];
|
||||
if (item.name === engine) {
|
||||
baseURL = item.url;
|
||||
}
|
||||
}
|
||||
|
||||
if (baseURL) {
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (baseURL) {
|
||||
useURL = baseURL.replace(/%keyword%/, keyword);
|
||||
}
|
||||
|
||||
if (useURL) {
|
||||
window.open(useURL, '_blank');
|
||||
} else {
|
||||
$message.error('搜索失败:找不到对应的搜索引擎');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** 搜索引擎列表 */
|
||||
export const searchEngineList = [
|
||||
{
|
||||
title: '搜索',
|
||||
list: [
|
||||
{
|
||||
name: '百度',
|
||||
desc: 'www.baidu.com',
|
||||
url: 'https://www.baidu.com/s?wd=%keyword%',
|
||||
icon: 'baidu.svg',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '必应',
|
||||
desc: 'cn.bing.com',
|
||||
url: 'https://cn.bing.com/search?q=%keyword%',
|
||||
icon: 'bing.svg',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '搜狗',
|
||||
desc: 'www.sogou.com',
|
||||
url: 'https://www.sogou.com/web?query=%keyword%',
|
||||
icon: 'sogou.svg',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '360',
|
||||
desc: 'www.so.com',
|
||||
url: 'https://www.so.com/s?q=%keyword%',
|
||||
icon: '360.svg',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'Google',
|
||||
desc: 'www.google.com',
|
||||
url: 'https://www.google.com/search?q=%keyword%',
|
||||
icon: 'google.svg',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'Yandex',
|
||||
desc: 'yandex.com',
|
||||
url: 'https://yandex.com/search/?text=%keyword%',
|
||||
icon: 'yandex.svg',
|
||||
show: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '多媒体',
|
||||
list: [
|
||||
{
|
||||
name: '网易云音乐',
|
||||
desc: 'music.163.com',
|
||||
url: 'https://music.163.com/#/search/m/?s=%keyword%',
|
||||
icon: 'netease_music.svg',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'AcFun',
|
||||
desc: 'www.acfun.cn',
|
||||
url: 'https://www.acfun.cn/search/?keyword=%keyword%',
|
||||
icon: 'acfun.svg',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'bilibili',
|
||||
desc: 'search.bilibili.com',
|
||||
url: 'https://search.bilibili.com/all?keyword=%keyword%',
|
||||
icon: 'bilibili.svg',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'QQ音乐',
|
||||
desc: 'y.qq.com',
|
||||
url: 'https://y.qq.com/n/ryqq/search?w=%keyword%',
|
||||
icon: 'qq_music.svg',
|
||||
show: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '技术',
|
||||
list: [
|
||||
{
|
||||
name: '博客园',
|
||||
desc: 'zzk.cnblogs.co',
|
||||
url: 'https://zzk.cnblogs.com/s?w=%keyword%',
|
||||
icon: 'cnblogs.svg',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'CSDN',
|
||||
desc: 'so.csdn.net',
|
||||
url: 'https://so.csdn.net/so/search/all?q=%keyword%',
|
||||
icon: 'csdn.svg',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'GitHub',
|
||||
desc: 'github.com',
|
||||
url: 'https://github.com/search?q=%keyword%',
|
||||
icon: 'github.svg',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'MDN',
|
||||
desc: 'developer.mozilla.org',
|
||||
url: 'https://developer.mozilla.org/zh-CN/search?q=%keyword%',
|
||||
icon: 'mdn.svg',
|
||||
show: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '设计',
|
||||
list: [
|
||||
{
|
||||
name: '站酷',
|
||||
desc: 'www.zcool.com.cn',
|
||||
url: 'https://www.zcool.com.cn/search/content?word=%keyword%',
|
||||
icon: 'zcool.svg',
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'Iconfont',
|
||||
desc: 'www.iconfont.cn',
|
||||
url: 'https://www.iconfont.cn/search/index?searchType=icon&q=%keyword%',
|
||||
icon: 'iconfont.svg',
|
||||
show: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '社区',
|
||||
list: [
|
||||
{
|
||||
name: '知乎',
|
||||
desc: 'www.zhihu.com',
|
||||
url: 'https://www.zhihu.com/search?type=content&q=%keyword%',
|
||||
icon: 'zhihu.svg',
|
||||
show: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
];
|
||||
|
||||
/** 搜索引擎名称 */
|
||||
export const searchEngineName = useLocalStorage(SKEY_SEARCH_ENGINE_NAME, '必应');
|
||||
|
||||
/** 搜索关键词 */
|
||||
export const searchKeyword = ref('');
|
@@ -1,6 +1,19 @@
|
||||
// 工具函数
|
||||
|
||||
import { description as appDesc } from '@package-json';
|
||||
import {
|
||||
description as appDesc,
|
||||
} from '@package-json';
|
||||
|
||||
/** 当前模块 URL */
|
||||
const META_URL = import.meta.url;
|
||||
|
||||
/**
|
||||
* @description 获取资源文件 URL
|
||||
* @param {string} path 文件相对于 assets 目录的路径
|
||||
*/
|
||||
export function getAssetsUrl(path = '') {
|
||||
return new URL(`../${path}`, META_URL).href;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 更新页面标题
|
||||
|
2
src/assets/website-icon/360.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#FFFFFF" p-id="8789"></path><path d="M428.846545 71.796364c53.504-4.096 107.892364 2.792727 158.487273 20.712727a389.701818 389.701818 0 0 1 242.967273 254.464c22.132364 73.541818 22.109091 153.553455 0.093091 227.118545-2.653091 8.052364-4.770909 16.360727-8.378182 24.087273 0.558545-8.96 0.698182-18.129455-2.001455-26.763636a64.581818 64.581818 0 0 0-20.340363-31.022546 66.094545 66.094545 0 0 0-48.058182-14.824727 64.488727 64.488727 0 0 0-45.079273 24.017455c-1.442909 1.792-2.885818 3.560727-4.282182 5.399272 16.709818-44.450909 21.317818-93.370182 13.172364-140.148363a260.910545 260.910545 0 0 0-123.950545-179.828364 258.490182 258.490182 0 0 0-124.858182-36.328727 259.258182 259.258182 0 0 0-142.08 37.073454 262.237091 262.237091 0 0 0-110.498909 133.585455 262.818909 262.818909 0 0 0 2.071272 186.624 66.792727 66.792727 0 0 0-33.512727-27.461818c-19.851636-7.424-43.333818-4.631273-60.602182 7.796363-10.472727 7.098182-18.618182 17.454545-23.133091 29.323637-3.863273 9.541818-4.491636 20.084364-3.630545 30.277818a394.100364 394.100364 0 0 1-24.692364-123.764364 390.120727 390.120727 0 0 1 31.557819-166.632727 389.771636 389.771636 0 0 1 118.272-152.971636 385.256727 385.256727 0 0 1 208.47709-80.756364z" fill="#0FB264"></path><path d="M121.995636 536.296727c17.268364-12.427636 40.750545-15.220364 60.602182-7.819636a66.792727 66.792727 0 0 1 33.512727 27.485091c6.190545 13.125818 12.032 26.484364 19.781819 38.795636 20.247273 33.792 48.267636 62.836364 81.198545 84.410182a257.954909 257.954909 0 0 0 112.174546 40.587636c42.193455 4.887273 85.597091-0.558545 125.044363-16.290909a257.186909 257.186909 0 0 0 91.787637-61.277091 263.261091 263.261091 0 0 0 56.15709-87.202909c1.396364-1.838545 2.839273-3.607273 4.282182-5.399272a64.488727 64.488727 0 0 1 45.079273-24.017455 66.094545 66.094545 0 0 1 48.058182 14.824727c9.774545 7.936 16.616727 19.083636 20.340363 30.999273 2.699636 8.657455 2.56 17.826909 2.001455 26.786909-0.698182 3.723636-2.443636 7.098182-3.863273 10.589091a391.889455 391.889455 0 0 1-81.640727 123.810909 387.793455 387.793455 0 0 1-128.605091 87.226182 387.979636 387.979636 0 0 1-209.198545 24.901818 382.836364 382.836364 0 0 1-128.279273-44.334545 390.260364 390.260364 0 0 1-164.747636-179.130182c-3.607273-8.378182-7.400727-16.709818-10.472728-25.344-0.837818-10.193455-0.209455-20.712727 3.653818-30.301091 4.491636-11.845818 12.660364-22.202182 23.133091-29.300364z m749.614546 157.602909c13.730909-1.629091 27.973818 1.163636 39.842909 8.331637a63.441455 63.441455 0 0 1 30.394182 63.092363 63.534545 63.534545 0 0 1-41.192728 50.734546 63.534545 63.534545 0 0 1-64.023272-12.823273 63.953455 63.953455 0 0 1-20.549818-46.08 63.255273 63.255273 0 0 1 55.552-63.255273z" fill="#FF9932"></path></svg>
|
||||
<!-- IconFont UID: 157961 -->
|
After Width: | Height: | Size: 2.9 KiB |
2
src/assets/website-icon/acfun.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1092 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M521.007 0L0 859.065 260.504 1024l53.99-184.999 413.375-31.18 107.266 204.805 256.673-153.56L521.008 0zM414.7 642.136l98.648-217.36 111.096 217.36H414.699z" fill="#FD4C5D"></path></svg>
|
||||
<!-- IconFont UID: 6087667 -->
|
After Width: | Height: | Size: 317 B |
2
src/assets/website-icon/baidu.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M184.682058 538.758771c111.176877-23.873478 96.029086-156.736593 92.70169-185.775677-5.444828-44.768588-58.101436-123.020542-129.605526-116.831122-89.979276 8.074168-103.125977 138.051991-103.125977 138.051991-12.169424 60.079258 29.132158 188.451554 140.029813 164.554808z m118.064352 231.102709c-3.25759 9.330667-10.51736 33.227413-4.234867 54.029449 12.402109 46.676604 52.912561 48.770769 52.912562 48.770769h58.217778V730.351572h-62.336302c-28.01527 8.35339-41.534266 30.155972-44.559171 39.509908z m88.280676-453.898564c61.405563 0 111.037266-70.666424 111.037266-158.039629 0-87.280131-49.631703-157.923287-111.037266-157.923287-61.312489 0-111.060534 70.643156-111.060534 157.923287 0 87.373205 49.771314 158.039629 111.060534 158.039629z m264.469733 10.447555c82.067988 10.656971 134.840938-76.92565 145.33503-143.310671 10.703508-66.291947-42.25559-143.287402-100.357026-156.527177-58.217779-13.356117-130.908562 79.904017-137.540084 140.704599-7.911289 74.319578 10.633703 148.59262 92.56208 159.133249z m201.086348 390.212688s-126.976186-98.239593-201.109617-204.413743c-100.473368-156.550445-243.202327-92.841302-290.949282-13.216506-47.537539 79.601527-121.624432 129.954554-132.141792 143.287403-10.68024 13.123432-153.38593 90.165424-121.694237 230.870023 31.668424 140.611525 142.938375 137.935648 142.938374 137.935648s81.998182 8.074168 177.119797-13.216506c95.168151-21.104526 177.096528 5.25868 177.096528 5.258681s222.283948 74.435921 283.107798-68.851482c60.754045-143.333939-34.36757-217.653518-34.367569-217.653518z m-380.323578 213.255772h-144.520632c-62.406108-12.448646-87.256862-55.029995-90.39811-62.289765-3.071442-7.376113-20.802036-41.604072-11.424832-99.845119 26.968188-87.256862 103.870569-93.516088 103.870569-93.516088h76.92565v-94.563171l65.524087 1.000546v349.213597z m269.146701-1.000545h-166.299946c-64.453736-16.613707-67.455372-62.406108-67.455371-62.406108v-183.890929l67.455371-1.093619v165.276131c4.118524 17.63752 26.014179 20.825304 26.01418 20.825305h68.525722v-185.007817h71.760044v246.297037z m235.40738-490.988548c0-31.761498-26.386475-127.395019-124.230503-127.395019-98.006908 0-111.107071 90.258498-111.107072 154.060716 0 60.893656 5.142338 145.893474 126.883112 143.194329 121.787311-2.699146 108.454463-137.935648 108.454463-169.860026z m0 0" fill="#3245DF"></path></svg>
|
||||
<!-- IconFont UID: 26416 -->
|
After Width: | Height: | Size: 2.4 KiB |
2
src/assets/website-icon/bilibili.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M306.005333 117.632L444.330667 256h135.296l138.368-138.325333a42.666667 42.666667 0 0 1 60.373333 60.373333L700.330667 256H789.333333A149.333333 149.333333 0 0 1 938.666667 405.333333v341.333334a149.333333 149.333333 0 0 1-149.333334 149.333333h-554.666666A149.333333 149.333333 0 0 1 85.333333 746.666667v-341.333334A149.333333 149.333333 0 0 1 234.666667 256h88.96L245.632 177.962667a42.666667 42.666667 0 0 1 60.373333-60.373334zM789.333333 341.333333h-554.666666a64 64 0 0 0-63.701334 57.856L170.666667 405.333333v341.333334a64 64 0 0 0 57.856 63.701333L234.666667 810.666667h554.666666a64 64 0 0 0 63.701334-57.856L853.333333 746.666667v-341.333334A64 64 0 0 0 789.333333 341.333333zM341.333333 469.333333a42.666667 42.666667 0 0 1 42.666667 42.666667v85.333333a42.666667 42.666667 0 0 1-85.333333 0v-85.333333a42.666667 42.666667 0 0 1 42.666666-42.666667z m341.333334 0a42.666667 42.666667 0 0 1 42.666666 42.666667v85.333333a42.666667 42.666667 0 0 1-85.333333 0v-85.333333a42.666667 42.666667 0 0 1 42.666667-42.666667z" fill="#00A1D6"></path></svg>
|
||||
<!-- IconFont UID: 5455300 -->
|
After Width: | Height: | Size: 1.2 KiB |
2
src/assets/website-icon/bing.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" ><path d="M56.888889 56.888889h910.222222v910.222222H56.888889V56.888889z" fill="#0C8484"></path><path d="M227.555556 170.666667v606.037333L369.777778 881.777778l426.666666-234.325334V483.555556L446.976 340.366222l73.159111 177.777778L625.777778 568.888889l-369.777778 199.111111L398.222222 625.777778V227.555556z" fill="#FFFFFF"></path></svg>
|
||||
<!-- IconFont UID: 5519894 -->
|
After Width: | Height: | Size: 466 B |
2
src/assets/website-icon/cnblogs.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" with="64" height="64"><defs><clipPath id="prefix__clip-path"><path class="prefix__cls-1" d="M29.48 25.24c-.16-1.89-.08-1.5-.24-3.16a72.24 72.24 0 00-2-10.37L26 6.25l-2.6 5.41-.44.89q-.24.48-.54 1a20.43 20.43 0 01-1.24 1.84 20.08 20.08 0 01-3.08 3.24 19.72 19.72 0 01-3.87 2.53c-.72.33-1.45.71-2.23 1-.34.14-1.19.44-1.93.66a2.55 2.55 0 01-1.07-.3c-.34-1-.83-2.24-1.2-3.19-.5-1.25-1-2.5-1.51-3.73a59.11 59.11 0 00-3.62-7.25 59.82 59.82 0 001.51 7.94c.3 1.3.7 2.58 1.05 3.87S6 22.71 6.44 24a1.4 1.4 0 001.29.93c1.28 0 2.57.06 3.86.05s2.59 0 3.88-.11a56 56 0 007.79-.87c-1.92-.49-7.5-.81-10.79-1.06a43 43 0 006.53-1.7 24.06 24.06 0 005.38-3.45c.71-.62 1.21 1.88 2.39 5.27.62 1.69.34 1 1 2.66s1.37 4.38 2.17 6c-.07-1.82-.31-4.67-.46-6.48z"/></clipPath><clipPath id="prefix__clip-path-2"><path class="prefix__cls-1" d="M20.92 3.46a4.25 4.25 0 01.31 5.86 3.91 3.91 0 01-5.66.24 4.25 4.25 0 01-.31-5.86 3.91 3.91 0 015.66-.24m1.35-1.54a5.89 5.89 0 00-8.53.36 6.41 6.41 0 00.48 8.83 5.91 5.91 0 008.53-.36 6.41 6.41 0 00-.48-8.83z"/></clipPath><style>.prefix__cls-1{fill:#3e3a39}@media (prefers-color-scheme:dark){.prefix__cls-1{fill:#efefef}}</style></defs><g style="isolation:isolate"><g id="prefix__layer_1" data-name="layer 1"><path class="prefix__cls-1" d="M29.48 25.24c-.16-1.89-.08-1.5-.24-3.16a72.24 72.24 0 00-2-10.37L26 6.25l-2.6 5.41-.44.89q-.24.48-.54 1a20.43 20.43 0 01-1.24 1.84 20.08 20.08 0 01-3.08 3.24 19.72 19.72 0 01-3.87 2.53c-.72.33-1.45.71-2.23 1-.34.14-1.19.44-1.93.66a2.55 2.55 0 01-1.07-.3c-.34-1-.83-2.24-1.2-3.19-.5-1.25-1-2.5-1.51-3.73a59.11 59.11 0 00-3.62-7.25 59.82 59.82 0 001.51 7.94c.3 1.3.7 2.58 1.05 3.87S6 22.71 6.44 24a1.4 1.4 0 001.29.93c1.28 0 2.57.06 3.86.05s2.59 0 3.88-.11a56 56 0 007.79-.87c-1.92-.49-7.5-.81-10.79-1.06a43 43 0 006.53-1.7 24.06 24.06 0 005.38-3.45c.71-.62 1.21 1.88 2.39 5.27.62 1.69.34 1 1 2.66s1.37 4.38 2.17 6c-.07-1.82-.31-4.67-.46-6.48z"/><g clip-path="url(#prefix__clip-path)"><path class="prefix__cls-1" d="M-.87-.78h34.42v33.07H-.87z"/></g><path class="prefix__cls-1" d="M20.92 3.46a4.25 4.25 0 01.31 5.86 3.91 3.91 0 01-5.66.24 4.25 4.25 0 01-.31-5.86 3.91 3.91 0 015.66-.24m1.35-1.54a5.89 5.89 0 00-8.53.36 6.41 6.41 0 00.48 8.83 5.91 5.91 0 008.53-.36 6.41 6.41 0 00-.48-8.83z"/><g clip-path="url(#prefix__clip-path-2)"><path class="prefix__cls-1" d="M-.87-.78h34.42v33.07H-.87z"/></g></g></g></svg>
|
||||
<!-- https://assets.cnblogs.com/favicon.svg -->
|
After Width: | Height: | Size: 2.4 KiB |
2
src/assets/website-icon/csdn.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h1024v1024H0z" fill="#FC5531"></path><path d="M698.9824 42.3936c-158.8736-32.5632-289.536 31.2832-324.9152 48.5888-94.72 46.2848-147.712 108.288-174.4896 140.288-25.9584 31.0272-82.7392 105.9328-108.288 215.8592-21.6576 93.1328-10.752 167.7824-6.0416 194.2528 11.4688 64.3072 33.28 186.88 150.4256 275.2 132.5056 99.8912 293.4784 85.5552 342.9888 80.9472 107.264-10.0352 289.4848-57.2928 300.8512-145.7152 5.1712-39.936-24.4224-89.4464-66.2016-102.5024-65.6384-20.5312-108.3392 63.5392-228.6592 80.9472-8.5504 1.2288-126.5664 16.6912-216.6272-48.5888-105.8816-76.6976-98.9696-211.3024-96.256-264.3968 1.536-30.5664 5.5808-93.5424 48.128-161.8944 14.7968-23.7568 60.3136-94.5664 156.4672-134.912 25.2928-10.5984 76.8512-31.5904 144.4352-26.9824 70.0416 4.7616 120.9856 34.5088 144.4352 48.5888 75.8272 45.4144 86.528 90.0608 120.3712 86.3232 35.8912-3.9424 69.9904-59.2896 66.2016-107.9296-7.424-93.7984-155.5968-158.1056-252.8256-178.0736z" fill="#FFFFFF"></path></svg>
|
||||
<!-- IconFont UID: 7767443 -->
|
After Width: | Height: | Size: 1.1 KiB |
2
src/assets/website-icon/default.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M884.224 501.248c0 13.824 0 29.184-1.536 43.008H394.752c0 83.968 73.728 145.92 154.624 145.92 54.784 0 108.032-27.648 135.68-75.776h178.688c-48.128 135.68-175.104 226.816-319.488 226.816-51.712 0-102.912-11.776-149.504-35.84C346.624 829.44 281.6 855.04 228.352 855.04c-72.192 0-99.84-43.008-99.84-111.616 0-39.424 8.704-77.312 20.48-115.2 5.12-24.064 34.304-73.728 46.592-97.792 51.712-92.672 118.272-185.344 200.704-256C332.8 302.08 260.608 372.224 216.064 423.936c34.304-153.088 171.52-262.656 328.192-262.656h20.48c51.712-24.064 125.44-49.664 183.808-49.664 67.072 0 126.976 25.6 126.976 102.912 0 39.424-15.36 83.968-32.768 121.856 27.648 49.664 41.472 108.032 41.472 164.864zM855.04 231.424c0-48.128-34.304-75.776-78.848-75.776-35.84 0-75.776 13.824-108.032 29.184 70.656 27.648 126.976 75.776 164.864 137.216 11.776-26.624 22.016-61.44 22.016-90.624zM181.76 752.128c0 49.664 29.184 75.776 77.312 75.776 37.888 0 78.848-15.36 111.616-35.84-70.656-41.472-121.856-104.96-147.456-180.224-19.456 40.448-41.472 95.744-41.472 140.288z m212.992-300.544h305.664C698.88 370.688 624.64 312.32 547.328 312.32c-78.848 0-151.04 58.368-152.576 139.264z m0 0" fill="#555555"></path></svg>
|
||||
<!-- IconFont UID: 946930 -->
|
After Width: | Height: | Size: 1.3 KiB |
2
src/assets/website-icon/github.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M0 524.992q0 166.016 95.488 298.496t247.488 185.504q6.016 0.992 10.016 0.992t6.496-1.504 4-3.008 2.016-4.992 0.512-4.992v-100.512q-36.992 4-66.016-0.512t-45.504-14.016-28.992-23.488-16.992-25.504-8.992-24-5.504-14.496q-8.992-15.008-27.008-27.488t-27.008-20-2.016-14.496q50.016-26.016 112.992 66.016 34.016 51.008 119.008 30.016 10.016-40.992 40-70.016Q293.984 736 237.984 670.976t-56-158.016q0-87.008 55.008-151.008-22.016-64.992 6.016-136.992 28.992-2.016 64.992 11.488t50.496 23.008 25.504 17.504q56.992-16 128.512-16t129.504 16q12.992-8.992 28.992-19.008t48.992-21.504 60.992-9.504q27.008 71.008 7.008 135.008 56 64 56 151.008 0 92.992-56.992 158.496t-172 85.504q43.008 43.008 43.008 104v128.992q0 0.992 0.992 3.008 0 6.016 0.512 8.992t4.512 6.016 12 3.008q152.992-52 250.496-185.504t97.504-300.512q0-104-40.512-199.008t-108.992-163.488-163.488-108.992T512.032 12.96 313.024 53.472 149.536 162.464t-108.992 163.488-40.512 199.008z" fill="#24292E"></path></svg>
|
||||
<!-- IconFont UID: 394374 -->
|
After Width: | Height: | Size: 1.1 KiB |
2
src/assets/website-icon/google.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M214.101333 512c0-32.512 5.546667-63.701333 15.36-92.928L57.173333 290.218667A491.861333 491.861333 0 0 0 4.693333 512c0 79.701333 18.858667 154.88 52.394667 221.610667l172.202667-129.066667A290.56 290.56 0 0 1 214.101333 512" fill="#FBBC05"></path><path d="M516.693333 216.192c72.106667 0 137.258667 25.002667 188.458667 65.962667L854.101333 136.533333C763.349333 59.178667 646.997333 11.392 516.693333 11.392c-202.325333 0-376.234667 113.28-459.52 278.826667l172.373334 128.853333c39.68-118.016 152.832-202.88 287.146666-202.88" fill="#EA4335"></path><path d="M516.693333 807.808c-134.357333 0-247.509333-84.864-287.232-202.88l-172.288 128.853333c83.242667 165.546667 257.152 278.826667 459.52 278.826667 124.842667 0 244.053333-43.392 333.568-124.757333l-163.584-123.818667c-46.122667 28.458667-104.234667 43.776-170.026666 43.776" fill="#34A853"></path><path d="M1005.397333 512c0-29.568-4.693333-61.44-11.648-91.008H516.650667V614.4h274.602666c-13.696 65.962667-51.072 116.650667-104.533333 149.632l163.541333 123.818667c93.994667-85.418667 155.136-212.650667 155.136-375.850667" fill="#4285F4"></path></svg>
|
||||
<!-- IconFont UID: 608646 -->
|
After Width: | Height: | Size: 1.2 KiB |
2
src/assets/website-icon/iconfont.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M1.703827 0h1022.296173v1022.296173H1.703827z" fill="#E94618"></path><path d="M501.799188 865.690622c-38.777398-23.478735-30.512133-64.416586-55.495348-90.18356-45.955621-47.388539-126.495521-49.818196-173.427434-104.054416-157.356938-181.844339-6.25986-521.808932 291.356113-471.721531 173.442769 29.18826 305.577957 272.184652 187.299993 443.973005-50.872865 73.896679-148.708313 79.747621-208.112239 159.553171-17.406296 17.273398-8.592399 60.780619-41.621085 62.433331zM252.06416 470.276686c-6.982283 131.959694 180.363714 125.277285 180.363714 6.937983 0-60.245617-54.101617-108.603634-124.866663-83.245577-49.779008 17.835661-53.437125 37.388779-55.497051 76.307594z m381.53797 97.11984c158.950017 44.573817 162.964233-230.536306 0-173.427434-77.096466 27.017584-68.110483 154.329238 0 173.427434z m-159.551468 83.247281c25.407468 5.697597 32.996313-68.502363 6.93628-69.374722-14.470602 14.327481-48.605072 59.225025-6.93628 69.374722z m62.429924 0h13.879374c17.914037-28.413018-6.004286-65.42014-34.686509-69.374722 2.320612 27.740007-8.91783 69.037364 20.807135 69.374722z" fill="#FFFFFF"></path></svg>
|
||||
<!-- IconFont UID: 294408 -->
|
After Width: | Height: | Size: 1.2 KiB |
2
src/assets/website-icon/mdn.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M1024 433.493333c0-20.48-3.413333-40.96-3.413333-61.44 0-10.24-3.413333-20.48-10.24-27.306666-6.826667-10.24-17.066667-17.066667-30.72-20.48-23.893333-10.24-47.786667-20.48-68.266667-27.306667-34.133333-10.24-64.853333-23.893333-95.573333-40.96-20.48-10.24-34.133333-34.133333-37.546667-58.026667-3.413333-27.306667-17.066667-51.2-40.96-64.853333-27.306667-13.653333-54.613333-17.066667-85.333333-10.24-20.48 3.413333-44.373333 3.413333-64.853334 0l-30.72-10.24-10.24-3.413333-23.893333-6.826667c-44.373333-13.653333-64.853333-20.48-136.533333-6.826667C307.2 112.64 238.933333 150.186667 180.906667 204.8L0 399.36h163.84l-98.986667 105.813333h170.666667L136.533333 610.986667h136.533334l-44.373334 116.053333c170.666667 174.08 351.573333 208.213333 351.573334 208.213333 0-47.786667 10.24-235.52 23.893333-266.24 3.413333-17.066667 13.653333-30.72 20.48-44.373333 23.893333-27.306667 58.026667-44.373333 95.573333-44.373333 37.546667 0 75.093333 6.826667 109.226667 20.48 20.48 10.24 44.373333 6.826667 64.853333-3.413334 13.653333-10.24 27.306667-17.066667 44.373334-27.306666 3.413333-3.413333 10.24-6.826667 17.066666-6.826667 17.066667 3.413333 30.72-6.826667 37.546667-20.48 3.413333-10.24 10.24-17.066667 13.653333-27.306667 13.653333-23.893333 17.066667-51.2 17.066667-81.92z" fill="#212121"></path></svg>
|
||||
<!-- IconFont UID: 3917962 -->
|
After Width: | Height: | Size: 1.4 KiB |
2
src/assets/website-icon/mijisou.svg
Normal file
After Width: | Height: | Size: 13 KiB |
2
src/assets/website-icon/netease_music.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M627.086668 5.114963c28.132297-7.672445 58.822075-7.672445 86.954372 0 33.24726 7.672445 63.937038 23.017334 89.511853 43.477186 10.229926 7.672445 17.902371 15.344889 23.017334 28.132297 7.672445 17.902371 5.114963 38.362223-5.114963 53.707112-7.672445 12.787408-23.017334 23.017334-40.919704 25.574815-12.787408 2.557482-25.574815 0-38.362223-7.672445-5.114963-2.557482-10.229926-10.229926-17.902371-12.787407-17.902371-10.229926-35.804741-20.459852-56.264593-17.902371-15.344889 0-28.132297 7.672445-35.804742 17.902371-10.229926 10.229926-12.787408 23.017334-10.229926 35.804741 7.672445 25.574815 12.787408 53.707112 20.459853 79.281927 51.14963 2.557482 99.741779 15.344889 143.218965 40.919704 40.919704 25.574815 79.281927 58.822075 109.971705 97.184298 25.574815 33.24726 46.034667 71.609483 56.264593 112.529187 12.787408 43.477186 17.902371 89.511853 12.787408 132.989039-2.557482 38.362223-10.229926 74.166964-23.017334 109.971705-33.24726 84.39689-92.069335 161.121336-171.351261 209.713485-56.264593 35.804741-122.759113 58.822075-189.253633 66.49452-46.034667 5.114963-92.069335 5.114963-138.104002-2.557482-94.626816-15.344889-181.581188-61.379556-250.633189-130.431558-66.49452-66.49452-112.529187-153.448891-132.989039-245.518225-7.672445-69.052001-7.672445-138.104002 7.672445-207.156004 17.902371-81.839409 61.379556-161.121336 117.644149-222.500892 48.592149-51.14963 107.414224-89.511853 171.351262-117.64415 7.672445-2.557482 12.787408-5.114963 20.459852-7.672444 15.344889-2.557482 30.689778 0 43.477186 10.229926 17.902371 12.787408 25.574815 33.24726 23.017334 53.707112-2.557482 20.459852-17.902371 38.362223-35.804741 46.034667-63.937038 25.574815-122.759113 69.052001-163.678818 122.759113C205.102218 373.392302 179.527402 432.214377 171.854958 493.593933c-7.672445 61.379556 0 122.759113 20.459852 181.581188 30.689778 84.39689 94.626816 156.006373 173.908743 196.926077 48.592149 25.574815 102.299261 38.362223 156.006373 38.362223 43.477186 0 89.511853-7.672445 130.431558-23.017334 35.804741-12.787408 71.609483-33.24726 99.741779-58.822074 28.132297-23.017334 51.14963-53.707112 66.494519-84.396891 7.672445-15.344889 17.902371-33.24726 20.459853-51.14963 15.344889-51.14963 17.902371-107.414224 2.557481-158.563854-12.787408-43.477186-38.362223-81.839409-71.609482-109.971706-15.344889-12.787408-30.689778-25.574815-48.592149-35.804741-15.344889-7.672445-30.689778-15.344889-48.592149-17.902371 12.787408 46.034667 23.017334 92.069335 35.804741 135.546521 2.557482 10.229926 5.114963 23.017334 5.114963 33.24726 2.557482 46.034667-15.344889 94.626816-46.034667 130.431557-28.132297 33.24726-69.052001 58.822075-112.529187 66.49452-46.034667 10.229926-97.184298 0-138.104002-25.574815-38.362223-25.574815-66.49452-63.937038-81.839409-104.856743-7.672445-23.017334-12.787408-48.592149-12.787407-74.166964-2.557482-56.264593 12.787408-109.971705 43.477185-156.006373 35.804741-53.707112 94.626816-92.069335 158.563855-109.971705-5.114963-17.902371-10.229926-35.804741-12.787408-53.707112-12.787408-38.362223-10.229926-81.839409 7.672445-115.086668 10.229926-20.459852 23.017334-38.362223 40.919704-51.149631C583.609483 25.574815 604.069335 12.787408 627.086668 5.114963m-148.333928 414.312006c-17.902371 17.902371-28.132297 40.919704-33.24726 63.937038-5.114963 20.459852-5.114963 43.477186 0 66.49452 5.114963 23.017334 17.902371 46.034667 38.362223 61.379556 15.344889 10.229926 35.804741 15.344889 56.264594 10.229926 35.804741-5.114963 63.937038-38.362223 63.937038-74.166964-2.557482-7.672445-2.557482-17.902371-5.114963-25.574815-12.787408-48.592149-25.574815-99.741779-38.362223-148.333928-30.689778 7.672445-58.822075 23.017334-81.839409 46.034667z" fill="#E72D2C"></path></svg>
|
||||
<!-- IconFont UID: 4194729 -->
|
After Width: | Height: | Size: 3.8 KiB |
2
src/assets/website-icon/qq_music.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M35.84 529.92c0 263.68 215.04 478.72 478.72 478.72 263.68 0 478.72-215.04 478.72-478.72C993.28 266.24 780.8 51.2 514.56 51.2 250.88 51.2 35.84 266.24 35.84 529.92z" fill="#FFDC00"></path><path d="M660.48 10.24c-17.92 20.48-56.32 38.4-107.52 51.2-87.04 20.48-104.96 25.6-130.56 40.96-15.36 7.68-33.28 20.48-43.52 30.72-20.48 17.92-35.84 51.2-30.72 61.44 2.56 5.12 51.2 74.24 110.08 158.72 58.88 81.92 115.2 163.84 128 181.76 12.8 17.92 20.48 33.28 20.48 33.28 0 2.56-10.24 0-20.48-2.56-40.96-12.8-112.64 0-163.84 25.6-38.4 20.48-81.92 64-99.84 99.84-20.48 40.96-23.04 97.28-7.68 135.68 15.36 40.96 48.64 74.24 92.16 97.28 33.28 17.92 40.96 17.92 84.48 20.48 35.84 2.56 56.32 0 76.8-5.12 94.72-28.16 163.84-102.4 168.96-189.44 2.56-48.64-2.56-64-66.56-176.64-99.84-174.08-189.44-332.8-189.44-335.36 0 0 17.92-2.56 40.96-5.12 66.56-2.56 120.32-35.84 148.48-89.6 12.8-23.04 12.8-30.72 12.8-79.36 0-30.72-2.56-58.88-5.12-61.44-2.56-7.68-5.12-5.12-17.92 7.68z" fill="#13BF74"></path></svg>
|
||||
<!-- IconFont UID: 307228 -->
|
After Width: | Height: | Size: 1.1 KiB |
2
src/assets/website-icon/sogou.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 917.5c-225 0-407.4-182.4-407.4-407.3 0-225 182.4-407.4 407.4-407.4s407.4 182.4 407.4 407.4c0 99.9-36 191.3-95.7 262.2l32.4 23.3c64.4-77.5 103.1-177 103.1-285.5C959.1 263.2 758.9 63 512 63 265 63 64.9 263.2 64.9 510.1c0 247 200.1 447.2 447.1 447.2 58.6 0.1 116.6-11.4 170.7-33.8l-20.2-34.8c-47.8 19-98.9 28.8-150.5 28.8z m188.1 8.7l20.2 34.8c67.3-27.9 126.8-71.7 173.4-127.8l-32.4-23.3c-43.4 51.4-98.7 91.4-161.2 116.3z" fill="#FA4D23"></path><path d="M503.5 678.9s-162.7 1.2-251.3-81.3l-7 115.3s535.5 194.2 540.3-117.7c0 0 11.4-74.1-182.5-125 0 0-76.5-18.6-162.7-68 0 0-47.4-54.6 88-43.7 160.6 12.9 242.2 54.6 242.2 54.6v-102s-363.6-137.2-506.8 19.4c0 0-47.1 71.6 1.5 116.5 48.6 44.9 147.6 102 280 136 0 0 170.7 77.7-41.7 95.9z" fill="#FA4D23"></path></svg>
|
||||
<!-- IconFont UID: 186394 -->
|
After Width: | Height: | Size: 893 B |
2
src/assets/website-icon/tianya.svg
Normal file
After Width: | Height: | Size: 6.5 KiB |
2
src/assets/website-icon/yandex.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M451 1024V691.8L229 96h111.6l163.6 459.4L692.4 0h102.6L553.6 695.6V1024h-102.6z" fill="#FF0000"></path></svg>
|
||||
<!-- IconFont UID: 597369 -->
|
After Width: | Height: | Size: 240 B |
2
src/assets/website-icon/zcool.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M641.6 33.36c2.96-6.24 11.36-27.44 19.12-13.76 31.2 72.96 25.76 158.56-5.36 230.8 91.2-16.48 179.12-54 251.2-112.72 28.32-21.76 51.92-48.64 77.6-73.28 11.52 16.32 6.08 37.36 6.96 55.92-2.24 124.8-44.72 247.44-116.88 349.04 45.92-4.16 89.28-20.16 134-30-24.24 110.56-112.8 201.36-217.2 241.68-21.52 120.24-100.72 229.36-209.84 284.88-97.76 51.36-218.48 56.16-320 12.8-78.4-32.8-145.52-91.6-187.84-165.36C2.56 693.68-5.12 536.4 61.44 413.28 112.56 318.64 205.6 252.8 305.92 218.4c65.92-24.24 138.48-25.2 202.4-55.76 58-25.28 108.16-70.64 133.28-129.28M244 448.08c-1.04 17.92 3.92 47.04 27.44 45.68 55.76 1.12 111.44-0.24 167.2 0.48-56.72 63.2-116.16 123.92-173.76 186.16-27.52 30.72-20.4 74.4-19.52 112.08 0.96 24.88 27.68 38.32 50 36 103.92-0.48 207.92 0.56 311.76-0.4 23.12-4.08 24-33.76 23.2-52.4-2.16-36.16-2.96-83.04-38.96-102.96 0.08 12.16 0.96 29.92-16.32 27.2-51.76 0.88-103.6-0.8-155.36 0.8 44.8-51.36 92.16-100.24 137.28-151.28 19.36-21.04 42.24-42.48 46.8-72.16 5.12-37.76-0.56-76.16 5.84-113.92-50.64 9.12-102.24 4.88-153.36 5.76-50.96-0.64-101.92 1.52-152.88 0.24-18.16 2.32-23.84-12.88-19.76-27.92-36.24 21.36-38.16 69.2-39.6 106.64z" fill="#272828"></path><path d="M244 448.08c1.44-37.44 3.36-85.28 39.6-106.64-4.08 15.04 1.6 30.24 19.76 27.92 50.96 1.28 101.92-0.88 152.88-0.24 51.12-0.88 102.72 3.36 153.36-5.76-6.4 37.76-0.72 76.16-5.84 113.92-4.56 29.68-27.44 51.12-46.8 72.16-45.12 51.04-92.48 99.92-137.28 151.28 51.76-1.6 103.6 0.08 155.36-0.8 17.28 2.72 16.4-15.04 16.32-27.2 36 19.92 36.8 66.8 38.96 102.96 0.8 18.64-0.08 48.32-23.2 52.4-103.84 0.96-207.84-0.08-311.76 0.4-22.32 2.32-49.04-11.12-50-36-0.88-37.68-8-81.36 19.52-112.08 57.6-62.24 117.04-122.96 173.76-186.16-55.76-0.72-111.44 0.64-167.2-0.48-23.52 1.36-28.48-27.76-27.44-45.68z" fill="#F4C921"></path></svg>
|
||||
<!-- IconFont UID: 578395 -->
|
After Width: | Height: | Size: 1.9 KiB |
2
src/assets/website-icon/zhihu.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M157.568 0h708.864A157.44 157.44 0 0 1 1024 156.352v711.296A157.376 157.376 0 0 1 866.432 1024H157.568A157.44 157.44 0 0 1 0 867.648V156.352A157.376 157.376 0 0 1 157.568 0z" fill="#0084FF"></path><path d="M240.448 529.728h108.16c2.432-36.672 0-115.584 0-171.328h-52.8c-14.72 32.832-28.608 59.584-55.808 70.4a62.912 62.912 0 0 1-40.32 3.584c11.968 1.408 52.928-148.864 72.96-176.448 13.76-17.28 34.176-27.52 56-28.352-4.032 29.44-12.032 58.176-24 85.376h200.192v45.632H396.224c0 55.168 1.984 134.016 0 171.328h125.632l-0.64 46.08-127.168-0.64c-1.216 9.984-2.24 34.112-3.392 43.392 0 0 66.56 70.592 101.952 116.48v79.232c-37.76-50.88-116.352-146.176-116.352-146.176-47.424 122.048-113.6 166.08-113.6 166.08H189.632s144.192-160.192 155.2-257.92H194.048l46.4-46.72z m304.96-219.84h251.008v460.16l-102.144 0.448-76.032 63.296-30.784-63.744h-42.048v-460.16z m204.608 44.224H592.064v361.792h8.96l27.008 56.832 69.632-56.832h52.352V354.112z" fill="#FFFFFF"></path></svg>
|
||||
<!-- IconFont UID: 4788168 -->
|
After Width: | Height: | Size: 1.1 KiB |
@@ -9,7 +9,7 @@ export const ENABLE_MC_CTRL_MODULE = IS_DEV;
|
||||
export const ENABLE_NAV_MODULE = IS_DEV;
|
||||
|
||||
/** 启用“搜索”模块 */
|
||||
export const ENABLE_SEARCH_MODULE = IS_DEV;
|
||||
export const ENABLE_SEARCH_MODULE = true;
|
||||
|
||||
/** 启用“工具箱”模块 */
|
||||
export const ENABLE_TOOLBOX_MODULE = IS_DEV;
|
||||
|
7
src/config/storage.js
Normal file
@@ -0,0 +1,7 @@
|
||||
// 本地储存 key 信息
|
||||
|
||||
/** 储存 key 前缀 */
|
||||
const PREFIX = 'frost-navigation/';
|
||||
|
||||
/** 当前使用的搜索引擎名称 */
|
||||
export const SKEY_SEARCH_ENGINE_NAME = PREFIX + 'search-engine-name';
|
@@ -1,9 +1,199 @@
|
||||
<template>
|
||||
<div class="search-view"></div>
|
||||
<div class="search-view flex-col">
|
||||
<div class="app-view-header">
|
||||
<span>搜索</span>
|
||||
</div>
|
||||
<div class="app-view-content is-transparent">
|
||||
|
||||
<!-- 搜索栏 -->
|
||||
<div class="search-bar-wrapper">
|
||||
<n-input
|
||||
v-model:value="searchKeyword"
|
||||
class="search-bar-element shadow-1"
|
||||
placeholder="搜索"
|
||||
size="large"
|
||||
@keydown.enter="openSearchResult"
|
||||
>
|
||||
<template #suffix>
|
||||
<div
|
||||
class="search-btn mdi mdi-magnify"
|
||||
@click="openSearchResult"
|
||||
></div>
|
||||
</template>
|
||||
</n-input>
|
||||
</div>
|
||||
|
||||
<!-- 搜索引擎列表 -->
|
||||
<div class="search-engines-wrapper">
|
||||
<n-radio-group
|
||||
v-model:value="searchEngineName"
|
||||
class="search-engines-list"
|
||||
>
|
||||
<!-- 搜索引擎分类 -->
|
||||
<div
|
||||
v-for="categoryItem in searchEngineList"
|
||||
:key="categoryItem.title"
|
||||
class="search-engine-category"
|
||||
>
|
||||
<div class="category-title">{{ categoryItem.title }}</div>
|
||||
<div class="category-items">
|
||||
<!-- 搜索引擎项 -->
|
||||
<n-radio
|
||||
v-for="engineItem in categoryItem.list"
|
||||
:key="engineItem.name"
|
||||
:value="engineItem.name"
|
||||
class="search-engine-item shadow-1"
|
||||
>
|
||||
<img
|
||||
class="item-icon"
|
||||
draggable="false"
|
||||
:src="getAssetsUrl('website-icon/' + engineItem.icon)"
|
||||
/>
|
||||
<span class="item-label">{{ engineItem.name }}</span>
|
||||
<span class="item-desc">{{ engineItem.desc }}</span>
|
||||
</n-radio>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</n-radio-group>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
NInput, NRadio, NRadioGroup,
|
||||
} from 'naive-ui';
|
||||
|
||||
import {
|
||||
openSearchResult,
|
||||
searchEngineList, searchEngineName, searchKeyword,
|
||||
} from '@/assets/js/search-engine';
|
||||
|
||||
import {
|
||||
getAssetsUrl,
|
||||
} from '@/assets/js/utils';
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.app-view-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.search-bar-wrapper,
|
||||
.search-engines-wrapper {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.search-bar-wrapper {
|
||||
position: sticky;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
margin-top: 64px;
|
||||
max-width: 640px;
|
||||
|
||||
:deep(.search-bar-element) {
|
||||
.n-input-wrapper {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.n-input__border, .n-input__state-border {
|
||||
box-shadow: none;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.n-input__suffix {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
display: flex;
|
||||
width: 40px;
|
||||
height: 100%;
|
||||
font-size: 18px;
|
||||
line-height: 1;
|
||||
transition: color 0.25s;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
&::before {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search-engines-wrapper {
|
||||
--item-margin: 12px;
|
||||
margin-top: 32px;
|
||||
padding-bottom: 64px;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.search-engine-category {
|
||||
&:not(:first-child) {
|
||||
margin-top: var(--item-margin);
|
||||
}
|
||||
|
||||
.category-title {
|
||||
font-size: 16px;
|
||||
line-height: 2;
|
||||
}
|
||||
|
||||
.category-items {
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.search-engine-item {
|
||||
margin: var(--item-margin);
|
||||
width: 240px;
|
||||
height: 40px;
|
||||
border-radius: var(--border-radius);
|
||||
border-left: 4px solid transparent;
|
||||
background-color: #FFF;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
transition: border 0.25s;
|
||||
|
||||
&.n-radio--checked {
|
||||
border-left-color: var(--color-primary);
|
||||
}
|
||||
|
||||
:deep(.n-radio__dot-wrapper) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:deep(.n-radio__label) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 12px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.item-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.item-label {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.item-desc {
|
||||
margin-left: 8px;
|
||||
font-size: 12px;
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|