From 03526465aa7a9a3bb0246af05de43d60a652bf30 Mon Sep 17 00:00:00 2001 From: Oli Evans Date: Thu, 26 Jul 2018 15:03:37 +0100 Subject: [PATCH 1/2] feat: lovely lesson layout WIP on #15 License: MIT Signed-off-by: Oli Evans --- src/App.vue | 5 ++ src/components/Button.vue | 39 ++++++++++ src/components/Lesson.vue | 149 ++++++++++++++++++-------------------- 3 files changed, 113 insertions(+), 80 deletions(-) create mode 100644 src/components/Button.vue diff --git a/src/App.vue b/src/App.vue index 22a26c938..9d249564c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -21,4 +21,9 @@ export default { pre { overflow: auto; } + +.focus-outline:focus { + outline: 0; + box-shadow: 0 0 0 .2rem rgba(201, 210, 215, .4); +} diff --git a/src/components/Button.vue b/src/components/Button.vue new file mode 100644 index 000000000..e567d6cc6 --- /dev/null +++ b/src/components/Button.vue @@ -0,0 +1,39 @@ + + + + + diff --git a/src/components/Lesson.vue b/src/components/Lesson.vue index 89f126327..51f23ebf0 100644 --- a/src/components/Lesson.vue +++ b/src/components/Lesson.vue @@ -1,47 +1,64 @@ @@ -49,6 +66,7 @@ import Vue from 'vue' import MonacoEditor from 'vue-monaco-editor' import Explorer from './Explorer.vue' +import Button from './Button.vue' const IPFS = require('ipfs') const CID = require('cids') const marked = require('marked') @@ -90,7 +108,8 @@ let oldIPFS export default { components: { MonacoEditor, - Explorer + Explorer, + Button }, data: self => { return { @@ -107,6 +126,13 @@ export default { } } }, + computed: { + exploreIpldUrl: function () { + let cid = this.output.test && this.output.test.cid && this.output.test.cid.toBaseEncodedString() + cid = cid || '' + return `https://ipfs.io/ipfs/QmeznoNAoUcQdCFEEz4ktv4zLfYYyhVNin28Frsv8LLxCb/#/explore/${cid}` + } + }, methods: { run: async function () { if (oldIPFS) { @@ -156,53 +182,16 @@ export default { From d8b5f1b446c9d07db5db0f954e06d9f4f9278ca0 Mon Sep 17 00:00:00 2001 From: Oli Evans Date: Thu, 26 Jul 2018 16:25:45 +0100 Subject: [PATCH 2/2] feat: nice code styles License: MIT Signed-off-by: Oli Evans --- src/App.vue | 15 ++++++++++++++- src/components/Lesson.vue | 16 ++++++++++++++-- src/main.js | 8 ++++---- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index 9d249564c..c383be6cf 100644 --- a/src/App.vue +++ b/src/App.vue @@ -21,9 +21,22 @@ export default { pre { overflow: auto; } - .focus-outline:focus { outline: 0; box-shadow: 0 0 0 .2rem rgba(201, 210, 215, .4); } +.code, code { + border-radius: 3px; + background-color: rgba(27,31,35,0.05); + padding: 0.2rem 0.3rem; + margin: 0 -0.1rem; + font-size: 85%; + font-family: SFMono-Regular, Monaco, Consolas, "Liberation Mono", "Courier New", monospace +} +pre code { + margin: 0.5rem 0; + padding: 0.6rem 0.8rem; + display: block; + font-size: 12px; +} diff --git a/src/components/Lesson.vue b/src/components/Lesson.vue index 51f23ebf0..1e235c4eb 100644 --- a/src/components/Lesson.vue +++ b/src/components/Lesson.vue @@ -17,12 +17,10 @@

{{lessonTitle}}

-