2018-09-04 23:30:36 +00:00
|
|
|
<template>
|
2018-12-16 16:57:08 +00:00
|
|
|
<div>
|
2018-12-19 20:41:47 +00:00
|
|
|
<div class="sm:flex">
|
|
|
|
<div class="w-full sm:w-1/3 lg:w-1/4 flex items-center">
|
2018-12-31 12:51:28 +00:00
|
|
|
<div class="w-3/4 py-5">
|
2018-12-30 23:45:55 +00:00
|
|
|
<div class="font-semibold text-sm">{{ siteTitle }}</div>
|
2018-12-29 23:41:01 +00:00
|
|
|
</div>
|
2018-09-04 23:30:36 +00:00
|
|
|
|
2018-12-19 20:41:47 +00:00
|
|
|
<div class="w-1/4 text-right sm:hidden">
|
2018-12-19 20:45:19 +00:00
|
|
|
<button type="button" class="nav-toggle appearance-none" @click="hidden = !hidden" aria-label="Toggle main menu">
|
2018-12-19 20:47:01 +00:00
|
|
|
<svg class="fill-current text-grey-dark w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M16.4 9H3.6c-.552 0-.6.447-.6 1 0 .553.048 1 .6 1h12.8c.552 0 .6-.447.6-1 0-.553-.048-1-.6-1zm0 4H3.6c-.552 0-.6.447-.6 1 0 .553.048 1 .6 1h12.8c.552 0 .6-.447.6-1 0-.553-.048-1-.6-1zM3.6 7h12.8c.552 0 .6-.447.6-1 0-.553-.048-1-.6-1H3.6c-.552 0-.6.447-.6 1 0 .553.048 1 .6 1z"/></svg>
|
2018-12-19 20:41:47 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
2018-12-18 22:57:51 +00:00
|
|
|
</div>
|
2018-12-19 20:41:47 +00:00
|
|
|
|
2018-12-16 16:57:08 +00:00
|
|
|
<nav
|
|
|
|
class="w-full -mx-4 mt-px sm:mt-0 sm:mx-0 block sm:flex sm:flex-wrap sm:flex-1 sm:justify-end bg-white absolute sm:relative border-b sm:border-b-0"
|
2018-12-19 20:45:19 +00:00
|
|
|
:class="{hidden: hidden}"
|
2018-12-16 16:57:08 +00:00
|
|
|
role="navigation"
|
|
|
|
>
|
|
|
|
<a
|
2018-12-19 20:45:19 +00:00
|
|
|
v-for="item in items"
|
2019-02-13 06:45:23 +00:00
|
|
|
class="block text-black no-underline focus:outline-none p-4 border-l-3 sm:border-l-0 sm:border-b-3 border-transparent hover:border-grey-light focus:border-grey-light focus:bg-white sm:ml-4 sm:mr-0 sm:p-0 hover:no-underline text-sm -mb-px"
|
2018-12-19 20:58:47 +00:00
|
|
|
:class="{'border-blue hover:border-blue': isActive(item)}"
|
2018-12-19 20:45:19 +00:00
|
|
|
:href="item.href"
|
2018-12-16 16:57:08 +00:00
|
|
|
>
|
2018-12-19 20:45:19 +00:00
|
|
|
<span class="flex items-center h-full">{{ item.title }}</span>
|
2018-12-16 16:57:08 +00:00
|
|
|
</a>
|
|
|
|
</nav>
|
2018-09-04 23:30:36 +00:00
|
|
|
</div>
|
2018-12-16 16:57:08 +00:00
|
|
|
</div>
|
2018-09-04 23:30:36 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-12-19 20:30:35 +00:00
|
|
|
export default {
|
2018-12-19 20:37:10 +00:00
|
|
|
props: {
|
2018-12-29 23:41:01 +00:00
|
|
|
siteTitle: String,
|
|
|
|
pageUrl: String,
|
2018-12-19 20:37:10 +00:00
|
|
|
},
|
2018-09-04 23:30:36 +00:00
|
|
|
|
2018-12-19 20:30:35 +00:00
|
|
|
methods: {
|
|
|
|
isActive(item) {
|
|
|
|
return this.pageUrl.match(new RegExp(item.pattern))
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-12-18 22:57:51 +00:00
|
|
|
data() {
|
|
|
|
return {
|
2018-12-19 20:45:19 +00:00
|
|
|
hidden: true,
|
2018-09-04 23:30:36 +00:00
|
|
|
|
2018-12-19 20:45:19 +00:00
|
|
|
items: [
|
2018-12-19 20:30:35 +00:00
|
|
|
{
|
|
|
|
title: 'About',
|
|
|
|
href: '/',
|
|
|
|
pattern: '^/.$',
|
|
|
|
},
|
2019-03-08 13:40:41 +00:00
|
|
|
{
|
|
|
|
title: 'Experience',
|
|
|
|
href: '/experience',
|
|
|
|
pattern: '^/experience/?$',
|
|
|
|
},
|
2018-12-19 20:30:35 +00:00
|
|
|
{
|
2019-01-15 08:34:39 +00:00
|
|
|
title: 'Articles',
|
|
|
|
href: '/articles',
|
|
|
|
pattern: '^/articles/?',
|
2018-12-19 20:30:35 +00:00
|
|
|
},
|
2019-01-15 22:35:23 +00:00
|
|
|
{
|
|
|
|
title: 'Talks',
|
|
|
|
href: '/talks',
|
|
|
|
pattern: '^/talks/?',
|
|
|
|
},
|
2019-03-04 15:49:36 +00:00
|
|
|
// {
|
|
|
|
// title: 'Testimonials',
|
|
|
|
// href: '/testimonials',
|
|
|
|
// pattern: '^/testimonials/?$',
|
|
|
|
// },
|
2019-03-08 10:11:46 +00:00
|
|
|
{
|
|
|
|
title: 'Podcasts',
|
|
|
|
href: '/podcasts',
|
|
|
|
pattern: '^/podcasts/?',
|
|
|
|
},
|
2018-12-19 20:30:35 +00:00
|
|
|
{
|
|
|
|
title: 'Book',
|
|
|
|
href: '/test-driven-drupal',
|
|
|
|
pattern: '^/test-driven-drupal/?$',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Contact',
|
|
|
|
href: '/contact',
|
|
|
|
pattern: '^/contact/?',
|
2018-12-19 20:45:19 +00:00
|
|
|
},
|
|
|
|
],
|
2018-12-19 20:30:35 +00:00
|
|
|
}
|
2018-12-19 20:45:19 +00:00
|
|
|
},
|
2018-12-16 16:57:08 +00:00
|
|
|
}
|
2018-09-04 23:30:36 +00:00
|
|
|
</script>
|