Skip to content

Commit

Permalink
add web files
Browse files Browse the repository at this point in the history
  • Loading branch information
黄冠 committed Jun 23, 2019
1 parent 22f8a44 commit 1d4a2c2
Show file tree
Hide file tree
Showing 27 changed files with 10,864 additions and 9 deletions.
93 changes: 84 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,88 @@
# Byte-compiled / optimized / DLL files
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
*.swp
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# Nuxt generate
dist

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# C extensions
*.so
# IDE / Editor
.idea
.editorconfig

# Distribution / packaging
build/
dist/
# Sphinx documentation
docs/_build/
# Service worker
sw.*

# Mac OSX
.DS_Store
22 changes: 22 additions & 0 deletions web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# web

> My divine Nuxt.js project
## Build Setup

``` bash
# install dependencies
$ npm install

# serve with hot reload at localhost:3000
$ npm run dev

# build for production and launch server
$ npm run build
$ npm start

# generate static project
$ npm run generate
```

For detailed explanation on how things work, checkout [Nuxt.js docs](https://nuxtjs.org).
7 changes: 7 additions & 0 deletions web/assets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ASSETS

**This directory is not required, you can delete it if you don't want to use it.**

This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked).
7 changes: 7 additions & 0 deletions web/components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# COMPONENTS

**This directory is not required, you can delete it if you don't want to use it.**

The components directory contains your Vue.js Components.

_Nuxt.js doesn't supercharge these components._
41 changes: 41 additions & 0 deletions web/components/footer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template>
<el-footer>
<div>
<h5>About ShouSiBaoCai</h5>
<p>
ShouSiBaoCai is a Search Engine based on DHT protocol. All resources are automatically indexed from the DHT network. Instead of torrent files, we store meta information only for indexing.
</p>
<h5>About Magnet Links</h5>
<p>
Magnet URI Scheme is a de facto standard defining a uniform resource identifier (URI) scheme for Magnet links, which mainly refer to resources available for download via peer-to-peer networks. --Wikipedia
</p>
</div>
<div>
<p class="copyright">
&copy; 2013 ~ 2019 www.shousibaocai.net
</p>
</div>
</el-footer>
</template>

<style scoped>
.el-footer p{
font-size: .8em;
}
.el-footer {
height: 150px !important;
margin: 20px auto;
color: #555;
}
.el-footer p {
padding: 5px 0;
}
.copyright {
text-align: center;
color: #888;
}
</style>
37 changes: 37 additions & 0 deletions web/components/loading.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<template>
<div v-if="loading" class="loading-page">
<p>Loading...</p>
</div>
</template>

<script>
export default {
data: () => ({
loading: false
}),
methods: {
start() {
this.loading = true
},
finish() {
this.loading = false
}
}
}
</script>

<style scoped>
.loading-page {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.8);
text-align: center;
padding-top: 150px;
font-size: 30px;
font-family: sans-serif;
}
</style>
19 changes: 19 additions & 0 deletions web/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

html {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 16px;
word-spacing: 1px;
box-sizing: border-box;
}

*,
*:before,
*:after {
box-sizing: border-box;
margin: 0;
}


.highlight {
color: red;
}
7 changes: 7 additions & 0 deletions web/layouts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# LAYOUTS

**This directory is not required, you can delete it if you don't want to use it.**

This directory contains your Application Layouts.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts).
5 changes: 5 additions & 0 deletions web/layouts/default.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<div>
<nuxt />
</div>
</template>
78 changes: 78 additions & 0 deletions web/layouts/search.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<template>
<el-container>
<el-header>
<div class="title">
<a href="/">手撕包菜</a>
</div>
<div class="search-box" v-on:keyup.enter="submit">
<el-input size="small" placeholder="Movie names" v-model="keyword" class="mini-input-keyword">
<el-button size="small" slot="append" v-on:click="submit" icon="el-icon-search"></el-button>
</el-input>
</div>
</el-header>
<el-main>
<nuxt />
</el-main>
<Footer />
</el-container>
</template>

<script>
import Footer from '~/components/footer.vue'
export default {
components: {
Footer
},
data() {
return {
keyword: ''
}
},
mounted() {
this.keyword = this.$route.query.q
},
methods: {
submit() {
window.location = '/search?q=' + encodeURIComponent(this.keyword)
}
}
};
</script>

<style scoped>
.el-container {
min-height: 100vh;
width: 800px;
margin: 0 auto;
}
.title {
line-height: 60px;
float: left;
padding: 0 30px 0 0;
}
.title a {
color: #555;
text-decoration: none;
font-size: 1.2em;
}
.search-box {
line-height: 60px;
float: left;
}
.mini-input-keyword {
width: 250px;
}
.el-header {
height: 160px;
}
</style>
8 changes: 8 additions & 0 deletions web/middleware/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# MIDDLEWARE

**This directory is not required, you can delete it if you don't want to use it.**

This directory contains your application middleware.
Middleware let you define custom functions that can be run before rendering either a page or a group of pages.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware).
Loading

0 comments on commit 1d4a2c2

Please sign in to comment.