-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #391 from penguin-statistics/release-3.3.4
Release 3.3.4
- Loading branch information
Showing
32 changed files
with
811 additions
and
416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<template> | ||
<v-card class="d-flex fill-height"> | ||
<v-row | ||
align="center" | ||
justify="center" | ||
> | ||
<v-col | ||
cols="12" | ||
class="px-6 py-12 text-center" | ||
> | ||
<PreloaderInline class="mx-auto mb-6" /> | ||
|
||
<h1 class="overline"> | ||
{{ overline }} | ||
</h1> | ||
<h1 class="title"> | ||
{{ title }} | ||
</h1> | ||
</v-col> | ||
</v-row> | ||
</v-card> | ||
</template> | ||
|
||
<script> | ||
import PreloaderInline from "@/components/global/PreloaderInline"; | ||
export default { | ||
name: "PreloaderCard", | ||
components: {PreloaderInline}, | ||
props: { | ||
title: { | ||
type: String, | ||
required: true | ||
}, | ||
overline: { | ||
type: String, | ||
required: true | ||
}, | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
<template> | ||
<div | ||
:style="size.image" | ||
class="animated-preloader-wrapper" | ||
> | ||
<transition | ||
mode="in-out" | ||
appear | ||
duration="125" | ||
name="fade-transition" | ||
> | ||
<div | ||
v-if="ready" | ||
key="preloader" | ||
class="animated-preloader mx-auto" | ||
|
||
:style="{...size.image, backgroundImage: `url(${url})`}" | ||
/> | ||
<div | ||
v-else | ||
key="circular" | ||
class="d-flex fill-height align-center justify-center v-image__placeholder" | ||
style="z-index: 0" | ||
> | ||
<v-progress-circular | ||
indeterminate | ||
:size="size.pending" | ||
:width="4" | ||
/> | ||
</div> | ||
</transition> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import randomUtils from "@/utils/randomUtils"; | ||
import CDN from "@/mixins/CDN"; | ||
import service from "@/utils/service"; | ||
import Console from "@/utils/Console"; | ||
export default { | ||
name: "PreloaderInline", | ||
mixins: [CDN], | ||
props: { | ||
small: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
}, | ||
data() { | ||
return { | ||
preloaders: [ | ||
"croissant", "exusiai", "sora", "texas" | ||
], | ||
ready: false, | ||
url: '' | ||
} | ||
}, | ||
computed: { | ||
currentPreloaderIndex () { | ||
return randomUtils.randomInt(this.preloaders.length - 1) | ||
}, | ||
currentSrc() { | ||
return this.cdnDeliver(`/images/preloaders/${this.preloaders[this.currentPreloaderIndex]}.png`) | ||
}, | ||
size () { | ||
if (this.small) { | ||
return { | ||
image: { | ||
"--size": "64px" | ||
}, | ||
pending: 32 | ||
} | ||
} else { | ||
return { | ||
image: { | ||
"--size": "160px" | ||
}, | ||
pending: 48 | ||
} | ||
} | ||
} | ||
}, | ||
watch: { | ||
url (_, oldValue) { | ||
this.revoke(oldValue) | ||
} | ||
}, | ||
beforeDestroy() { | ||
this.revoke(this.url) | ||
}, | ||
created() { | ||
this.update() | ||
}, | ||
methods: { | ||
revoke(url) { | ||
if (url !== '') { | ||
URL.revokeObjectURL(url) | ||
Console.debug("Preloader", "revoked blob with URL", url) | ||
} | ||
}, | ||
update() { | ||
this.ready = false | ||
service.get(this.currentSrc, { | ||
withCredentials: false, | ||
responseType: "blob" | ||
}) | ||
.then(({data}) => { | ||
this.ready = true | ||
this.url = URL.createObjectURL(data) | ||
}) | ||
.catch((err) => { | ||
Console.error("Preloader", "failed to update preloader image:", err) | ||
// we could do nothing here :( | ||
}) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.animated-preloader { | ||
height: var(--size); | ||
width: var(--size); | ||
animation: preloader infinite; | ||
animation-duration: 270ms; | ||
animation-timing-function: steps(3, end); | ||
background-size: var(--size); | ||
background-repeat: no-repeat; | ||
z-index: 1; | ||
} | ||
@keyframes preloader { | ||
from { | ||
background-position: 0 0; | ||
} | ||
to { | ||
background-position: 0 calc(-3 * var(--size)); | ||
} | ||
} | ||
.animated-preloader-wrapper { | ||
position: relative; | ||
height: var(--size); | ||
width: var(--size); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
20976d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: