audiobookshelf.audiobookshe.../pages/index.vue

178 lines
6.8 KiB
Vue
Raw Normal View History

2021-09-15 16:02:37 -05:00
<template>
2021-09-27 16:43:18 -05:00
<div ref="wrapper" class="w-full h-full bg-gradient overflow-hidden">
<div class="absolute top-0 left-0 w-full h-screen pointer-events-none max-h-screen max-w-screen overflow-hidden">
2021-09-15 21:03:31 -05:00
<template v-for="(shelf, index) in shelves">
<div :key="index" class="bookshelfRow w-full flex relative h-32 md:h-48 px-3 md:px-12">
2021-09-15 21:03:31 -05:00
<template v-for="(book, n) in shelf">
<div :key="`book-${n}`" class="h-full pt-5 md:pt-4 px-3 md:px-4 transition-opacity duration-300" :class="showBooks ? '' : 'opacity-0'">
<div class="h-24 w-24 md:h-40 md:w-40 relative bg-primary">
<img :src="`/square_covers/${book}`" class="absolute top-0 left-0 h-full w-full object-contain box-shadow-book z-10" />
2021-09-15 21:03:31 -05:00
</div>
</div>
</template>
2021-09-18 10:33:59 -05:00
<div class="bookshelfDivider h-3 md:h-4 w-full absolute bottom-0 left-0 right-0 z-10" />
2021-09-15 21:03:31 -05:00
</div>
</template>
<div class="absolute top-0 left-0 w-full h-full overlay z-20" />
</div>
<div class="absolute top-0 left-0 w-full h-full z-30">
2021-09-26 11:45:07 -05:00
<div class="absolute bottom-0 left-0 w-10 h-10" @dblclick.prevent="animatePage" />
<div key="homePage" class="h-full flex flex-col items-center justify-center">
<img ref="logo" src="/Logo.png" class="h-28 md:h-40" />
<h1 ref="title" class="text-white text-4xl md:text-5xl pt-4 md:pt-8 font-book">audiobookshelf</h1>
2021-09-26 11:45:07 -05:00
<p ref="subtitle" class="text-white text-center text-sm md:text-lg pt-4">Self-hosted Audiobook Server</p>
2021-09-18 10:33:59 -05:00
</div>
2021-09-26 11:45:07 -05:00
2021-09-18 10:33:59 -05:00
<div class="absolute bottom-6 right-6 md:bottom-12 md:right-12 text-right">
2021-09-26 12:08:03 -05:00
<nuxt-link to="/install" class="text-gray-200 text-lg md:text-3xl font-book py-1 md:py-2 hover:underline block">Install Guides</nuxt-link>
2021-09-26 11:45:07 -05:00
<nuxt-link to="/docs" class="text-gray-200 text-lg md:text-3xl font-book py-1 md:py-2 hover:underline block">Documentation</nuxt-link>
2021-12-15 19:26:31 -06:00
<nuxt-link to="/support" class="text-gray-200 text-lg md:text-3xl font-book py-1 md:py-2 hover:underline block">How to Support</nuxt-link>
2021-09-18 10:33:59 -05:00
<div class="flex items-center pt-4 md:pt-8 text-gray-300">
<a :href="discordUrl" class="mx-2">
<img src="/discord.svg" class="h-7 md:h-9 hover:scale-110 transform duration-100" />
</a>
2021-09-26 11:45:07 -05:00
<a :href="dockerHubUrl" class="mx-2">
<img src="/docker.svg" class="h-8 md:h-11 hover:scale-110 transform duration-100" />
2021-09-18 10:33:59 -05:00
</a>
2021-09-26 11:45:07 -05:00
<a :href="githubUrl" class="mx-2">
<img src="/github.svg" class="h-7 md:h-10 hover:scale-110 transform duration-100" />
2021-09-18 10:33:59 -05:00
</a>
2021-09-26 11:45:07 -05:00
<a :href="playStoreUrl" class="mx-2">
2021-09-18 10:33:59 -05:00
<img src="/GetGooglePlayStore.png" class="h-7 md:h-10 ml-2" />
</a>
<a :href="appStoreUrl" class="hidden md:block">
<img src="/AppleAppStoreDark.svg" class="h-7 md:h-10 ml-2" />
</a>
2021-09-18 10:33:59 -05:00
<!-- <img src="/GetAppleAppStore.png" class="h-7 ml-1" /> -->
</div>
2021-09-15 21:03:31 -05:00
</div>
2021-09-15 16:02:37 -05:00
</div>
</div>
</template>
<script>
2021-09-15 21:03:31 -05:00
export default {
2021-09-26 11:45:07 -05:00
layout: 'blank',
2021-09-15 21:03:31 -05:00
data() {
return {
2021-09-26 11:45:07 -05:00
showBooks: false,
showInstall: false,
appStoreUrl: 'https://testflight.apple.com/join/wiic7QIW',
2021-09-18 10:33:59 -05:00
dockerHubUrl: 'https://hub.docker.com/repository/docker/advplyr/audiobookshelf',
playStoreUrl: 'https://play.google.com/store/apps/details?id=com.audiobookshelf.app',
githubUrl: 'https://github.com/advplyr/audiobookshelf',
discordUrl: 'https://discord.gg/pJsjuNCKRq',
2021-09-15 21:03:31 -05:00
shelves: [
['1984.jpg', 'anatomyofthestate.jpg', 'animalfarm.jpg', 'atlasshrugged.jpg', 'democracythegodthatfailed.jpg', 'theroadtoserfdom.jpg', 'faithofthefallen.jpg', 'endersgame.jpg', 'wealthofnations.jpg', 'hackers.jpg'],
['bravenewworld.jpg', 'fahrenheit451.jpg', 'rulesforradicals.jpg', 'humanaction.jpg', 'economicsinonelesson.jpg', 'thecommunistmanifesto.jpg', 'warandpeace.jpg', 'anthem.jpg'],
['theanarchisthandbook.jpg', 'thecreaturefromjekyllisland.jpg', 'theidiot.jpg', 'thefountainhead.jpg', 'themachineryoffreedom.jpg'],
['notreason.jpg', 'endthefed.jpg', 'amanforallmarkets.jpg'],
['theprince.jpg', 'hackers.jpg'],
2021-09-27 16:43:18 -05:00
['economicsinonelesson.jpg']
2021-09-15 21:03:31 -05:00
]
}
},
2021-09-26 11:45:07 -05:00
methods: {
async animatePage() {
if (this.$refs.logo) {
this.$refs.logo.classList.add('animate-roll')
}
if (this.$refs.title) {
this.$refs.title.classList.add('animate-drop')
}
if (this.$refs.subtitle) {
this.$refs.subtitle.classList.add('animate-drop-pause')
}
2021-09-26 11:45:07 -05:00
var opacity2 = 0
var opacity1 = 0
this.showInstall = true
while (opacity2 < 1 || opacity1 < 1) {
document.documentElement.style.setProperty('--overlay-gradient', `rgba(48, 48, 48, ${opacity1}) 0%, rgba(39, 39, 39, ${opacity2}) 36%, rgba(46, 46, 46, 1) 50%, rgba(48, 48, 48, 1) 71%, rgba(34, 34, 34, 1) 86%, rgba(25, 25, 25, 1) 100%`)
opacity2 = Math.min(1, opacity2 + 0.02)
if (opacity2 > 0.5) {
opacity1 = Math.min(1, opacity1 + 0.02)
}
await new Promise((resolve) => setTimeout(resolve, 5))
}
},
windowLoaded() {
this.showBooks = true
}
},
2021-09-15 21:03:31 -05:00
mounted() {
var width = window.innerWidth
var height = window.innerHeight
var angle = Math.atan(height / width)
var deg = angle * (180 / Math.PI) + 180
document.documentElement.style.setProperty('--angle', '-' + deg + 'deg')
2021-09-26 11:45:07 -05:00
if (document.readyState === 'complete') {
this.windowLoaded()
}
},
beforeMount() {
window.addEventListener('load', this.windowLoaded)
},
beforeDestroy() {
window.removeEventListener('load', this.windowLoaded)
2021-09-15 21:03:31 -05:00
}
}
2021-09-15 16:02:37 -05:00
</script>
2021-09-15 21:03:31 -05:00
<style>
2021-09-26 11:45:07 -05:00
:root {
--overlay-gradient: rgba(48, 48, 48, 0) 0%, rgba(39, 39, 39, 0) 36%, rgba(46, 46, 46, 1) 50%, rgba(48, 48, 48, 1) 71%, rgba(34, 34, 34, 1) 86%, rgba(25, 25, 25, 1) 100%;
}
2021-09-15 21:03:31 -05:00
.bookshelfRow {
background-image: url(/wood_panels.jpg);
}
.bookshelfDivider {
background: rgb(149, 119, 90);
background: linear-gradient(180deg, rgba(149, 119, 90, 1) 0%, rgba(103, 70, 37, 1) 17%, rgba(103, 70, 37, 1) 88%, rgba(71, 48, 25, 1) 100%);
box-shadow: 2px 14px 8px #111111aa;
}
.overlay {
background: rgb(48, 48, 48);
2021-09-26 11:45:07 -05:00
background: linear-gradient(var(--angle), var(--overlay-gradient));
2021-09-15 21:03:31 -05:00
}
.box-shadow-book {
box-shadow: 4px 1px 8px #11111166, -4px 1px 8px #11111166, 1px -4px 8px #11111166;
}
2021-09-26 11:45:07 -05:00
.animate-roll {
animation: roll 1s cubic-bezier(0.47, 0, 0.745, 0.715);
animation-fill-mode: forwards;
}
@keyframes roll {
from {
transform: translate(0px, 0px) rotate(0deg);
}
to {
transform: translate(60vw, 0px) rotate(1280deg);
}
}
.animate-drop {
animation: drop 1s ease-in;
animation-fill-mode: forwards;
}
.animate-drop-pause {
animation: drop 1s ease-in 0.05s;
animation-fill-mode: forwards;
}
@keyframes drop {
from {
transform: translate(0px, 0px);
}
to {
transform: translate(0px, 100vh);
}
}
2021-09-15 21:03:31 -05:00
</style>