Skip to content

Commit 9ad5c51

Browse files
authored
Merge pull request #23 from besscroft/dev
v0.3.1
2 parents 0af9eba + 205141a commit 9ad5c51

File tree

13 files changed

+68
-45
lines changed

13 files changed

+68
-45
lines changed

.env.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Postgre 主机
2-
Postgre_HOST="db.kamera.supabase.co"
2+
Postgre_HOST="localhost"
33
# Postgre 端口
44
Postgre_PORT=5432
55
# Postgre 数据库

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,14 @@ nitro: {
6262
>
6363
> 项目内默认的 key 都是用作演示用途!
6464
65-
| Key | 备注 |
66-
| ---------------- |-------------------------------------------------------------------------------------------------------------------|
67-
| Postgre_HOST | Postgre 数据库主机,如:db.kamera.supabase.co |
68-
| Postgre_PORT | Postgre 数据库端口,默认值:5432 |
69-
| Postgre_DATABASE | Postgre 数据库名称,默认值:postgres |
70-
| Postgre_USERNAME | Postgre 数据库用户名,默认值:postgres |
71-
| Postgre_PASSWORD | Postgre 数据库密码,默认值:postgres |
65+
| Key | 备注 |
66+
|------------------|---------------------------------------|
67+
| Postgre_HOST | Postgre 数据库主机,如:db.kamera.supabase.co |
68+
| Postgre_PORT | Postgre 数据库端口,默认值:5432 |
69+
| Postgre_DATABASE | Postgre 数据库名称,默认值:postgres |
70+
| Postgre_USERNAME | Postgre 数据库用户名,默认值:postgres |
71+
| Postgre_PASSWORD | Postgre 数据库密码,默认值:postgres |
72+
| MOBOLE_ROW | 移动端瀑布流显示列数,可选值:`1``2`,默认 1 |
7273

7374
#### 页面配置
7475

@@ -152,6 +153,12 @@ export default defineAppConfig({
152153

153154
如果你要修改音乐列表,请在 `assets/server/music.json` 下更改,可以换成你自己的。
154155

156+
`app.config.ts` 文件中,可以配置:
157+
158+
| Key | 备注 |
159+
| ---------------- |-----------------------------|
160+
| mobileRow | 移动端瀑布流显示列数,可选值[1, 2],默认 1 |
161+
155162
### 容器部署
156163

157164
我把容器部署往后放,是不希望前面的内容被跳过,这样你在构建/部署时才能得心应手!
@@ -270,7 +277,7 @@ pnpm run dev
270277

271278
[提出新想法 & 提交 Bug](https://github.com/besscroft/kamera/issues/new) | [Fork & Pull Request](https://github.com/besscroft/kamera/fork)
272279

273-
Kamera 欢迎各种贡献,包括但不限于改进,新功能,文档和代码改进,问题和错误报告。
280+
Kamera 欢迎各种贡献,包括但不限于改进,新功能,文档和代码改进,问题和错误报告。`dev` 分支接受 `PR`
274281

275282
> 有需求和建议都可以提,有空的话我会处理,但受限于 Nuxt3 / SSR 的⌈局限性⌋,很多功能的设计上可能会有取舍。
276283

app.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default defineAppConfig({
2020
'/api/music',
2121
'/api/getImageList',
2222
],
23+
mobileRow: 2,
2324
ui: {
2425
notifications: {
2526
position: 'top-0 bottom-auto',

app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ useHead({
1515
<template>
1616
<NuxtLayout>
1717
<NuxtLoadingIndicator />
18-
<UNotifications :ui="{ width: 'w-full md:w-80' }" />
18+
<UNotifications :ui="{ wrapper: 'z-[9999]', width: 'w-full md:w-80' }" />
1919
<ElConfigProvider :locale="zhCn">
2020
<NuxtPage />
2121
</ElConfigProvider>

components/DarkToggle.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
33
44
const breakpoints = useBreakpoints(breakpointsTailwind)
5-
const smAndLarger = breakpoints.greaterOrEqual('md')
5+
const mdAndLarger = breakpoints.greaterOrEqual('md')
66
const isDark = useDark()
77
88
// @ts-expect-error: Transition API
@@ -53,7 +53,7 @@ function toggleDark(event?: MouseEvent) {
5353

5454
<template>
5555
<button
56-
v-if="!smAndLarger"
56+
v-if="!mdAndLarger"
5757
flex flex-row items-center block px-5 py-2 focus-blue w-full
5858
class="!outline-none"
5959
:title="isDark ? '切换至⌈白夜⌋' : '切换至⌈常夜⌋'"

components/Header.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
33
import photosList from '~/constants/photos.json'
44
55
const breakpoints = useBreakpoints(breakpointsTailwind)
6-
const smAndLarger = breakpoints.greaterOrEqual('md')
6+
const mdAndLarger = breakpoints.greaterOrEqual('md')
77
const router = useRouter()
88
const route = useRoute()
99
const user = useUserStore()
@@ -80,7 +80,7 @@ onBeforeUnmount(() => {
8080
</ClientOnly>
8181
</div>
8282

83-
<div v-if="smAndLarger" flex items-center justify-center space-x-3>
83+
<div v-if="mdAndLarger" flex items-center justify-center space-x-3>
8484
<ClientOnly>
8585
<DarkToggle />
8686
</ClientOnly>

components/ImageExif.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ const props = defineProps<{
55
exif: any
66
}>()
77
const breakpoints = useBreakpoints(breakpointsTailwind)
8-
const smAndLarger = breakpoints.greaterOrEqual('md')
8+
const mdAndLarger = breakpoints.greaterOrEqual('md')
99
</script>
1010

1111
<template>
1212
<el-descriptions
1313
:title="Object.keys(exif).length === 0 ? 'EXIF 信息为空!' : 'EXIF'"
1414
direction="vertical"
15-
:column="smAndLarger ? 3 : 2"
15+
:column="mdAndLarger ? 3 : 2"
1616
border
1717
>
1818
<el-descriptions-item v-if="exif.make" label="相机品牌">

components/Waterfall.vue

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
33
44
const breakpoints = useBreakpoints(breakpointsTailwind)
5-
const smAndLarger = breakpoints.greaterOrEqual('md')
5+
const mdAndLarger = breakpoints.greaterOrEqual('md')
6+
7+
const appConfig = useAppConfig()
68
79
const props = defineProps({
810
loading: Boolean,
@@ -31,6 +33,14 @@ const LazyImg = defineAsyncComponent(() =>
3133
import('vue-waterfall-plugin-next').then((module) => module.LazyImg)
3234
)
3335
36+
const breakPointsConfig = computed(() => {
37+
return {
38+
9999: { rowPerView: 4 },
39+
1280: { rowPerView: 3 },
40+
1024: { rowPerView: Number(appConfig.mobileRow) === 2 ? 2 : 1 },
41+
}
42+
})
43+
3444
onMounted(async () => {
3545
mounted.value = true
3646
await emit('dataHandle')
@@ -47,15 +57,11 @@ onUnmounted(() => {
4757
<Waterfall
4858
v-if="dataList && dataList?.length > 0"
4959
:list="dataList"
50-
:gutter="smAndLarger ? 12 : 4"
60+
:gutter="mdAndLarger ? 12 : 4"
5161
:hasAroundGutter="true"
5262
:crossOrigin="false"
5363
:backgroundColor="isDark ? '#121212' : '#FFFFFF'"
54-
:breakpoints="{
55-
9999: { rowPerView: 4 },
56-
1280: { rowPerView: 3 },
57-
1024: { rowPerView: 2 },
58-
}"
64+
:breakpoints="breakPointsConfig"
5965
>
6066
<template #item="{ item }">
6167
<div class="card">

layouts/admin.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
33
44
const { isMobile } = useDevice()
55
const breakpoints = useBreakpoints(breakpointsTailwind)
6-
const smAndLarger = breakpoints.greaterOrEqual('md')
6+
const mdAndLarger = breakpoints.greaterOrEqual('md')
77
</script>
88

99
<template>
@@ -13,9 +13,9 @@ const smAndLarger = breakpoints.greaterOrEqual('md')
1313
<slot />
1414
</div>
1515
<ClientOnly>
16-
<el-backtop v-if="smAndLarger" :right="100" :bottom="100" z-50 />
17-
<Music v-if="smAndLarger && !isMobile" />
18-
<NavBottom v-if="!smAndLarger" />
16+
<el-backtop v-if="mdAndLarger" :right="100" :bottom="100" z-50 />
17+
<Music v-if="mdAndLarger && !isMobile" />
18+
<NavBottom v-if="!mdAndLarger" />
1919
</ClientOnly>
2020
</div>
2121
</template>

layouts/default.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
33
44
const { isMobile } = useDevice()
55
const breakpoints = useBreakpoints(breakpointsTailwind)
6-
const smAndLarger = breakpoints.greaterOrEqual('md')
6+
const mdAndLarger = breakpoints.greaterOrEqual('md')
77
</script>
88

99
<template>
@@ -12,10 +12,10 @@ const smAndLarger = breakpoints.greaterOrEqual('md')
1212
<div style="min-height: calc(100vh - 3.5rem);" pb-14>
1313
<slot />
1414
</div>
15-
<el-backtop v-if="smAndLarger" :right="100" :bottom="100" z-50 />
15+
<el-backtop v-if="mdAndLarger" :right="100" :bottom="100" z-50 />
1616
<ClientOnly>
17-
<Music v-if="smAndLarger && !isMobile" />
18-
<NavBottom v-if="!smAndLarger" />
17+
<Music v-if="mdAndLarger && !isMobile" />
18+
<NavBottom v-if="!mdAndLarger" />
1919
</ClientOnly>
2020
</main>
2121
</template>

0 commit comments

Comments
 (0)