Commit 4baa847c authored by shuang's avatar shuang

CSS restructuring

parent 09c25149
...@@ -2,13 +2,28 @@ ...@@ -2,13 +2,28 @@
<div id="app"> <div id="app">
<div id="nav"> <div id="nav">
<router-link to="/">Home</router-link> | <router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link> <router-link to="/about">About</router-link> |
<router-link to="/address">Address</router-link>
</div> </div>
<router-view/> <router-view/>
</div> </div>
</template> </template>
<script>
// import bulma from 'bulma';
export default {
}
</script>
<style lang="scss"> <style lang="scss">
@import '../../node_modules/bulma/css/bulma.css';
* {
box-sizing: border-box;
font-family: "DIN 2014", sans-serif;
}
#app { #app {
font-family: 'Avenir', Helvetica, Arial, sans-serif; font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
......
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
import Home from '../views/Home.vue' import Home from '../views/Home.vue'
import Address from '../views/Address.vue'
Vue.use(VueRouter) Vue.use(VueRouter)
...@@ -17,6 +18,11 @@ const routes = [ ...@@ -17,6 +18,11 @@ const routes = [
// this generates a separate chunk (about.[hash].js) for this route // this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited. // which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue') component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
},
{
path: 'address',
name: 'address',
component: Address
} }
] ]
......
<template> <template>
<div class="about"> <div class="field search-bar-container">
<h1>This is an about page</h1> <h1 class="title is-1">Search Results</h1>
<input type="text" placeholder="Bing me" v-model="searchTerm" @keyup.enter="search"> <div class="control is-medium has-icons-right">
<div v-if="!this.results.empty" class="results"> <input
class="input is-medium"
placeholder="Bing me"
type="text"
v-model="searchTerm"
@keyup.enter="search"
>
<span class="icon is-small is-right">
<i class="fas fa-search"></i>
</span>
</div>
<div class="search-results-container" v-if="Object.keys(this.results).length != 0">
<div v-if="this.searchTerm"> <div v-if="this.searchTerm">
{{this.searchTerm}} <br/> {{this.searchTerm}} <br/>
{{`/${this.searchTerm}/`}} {{`/${this.searchTerm}/`}}
</div> </div>
<div v-for="result in this.results" :key="result.id" class="result"> <ul class="rows">
<h2> <li class="search-result row content" v-for="result in this.results" :key="result.index">
{{result.name.slice(0, result.name.indexOf(' - '))}} <a v-bind:href="result.url">
</h2> <h2 class="is-medium">
<a href="result.url">{{result.url.slice(35)}}</a> {{result.name.slice(0, result.name.indexOf(' - '))}}
<div v-html="result.snippet"> </h2>
</a>
</div> <p class="url-path is-small">{{result.url.slice(35)}}</p>
</div> <p class="is-small">{{ result.snippet }}</p>
</li>
</ul>
</div> </div>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import axios from 'axios'; import axios from 'axios';
export default { export default {
...@@ -46,49 +60,41 @@ export default { ...@@ -46,49 +60,41 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.input {
border-radius: 4px;
padding: 12px;
line-height: 28px;
border: 2px transparent solid;
background: #edf0f2;
min-width: 200px;
width: 100%;
box-shadow: none;
@import url('https://fonts.googleapis.com/css?family=Roboto+Condensed&display=swap'); &:hover {
border: 2px transparent solid;
.about {
display: flex;
flex-direction: column;
justify-content: center;
font-family: 'Roboto Condensed', sans-serif;
text-align: left;
h1 {
width: 100%;
margin: 0 auto;
} }
input {
border: 3px solid red; &:focus {
margin: 0 auto; outline: none;
border: 2px solid black;
box-shadow: none;
background: white;
} }
} }
.results { .search-bar-container {
margin: 0 auto; width: 80%;
display: flex; margin: auto;
flex-direction: column;
width: 60%;
} }
.result {
display: flex;
flex-direction: column;
justify-content: left;
h2 {
text-align: left;
}
a { .search-results-container {
text-align: left; text-align: left;
text-decoration: none;
color: inherit;
width: fit-content;
}
div {
text-align: left;
}
} }
</style>
\ No newline at end of file // i {
// border: 3px solid red;
// height: 20px;
// width: 20px;
// }
</style>
<template>
<div class="home">
<img alt="Vue logo" src="../assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
</div>
</template>
<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
export default {
name: 'home',
components: {
HelloWorld
}
}
</script>
...@@ -16,3 +16,4 @@ export default { ...@@ -16,3 +16,4 @@ export default {
} }
} }
</script> </script>
...@@ -163,6 +163,11 @@ ...@@ -163,6 +163,11 @@
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8="
}, },
"bulma": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/bulma/-/bulma-0.8.0.tgz",
"integrity": "sha512-nhf3rGyiZh/VM7FrSJ/5KeLlfaFkXz0nYcXriynfPH4vVpnxnqyEwaNGdNCVzHyyCA3cHgkQAMpdF/SFbFGZfA=="
},
"bytes": { "bytes": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
"@types/express": "^4.17.2", "@types/express": "^4.17.2",
"@types/node": "^13.7.0", "@types/node": "^13.7.0",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"bulma": "^0.8.0",
"concurrently": "^5.1.0", "concurrently": "^5.1.0",
"cors": "^2.8.5", "cors": "^2.8.5",
"express": "^4.17.1", "express": "^4.17.1",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment