From 6bfc0bb0642cee122d04411baa2615b1874589b3 Mon Sep 17 00:00:00 2001 From: Romulus21 Date: Sat, 4 Apr 2020 18:56:03 +0200 Subject: [PATCH] finish hangman v1 --- resources/js/router.js | 2 +- resources/js/views/Games/GameIndex.vue | 13 +- resources/js/views/Games/HangMan/Hangman.vue | 157 ++++++++++++++++++ .../js/views/Games/HangMan/HangmanIndex.vue | 13 ++ resources/js/views/Games/Hangman.vue | 115 ------------- resources/sass/app.scss | 1 + resources/sass/pages/games.scss | 20 +++ resources/sass/pages/games/hangman.scss | 74 ++++----- resources/svg/hangman.svg | 81 +++++++++ 9 files changed, 318 insertions(+), 158 deletions(-) create mode 100644 resources/js/views/Games/HangMan/Hangman.vue create mode 100644 resources/js/views/Games/HangMan/HangmanIndex.vue delete mode 100644 resources/js/views/Games/Hangman.vue create mode 100644 resources/sass/pages/games.scss create mode 100644 resources/svg/hangman.svg diff --git a/resources/js/router.js b/resources/js/router.js index 1041aa9..c172149 100644 --- a/resources/js/router.js +++ b/resources/js/router.js @@ -9,7 +9,7 @@ import MemoCreate from "./views/Memo/MemoCreate"; import MemoShow from "./views/Memo/MemoShow"; import MemoEdit from "./views/Memo/MemoEdit"; import GameIndex from "./views/Games/GameIndex"; -import Hangman from "./views/Games/Hangman"; +import Hangman from "./views/Games/HangMan/Hangman"; Vue.use(VueRouter) diff --git a/resources/js/views/Games/GameIndex.vue b/resources/js/views/Games/GameIndex.vue index 33aa159..7f43775 100644 --- a/resources/js/views/Games/GameIndex.vue +++ b/resources/js/views/Games/GameIndex.vue @@ -1,16 +1,19 @@ diff --git a/resources/js/views/Games/HangMan/Hangman.vue b/resources/js/views/Games/HangMan/Hangman.vue new file mode 100644 index 0000000..16a6d9b --- /dev/null +++ b/resources/js/views/Games/HangMan/Hangman.vue @@ -0,0 +1,157 @@ + + + diff --git a/resources/js/views/Games/HangMan/HangmanIndex.vue b/resources/js/views/Games/HangMan/HangmanIndex.vue new file mode 100644 index 0000000..73ee6d1 --- /dev/null +++ b/resources/js/views/Games/HangMan/HangmanIndex.vue @@ -0,0 +1,13 @@ + + + diff --git a/resources/js/views/Games/Hangman.vue b/resources/js/views/Games/Hangman.vue deleted file mode 100644 index d86e3a7..0000000 --- a/resources/js/views/Games/Hangman.vue +++ /dev/null @@ -1,115 +0,0 @@ - - - diff --git a/resources/sass/app.scss b/resources/sass/app.scss index ee5fc9f..a594b46 100644 --- a/resources/sass/app.scss +++ b/resources/sass/app.scss @@ -18,5 +18,6 @@ @import "pages/auth"; @import "pages/memos"; @import "pages/meteo"; +@import "pages/games"; @import "pages/games/hangman"; diff --git a/resources/sass/pages/games.scss b/resources/sass/pages/games.scss new file mode 100644 index 0000000..9cdd756 --- /dev/null +++ b/resources/sass/pages/games.scss @@ -0,0 +1,20 @@ +.game-index { + display: flex; + flex-wrap: wrap; + margin-top: 3rem; +} + +.game-index-item { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 18rem; + height: 18rem; + background-color: $light; + text-decoration: none; + + &:hover { + text-decoration: underline; + } +} diff --git a/resources/sass/pages/games/hangman.scss b/resources/sass/pages/games/hangman.scss index f7f7809..048152e 100644 --- a/resources/sass/pages/games/hangman.scss +++ b/resources/sass/pages/games/hangman.scss @@ -1,48 +1,55 @@ .game-container { - padding: 20px 30px; + max-width: 80rem; + margin: 0 auto; +} +.game-container-box { + padding: 2rem 3rem; position: relative; - margin: auto; - height: 350px; - width: 450px; + display: flex; + flex: 1; + flex-direction: column; + justify-content: space-between; } .figure-container { fill: transparent; - stroke: $dark; + stroke: $mediumDark; stroke-width: 4px; stroke-linecap: round; } .figure-part { display: none; + stroke: $dark; } .wrong-letters-container { - position: absolute; - top: 20px; - right: 20px; + top: 4rem; display: flex; flex-direction: column; text-align: right; + .wrong-letters { + height: 3.5rem; + } + p { margin: 0 0 5px; } span { - font-size: 24px; + font-size: 2.4rem; } } .word { display: flex; - position: absolute; - bottom: 10px; - left: 50%; - transform: translateX(-50%); + align-self: center; + justify-self: center; + bottom: 1rem; .letter { - border-bottom: 3px solid #2980b9; + border-bottom: 3px solid $medium; display: inline-flex; font-size: 30px; align-items: center; @@ -53,29 +60,27 @@ } } +.game-input { + max-width: 30rem; + margin: 0 auto; + text-align: center; +} + .popup-container { - background-color: rgba(0,0,0,0.3); - position: fixed; - top: 0; - bottom: 0; - right: 0; - left: 0; - display: flex; - display: none; - align-items: center; - justify-content: center; + position: absolute; + width: calc(100% - 6rem); .popup { - background-color: #2980b9; + background-color: $medium; border-radius: 5px; - box-shadow: 0 15px 10px 3px rgba(0,0,0,0.1); + color: $light; padding: 20px; text-align: center; button { cursor: pointer; background-color: #fff; - color: #2980b9; + color: $dark; border: 0; margin-top: 20px; padding: 12px 20px; @@ -93,18 +98,13 @@ } .notification-container { - background-color: rgba(0,0,0,0.3); - border-radius: 10px 10px 0 0; - padding: 15px 20px; - position: absolute; - bottom: -50px; - transition: transform 0.3s ease-in-out; + background-color: $mediumLight; + border-radius: 2px; + padding: 1rem; + text-align: center; + margin-bottom: 6rem; p { margin: 0; } - - &.show { - transform: translateY(-50px); - } } diff --git a/resources/svg/hangman.svg b/resources/svg/hangman.svg new file mode 100644 index 0000000..4b53c95 --- /dev/null +++ b/resources/svg/hangman.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + +