pref: search mobile adjust

This commit is contained in:
KUN1007 2023-11-18 00:27:12 +08:00
parent fc461c4d86
commit 8caf2a2291
4 changed files with 29 additions and 11 deletions

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { onBeforeMount, onBeforeUnmount, onMounted, ref, watch } from 'vue' import { onBeforeUnmount, ref, watch } from 'vue'
import SearchBox from './SearchBox.vue' import SearchBox from './SearchBox.vue'
import SearchHistory from './SearchHistory.vue' import SearchHistory from './SearchHistory.vue'
import SearchResult from './SearchResult.vue' import SearchResult from './SearchResult.vue'
@ -42,15 +42,11 @@ watch(
const scrollHandler = async () => { const scrollHandler = async () => {
if (isScrollAtBottom() && search.value.isLoading && search.value.keywords) { if (isScrollAtBottom() && search.value.isLoading && search.value.keywords) {
console.log(12222)
search.value.page++ search.value.page++
const lazyLoadTopics = await searchTopics() const lazyLoadTopics = await searchTopics()
if (!lazyLoadTopics.length) { if (!lazyLoadTopics.length) {
console.log(1)
search.value.isLoading = false search.value.isLoading = false
} }
@ -141,4 +137,16 @@ onBeforeUnmount(() => {
-webkit-transform: scale(1.1); -webkit-transform: scale(1.1);
transform: scale(1.1); transform: scale(1.1);
} }
@media (max-width: 1000px) {
.container {
width: 60vw;
}
}
@media (max-width: 700px) {
.container {
width: 90vw;
}
}
</style> </style>

View file

@ -61,7 +61,7 @@ onMounted(() => {
.search-form { .search-form {
position: sticky; position: sticky;
top: 0; top: 0;
width: calc(40vw - 20px); width: 100%;
max-width: 777px; max-width: 777px;
display: flex; display: flex;
justify-content: center; justify-content: center;

View file

@ -38,8 +38,12 @@ const handleDeleteHistory = (historyIndex: number) => {
@click="handleClickHistory(index)" @click="handleClickHistory(index)"
> >
<span>{{ history }} </span> <span>{{ history }} </span>
<span @click="handleDeleteHistory(index)"> <span>
<Icon class="delete" icon="line-md:close-circle" /> <Icon
@click="handleDeleteHistory(index)"
class="delete"
icon="line-md:close-circle"
/>
</span> </span>
</div> </div>
</div> </div>
@ -107,7 +111,6 @@ const handleDeleteHistory = (historyIndex: number) => {
} }
} }
/* Delete button */
.delete { .delete {
width: 30px; width: 30px;
right: 5px; right: 5px;

View file

@ -311,12 +311,13 @@ $navNumber: v-bind(navItemNum);
margin-right: 0 !important; margin-right: 0 !important;
} }
} }
}
@media (max-width: 700px) {
.settings { .settings {
display: none !important; display: none !important;
} }
}
@media (max-width: 700px) {
.top-bar { .top-bar {
display: none; display: none;
} }
@ -331,5 +332,11 @@ $navNumber: v-bind(navItemNum);
.kungalgamer-info { .kungalgamer-info {
margin-right: 30px; margin-right: 30px;
} }
.avatar {
img {
margin-left: 0;
}
}
} }
</style> </style>