From eacc53b39d6359b6e6ee3ea0c98b6711d3efe1c9 Mon Sep 17 00:00:00 2001 From: Kristian Polso Date: Fri, 18 May 2018 12:55:50 +0300 Subject: [PATCH] Closes #40 --- .vuepress/components/Step2.vue | 74 +++++++++++++++++++++++++++------ .vuepress/scss/pages/_hook.scss | 29 ++++++++++++- 2 files changed, 88 insertions(+), 15 deletions(-) diff --git a/.vuepress/components/Step2.vue b/.vuepress/components/Step2.vue index 8bc5c41..107bb11 100644 --- a/.vuepress/components/Step2.vue +++ b/.vuepress/components/Step2.vue @@ -13,9 +13,10 @@
- + Sorry, canvas not supported + + + +
+ +

Image Text

+
@@ -41,6 +49,8 @@
+ +
@@ -48,22 +58,37 @@
- -
- -
- - +
- +
- +
@@ -99,19 +124,35 @@ export default { components: { ImageUploader }, + data () { + var images = [ + { + src: 'https://spee.ch/4f6b953e605a602434246743fd246d3e1fd4f5fd/carlsagan2.jpeg', + alt: 'Carl Sagan' + }, + { + src: 'https://spee.ch/2f90f2d91441a4d33d3d4eb82bdfc4c56ec742c7/doge-meme.jpeg', + alt: 'Doge' + }, + { + src: 'https://spee.ch/40ac6818bbac87a208722bf4467653341d460908/lbry-green.png', + alt: 'LBRY Logo With Green Background' + } + ]; return { valid: false, isLoading: false, topLine: 'This is an example meme', bottomLine: 'that I made', title: '', - description: '', + description: 'Check out this image I published to LBRY via lbry.tech', author: '', language: 'EN', license: 'Public Domain', nsfw: false, - backgroundImage: '', + images: images, + backgroundImage: images[0].src, textFieldRules: [ v => !!v || 'Field is required' ], @@ -130,12 +171,14 @@ export default { ctx.drawImage(img, 0, 0, canvasWidth, canvasHeight, 0, 0, canvasWidth, canvasHeight); ctx.lineWidth = 4; - ctx.font = 'bold 28px Coda'; + ctx.font = 'bold 28px Karla'; ctx.strokeStyle = 'black'; ctx.fillStyle = 'white'; ctx.textAlign = 'center'; ctx.textBaseline = 'top'; + ctx.lineJoin = 'round'; + ctx.strokeText(this.topLine.toUpperCase(), canvasWidth / 2, 20); ctx.fillText(this.topLine.toUpperCase(), canvasWidth / 2, 20); @@ -149,10 +192,15 @@ export default { imagesLoaded (instance) { var component = this; // Make sure the font is loaded - document.fonts.load('bold 28px Coda').then(function() { + document.fonts.load('bold 28px Karla').then(function() { component.updateCanvas(); }); }, + chooseImage (src) { + var component = this; + component.backgroundImage = src; + component.updateCanvas(); + }, setImage (file) { var component = this; document.getElementById('base-image').src = file; diff --git a/.vuepress/scss/pages/_hook.scss b/.vuepress/scss/pages/_hook.scss index 9bc32d8..fb02a59 100644 --- a/.vuepress/scss/pages/_hook.scss +++ b/.vuepress/scss/pages/_hook.scss @@ -223,17 +223,36 @@ &.left { margin-bottom: 2rem; - img { + #base-image { height: 0; visibility: hidden; } + .thumbnail { + width: 5rem; + height: 5rem; + object-fit: cover; + margin: 0 1rem 1rem 0; + border: 4px solid white; + border-radius: 1px; + &.selected { + border-color: black; + } + } + canvas { width: 100%; height: 100%; background-color: rgba($teal, 0.3); } } + h2 { + text-transform: uppercase; + &.metadata { + margin-top: 3rem; + } + } + fieldset { border: none; @@ -253,7 +272,9 @@ width: 100%; } - input { + input, + textarea, + select { @media (min-width: 901px) { &:not([type="checkbox"]):not([type="submit"]) { font-size: 1.25rem; @@ -310,6 +331,10 @@ } } } + #meme-top-line, + #meme-bottom-line { + text-transform: uppercase; + } } .hook__page__content__meme__uploader {