Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
camera-2018 committed Feb 18, 2023
1 parent 6c81575 commit 9caf414
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 51 deletions.
36 changes: 29 additions & 7 deletions frontend/components/ArticlesContent/SideBar/Right/Column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (props?.column) {
}
const isActive = ref(false)
const handleClick = (e: any) => {
const handleClick = () => {
isActive.value = !isActive.value
}
const handleClickOutside = (e: any) => {
Expand All @@ -40,17 +40,20 @@ onUnmounted(() => {
<div class="next-article-title">
下一篇
</div>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" :class="isActive ? 'list-icon active' : 'list-icon'" @click="handleClick">
<svg
width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"
:class="isActive ? 'list-icon active' : 'list-icon'" @click="handleClick"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
fill-rule="evenodd" clip-rule="evenodd"
d="M2.00001 2C1.63182 2 1.33334 2.29848 1.33334 2.66667C1.33334 3.03486 1.63182 3.33333 2.00001 3.33333H3.33334C3.70153 3.33333 4.00001 3.03486 4.00001 2.66667C4.00001 2.29848 3.70153 2 3.33334 2H2.00001ZM6.00034 2C5.63215 2 5.33367 2.29848 5.33367 2.66667C5.33367 3.03486 5.63215 3.33333 6.00034 3.33333H14.0003C14.3685 3.33333 14.667 3.03486 14.667 2.66667C14.667 2.29848 14.3685 2 14.0003 2H6.00034ZM6.00034 7.33333C5.63215 7.33333 5.33367 7.63181 5.33367 8C5.33367 8.36819 5.63215 8.66667 6.00034 8.66667H14.0003C14.3685 8.66667 14.667 8.36819 14.667 8C14.667 7.63181 14.3685 7.33333 14.0003 7.33333H6.00034ZM1.33367 8C1.33367 7.63181 1.63215 7.33333 2.00034 7.33333H3.33367C3.70186 7.33333 4.00034 7.63181 4.00034 8C4.00034 8.36819 3.70186 8.66667 3.33367 8.66667H2.00034C1.63215 8.66667 1.33367 8.36819 1.33367 8ZM1.33367 13.3333C1.33367 12.9651 1.63215 12.6667 2.00034 12.6667H3.33367C3.70186 12.6667 4.00034 12.9651 4.00034 13.3333C4.00034 13.7015 3.70186 14 3.33367 14H2.00034C1.63215 14 1.33367 13.7015 1.33367 13.3333ZM6.00034 12.6667C5.63215 12.6667 5.33367 12.9651 5.33367 13.3333C5.33367 13.7015 5.63215 14 6.00034 14H14.0003C14.3685 14 14.667 13.7015 14.667 13.3333C14.667 12.9651 14.3685 12.6667 14.0003 12.6667H6.00034Z"
/>
</svg>
</div>
<hr class="next-article-hr">
<div class="article-content">
<a :href="`/article/${nextArticle?.id}`" target="_blank" :title="nextArticle?.title" class="article"> {{ nextArticle?.title }} </a>
<a :href="`/article/${nextArticle?.id}`" target="_blank" :title="nextArticle?.title" class="article"> {{
nextArticle?.title }} </a>
</div>
<nav v-show="isActive" class="article-list next-article-list ">
<div class="list-title">
Expand All @@ -59,7 +62,10 @@ onUnmounted(() => {
<div class="list-body">
<ul class="list-ul">
<li v-for="item in allColumnList" :key="item.id" class="list-li">
<a :href="`/article/${item.id}`" target="_blank" :title="item.title" :class="item.id === currentId ? 'list-item active' : 'list-item'">
<a
:href="`/article/${item.id}`" target="_blank" :title="item.title"
:class="item.id === currentId ? 'list-item active' : 'list-item'"
>
{{ item.title }}
</a>
</li>
Expand All @@ -73,62 +79,78 @@ onUnmounted(() => {
.next-article {
@apply bg-#fff rd-4px max-h-130px relative bg-jj-sidebar;
}
.next-article-header {
@apply flex justify-between;
}
.next-article-title {
@apply fw-500 text-16px lh-2rem my-0 mx-1.667rem pt-1.333rem pb-12px text-jj-content;
}
.list-icon {
@apply inline-block box-content w-16px h-24px py-4px px-6px my-12px mx-10px;
@apply hover:bg-jj-gray-icon-normal rd-4px cursor-pointer fill-jj-black-normal;
@apply hover: bg-jj-gray-icon-normal rd-4px cursor-pointer fill-jj-black-normal;
transition: transform 0.5s;
}
.list-icon.active {
@apply fill-jj-blue-fill-normal;
}
.next-article-hr {
@apply absolute h-1px top-50px left-20px w-20px bg-jj-catalog-normal border-0;
}
.article-content {
@apply pb-1.667rem p-0;
}
.article {
@apply text-14px c-jj-gray-text-normal lh-22px pt-12px px-1.667rem pb-0 overflow-hidden text-ellipsis text-jj-span;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.next-article-list {
@apply absolute bottom-100% right-17px border-1px border-solid border-jj-border-normal p-0;
box-shadow: 0 8px 24px rgb(81 87 103 / 16%);
}
.article-list {
@apply bg-jj_font_white rd-4px w-300px bg-jj-sidebar;
}
.list-title {
@apply text-16px c-jj_primary lh-2rem fw-500 my-0 mx-1.667rem pt-20px pb-8px px-0 text-jj-content;
}
.list-body {
@apply relative max-h-300px w-300px ml--24px overflow-auto pt-0 pr-20px pb-12px pl-0;
}
.list-ul {
@apply ml-29px;
}
.list-li {
@apply p-y-8px pr-0 pl-30px;
}
.list-item {
@apply text-14px c-jj-span fw-400 ml-4px overflow-hidden text-ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.list-li:before {
@apply absolute left-44px w-4px h-4px mt-7px bg-jj-blue-normal;
content: '';
transform: rotate(45deg);
}
.active {
/* color: rgb(0, 127, 255); */
@apply text-jj-link-normal;
Expand Down
4 changes: 3 additions & 1 deletion frontend/components/ArticlesContent/highlightStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export default function highlightStyle() {
const $style = document.createElement('style')
let hl = file.value.frontmatter?.highlight
const hlStyle = highlight[hl]
if (hlStyle) { $style.innerHTML = hlStyle }
if (hlStyle) {
$style.innerHTML = hlStyle
}
else {
$style.innerHTML = highlight.default
hl = 'default'
Expand Down
100 changes: 61 additions & 39 deletions frontend/components/Types/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup>
const route = useRoute()
const pageNum = ref(1)
const typeList = reactive({
data: [],
Expand Down Expand Up @@ -52,70 +51,87 @@ const changePageNum = async (direction) => {
</div>
</div>
<span v-if="typeList.meta.pagination.total > 9" class="type-manage type-list-item alter-items">
<div i-carbon:caret-left class="alter-prev alter-item" :class="pageNum === 1 ? '!text-gray' : 'hover:!text-jj-blue-normal'" @click="changePageNum('prev')" />
<div i-carbon:caret-right class="alter-next alter-item" :class="pageNum === typeList.meta.pagination.pageCount ? '!text-gray' : 'hover:!text-jj-blue-normal'" @click="changePageNum('next')" />
<div
i-carbon:caret-left class="alter-prev alter-item"
:class="pageNum === 1 ? '!text-gray' : 'hover:!text-jj-blue-normal'" @click="changePageNum('prev')"
/>
<div
i-carbon:caret-right class="alter-next alter-item"
:class="pageNum === typeList.meta.pagination.pageCount ? '!text-gray' : 'hover:!text-jj-blue-normal'"
@click="changePageNum('next')"
/>
</span>
</div>
</div>
</template>

<style scoped>
.nav-shown{
transform: translate3d(0,-5rem,0) !important;
.nav-shown {
transform: translate3d(0, -5rem, 0) !important;
}
@media (max-width: 640px) {
.nav-shown{
transform: translate3d(0,-4.333rem,0) !important;
.nav-shown {
transform: translate3d(0, -4.333rem, 0) !important;
}
}
@media (max-width: 960px){
@media (max-width: 960px) {
.type-list-item:first-child {
@apply pl-[1.5rem];
@apply pl-[1.5rem];
}
.type-list-item:last-child {
@apply pr-[1.5rem];
@apply pr-[1.5rem];
}
}
.view-types {
transition: all .2s;
transform: translateZ(0);
@apply bg-jj-sidebar w-full fixed top-[5rem] lt-sm:(top-[4.333rem]) shadow-sm shadow-black/5 dark:shadow-white/5 h-[3.833rem] z-1;
@apply bg-jj-sidebar w-full fixed top-[5rem] lt-sm: (top-[4.333rem]) shadow-sm shadow-black/5 dark:shadow-white/5 h-[3.833rem] z-1;
}
.type-list-item{
.type-list-item {
@apply h-full w-auto float-left cursor-pointer whitespace-nowrap flex items-center p-x-[1rem] text-jj-types-normal text-[1.16rem];
@apply cursor-pointer;
}
.type-list-item:hover{
.type-list-item:hover {
@apply text-jj-blue-normal;
}
.type-list{
.type-list {
line-height: 1;
@apply list-none ma max-w-[960px] h-full;
@apply overflow-x-auto flex items-center;
@apply relative;
}
.type-list::-webkit-scrollbar {
height: 0;
height: 0;
}
.type-list-item.router-link-exact-active {
@apply opacity-100 text-primary;
@apply opacity-100 text-primary;
}
.type-manage{
@apply md:(absolute right-0 top-0);
.type-manage {
@apply md: (absolute right-0 top-0);
}
.list-item-wrapper{
.list-item-wrapper {
@apply relative h-full;
}
.type-list-item:hover+.category-popover{
.type-list-item:hover+.category-popover {
@apply scale-100;
}
.category-popover:hover{
.category-popover:hover {
@apply scale-100;
}
.category-popover {
@apply scale-0 transition-100 delay-150 transition-all bg-jj-article border-jj-border-dropdown-normal;
position: fixed;
Expand All @@ -130,34 +146,40 @@ const changePageNum = async (direction) => {
cursor: default;
z-index: 250;
}
.tag-list {
display: flex;
flex-wrap: wrap;
display: flex;
flex-wrap: wrap;
}
.tag {
display: flex;
justify-content: center;
align-items: center;
height: 2rem;
border-radius: 1rem;
font-size: 1.1rem;
margin-right: 1rem;
margin-bottom: 1rem;
@apply bg-jj-types-bg text-jj-types-text cursor-pointer;
}
.tag:hover{
display: flex;
justify-content: center;
align-items: center;
height: 2rem;
border-radius: 1rem;
font-size: 1.1rem;
margin-right: 1rem;
margin-bottom: 1rem;
@apply bg-jj-types-bg text-jj-types-text cursor-pointer;
}
.tag:hover {
@apply text-link;
}
.tag-item{
.tag-item {
padding: 0 .83rem;
height: 2rem;
border-radius: 1rem;
@apply f-c-c;
border-radius: 1rem;
@apply f-c-c;
}
.tag-item.router-link-exact-active {
@apply text-jj-light bg-primary;
}
.alter-items{
@apply hover:!text-jj-types-normal text-[1.2rem];
.alter-items {
@apply hover: !text-jj-types-normal text-[1.2rem];
}
</style>
3 changes: 0 additions & 3 deletions frontend/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ export interface liked extends mutation {
liked: number
}
}

```

## 作者
Expand Down Expand Up @@ -316,7 +315,6 @@ export interface ITagItem {
tag: string
alias: string
}

```

### 获取文章列表数据
Expand Down Expand Up @@ -437,7 +435,6 @@ interface IColumId {
cover: string
describe: string
}

```


1 change: 0 additions & 1 deletion frontend/utils/useGraphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ export async function useGraphql(query: any, authorization?: string) {
console.error(err)
}
}

0 comments on commit 9caf414

Please sign in to comment.