From 7df25e8a881c42c5e0ffcefb11f0d1ab30509e0c Mon Sep 17 00:00:00 2001 From: Marvin Blum Date: Wed, 16 Dec 2020 00:12:22 +0100 Subject: [PATCH 1/2] Added basic components for UI. --- src/App.vue | 57 ++++++++++--- src/components/Buffer.vue | 32 ++++++++ src/components/HelloWorld.test.ts | 16 ---- src/components/HelloWorld.vue | 61 -------------- src/components/Level.vue | 16 ++++ src/components/Matrix.vue | 21 +++++ src/components/Timer.vue | 37 +++++++++ src/sass/main.scss | 129 +++++++++++++++++++++++++++++- 8 files changed, 280 insertions(+), 89 deletions(-) create mode 100644 src/components/Buffer.vue delete mode 100644 src/components/HelloWorld.test.ts delete mode 100644 src/components/HelloWorld.vue create mode 100644 src/components/Level.vue create mode 100644 src/components/Matrix.vue create mode 100644 src/components/Timer.vue diff --git a/src/App.vue b/src/App.vue index 9183500..24e9a96 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,18 +1,55 @@ diff --git a/src/components/Level.vue b/src/components/Level.vue new file mode 100644 index 0000000..2073fb4 --- /dev/null +++ b/src/components/Level.vue @@ -0,0 +1,16 @@ + + + diff --git a/src/components/Matrix.vue b/src/components/Matrix.vue new file mode 100644 index 0000000..03a5508 --- /dev/null +++ b/src/components/Matrix.vue @@ -0,0 +1,21 @@ + + + diff --git a/src/components/Timer.vue b/src/components/Timer.vue new file mode 100644 index 0000000..0cac15d --- /dev/null +++ b/src/components/Timer.vue @@ -0,0 +1,37 @@ + + + diff --git a/src/sass/main.scss b/src/sass/main.scss index bbfa4b2..f6272f3 100644 --- a/src/sass/main.scss +++ b/src/sass/main.scss @@ -1,3 +1,128 @@ -body { - background: rgb(238, 238, 238); +@import url('https://fonts.googleapis.com/css2?family=Inconsolata&display=swap'); + +$background: #121018; +$yellow: #d0ee58; + +* { + box-sizing: border-box; +} + +html, body { + margin: 0; + padding: 0; + background: $background; + color: $yellow; + font-family: "Inconsolata", monospace; + font-size: 18px; + height: 100%; +} + +body { + display: flex; + justify-content: center; + align-items: center; +} + +main { + min-width: 400px; + border: 1px solid $yellow; + padding: 20px; +} + +.level { + display: flex; + justify-content: space-between; + align-items: center; + margin: 0 0 10px 0; + + &-display { + span { + background: $yellow; + color: $background; + padding: 5px; + font-weight: bold; + } + } +} + +.timer { + border: 1px solid $yellow; + margin: 0 0 10px 0; + + &-countdown { + padding: 10px; + } + + &-progress { + width: 100%; + height: 3px; + background: $yellow; + } +} + +.buffer { + border: 1px solid $yellow; + margin: 0 0 10px 0; + padding: 10px; + + &-codes { + display: flex; + justify-content: space-between; + align-items: center; + } + + &-slots { + display: flex; + margin: 5px 0; + + &-slot { + display: flex; + justify-content: center; + align-items: center; + width: 32px; + height: 32px; + margin: 0 5px 0 0; + } + + &-points { + display: flex; + justify-content: center; + align-items: center; + width: 64px; + height: 32px; + } + + &-border { + border: 1px solid $yellow; + } + } +} + +.matrix { + border: 1px solid $yellow; + padding: 10px; + + &-row { + display: flex; + } + + &-column { + display: flex; + justify-content: center; + align-items: center; + width: 32px; + height: 32px; + margin: 0 5px 5px 0; + } +} + +h1, h2 { + display: flex; + align-items: center; + text-transform: uppercase; + font-size: 18px; + font-weight: normal; + margin: 0; + padding: 5px 0; + height: 32px; } From 782fc5e6333ec2e887836d42c1e747c29d39f4f5 Mon Sep 17 00:00:00 2001 From: Marvin Blum Date: Wed, 16 Dec 2020 18:38:05 +0100 Subject: [PATCH 2/2] Review comments. --- src/components/Matrix.vue | 4 ++-- src/components/Timer.vue | 28 +++++++++++++++------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/components/Matrix.vue b/src/components/Matrix.vue index 03a5508..531e2a5 100644 --- a/src/components/Matrix.vue +++ b/src/components/Matrix.vue @@ -3,7 +3,7 @@

Code-Matrix

- {{matrix[(i-1)*5+(j-1)]}} + {{matrix[(i - 1)*5 + (j - 1)]}}
@@ -15,7 +15,7 @@ export default defineComponent({ props: { size: {type: Number, required: true}, - matrix: {type: Array, required: true} + matrix: {type: Array, required: true}, } }); diff --git a/src/components/Timer.vue b/src/components/Timer.vue index 0cac15d..498154b 100644 --- a/src/components/Timer.vue +++ b/src/components/Timer.vue @@ -6,27 +6,29 @@