Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes and improvements #1257

Merged
merged 4 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/assets/illustrations/kitsu-band.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
97 changes: 96 additions & 1 deletion src/components/pages/OpenProductions.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
<template>
<div class="open-productions page">
<div class="social-contributions flexrow" v-if="isContributions">
<img
class="flexrow-item kitsu-with-body"
src="../../assets/illustrations/kitsu-band.png"
/>
<div class="filler">
<span class="close-contributions" @click="hideContributions">
<x-icon size="0.9x" />
</span>
<p>
{{ $t('intro.main') }}
</p>
<ul>
<li>
{{ $t('intro.first') }}
<a href="https://github.com/cgwire/kitsu">Github</a>
</li>
<li>
{{ $t('intro.second') }}
<a href="https://twitter.com/cgwirekitsu">X</a>
{{ $t('main.or') }}
<a href="https://www.linkedin.com/company/cgwire/">Linkedin</a>
</li>
<li>
{{ $t('intro.third') }}
<a href="https://discord.gg/VbCxtKN">Discord</a>
</li>
<li>
{{ $t('intro.four') }}
<a href="https://cgwire.canny.io">Canny</a>
</li>
<li>
{{ $t('intro.five') }}
<a href="https://liberapay.com/CGWire/donate">Liberapay</a>
</li>
<li>
{{ $t('intro.six') }}
<a href="https://cg-wire.com/pricing">offers</a>
</li>
</ul>
<p>
{{ $t('intro.seven') }}
</p>
</div>
</div>
<div class="has-text-centered" v-if="isOpenProductionsLoading">
<spinner />
</div>
Expand Down Expand Up @@ -108,7 +153,9 @@
<script>
import { mapGetters, mapActions } from 'vuex'

import { XIcon } from 'vue-feather-icons'
import { buildNameIndex } from '@/lib/indexing'
import preferences from '@/lib/preferences'

import colors from '@/lib/colors'
import EditProductionModal from '@/components/modals/EditProductionModal'
Expand All @@ -121,11 +168,13 @@ export default {
components: {
EditProductionModal,
SearchField,
Spinner
Spinner,
XIcon
},

data() {
return {
isContributions: false,
filteredProductions: [],
search: '',
errors: {
Expand All @@ -144,6 +193,9 @@ export default {
this.$refs['search-field']?.focus()
this.filteredProductions = this.openProductions
this.productionIndex = buildNameIndex(this.openProductions)
this.isContributions =
preferences.getPreference('open-productions:contributions') === 'true'
this.isContributions = false
},

computed: {
Expand Down Expand Up @@ -230,6 +282,11 @@ export default {
} else {
this.filteredProductions = this.productionIndex[search]
}
},

hideContributions() {
this.isContributions = false
preferences.setPreference('open-productions:contributions', false)
}
},

Expand Down Expand Up @@ -401,6 +458,44 @@ a.secondary:hover {
padding-bottom: 3em;
}

.social-contributions {
background: $white;
border: 3px solid $purple;
box-shadow: 0 0 3px 3px #eee;
border-radius: 1em;
color: $dark-purple;
font-size: 1.1rem;
max-width: 800px;
margin-bottom: 0em;
margin-top: 2em;
margin-left: auto;
margin-right: auto;
padding: 2em;
position: relative;

a {
color: $green;
}

ul {
margin-bottom: 1em;
margin-top: 1em;
}

.close-contributions {
cursor: pointer;
position: absolute;
right: 30px;
top: 15px;
width: 2px;
}

.kitsu-with-body {
margin-right: 2em;
width: 320px;
}
}

.big-button {
background: $white;
border: 1px solid $green;
Expand Down
9 changes: 6 additions & 3 deletions src/components/previews/PreviewPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,9 @@ export default {
getAnnotation(time) {
if (this.isMovie) {
time = roundToFrame(time, this.fps)
return this.annotations.find(annotation => annotation.time === time)
return this.annotations.find(annotation => {
return roundToFrame(annotation.time, this.fps) === time
})
} else if (this.isPicture) {
return this.annotations.find(annotation => annotation.time === 0)
}
Expand All @@ -1480,7 +1482,8 @@ export default {
saveAnnotations() {
let currentTime = 0
if (this.isMovie) {
currentTime = this.currentTimeRaw
currentTime = this.currentFrame * this.frameDuration
currentTime = roundToFrame(currentTime, this.fps)
}
const annotation = this.getAnnotation(currentTime)
const annotations = this.getNewAnnotations(currentTime, annotation)
Expand All @@ -1496,7 +1499,7 @@ export default {
let currentTime = 0
if (!annotation) {
if (this.isMovie) {
currentTime = this.currentTimeRaw
currentTime = this.currentFrame * this.frameDuration
}
annotation = this.getAnnotation(currentTime)
if (!annotation) {
Expand Down
6 changes: 3 additions & 3 deletions src/components/sides/TaskInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1237,9 +1237,9 @@ export default {
onSetCurrentFrameAsThumbnail(isUseCurrentFrame) {
if (this.$refs['preview-player']) {
this.loading.setFrameThumbnail = true
let frame = undefined
if (isUseCurrentFrame && this.$refs['preview-player'].isMovie) {
frame = parseInt(this.$refs['preview-player'].currentFrame)
let frame = null
if (isUseCurrentFrame) {
frame = this.currentFrameRaw
}
return this.setCurrentPreviewAsEntityThumbnail(frame)
}
Expand Down
8 changes: 7 additions & 1 deletion src/components/tops/Topbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
<nav
class="user-menu"
:style="{
top: isUserMenuHidden ? '-480px' : '60px'
top: isUserMenuHidden ? '-500px' : '60px'
}"
>
<ul>
Expand Down Expand Up @@ -180,6 +180,12 @@
<a href="https://discord.gg/VbCxtKN" target="_blank">
<li>Discord</li>
</a>
<a href="https://linkedin.com/company/cgwire/" target="_blank">
<li>Linkedin</li>
</a>
<a href="https://twitter.com/cgwirekitsu" target="_blank">
<li>X</li>
</a>
<a href="https://cgwire.canny.io" target="_blank">
<li>Roadmap / Feedback</li>
</a>
Expand Down
11 changes: 11 additions & 0 deletions src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,17 @@ export default {
shortcuts: 'Shortcuts'
},

intro: {
main: 'Welcome to Kitsu! To make our project thrives, we need your support. To help us, we propose you simple contributions:',
first: 'Star our repository on ',
second: 'Follow us on ',
third: 'Join our',
four: 'You can suggest new features on ',
five: 'Donate to our ',
six: 'Have a look at our cloud and on-premise ',
seven: 'Finally, you can help us by sharing Kitsu with your friends and colleagues. The more we are, the more we can improve Kitsu.'
},

login: {
back_to_login: 'Go back to login page',
choose_totp: 'Enter two-factor authentication code via TOTP',
Expand Down