-
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
1 parent
cc0e364
commit 1167179
Showing
11 changed files
with
209 additions
and
7 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,3 +1,28 @@ | ||
<template> | ||
<div>Mobile Menu</div> | ||
<div class="sm:hidden"> | ||
<div class="px-2 pt-2 pb-3 space-y-1"> | ||
<nav-link | ||
to="/news/" | ||
class="block px-3 py-2 rounded-md text-base font-medium" | ||
> | ||
News | ||
</nav-link> | ||
<nav-link | ||
to="/" | ||
class="block px-3 py-2 rounded-md text-base font-medium" | ||
> | ||
DashBoard | ||
</nav-link> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import NavLink from './links/NavLink' | ||
export default { | ||
components: { | ||
NavLink | ||
} | ||
} | ||
</script> |
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,28 @@ | ||
<template> | ||
<div class="hidden sm:block sm:ml-6"> | ||
<div class="flex space-x-4"> | ||
<nav-link | ||
to="/news/" | ||
class="px-3 py-2 rounded-md text-sm font-medium" | ||
> | ||
News | ||
</nav-link> | ||
<nav-link | ||
to="/" | ||
class="px-3 py-2 rounded-md text-sm font-medium" | ||
> | ||
DashBoard | ||
</nav-link> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import NavLink from './links/NavLink' | ||
export default { | ||
components: { | ||
NavLink | ||
} | ||
} | ||
</script> |
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 |
---|---|---|
@@ -1,5 +1,54 @@ | ||
<template> | ||
<div> | ||
Toggle Theme | ||
</div> | ||
</template> | ||
<button | ||
class="focus:outline-none" | ||
:title="'Toggle ' + nextTheme" | ||
@click="toggleTheme" | ||
> | ||
<Sun | ||
v-if="current === 'light'" | ||
class="h-6 w-6 text-gray-500 hover:text-gray-700" | ||
/> | ||
<Moon | ||
v-else | ||
class="h-6 w-6 text-gray-400 hover:text-gray-300" | ||
/> | ||
</button> | ||
</template> | ||
|
||
<script> | ||
import Sun from '~/assets/icons/sun.svg' | ||
import Moon from '~/assets/icons/moon.svg' | ||
export default { | ||
components: { | ||
Sun, | ||
Moon | ||
}, | ||
data () { | ||
return { | ||
themes: ['light', 'dark'], | ||
current: 'light' | ||
} | ||
}, | ||
computed: { | ||
nextTheme () { | ||
const currentIndex = this.themes.indexOf(this.current) | ||
const nextIndex = (currentIndex + 1) % this.themes.length | ||
return this.themes[nextIndex] | ||
} | ||
}, | ||
mounted () { | ||
if (window.__theme) { | ||
this.current = window.__theme | ||
} | ||
}, | ||
methods: { | ||
toggleTheme () { | ||
const currentIndex = this.themes.indexOf(this.current) | ||
const nextIndex = (currentIndex + 1) % this.themes.length | ||
window.__setPreferredTheme(this.themes[nextIndex]) | ||
this.current = this.themes[nextIndex] | ||
} | ||
} | ||
} | ||
</script> |
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,32 @@ | ||
<template> | ||
<g-link | ||
:to="to" | ||
:class="isActive ? activeClass : inactiveClass" | ||
> | ||
<slot /> | ||
</g-link> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
activeClass: { | ||
type: String, | ||
default: '' | ||
}, | ||
inactiveClass: { | ||
type: String, | ||
default: '' | ||
}, | ||
to: { | ||
type: String, | ||
default: '/' | ||
} | ||
}, | ||
computed: { | ||
isActive: function () { | ||
return this.$route.path === this.to | ||
} | ||
} | ||
} | ||
</script> |
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,25 @@ | ||
<template> | ||
<app-link | ||
:to="to" | ||
active-class="bg-gray-200 dark:bg-gray-900 text-gray-700 dark:text-white" | ||
inactive-class="text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700 hover:text-gray-800 dark:hover:text-white" | ||
> | ||
<slot /> | ||
</app-link> | ||
</template> | ||
|
||
<script> | ||
import AppLink from './AppLink' | ||
export default { | ||
components: { | ||
AppLink | ||
}, | ||
props: { | ||
to: { | ||
type: String, | ||
default: '/' | ||
} | ||
} | ||
} | ||
</script> |
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,30 @@ | ||
<!DOCTYPE html> | ||
<html ${htmlAttrs}> | ||
<head> | ||
${head} | ||
</head> | ||
<body ${bodyAttrs}> | ||
<script> | ||
(function() { | ||
function setTheme(newTheme) { | ||
window.__theme = newTheme; | ||
document.documentElement.setAttribute('class', newTheme); | ||
} | ||
let preferredTheme; | ||
try { | ||
preferredTheme = localStorage.getItem('theme'); | ||
} catch (err) { } | ||
|
||
window.__setPreferredTheme = function(newTheme) { | ||
setTheme(newTheme); | ||
try { | ||
localStorage.setItem('theme', newTheme); | ||
} catch (err) {} | ||
} | ||
setTheme(preferredTheme ? preferredTheme : ''); | ||
})(); | ||
</script> | ||
${app} | ||
${scripts} | ||
</body> | ||
</html> |
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