forked from nuxt/hackernews
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
262 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
<template> | ||
<div id="app"> | ||
<header class="header"> | ||
<nav class="inner" role="navigation"> | ||
<router-link to="/amp" exact> | ||
<amp-img | ||
class="logo" | ||
:src="AMPLogo" | ||
alt="logo" | ||
width="24px" | ||
height="18px" | ||
/> | ||
</router-link> | ||
<router-link v-for="(list, key) in feeds" :key="key" :to="`/amp/${key}`"> | ||
{{ list.title }} | ||
</router-link> | ||
<a class="github" href="https://github.com/nuxt/hackernews" target="_blank" rel="noopener banner"> | ||
Built with Nuxt.js | ||
</a> | ||
</nav> | ||
</header> | ||
<nuxt nuxt-child-key="none" role="main" /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { feeds } from '~/common/api' | ||
import AMPLogo from '~/assets/logo.svg' | ||
export default { | ||
head() { | ||
const host = process.server | ||
? this.$ssrContext.req.headers.host | ||
: window.location.host | ||
return { | ||
link: [ | ||
// We use $route.path since we don't use query parameters | ||
{ hid: 'canonical', rel: 'canonical', href: `https://${host}${this.$route.path}` } | ||
] | ||
} | ||
}, | ||
data() { | ||
return { | ||
AMPLogo | ||
} | ||
}, | ||
computed: { | ||
feeds: () => feeds | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="stylus"> | ||
body { | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; | ||
font-size: 15px; | ||
background-color: lighten(#eceef1, 30%); | ||
margin: 0; | ||
padding: 0; | ||
color: #2E495E; | ||
overflow-y: scroll; | ||
} | ||
a { | ||
color: #2E495E; | ||
text-decoration: none; | ||
} | ||
.header { | ||
background-color: #2E495E; | ||
z-index: 999; | ||
height: 55px; | ||
.inner { | ||
max-width: 800px; | ||
box-sizing: border-box; | ||
margin: 0px auto; | ||
padding: 15px 5px; | ||
} | ||
a { | ||
color: #fff; | ||
line-height: 24px; | ||
transition: color 0.15s ease; | ||
display: inline-block; | ||
vertical-align: middle; | ||
font-weight: 300; | ||
letter-spacing: 0.075em; | ||
margin-right: 1.8em; | ||
&:hover { | ||
color: #fff; | ||
} | ||
&.router-link-active, &.nuxt-link-active { | ||
color: #fff; | ||
font-weight: 600; | ||
} | ||
&:nth-child(6) { | ||
margin-right: 0; | ||
} | ||
} | ||
.github { | ||
color: #fff; | ||
font-size: 0.9em; | ||
margin: 0; | ||
float: right; | ||
} | ||
} | ||
.logo { | ||
width: 24px; | ||
margin-right: 10px; | ||
display: inline-block; | ||
vertical-align: middle; | ||
} | ||
.view { | ||
max-width: 800px; | ||
margin: 0 auto; | ||
position: relative; | ||
} | ||
.appear-active { | ||
transition: opacity 0.4s ease; | ||
} | ||
.page-enter-active, .page-leave-active { | ||
transition: all 0.2s ease; | ||
} | ||
.appear, .page-enter, .page-leave-active { | ||
opacity: 0; | ||
} | ||
@media (max-width: 860px) { | ||
.header .inner { | ||
padding: 15px 30px; | ||
} | ||
} | ||
@media (max-width: 600px) { | ||
.header { | ||
.inner { | ||
padding: 15px; | ||
} | ||
a { | ||
margin-right: 1em; | ||
} | ||
.github { | ||
display: none; | ||
} | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.