Skip to content

Commit

Permalink
Merge branch 'main' of github.com:MarleneJiang/ByteDream-JueJin into …
Browse files Browse the repository at this point in the history
…youhua
  • Loading branch information
Plumbiu committed Feb 18, 2023
2 parents bef5c64 + a6183f5 commit eaa538b
Show file tree
Hide file tree
Showing 9 changed files with 250 additions and 13 deletions.
61 changes: 61 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,66 @@
# Changelog

## [1.6.0](https://github.com/MarleneJiang/ByteDream-JueJin/compare/v1.5.0...v1.6.0) (2023-02-18)


### Features

* use UMAMI ([5a5b188](https://github.com/MarleneJiang/ByteDream-JueJin/commit/5a5b188eb5ea528267be53d26dec5165f9b2efbe))
* 不知道为啥就是看不到列表也卡在加载面 ([b6b7092](https://github.com/MarleneJiang/ByteDream-JueJin/commit/b6b7092644f2b064c0b23e0853f703a423190ebd))
* 之前不好,现在框再调了一下 ([9f1ad1d](https://github.com/MarleneJiang/ByteDream-JueJin/commit/9f1ad1d26e93ce837a6377503a27c8ee210a3b12))
* 修复标签栏自适应问题 ([2adbbb6](https://github.com/MarleneJiang/ByteDream-JueJin/commit/2adbbb6f9bb39b14155a93aa8c902f4b3dd20b90))
* 修復z-index導致的select組件問題 ([d0fd6fc](https://github.com/MarleneJiang/ByteDream-JueJin/commit/d0fd6fce7caee183a285f3f5694ab8478ce1b22c))
* 修復z-index導致的select組件問題 ([b1fb1e3](https://github.com/MarleneJiang/ByteDream-JueJin/commit/b1fb1e3e04f9becf407b702597b9bf8001f7c885))
* 删掉点杂物 ([8b5e68f](https://github.com/MarleneJiang/ByteDream-JueJin/commit/8b5e68f2d0a90717f1415ddc9abcf1b6d761e5c4))
* 加了引用api后调不动了不知道为啥 ([8de5a45](https://github.com/MarleneJiang/ByteDream-JueJin/commit/8de5a450bca61deffeffb8443fcf9a43146f18e7))
* 去除无用部署 ([d8d69cf](https://github.com/MarleneJiang/ByteDream-JueJin/commit/d8d69cfb93f262783232931b6ed125fc5e9a508d))
* 增加搜索功能 ([355bcdb](https://github.com/MarleneJiang/ByteDream-JueJin/commit/355bcdb0a0f7f523c22e0a57f7d36fb4f098d859))
* 提交"license": "Apache License 2.0" ([1d2f039](https://github.com/MarleneJiang/ByteDream-JueJin/commit/1d2f039da3188b52a58347b93121a15ba15c577c))
* 更新umami链接 ([957f1ef](https://github.com/MarleneJiang/ByteDream-JueJin/commit/957f1efe295c78e3aaf966ba40f205043a964b5c))
* 样式好像整的还行了 ([46bda3b](https://github.com/MarleneJiang/ByteDream-JueJin/commit/46bda3ba324eece718ee17982c376e6690c67052))
* 测试提交 ([c63dee0](https://github.com/MarleneJiang/ByteDream-JueJin/commit/c63dee095ddcaca95b1da343aa7dd8fd0e406732))
* 添加懒加载 ([b65567f](https://github.com/MarleneJiang/ByteDream-JueJin/commit/b65567f8ac123417f0cb92c7f3a180683671dc25))
* 添加懒加载 ([cfc18f4](https://github.com/MarleneJiang/ByteDream-JueJin/commit/cfc18f43e28091fb3643bc84f62165e93b266ec2))
* 点击时会变宽 ([222d7c6](https://github.com/MarleneJiang/ByteDream-JueJin/commit/222d7c6ba45eee8e62ca288437807135d926ac0b))
* 热度选择框懒加载 ([bd9775f](https://github.com/MarleneJiang/ByteDream-JueJin/commit/bd9775f1b5b8f68f1677a63b7fd6e27593114d02))
* 热度选择框懒加载 ([a91a1cb](https://github.com/MarleneJiang/ByteDream-JueJin/commit/a91a1cb36e88eba0936541a73e742f4d3dea4aaf))
* 相关文章最多十篇,按点赞量逆序排列 ([f25a7d6](https://github.com/MarleneJiang/ByteDream-JueJin/commit/f25a7d64a54810652802ef3b00f60e250a1e5b02))
* 蓝块块加上 ([b094801](https://github.com/MarleneJiang/ByteDream-JueJin/commit/b094801dbc117da634358de08abf6184b064a974))
* 蓝框框加上 ([f4a7273](https://github.com/MarleneJiang/ByteDream-JueJin/commit/f4a7273ff26a21a14fce6441b1b09bdc9cc591dd))
* 解决导航栏&标签栏极端情况 ([c17ea83](https://github.com/MarleneJiang/ByteDream-JueJin/commit/c17ea83f6131648ed337a044c12358a9ed5520a1))
* 骨架屏代码优化 ([a1999e4](https://github.com/MarleneJiang/ByteDream-JueJin/commit/a1999e4ac35e808d30ec0266a1dc0487ecba31bb))


### Bug Fixes

* autoDeploy,yaml line ([cc6dbab](https://github.com/MarleneJiang/ByteDream-JueJin/commit/cc6dbab75182f5fc2e7e2ac3db8365cb0a93e292))
* backend启动命令 ([d6d4584](https://github.com/MarleneJiang/ByteDream-JueJin/commit/d6d4584cf2b8c83499ce8c6193ede9d3a547ca2c))
* change umami Host ([79754c1](https://github.com/MarleneJiang/ByteDream-JueJin/commit/79754c1c34b9af0ad166f8107314d1fb8a40eb26))
* eslint ([1f4de1d](https://github.com/MarleneJiang/ByteDream-JueJin/commit/1f4de1d7a0494367c2e41631dece0aeab3893c73))
* eslint ([1bbebfb](https://github.com/MarleneJiang/ByteDream-JueJin/commit/1bbebfbaa43c0f63c948347c4a7d52f435dbd1a8))
* eslint ([3404757](https://github.com/MarleneJiang/ByteDream-JueJin/commit/34047578b15553f76cff1336dd2a2651e92f51cd))
* eslint ([46d73e7](https://github.com/MarleneJiang/ByteDream-JueJin/commit/46d73e74feea6a76583fec62f4abde4cb6f1239c))
* eslint ([bc19ed7](https://github.com/MarleneJiang/ByteDream-JueJin/commit/bc19ed7b53d0d1be848cedb8720f9e3cdcd3e47b))
* image OSS ([26db352](https://github.com/MarleneJiang/ByteDream-JueJin/commit/26db3529a7a6125e31f854dcfbfca98e78d1aaee))
* lint package.json ([7778c15](https://github.com/MarleneJiang/ByteDream-JueJin/commit/7778c15dd1ee62e8237402d80699bcdbb7975374))
* package.json错误 ([14fd209](https://github.com/MarleneJiang/ByteDream-JueJin/commit/14fd209e530a3bcddb90f2a7871eb9a036519b0d))
* 其他页面切回主页时签到不显示 ([011c28c](https://github.com/MarleneJiang/ByteDream-JueJin/commit/011c28cb3e0e55c0147ff72d3d64b8d08efc18b7))
* 文章列表背景问题 ([2348b47](https://github.com/MarleneJiang/ByteDream-JueJin/commit/2348b47c918e2f2e50f8bc9900f50454b86249c9))
* 文章底部对齐 ([f41177b](https://github.com/MarleneJiang/ByteDream-JueJin/commit/f41177b325ce6596fd55f5854457f4f05878e3c0))
* 标题移动端溢出问题 ([4122bcd](https://github.com/MarleneJiang/ByteDream-JueJin/commit/4122bcd869ec93fca8d6e0cfc10253820f57553f))
* 目录滚动优化 ([e309eca](https://github.com/MarleneJiang/ByteDream-JueJin/commit/e309ecae01b6081eb15fcf98b1a249f742bb91bc))
* 细节修复 ([edc9c66](https://github.com/MarleneJiang/ByteDream-JueJin/commit/edc9c6647d5b8ac1bc73c59a8cfe79d970dbcdbf))
* 细节问题 ([54c1809](https://github.com/MarleneJiang/ByteDream-JueJin/commit/54c18094bee4aa1a3f9ba0c48a97a8f360331e06))
* 细节问题 ([3ae96ec](https://github.com/MarleneJiang/ByteDream-JueJin/commit/3ae96ec3a8e45e18623e79221d1bfdb375f84f44))
* 規範 開源證書 ([53773b6](https://github.com/MarleneJiang/ByteDream-JueJin/commit/53773b659464c6be03f24c3d7b3dd963e0770cd9))
* 解决移动端缩放问题 ([cb4002e](https://github.com/MarleneJiang/ByteDream-JueJin/commit/cb4002e988c8cfc16e1d7f2ae0d80b627aa91ff1))
* 采用分页策略 ([f084f52](https://github.com/MarleneJiang/ByteDream-JueJin/commit/f084f524a490e991ece22f3cea56bcf93dc72823))


### Performance Improvements

* ref to shallowRef ([464575b](https://github.com/MarleneJiang/ByteDream-JueJin/commit/464575b23729d9dedb86392b2d46004052eb8b75))

## [1.5.0](https://github.com/MarleneJiang/ByteDream-JueJin/compare/v1.4.0...v1.5.0) (2023-02-14)


Expand Down
Binary file modified backend/.tmp/data.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"x-generation-date": "2023-02-14T15:56:25.705Z"
"x-generation-date": "2023-02-18T01:32:46.434Z"
},
"x-strapi-config": {
"path": "/documentation",
Expand Down
3 changes: 2 additions & 1 deletion frontend/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ useHead({
{ rel: 'canonical', href: 'https://bytedream.top' },
],
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1, user-scalable=no, viewport-fit=cover, maximum-scale=1.0, minimum-scale=1.0' },
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black' },
{ name: 'apple-mobile-web-app-title', content: 'JueJin' },
Expand Down Expand Up @@ -76,6 +76,7 @@ if (process.client) {
html,
body,
#__nuxt {
overflow-x: initial;
font-size: 12px;
height: 100vh;
margin: 0;
Expand Down
12 changes: 12 additions & 0 deletions frontend/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ html {
--juejin-category-popover-text:#71777c;
--juejin-category-popover-bg:#f4f5f5;
--juejin-author-user-list-text:#515767;
--juejin-search-bg:#fff;
--juejin-search-icon:#f2f3f5;
--juejin-search-list:#fff;
--juejin-search-hover:#eff2f5;
--juejin-search-border:#ebebeb;
--juejin-search-text:#5e6369;
}

html.dark {
Expand Down Expand Up @@ -348,6 +354,12 @@ html.dark {
--juejin-category-popover-text:#71777c;
--juejin-category-popover-bg:#f4f5f5;
--juejin-author-user-list-text:#8a919f;
--juejin-search-bg:#000;
--juejin-search-icon:#27272a;
--juejin-search-list:#000;
--juejin-search-hover:#333;
--juejin-search-border:#b9babe59;
--juejin-search-text:#fff;
}

.page-enter-active,
Expand Down
149 changes: 149 additions & 0 deletions frontend/components/Navs/SearchBox.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
<script setup>
const isActive = ref(false)
const keyword = ref('')
const searchData = ref('')
const handleClick = () => {
isActive.value = true
}
const handleClickOutside = (e) => {
if (!e.target.closest('.search-active'))
isActive.value = false
}
const handleClickLink = () => {
keyword.value = ''
searchData.value = ''
isActive.value = false
}
const searchInput = useDebounceFn(async () => {
if (keyword.value !== '') {
const { data: SearchData_ } = await useFetch(
`/api/global/search?keyword=${keyword}`,
)
searchData.value = SearchData_.value
}
else {
searchData.value = ''
}
}, 100)
onMounted(() => {
document.addEventListener('click', handleClickOutside)
})
onUnmounted(() => {
document.removeEventListener('click', handleClickOutside)
})
</script>

<template>
<div class="h-full f-c-c">
<div
class="search-box"
:class="{ 'search-active': isActive }"
@click="handleClick"
>
<input
v-model="keyword"
class="search-input active isResourceVisible"
type="search"
maxlength="32"
placeholder="搜索"
@input="searchInput"
>
<div class="search-icon" :class="{ 'search-active': isActive }">
<div class="i-carbon-search" />
</div>
<div v-if="!!searchData.hits" class="search-result">
<div class="result-title">
共查到{{ searchData.estimatedTotalHits }}条结果
</div>
<div class="result-list">
<NuxtLink
v-for="item in searchData.hits"
:key="item.id"
class="result-item"
:to="`/article/${item.id}`"
@click="handleClickLink"
>
{{ item.title }}
</NuxtLink>
</div>
</div>
</div>
</div>
</template>

<style scoped>
.search-box {
@apply relative flex bg-jj-navs-search-bg;
display: flex;
align-items: center;
justify-content: space-between;
border-radius: 4px;
position: relative;
height: 2.834rem;
border: 1px solid #c2c8d1;
transition: width 0.2s;
}
.search-box.search-active {
border: 1px solid #1e80ff;
}
.search-input {
border: none;
width: calc(100% - 44px);
padding: 0.6rem 0 0.6rem 1rem;
box-shadow: none;
outline: none;
font-size: 1.1rem;
color: #8a919f;
background-color: transparent;
transition: width 0.3s;
}
[type="search"] {
appearance: textfield;
outline-offset: -2px;
}
.search-icon {
position: relative;
border-radius: 2px;
@apply f-c-c text-1.2rem text-gray h-full w-3rem bg-jj-navs-search-icon;
}
.search-icon.search-active {
@apply bg-[#eaf2ff] text-blue;
}
.search-result {
width: 100%;
position: absolute;
top: 105%;
line-height: 2rem;
left: 0;
z-index: 1000;
min-width: 6rem;
font-size: 1rem;
color: #869aab;
list-style: none;
text-align: left;
border-radius: 0.17rem;
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 5%);
border: 1px solid;
@apply bg-jj-navs-search-list border-jj-navs-search-border;
}
.result-title {
border-bottom: 1px solid;
@apply border-jj-navs-search-border;
padding: 0.5rem 1rem;
display: flex;
justify-content: space-between;
}
.result-list {
cursor: pointer;
@apply text-jj-navs-search-text;
}
.result-item {
padding: 0.5rem 1rem;
@apply text-ellipsis truncate block;
}
.result-item:hover {
@apply bg-jj-navs-search-hover;
}
</style>
26 changes: 16 additions & 10 deletions frontend/components/Navs/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ const changePageNum = (direction) => {
</div>
</div>
</nav>
<UnoDarkToggle />
<div class="nav-other">
<NavsSearchBox />
<UnoDarkToggle />
</div>
</header>
</div>
</template>
Expand All @@ -57,7 +60,7 @@ const changePageNum = (direction) => {
transform: translate3d(0,-100%,0);
transition: all .2s;
@apply flex items-center fixed top-0 left-0 right-0;
@apply space-between md:justify-around;
@apply space-between mlg:justify-around;
@apply bg-jj-sidebar border-b-1 h-[5rem] lt-sm:(h-[4.333rem]) z-99 border-jj-navs-normal;
}
.logo{
Expand All @@ -69,11 +72,11 @@ const changePageNum = (direction) => {
}

.nav-item-wrapper{
@apply hidden md:(flex h-full);
@apply lt-md:(absolute top-4rem left-2rem p-2 h-auto border-1 border-jj-navs-wrapper-normal rounded-md shadow-xl shadow-black/10 dark:shadow-white/10 transform-gpu -translate-x-1/2 bg-jj-article);
@apply hidden mlg:(flex h-full);
@apply lt-mlg:(absolute top-4rem left-2rem p-2 h-auto border-1 border-jj-navs-wrapper-normal rounded-md shadow-xl shadow-black/10 dark:shadow-white/10 transform-gpu -translate-x-1/2 bg-jj-article);
}
.mobile-nav{
@apply f-c-c md:hidden text-jj-blue-normal;
@apply f-c-c mlg:hidden text-jj-blue-normal;
cursor: pointer;
font-size: 1.33rem;
width: 5.66rem;
Expand All @@ -90,29 +93,32 @@ const changePageNum = (direction) => {
}

.mobile-nav-item-wrapper {
@apply lt-md:(block);
@apply lt-mlg:(block);

}

.mobile-nav-item{
@apply lt-md:(px-13 h-4rem);
@apply lt-mlg:(px-13 h-4rem);
}

.nav-wrapper{
@apply relative h-full flex items-center;
}

.alter-items{
@apply h-full f-c-c mx-4 flex-col lt-md:(flex-row h-4rem);
@apply h-full f-c-c mx-4 flex-col lt-mlg:(flex-row h-4rem);
}
.alter-item{
@apply text-[1.2rem] text-jj-navs-item-normal;
}

.alter-prev{
@apply lt-md:(i-carbon:caret-left) i-carbon:caret-up hover:(text-jj-blue-normal cursor-pointer);
@apply lt-mlg:(i-carbon:caret-left) i-carbon:caret-up hover:(text-jj-blue-normal cursor-pointer);
}
.alter-next{
@apply lt-md:(i-carbon:caret-right) i-carbon:caret-down hover:(text-jj-blue-normal cursor-pointer);
@apply lt-mlg:(i-carbon:caret-right) i-carbon:caret-down hover:(text-jj-blue-normal cursor-pointer);
}
.nav-other{
@apply h-full flex items-center gap-1.5rem lt-lg:mr-1.5rem lt-md:mr-1rem lt-sm:(mx-0.5rem gap-1rem) ;
}
</style>
8 changes: 8 additions & 0 deletions frontend/unocss.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ export default defineConfig({
after: {
normal: 'var(--juejin-color-navs-item-after)', // #EF4444
},
search: {
bg: 'var(--juejin-search-bg)',
icon: 'var(--juejin-search-icon)',
list: 'var(--juejin-search-list)',
hover: 'var(--juejin-search-hover)',
border: 'var(--juejin-search-border)',
text: 'var(--juejin-search-text)',
},
},
types: {
normal: 'var(--juejin-color-types-list)', // #71777c
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ByteDream-JueJin",
"version": "1.5.0",
"version": "1.6.0",
"description": "",
"main": "index.ts",
"private": true,
Expand Down

0 comments on commit eaa538b

Please sign in to comment.