KawAnime/assets/App.vue

229 lines
6.0 KiB
Vue
Raw Normal View History

<template lang="pug">
v-app(dark, footer, toolbar)
2017-08-28 08:09:59 +00:00
v-navigation-drawer.pb-0(style='width: 280px', temporary, persistent, v-model='$store.state.drawer')
v-list
v-list-tile#title(to='/')
v-list-tile-action
img(src='static/images/icon2.png', height='50')
v-list-tile-title.title.white--text かわニメ
template(v-for='item in itemGroup')
2017-08-28 08:09:59 +00:00
v-list-group(v-if='item.items', :key='item.title', :group="item.group")
v-list-tile.ripple(slot='item', ripple)
v-list-tile-action
v-icon {{ item.action }}
v-list-tile-title {{ item.title }}
v-list-tile-action
v-icon keyboard_arrow_down
2017-08-28 08:09:59 +00:00
v-list-tile.ripple(v-for='subItem in item.items', ripple, :to='subItem.href', :key='subItem.title', exact)
v-list-tile-action
v-icon {{ subItem.action }}
v-list-tile-content
v-list-tile-title {{ subItem.title }}
v-divider
v-subheader.white--text(v-else-if='item.header') {{ item.header }}
v-divider(v-else-if='item.divider')
2017-08-14 20:49:23 +00:00
2017-09-07 08:39:28 +00:00
v-system-bar.wb.dragable(dark, status)
v-spacer
2017-09-07 08:39:28 +00:00
div(v-if="!isBrowser && $store.state.platform !== 'darwin'")
v-icon.window-icon.non-dragable(@click="actOnWindow('minimize')") remove
v-icon.window-icon.non-dragable(@click="actOnWindow('maximize')") check_box_outline_blank
v-icon.window-icon.non-dragable(@click="actOnWindow('close')") close
2017-08-14 20:49:23 +00:00
v-toolbar.mablue.tb(fixed, dark)
v-toolbar-side-icon(@click.stop='toggleDrawer()')
v-toolbar-title.white--text.title.hidden-xs-only かわニメ
v-spacer
2017-09-01 17:35:16 +00:00
v-btn(icon, v-show="$store.state.isUpdateAvailable", v-tooltip:left="{ html: 'Update KawAnime' }", @click='restartAndUpdate()')
2017-08-22 12:59:08 +00:00
v-icon.green--text file_download
info-modal
2017-08-22 12:59:08 +00:00
v-btn(icon, v-tooltip:left="{ html: 'Open KawAnime in your browser' }", @click='openInBrowser()')
v-icon open_in_new
settings
2017-08-14 20:49:23 +00:00
main.m
transition(name='page', mode='out-in')
router-view
2017-08-14 20:49:23 +00:00
env(v-show='$store.state.NODE_ENV === "development"')
2017-08-14 20:49:23 +00:00
info-results(v-show='$store.state.info.show')
2017-08-14 20:49:23 +00:00
2017-08-19 18:02:02 +00:00
//- Used for displaying any info
v-snackbar(
:timeout='5000',
:top='true',
:bottom='false',
:right='false',
:left='false',
v-model='$store.state.infoSnackbar.show'
) {{ $store.state.infoSnackbar.text }}
v-btn.pink--text(flat, @click='$store.state.infoSnackbar.show = false') Close
2017-08-14 20:49:23 +00:00
2017-09-01 17:35:16 +00:00
v-footer.grey.darken-4.pr-2
v-spacer
.white--text © 2016 - 2017 Kylart
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-08-19 18:02:02 +00:00
mounted () {
2017-08-20 12:43:56 +00:00
this.isBrowser = !window.process
2017-08-19 18:02:02 +00:00
},
2017-04-15 14:16:14 +00:00
data () {
return {
searchModal: false,
drawer: false,
2017-08-19 18:02:02 +00:00
isBrowser: 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-08-28 08:09:59 +00:00
group: 'core',
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-08-28 08:09:59 +00:00
group: 'news',
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-08-28 08:09:59 +00:00
group: 'local',
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.$store.dispatch('openInBrowser')
2017-08-22 12:59:08 +00:00
},
restartAndUpdate () {
this.$store.dispatch('updateApp')
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%;
2017-08-03 09:54:49 +00:00
padding-top: calc(48px + 24px);
2017-07-11 14:49:19 +00:00
}
.wb
{
position: fixed;
width: 100%;
z-index: 100;
2017-07-11 14:49:19 +00:00
background-color: #303030 !important;
}
.tb
{
margin-top: 24px !important;
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>
2017-07-27 15:00:15 +00:00
<style>
@import '../node_modules/animate.css/animate.min.css';
2017-08-22 12:59:08 +00:00
@import './iconfont/material-icons.css';
2017-07-27 15:00:15 +00:00
</style>