-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df2b296
commit e6e5a70
Showing
9 changed files
with
422 additions
and
251 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<template> | ||
<a | ||
v-if="to.match(/^((ftp|http(s)?):\/\/|(mailto):)/)" | ||
class="items-center inline-flex rounded" | ||
:class="{ 'text-link-dark dark:text-link-bright': isColored }" | ||
:href="to" | ||
:rel=" | ||
[...(nofollow ? ['nofollow'] : []), 'noopener', 'noreferrer'].join(' ') | ||
" | ||
target="_blank" | ||
@click="$emit('click')" | ||
> | ||
<FontAwesomeIcon | ||
v-if="iconId" | ||
:class="{ 'mr-2': $slots.default }" | ||
:icon="iconId" | ||
/> | ||
<slot /> | ||
</a> | ||
<nuxt-link | ||
v-else | ||
:append="append" | ||
class="rounded" | ||
:class="{ 'text-link-dark dark:text-link-bright': isColored }" | ||
:to="to" | ||
@click.native="$emit('click')" | ||
> | ||
<FontAwesomeIcon | ||
v-if="iconId" | ||
:class="{ 'mr-2': $slots.default }" | ||
:icon="iconId" | ||
/> | ||
<slot /> | ||
</nuxt-link> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent, PropType } from '@nuxtjs/composition-api' | ||
export default defineComponent({ | ||
props: { | ||
append: { | ||
default: false, | ||
type: Boolean, | ||
}, | ||
iconId: { | ||
default: undefined, | ||
type: Array as PropType<string[] | undefined>, | ||
}, | ||
isColored: { | ||
default: true, | ||
type: Boolean, | ||
}, | ||
nofollow: { | ||
default: false, | ||
type: Boolean, | ||
}, | ||
to: { | ||
required: true, | ||
type: String, | ||
}, | ||
}, | ||
}) | ||
</script> |
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,61 @@ | ||
<template> | ||
<img | ||
v-if="srcWhenLoaded" | ||
:alt="alt" | ||
:class="{ 'rounded-full': rounded }" | ||
:src="srcWhenLoaded" | ||
/> | ||
<div v-else> | ||
<!-- Wrapping div is required as target for class names defined on the linking element. --> | ||
<LoaderIndicatorPing /> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent, PropType } from '@nuxtjs/composition-api' | ||
export default defineComponent({ | ||
props: { | ||
alt: { | ||
required: true, | ||
type: String, | ||
}, | ||
rounded: { | ||
default: undefined, | ||
type: Boolean as PropType<boolean | undefined>, | ||
}, | ||
src: { | ||
required: true, | ||
type: String, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
srcWhenLoaded: undefined as string | undefined, | ||
} | ||
}, | ||
async fetch() { | ||
await this.updateSource() | ||
}, | ||
watch: { | ||
async src() { | ||
await this.updateSource() | ||
}, | ||
}, | ||
methods: { | ||
async updateSource() { | ||
this.srcWhenLoaded = process.server | ||
? this.src | ||
: await new Promise<string>((resolve) => { | ||
const img = new Image() | ||
img.onload = () => { | ||
resolve(img.src) | ||
} | ||
img.src = this.src | ||
}) | ||
}, | ||
}, | ||
}) | ||
</script> |
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,8 @@ | ||
<template> | ||
<div class="flex h-full items-center justify-center"> | ||
<div | ||
class="animate-ping bg-gray-500 h-1/2 rounded-full w-1/2" | ||
:title="$t('globalLoading')" | ||
/> | ||
</div> | ||
</template> |
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 |
---|---|---|
@@ -1,10 +1,5 @@ | ||
<template> | ||
<div> | ||
<main> | ||
<nuxt /> | ||
</main> | ||
<!-- <Footer /> --> | ||
</div> | ||
<nuxt /> | ||
</template> | ||
|
||
<script lang="ts"> | ||
|
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.