Skip to content

Commit

Permalink
chore: bump version (bump version: 2.0.0-alpha.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
dragon-fish committed Jun 9, 2021
1 parent 5319b1f commit 5dff17a
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 20 deletions.
7 changes: 2 additions & 5 deletions api/utils.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import axios from 'axios'

function replaceUrl(obj) {
function replaceUrl(obj: any) {
for (let key in obj) {
if (
typeof obj[key] === 'string' &&
obj[key].startsWith('https://i.pximg.net/')
) {
obj[key] = obj[key].replace(
'https://i.pximg.net/',
'/image/'
)
obj[key] = obj[key].replace('https://i.pximg.net/', '/image/')
} else if (typeof obj[key] === 'object') {
obj[key] = replaceUrl(obj[key])
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pixiv-now",
"version": "2.0.0-alpha.0",
"version": "2.0.0-alpha.1",
"private": true,
"main": "index.js",
"repository": "https://github.com/Wjghj-Project/pixiv-now.git",
Expand Down
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export default defineComponent({
</script>

<style scoped>
main {
/* min-height: 70vh; */
main article {
/* min-height: 100vh; */
padding: 1rem;
}
</style>
2 changes: 1 addition & 1 deletion src/components/AuthorCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export default defineComponent({
.authorCard {
box-shadow: 0 0 4px #888;
border-radius: 4px;
padding: 1rem;
display: flex;
align-items: center;
padding: 1rem;
}
.left {
margin-right: 1rem;
Expand Down
14 changes: 11 additions & 3 deletions src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import {
} from 'vue-router'

import index from './view/index.vue'
import indexArtwork from './view/indexArtwork.vue'
import viewArtwork from './view/viewArtwork.vue'
import indexArtwork from './view/artwork/index.vue'
import viewArtwork from './view/artwork/view.vue'
import users from './view/users.vue'
import error404 from './view/404.vue'

const router = createRouter({
history: createWebHashHistory(),
history: createWebHistory(),
routes: [],
})

Expand All @@ -20,11 +21,13 @@ router.addRoute({
})
router.addRoute({
path: '/artworks',
alias: ['/illust'],
name: '',
component: indexArtwork,
})
router.addRoute({
path: '/artworks/:id',
alias: ['/illust/:id'],
name: 'Artworks',
component: viewArtwork,
})
Expand All @@ -33,5 +36,10 @@ router.addRoute({
name: 'Users',
component: users,
})
router.addRoute({
path: '/:pathMatch(.*)*',
name: 'NotFound',
component: error404,
})

export { router }
21 changes: 21 additions & 0 deletions src/static/common.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:root {
font-size: 16px;
}

html,
body {
margin: 0;
Expand All @@ -11,3 +15,20 @@ body {
/* text-align: center; */
color: #2c3e50;
}

h1 {
font-size: 2rem;
text-shadow: 2px 2px 0px #fff;
box-shadow: 0 -0.5em 0 rgb(93, 233, 243) inset;
}
h2 {
display: inline-block;
position: relative;
left: 50%;
transform: translateX(-50%);
/* margin: 0.4rem auto; */
padding: 0 0.4rem;
font-size: 1.4rem;
text-shadow: 2px 2px 0px #fff;
box-shadow: 0 -0.5em 0 rgb(93, 188, 243) inset;
}
67 changes: 67 additions & 0 deletions src/view/404.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<template>
<section class="error-404">
<div class="title">404</div>
<div class="description">啊咧?啊咧咧——?!页面跑丢了!!!</div>
<div class="random" @click="random404">{{ msg }}</div>
</section>
</template>

<script lang="ts">
function pick(list: any[]) {
return list[Math.floor(Math.random() * list.length)]
}
const errMsg = [
'就像装在游戏机盒子里的作业本一样没有人喜欢!',
// FF14骚话
'就像闪耀登场释放天辉的白魔法师一样没有人喜欢!',
'就像冰4火4一个慢动作的黑魔法师一样没有人喜欢!',
'就像耗尽了了以太超流的学者一样没有人喜欢!',
'就像忘记了每分钟背刺的忍者一样没有人喜欢!',
'就像进本后跳999接受LB需求退本一气呵成的龙骑一样没有人喜欢!',
'就像成天把拉拉菲尔族成为食材的人一样没有人喜欢!',
'就像死而不僵状态下的暗黑骑士一样没有人喜欢!',
'就像无论如何也触发不了诗心的诗人一样没有人喜欢!',
]
export default {
data() {
return {
msg: '',
}
},
methods: {
random404() {
this.msg = pick(errMsg)
},
},
mounted() {
this.random404()
},
}
</script>

<style scoped>
.error-404 {
margin: 10rem auto;
height: 100%;
text-align: center;
display: flex;
align-items: center;
flex-wrap: wrap;
}
.error-404 > div {
width: 100%;
}
.title {
font-size: 6rem;
font-weight: bold;
}
.description {
font-size: 1.5rem;
}
.random {
color: #aaa;
user-select: none;
margin-top: 1rem;
}
</style>
2 changes: 1 addition & 1 deletion src/view/indexArtwork.vue → src/view/artwork/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</template>

<script lang="ts">
import { router } from '../router'
import { router } from '../../router'
export default {
data() {
return {
Expand Down
18 changes: 14 additions & 4 deletions src/view/viewArtwork.vue → src/view/artwork/view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</div>
<div class="description" v-if="illust.description">
<h2>简介</h2>
<p v-html="illust.description"></p>
<p class="card" v-html="illust.description"></p>
</div>
</section>
<section class="error" v-if="error">
Expand All @@ -24,8 +24,8 @@

<script lang="ts">
import axios from 'axios'
import Gallery from '../components/Gallery.vue'
import AuthorCard from '../components/AuthorCard.vue'
import Gallery from '../../components/Gallery.vue'
import AuthorCard from '../../components/AuthorCard.vue'
export default {
data() {
Expand Down Expand Up @@ -75,4 +75,14 @@ export default {
}
</script>

<style scoped></style>
<style scoped>
h1,
h2 {
text-align: center;
}
.card {
box-shadow: 0 0 4px #888;
border-radius: 4px;
padding: 1rem;
}
</style>
16 changes: 13 additions & 3 deletions src/view/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<section style="text-align: center">
<h1>Home</h1>
<section class="home">
<div class="title">PixivNow</div>
<p>Pixiv Service Proxy.</p>
<p>
Expand All @@ -23,4 +23,14 @@ export default {
}
</script>

<style></style>
<style scoped>
.home {
margin: 10rem auto;
height: 100%;
text-align: center;
}
.title {
font-size: 6rem;
font-weight: bold;
}
</style>

0 comments on commit 5dff17a

Please sign in to comment.