Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.
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
2 changes: 1 addition & 1 deletion dashboard/src/components/rmrk/Gallery/GalleryItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export default class GalleryItem extends Vue {
const { headers } = await api.head(this.nft.animation_url);
this.mimeType = headers['content-type'];
const mediaType = resolveMedia(this.mimeType);
this.imageVisible = ![MediaType.VIDEO, MediaType.IMAGE, MediaType.MODEL].some(
this.imageVisible = ![MediaType.VIDEO, MediaType.IMAGE, MediaType.MODEL, MediaType.IFRAME].some(
t => t === mediaType
);
}
Expand Down
21 changes: 21 additions & 0 deletions dashboard/src/components/rmrk/Media/IFrameMedia.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<template>

<iframe class="iframe-model__wrapper" :src="src" :alt="mimeType" />
</template>

<script lang="ts" >
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
@Component({})
export default class ImageMedia extends Vue {
@Prop() public src!: string;
@Prop() public mimeType!: string;
}
</script>

<style scoped>
.iframe-model__wrapper {
height: 100%;
min-height: 37em;
width: 100%;
}
</style>
2 changes: 2 additions & 0 deletions dashboard/src/components/rmrk/Media/MediaResolver.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const ImageMedia = () => import('./ImageMedia.vue')
const AudioMedia = () => import('./AudioMedia.vue')
const JsonMedia = () => import('./JsonMedia.vue')
const ModelMedia = () => import('./ModelMedia.vue')
const IFrameMedia = () => import('./IFrameMedia.vue')
const Media = () => import('./Unknown.vue')
const SUFFIX = 'Media'
@Component({
Expand All @@ -22,6 +23,7 @@ const SUFFIX = 'Media'
AudioMedia,
JsonMedia,
ModelMedia,
IFrameMedia,
Media
}
})
Expand Down
1 change: 1 addition & 0 deletions dashboard/src/components/rmrk/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export enum MediaType {
AUDIO = 'Audio',
JSON = 'Json',
TEXT = 'Text',
IFRAME = 'IFrame',
UNKNOWN = ''
}

Expand Down
4 changes: 4 additions & 0 deletions dashboard/src/components/rmrk/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ export const resolveMedia = (mimeType: string): MediaType => {
return MediaType.MODEL;
}

if (/^image\/svg\+xml/.test(mimeType)) {
return MediaType.IFRAME
}

const match = mimeType.match(/^[a-z]+/);

if (!match) {
Expand Down
3 changes: 2 additions & 1 deletion dashboard/tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"quotemark": [true, "single"],
"no-console": false,
"no-trailing-whitespace": false,
"max-classes-per-file": [true, 2]
"max-classes-per-file": [true, 2],
"no-string-literal": false
}
}