Skip to content

Commit

Permalink
chore: 新增列表页导航栏浮动功能
Browse files Browse the repository at this point in the history
  • Loading branch information
dlzmoe committed Aug 30, 2024
1 parent 7638083 commit 632023d
Show file tree
Hide file tree
Showing 28 changed files with 795 additions and 716 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
- 更新文档
- 修复了部分代码
- 新增:列表页导航栏浮动功能
661 changes: 344 additions & 317 deletions dist/linuxdo-scripts.user.js

Large diffs are not rendered by default.

661 changes: 344 additions & 317 deletions linuxdo-scripts.user.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linuxdo-scripts",
"version": "0.3.5",
"version": "0.3.6",
"author": "dlzmoe",
"description": "An enhanced script for the linux.do forum",
"type": "module",
Expand Down
8 changes: 5 additions & 3 deletions src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
<MenuShowAI :sort="18" v-model:value="settingData.checked18" />
<!-- 编辑器切换 ja 字体 -->
<MenuEditorJa :sort="19" v-model:value="settingData.checked19" />
<!-- 首页新增按创建时间排序 -->
<!-- <MenuCreatedOrder :sort="21" v-model:value="settingData.checked21" /> -->

<!-- 开启列表页导航栏浮动 -->
<MenuStickyNav :sort="20" v-model:value="settingData.checked20" />
<!-- 检测更新 -->
<Updates />
</div>
Expand Down Expand Up @@ -182,6 +182,7 @@ import AIDialog from "./components/AIDialog.vue";
import MenuEditorJa from "./components/MenuEditorJa.vue";
import MenuCreatedOrder from "./components/MenuCreatedOrder.vue";
import GPTconfig from "./components/GPTconfig.vue";
import MenuStickyNav from "./components/MenuStickyNav.vue";
export default {
components: {
Expand Down Expand Up @@ -219,6 +220,7 @@ export default {
MenuEditorJa,
MenuCreatedOrder,
GPTconfig,
MenuStickyNav,
},
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/assets/app.less
Original file line number Diff line number Diff line change
Expand Up @@ -573,4 +573,4 @@ body.body-preview #main-outlet-wrapper {
background: #999;
color: #fff;
}
}
}
1 change: 0 additions & 1 deletion src/assets/vite.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/assets/vue.svg

This file was deleted.

6 changes: 2 additions & 4 deletions src/components/MenuAutoexpandreply.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuCreatedOrder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuEditorJa.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuFilterText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuFloorHeight.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuHidetopicdetailtitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuLevelSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
8 changes: 3 additions & 5 deletions src/components/MenuLookOP.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
<!-- 是否开启只看楼主 -->
<div class="item">
<div class="tit">{{ sort }}. 是否开启只看楼主</div>
<input type="checkbox" v-model="localChecked" @change="handleChange">
<input type="checkbox" v-model="localChecked" @change="handleChange" />
</div>
</template>

<script>
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuLookmeSign.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuNewtopicreminder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuPangu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuQuickAccess.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuShowAI.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuShowUnread.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuShowcreatetime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuShowcreatetime1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
6 changes: 2 additions & 4 deletions src/components/MenuShowfloors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
58 changes: 58 additions & 0 deletions src/components/MenuStickyNav.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<template>
<div class="item">
<div class="tit">{{ sort }}. 开启列表页导航栏浮动</div>
<input type="checkbox" v-model="localChecked" @change="handleChange" />
</div>
</template>

<script>
export default {
props: {
value: {
type: Boolean,
default: false,
},
sort: {
type: Number,
required: true,
},
},
data() {
return {
localChecked: this.value,
};
},
watch: {
value(newValue) {
this.localChecked = newValue;
},
},
methods: {
handleChange() {
this.$emit("update:value", this.localChecked);
},
},
created() {
if (this.localChecked) {
$(window).on("scroll", function () {
if ($(window).scrollTop() >= 250) {
$(".navigation-container").addClass("is-active");
} else {
$(".navigation-container").removeClass("is-active");
}
});
$("head").append(`<style>
.navigation-container.is-active{position:fixed;top:65px;background:#fff!important;z-index:9;box-shadow:1px 3px 7px 0 rgba(0,0,0,.2);margin-left:-30px;padding-left:30px;border-radius:5px;padding-top:10px;padding-right:20px;min-width:1000px;width:auto}
</style>`);
}
},
};
</script>
<style scoped>
.item {
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
6 changes: 2 additions & 4 deletions src/components/MenuTopicpreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
export default {
props: {
value: {
type: Object,
default: {
value: false,
},
type: Boolean,
default: false,
},
sort: {
type: Number,
Expand Down
4 changes: 4 additions & 0 deletions version-log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.6

- 新增:列表页导航栏浮动功能

## 0.3.5

- 更新文档
Expand Down

0 comments on commit 632023d

Please sign in to comment.