From b10787d23ca645932e89383ebb39402d1eb84700 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 29 Jan 2018 10:47:26 +0300 Subject: first ver --- src/components/still-image/still-image.js | 29 +++++++++++++++++ src/components/still-image/still-image.vue | 51 ++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 src/components/still-image/still-image.js create mode 100644 src/components/still-image/still-image.vue (limited to 'src/components/still-image') diff --git a/src/components/still-image/still-image.js b/src/components/still-image/still-image.js new file mode 100644 index 00000000..fa027bc4 --- /dev/null +++ b/src/components/still-image/still-image.js @@ -0,0 +1,29 @@ +import fileTypeService from '../../services/file_type/file_type.service.js' + +const StillImage = { + props: [ + 'src', + 'referrerpolicy', + 'mimetype' + ], + data () { + return { + hideNsfwLocal: this.$store.state.config.hideNsfw, + } + }, + computed: { + animated () { + return this.mimetype === 'image/gif' + } + }, + methods: { + drawCanvas() { + const canvas = this.$refs.canvas + if (!canvas) return + const ctx = canvas.getContext('2d') + ctx.drawImage(this.$refs.src, 1, 1, canvas.width, canvas.height) + } + } +} + +export default StillImage diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue new file mode 100644 index 00000000..fa086e51 --- /dev/null +++ b/src/components/still-image/still-image.vue @@ -0,0 +1,51 @@ + + + + + -- cgit v1.2.3-70-g09d2