KawAnime/assets/App.vue

244 lines
6.4 KiB
Vue
Raw Normal View History

<template lang="pug">
v-app(dark)
v-navigation-drawer.pb-0.main-drawer(app, temporary, 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
v-system-bar.wb.dragable(app, dark, status)
v-spacer
div.window-icon.non-dragable(v-if="!isBrowser && $store.state.platform !== 'darwin'")
v-icon.not-close(@click="actOnWindow('minimize')") remove
v-icon.not-close(@click="actOnWindow('maximize')") check_box_outline_blank
v-icon.close(@click="actOnWindow('close')") close
2017-08-14 20:49:23 +00:00
v-toolbar.mablue.tb(app, fixed, dark)
v-toolbar-side-icon(@click.stop='toggleDrawer()')
v-toolbar-title.white--text.title.hidden-xs-only かわニメ
v-spacer
2017-09-20 14:44:58 +00:00
v-tooltip(left)
v-btn(icon, v-show="$store.state.update.isAvailable", @click='restartAndUpdate()', slot='activator')
v-icon.green--text file_download
span Update KawAnime
info-modal
2017-09-20 14:44:58 +00:00
v-tooltip(left)
v-btn(icon, @click='openInBrowser()', slot='activator')
v-icon open_in_new
span Open KawAnime in your browser
settings
logs
2017-08-14 20:49:23 +00:00
main.m
//- v-content // Apparently required. Todo
transition(name='page', mode='out-in')
router-view
2017-08-14 20:49:23 +00:00
2017-11-01 16:17:27 +00:00
k-footer
env(v-show='$store.state.NODE_ENV === "development"')
magnets-modal
info-results(v-show='$store.state.search.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-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 () {
2017-09-19 12:19:55 +00:00
this.$store.dispatch('update/updateApp')
2017-07-11 07:44:55 +00:00
}
2017-04-15 14:16:14 +00:00
}
}
</script>
2017-10-16 00:44:14 +00:00
<style lang="stylus" scoped>
2017-07-11 09:05:58 +00:00
.m
2017-11-01 16:17:27 +00:00
display block
2017-11-01 02:14:08 +00:00
overflow-y scroll
2017-11-01 02:17:20 +00:00
overflow-x hidden
2017-11-01 02:14:08 +00:00
max-height calc(100vh - (48px + 24px))
2017-10-16 00:44:14 +00:00
min-width 100%
2017-11-01 02:14:08 +00:00
margin-top calc(48px + 24px)
2017-07-11 14:49:19 +00:00
.wb
padding-right 0
2017-10-16 00:44:14 +00:00
position fixed
width 100%
background-color #303030 !important
2017-07-11 14:49:19 +00:00
.tb
2017-10-16 00:44:14 +00:00
margin-top 24px !important
max-height 48px
padding-left 1%
2017-07-11 14:49:19 +00:00
.main-drawer
2017-10-16 00:44:14 +00:00
width 280px !important
background-image url('/static/images/sidebar-background.png')
background-position left bottom
background-size 75%
2017-07-11 09:05:58 +00:00
.main-drawer ul
2017-10-16 00:44:14 +00:00
background-image none
.ripple
2017-10-16 00:44:14 +00:00
position relative
.window-icon
2017-10-16 00:44:14 +00:00
cursor pointer
height 100%
.close, .not-close
text-align center
margin 0
height 100%
width 25px
.not-close
padding-top 4px
font-size 17px
&:hover
background-color rgba(255, 255, 255, 0.25)
.close
padding-top 2px
font-size 18px
&:hover
background-color rgba(240, 71, 71, 0.7)
.title
2017-10-16 00:44:14 +00:00
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">
2017-10-16 00:44:14 +00:00
@import '../node_modules/animate.css/animate.min.css'
@import './iconfont/material-icons.css'
@import './stylus/main'
</style>