KawAnime/assets/App.vue

254 lines
6.6 KiB
Vue
Raw Normal View History

<template>
2017-07-11 14:49:19 +00:00
<v-app dark footer toolbar>
<v-navigation-drawer class="pb-0"
style="width: 280px"
2017-07-11 14:49:19 +00:00
temporary
2017-07-11 07:44:55 +00:00
v-model="$store.state.drawer"
>
<v-list>
2017-07-11 09:35:51 +00:00
<v-list-tile id="title" to="/">
<v-list-tile-action>
<img src="static/images/icon2.png" height="50"/>
</v-list-tile-action>
<v-list-tile-title class="title">
かわニメ
</v-list-tile-title>
</v-list-tile>
<template v-for="item in itemGroup">
<v-list-group v-if="item.items"
:key="item.title">
<v-list-tile slot="item" class="ripple" ripple>
<v-list-tile-action>
<v-icon>{{ item.action }}</v-icon>
</v-list-tile-action>
<v-list-tile-title>
{{ item.title }}
</v-list-tile-title>
<v-list-tile-action>
<v-icon>
keyboard_arrow_down
</v-icon>
</v-list-tile-action>
</v-list-tile>
<v-list-tile v-for="subItem in item.items"
class="ripple"
ripple
2017-07-11 07:44:55 +00:00
:to="subItem.href"
:key="subItem.title">
<v-list-tile-action>
<v-icon>{{ subItem.action }}</v-icon>
</v-list-tile-action>
<v-list-tile-content>
<v-list-tile-title>{{ subItem.title }}</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
<v-divider></v-divider>
</v-list-group>
<v-subheader v-else-if="item.header" class="white--text">{{ item.header }}</v-subheader>
<v-divider v-else-if="item.divider"></v-divider>
</template>
</v-list>
</v-navigation-drawer>
2017-04-15 14:16:14 +00:00
2017-07-11 14:49:19 +00:00
<v-system-bar dark
status
class="wb dragable"
v-if="!browser">
<v-spacer></v-spacer>
<div v-if="$store.state.platform !== 'darwin'">
<v-icon class="window-icon" @click="actOnWindow('minimize')">remove</v-icon>
2017-07-19 07:50:10 +00:00
<v-icon class="window-icon" @click="actOnWindow('maximize')">check_box_outline_blank</v-icon>
<v-icon class="window-icon" @click="actOnWindow('close')">close</v-icon>
</div>
2017-07-11 14:49:19 +00:00
</v-system-bar>
<v-toolbar fixed dark class="mablue tb">
2017-07-19 07:50:10 +00:00
<v-toolbar-side-icon @click.stop="toggleDrawer()"></v-toolbar-side-icon>
<v-toolbar-title class="white--text title hidden-xs-only">かわニメ</v-toolbar-title>
<v-spacer></v-spacer>
<info-modal></info-modal>
<v-btn icon
class="open-in-browser"
v-tooltip:left="{ html: 'Open KawAnime in your browser' }"
2017-07-19 07:50:10 +00:00
@click="openInBrowser()">
<v-icon>open_in_new</v-icon>
</v-btn>
<settings></settings>
</v-toolbar>
2017-04-15 14:16:14 +00:00
2017-07-11 09:05:58 +00:00
<main class="m">
<transition name="page" mode="out-in">
<router-view></router-view>
</transition>
</main>
2017-07-11 07:44:55 +00:00
<env v-if="$store.state.NODE_ENV"></env>
2017-07-11 14:49:19 +00:00
<!-- Displayed if an error occurred -->
<v-snackbar
:timeout="5000"
:top="true"
:bottom="false"
:right="false"
:left="false"
v-model="$store.state.infoSnackbar.show"
2017-07-11 14:49:19 +00:00
>
{{ $store.state.infoSnackbar.text }}
2017-07-19 07:50:10 +00:00
<v-btn flat class="pink--text" @click="$store.state.infoSnackbar.show = false">Close</v-btn>
2017-07-11 14:49:19 +00:00
</v-snackbar>
2017-05-13 14:38:17 +00:00
<v-footer class="grey darken-4">
<v-spacer></v-spacer>
<div class="white--text">&copy; 2016 - 2017 Kylart</div>
2017-05-13 14:38:17 +00:00
</v-footer>
</v-app>
2017-04-15 14:16:14 +00:00
</template>
<script>
import axios from 'axios'
import Meta from 'mixins/meta'
2017-04-26 19:16:31 +00:00
2017-04-15 14:16:14 +00:00
export default {
mixins: [Meta],
2017-04-15 14:16:14 +00:00
data () {
return {
searchModal: false,
drawer: false,
browser: false,
links: [
{link: 'Github', to: 'https://github.com/Kylart/KawAnime', icon: 'github-circle'},
{link: 'Updates', to: '', icon: ''}
],
2017-04-15 14:16:14 +00:00
itemGroup: [
{divider: true},
2017-04-15 14:16:14 +00:00
{header: 'Core'},
{
title: 'Downloading',
2017-06-05 10:51:10 +00:00
action: 'file_download',
2017-04-15 14:16:14 +00:00
items: [
{
title: 'Downloader',
2017-06-05 10:51:10 +00:00
action: 'file_download',
2017-04-15 14:16:14 +00:00
href: '/downloader'
}, {
2017-04-15 14:16:14 +00:00
title: 'Latest releases',
2017-06-05 10:51:10 +00:00
action: 'access_time',
2017-04-15 14:16:14 +00:00
href: '/'
}
]
}, {
2017-04-15 14:16:14 +00:00
title: 'News',
2017-06-05 10:51:10 +00:00
action: 'info_outline',
2017-04-15 14:16:14 +00:00
items: [
{
title: 'Seasons',
2017-06-05 10:51:10 +00:00
action: 'hourglass_empty',
2017-04-15 14:16:14 +00:00
href: '/seasons'
},
{
title: 'News',
2017-06-05 10:51:10 +00:00
action: 'more',
2017-04-15 14:16:14 +00:00
href: '/news'
}
]
},
{divider: true},
2017-04-15 14:16:14 +00:00
{header: 'Local'},
{
title: 'Anime related',
2017-06-05 10:51:10 +00:00
action: 'folder_open',
2017-04-15 14:16:14 +00:00
items: [
{
title: 'Animes',
2017-06-05 10:51:10 +00:00
action: 'tv',
2017-04-15 14:16:14 +00:00
href: '/localPage'
}, {
2017-04-15 14:16:14 +00:00
title: 'Watch list',
2017-06-05 10:51:10 +00:00
action: 'sort_by_alpha',
2017-04-15 14:16:14 +00:00
href: '/watchList'
}
]
2017-05-13 14:38:17 +00:00
}
// Too soon...
// {
// title: 'Torrenting',
// items: [
// {title: 'Current downloads'},
// {title: 'Sourcing'},
// {title: 'Create torrents'}
// ]
// }
]
2017-04-15 14:16:14 +00:00
}
},
2017-07-11 07:44:55 +00:00
methods: {
toggleDrawer () {
this.$store.commit('toggleDrawer')
},
actOnWindow (action) {
axios.get('/_win', {
params: {
action
}
})
},
openInBrowser () {
this.browser = true
this.$store.dispatch('openInBrowser')
2017-07-11 07:44:55 +00:00
}
2017-04-15 14:16:14 +00:00
}
}
</script>
<style scoped>
2017-07-11 09:05:58 +00:00
.m
{
2017-07-11 14:49:19 +00:00
min-width: 100%;
}
.wb
{
position: fixed;
width: 100%;
z-index: 20;
background-color: #303030 !important;
}
.tb
{
margin-top: 24px;
2017-07-11 15:07:24 +00:00
max-height: 48px;
2017-07-19 07:50:10 +00:00
padding-left: 1%;
2017-07-11 14:49:19 +00:00
}
.navigation-drawer
{
padding-top: 24px;
background-image: url('/static/images/sidebar-background.png');
2017-07-11 14:49:19 +00:00
background-position: left bottom;
background-size: 75%;
2017-07-11 09:05:58 +00:00
}
.ripple
{
position: relative;
}
.window-icon
{
cursor: pointer;
}
.title
{
overflow: hidden;
padding-left: 20px;
font-family: 'Hiragino Mincho Pro', 'MS PMincho', serif;
font-size: 30px !important;
}
2017-04-15 14:16:14 +00:00
</style>
<style lang="stylus">
@import './stylus/main'
</style>