Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Beadd committed Aug 26, 2023
1 parent ed6ff77 commit 658e19e
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 84 deletions.
56 changes: 28 additions & 28 deletions src/router/index.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
{
path: '/',
name: 'home',
component: () => import('../views/Home.vue')
},
{
path: '/search/:q',
name:'search',
component: () => import('../views/Search.vue'),
props: true
},
{
path: '/play/:songid/:title/:artist/:album/:cover/:publishTime',
name: 'play',
component: () => import('../views/Play.vue'),
props: true
}
]

const router = createRouter({
history: createWebHashHistory(process.env.BASE_URL),
routes,
})

export default router
import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
{
path: '/',
name: 'home',
component: () => import('../views/Home.vue')
},
{
path: '/search/:q',
name:'search',
component: () => import('../views/Search.vue'),
props: true
},
{
path: '/play/:songid/:title/:artist/:album/:cover/:publishTime',
name: 'play',
component: () => import('../views/Play.vue'),
props: true
}
]

const router = createRouter({
history: createWebHashHistory(process.env.BASE_URL),
routes,
})

export default router
4 changes: 2 additions & 2 deletions src/themes/home/1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const inputRef = ref(null)
const emit = defineEmits(['switch', 'search'])
function changeTheme() {
emit('switch', 2)
emit('switch', 1)
}
function searchEnter() {
emit('search', search.value)
Expand All @@ -19,7 +19,7 @@ function onClick() {
<template>
<div class="home" @contextmenu.prevent="changeTheme" @click="onClick">
<div class="home-search">
<input class="home-input" v-model="search" @keyup.enter="searchEnter" autofocus ref="inputRef">
<input class="home-input" placeholder="歌曲名或歌单歌曲链接" v-model="search" @keyup.enter="searchEnter" autofocus ref="inputRef">
</div>
</div>
</template>
Expand Down
54 changes: 2 additions & 52 deletions src/themes/home/2.vue
Original file line number Diff line number Diff line change
@@ -1,52 +1,2 @@
<script setup>
import { ref } from 'vue'
const search = ref('')
const inputRef = ref(null)
const emit = defineEmits(['switch', 'search'])
function changeTheme() {
emit('switch', 2)
}
function searchEnter() {
emit('search', search.value)
}
function onClick() {
inputRef.value.focus()
}
</script>
<template>
<div class="home" @contextmenu.prevent="changeTheme" @click="onClick">
<div class="home-search">
<input class="home-input" v-model="search" @keyup.enter="searchEnter" autofocus ref="inputRef">
</div>
</div>
</template>
<style scoped>
.home {
position: absolute;
height: 100%;
width: 100%;
}
.home-input {
border: 1px solid;
position: absolute;
top: 50%;
left: 50%;
width: 99%;
transform: translate(-50%, -50%);
font-size: 7.7vw;
text-align: center;
border-color: transparent;
}
.home-input:focus {
outline: none;
border: none;
}
body.dark .home-input {
color: #c4c4c4;
background-color: black;
}
</style>
<!-- theme file. you can copy 1.vue as template, and customize it -->
<template></template>
2 changes: 1 addition & 1 deletion src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Theme2 from '../themes/home/2.vue';
const router = useRouter()
const homeTheme = ref(1)
const darkTheme = ref(false)
const darkTheme = ref(true)
const database = 'CreamPlayer'
const store = 'Setting'
Expand Down
2 changes: 1 addition & 1 deletion src/views/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const props = defineProps({
const counterStore = useCounterStore()
counterStore.setLastSearch(props.q)
const searchTheme = ref(12)
const searchTheme = ref(15)
const darkTheme = ref(false)
const database = 'CreamPlayer'
Expand Down

0 comments on commit 658e19e

Please sign in to comment.