2020-01-23 06:16:40 +13:00
|
|
|
<template>
|
2020-01-24 04:23:26 +13:00
|
|
|
<div class="about" @click="toggle">
|
2020-01-23 06:16:40 +13:00
|
|
|
<div class="window">
|
|
|
|
<div class="loading" v-if="loading">
|
|
|
|
<div class="logo">
|
2020-02-02 09:35:48 +13:00
|
|
|
<img src="@/assets/images/logo.svg" alt="n.eko" />
|
2020-01-23 06:16:40 +13:00
|
|
|
<span><b>N</b>.EKO</span>
|
|
|
|
</div>
|
|
|
|
<div class="loader">
|
|
|
|
<div class="bounce1"></div>
|
|
|
|
<div class="bounce2"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="markdown-body" v-if="!loading" v-html="about"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.about {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
background: rgba($color: $background-floating, $alpha: 0.8);
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
.window {
|
|
|
|
max-width: 70vw;
|
|
|
|
background: $background-secondary;
|
|
|
|
border-radius: 5px;
|
|
|
|
max-height: 70vh;
|
|
|
|
overflow-y: auto;
|
|
|
|
overflow-x: hidden;
|
|
|
|
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
width: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&::-webkit-scrollbar-track {
|
|
|
|
background-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
&::-webkit-scrollbar-thumb {
|
|
|
|
background-color: $background-tertiary;
|
|
|
|
border: 2px solid $background-primary;
|
|
|
|
border-radius: 4px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&::-webkit-scrollbar-thumb:hover {
|
|
|
|
background-color: $background-floating;
|
|
|
|
}
|
|
|
|
|
|
|
|
.loading {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
.logo {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
margin: 40px 80px 0 80px;
|
|
|
|
|
|
|
|
img {
|
|
|
|
height: 90px;
|
|
|
|
margin-right: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
span {
|
|
|
|
font-size: 30px;
|
|
|
|
line-height: 56px;
|
|
|
|
|
|
|
|
b {
|
|
|
|
font-weight: 900;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.loader {
|
|
|
|
width: 90px;
|
|
|
|
height: 90px;
|
|
|
|
position: relative;
|
|
|
|
margin: 0 auto 20px auto;
|
|
|
|
|
|
|
|
.bounce1,
|
|
|
|
.bounce2 {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
border-radius: 50%;
|
|
|
|
background-color: $style-primary;
|
|
|
|
opacity: 0.6;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
|
|
|
|
-webkit-animation: bounce 2s infinite ease-in-out;
|
|
|
|
animation: bounce 2s infinite ease-in-out;
|
|
|
|
}
|
|
|
|
|
|
|
|
.bounce2 {
|
|
|
|
-webkit-animation-delay: -1s;
|
|
|
|
animation-delay: -1s;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.markdown-body {
|
|
|
|
margin: 50px 200px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes bounce {
|
|
|
|
0%,
|
|
|
|
100% {
|
|
|
|
transform: scale(0);
|
|
|
|
-webkit-transform: scale(0);
|
|
|
|
}
|
|
|
|
50% {
|
|
|
|
transform: scale(1);
|
|
|
|
-webkit-transform: scale(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Ref, Watch, Vue } from 'vue-property-decorator'
|
|
|
|
import md, { HtmlOutputRule } from 'simple-markdown'
|
|
|
|
|
|
|
|
@Component({ name: 'neko-about' })
|
|
|
|
export default class extends Vue {
|
|
|
|
loading = false
|
|
|
|
|
|
|
|
get about() {
|
|
|
|
return this.$accessor.client.about_page
|
|
|
|
}
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
if (this.about === '') {
|
|
|
|
this.loading = true
|
|
|
|
this.$http
|
2020-02-10 13:59:08 +13:00
|
|
|
.get<string>('https://raw.githubusercontent.com/nurdism/neko/master/docs/README.md')
|
2020-04-05 15:17:06 +12:00
|
|
|
.then((res) => {
|
2020-01-23 06:16:40 +13:00
|
|
|
return this.$http.post('https://api.github.com/markdown', {
|
|
|
|
text: res.data,
|
|
|
|
mode: 'gfm',
|
|
|
|
context: 'github/gollum',
|
|
|
|
})
|
|
|
|
})
|
2020-04-05 15:17:06 +12:00
|
|
|
.then((res) => {
|
2020-01-23 06:16:40 +13:00
|
|
|
this.$accessor.client.setAbout(res.data)
|
|
|
|
this.loading = false
|
|
|
|
})
|
2020-04-05 15:17:06 +12:00
|
|
|
.catch((err) => console.error(err))
|
2020-01-23 06:16:40 +13:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-24 04:23:26 +13:00
|
|
|
toggle(event: { target?: HTMLElement }) {
|
|
|
|
if (event.target && event.target.classList.contains('about')) {
|
|
|
|
this.$accessor.client.toggleAbout()
|
|
|
|
}
|
2020-01-23 06:16:40 +13:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|