mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-03-17 01:20:46 +08:00
feat: mobile Profile page
This commit is contained in:
@@ -88,6 +88,7 @@ export default {
|
|||||||
|
|
||||||
.timeline-content {
|
.timeline-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
width: calc(100% - 32px);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
|
|||||||
@@ -16,3 +16,12 @@ export function stripMarkdown(text) {
|
|||||||
el.innerHTML = html
|
el.innerHTML = html
|
||||||
return el.textContent || el.innerText || ''
|
return el.textContent || el.innerText || ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function stripMarkdownLength(text, length) {
|
||||||
|
const plain = stripMarkdown(text)
|
||||||
|
if (!length || plain.length <= length) {
|
||||||
|
return plain
|
||||||
|
}
|
||||||
|
// 截断并加省略号
|
||||||
|
return plain.slice(0, length) + '...'
|
||||||
|
}
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
下对
|
下对
|
||||||
<router-link :to="`/posts/${item.comment.post.id}#comment-${item.comment.parentComment.id}`"
|
<router-link :to="`/posts/${item.comment.post.id}#comment-${item.comment.parentComment.id}`"
|
||||||
class="timeline-link">
|
class="timeline-link">
|
||||||
{{ item.comment.parentComment.content }}
|
{{ stripMarkdownLength(item.comment.parentComment.content, 200) }}
|
||||||
</router-link>
|
</router-link>
|
||||||
回复了
|
回复了
|
||||||
</template>
|
</template>
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<router-link :to="`/posts/${item.comment.post.id}#comment-${item.comment.id}`"
|
<router-link :to="`/posts/${item.comment.post.id}#comment-${item.comment.id}`"
|
||||||
class="timeline-link">
|
class="timeline-link">
|
||||||
{{ item.comment.content }}
|
{{ stripMarkdownLength(item.comment.content, 200) }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<div class="timeline-date">
|
<div class="timeline-date">
|
||||||
{{ formatDate(item.comment.createdAt) }}
|
{{ formatDate(item.comment.createdAt) }}
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
</router-link>
|
</router-link>
|
||||||
下评论了
|
下评论了
|
||||||
<router-link :to="`/posts/${item.comment.post.id}#comment-${item.comment.id}`" class="timeline-link">
|
<router-link :to="`/posts/${item.comment.post.id}#comment-${item.comment.id}`" class="timeline-link">
|
||||||
{{ item.comment.content }}
|
{{ stripMarkdownLength(item.comment.content, 200) }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<div class="timeline-date">{{ formatDate(item.createdAt) }}</div>
|
<div class="timeline-date">{{ formatDate(item.createdAt) }}</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -240,7 +240,7 @@ import { getToken, authState } from '../utils/auth'
|
|||||||
import BaseTimeline from '../components/BaseTimeline.vue'
|
import BaseTimeline from '../components/BaseTimeline.vue'
|
||||||
import UserList from '../components/UserList.vue'
|
import UserList from '../components/UserList.vue'
|
||||||
import BasePlaceholder from '../components/BasePlaceholder.vue'
|
import BasePlaceholder from '../components/BasePlaceholder.vue'
|
||||||
import { stripMarkdown } from '../utils/markdown'
|
import { stripMarkdown, stripMarkdownLength } from '../utils/markdown'
|
||||||
import TimeManager from '../utils/time'
|
import TimeManager from '../utils/time'
|
||||||
import { hatch } from 'ldrs'
|
import { hatch } from 'ldrs'
|
||||||
hatch.register()
|
hatch.register()
|
||||||
@@ -440,6 +440,7 @@ export default {
|
|||||||
followTab,
|
followTab,
|
||||||
formatDate,
|
formatDate,
|
||||||
stripMarkdown,
|
stripMarkdown,
|
||||||
|
stripMarkdownLength,
|
||||||
loadTimeline,
|
loadTimeline,
|
||||||
loadFollow,
|
loadFollow,
|
||||||
loadSummary,
|
loadSummary,
|
||||||
@@ -464,6 +465,7 @@ export default {
|
|||||||
background-color: var(--background-color);
|
background-color: var(--background-color);
|
||||||
height: calc(100vh - var(--header-height));
|
height: calc(100vh - var(--header-height));
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-page-header {
|
.profile-page-header {
|
||||||
@@ -535,6 +537,8 @@ export default {
|
|||||||
gap: 20px;
|
gap: 20px;
|
||||||
border-top: 1px solid var(--normal-border-color);
|
border-top: 1px solid var(--normal-border-color);
|
||||||
border-bottom: 1px solid var(--normal-border-color);
|
border-bottom: 1px solid var(--normal-border-color);
|
||||||
|
scrollbar-width: none;
|
||||||
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-info-item {
|
.profile-info-item {
|
||||||
@@ -543,6 +547,7 @@ export default {
|
|||||||
gap: 5px;
|
gap: 5px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-info-item-label {
|
.profile-info-item-label {
|
||||||
@@ -559,10 +564,13 @@ export default {
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
border-bottom: 1px solid var(--normal-border-color);
|
border-bottom: 1px solid var(--normal-border-color);
|
||||||
}
|
scrollbar-width: none;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.profile-tabs-item {
|
.profile-tabs-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex: 0 0 auto;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -570,6 +578,7 @@ export default {
|
|||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-tabs-item.selected {
|
.profile-tabs-item.selected {
|
||||||
@@ -586,6 +595,7 @@ export default {
|
|||||||
|
|
||||||
.summary-title {
|
.summary-title {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
margin-bottom: 10px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -596,7 +606,9 @@ export default {
|
|||||||
.total-summary-content {
|
.total-summary-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 20px;
|
flex-wrap: wrap;
|
||||||
|
row-gap: 0px;
|
||||||
|
column-gap: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.total-summary-item {
|
.total-summary-item {
|
||||||
@@ -604,7 +616,6 @@ export default {
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 10px 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.total-summary-item-label {
|
.total-summary-item-label {
|
||||||
@@ -697,4 +708,33 @@ export default {
|
|||||||
.follow-list {
|
.follow-list {
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.profile-page {
|
||||||
|
width: 100vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile-page-header-avatar-img {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile-tabs-item {
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-divider {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hot-reply,
|
||||||
|
.hot-topic,
|
||||||
|
.hot-tag {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile-timeline {
|
||||||
|
width: calc(100vw - 40px);
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user