From 141c3207c4a28d00c5c1fbafd35577005e9d6f3d Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 2 Jul 2020 18:39:24 +0100 Subject: [PATCH] refactored css to use one button class instead of copy and pasting the same style --- public/css/style.scss | 190 ++++++++++++----------------------- public/index.html | 44 ++++---- public/js/account.js | 4 +- public/js/script.js | 28 +++--- public/js/settings.js | 14 +-- public/js/userconfig.js | 16 +-- public/themes/9009.css | 6 +- public/themes/bingsu.css | 2 +- public/themes/dots.css | 16 +-- public/themes/dracula.css | 12 +-- public/themes/mr_sleeves.css | 12 +-- public/themes/oblivion.css | 12 +-- public/themes/rgb.css | 6 +- public/themes/shadow.css | 6 +- public/themes/taro.css | 4 +- 15 files changed, 158 insertions(+), 214 deletions(-) diff --git a/public/css/style.scss b/public/css/style.scss index 20e22a4c0..3dc762644 100644 --- a/public/css/style.scss +++ b/public/css/style.scss @@ -159,30 +159,6 @@ a:hover { display: grid; gap: 1rem; overflow-y: scroll; - .button{ - color: var(--text-color); - cursor: pointer; - transition: .25s; - padding: .2rem .5rem; - border-radius: var(--roundness); - - background: rgba(0,0,0,.1); - text-align: center; - -webkit-user-select: none; - display: grid; - align-content: center; - height: min-content; - height: -moz-min-content; - &.active{ - background: var(--main-color); - color: var(--bg-color); - } - &:hover,&:focus{ - color: var(--bg-color); - background: var(--main-color); - outline: none; - } - } } } @@ -212,31 +188,6 @@ a:hover { gap: 1rem; grid-template-columns: 1fr 1fr 1fr; } - .button{ - display: block; - color: var(--text-color); - cursor: pointer; - transition: .25s; - padding: .2rem .5rem; - border-radius: var(--roundness); - - background: rgba(0,0,0,.1); - text-align: center; - -webkit-user-select: none; - display: grid; - align-content: center; - height: min-content; - height: -moz-min-content; - &.active{ - background: var(--main-color); - color: var(--bg-color); - } - &:hover,&:focus{ - color: var(--bg-color); - background: var(--main-color); - outline: none; - } - } } } @@ -569,13 +520,7 @@ a:hover { width: fit-content; width: -moz-fit-content; /* transition: 0.25s; */ - .button{ - display: grid; - grid-auto-flow: column; - align-content: center; - transition: 0.25s; - padding: 0.5rem; - border-radius: var(--roundness); + .button.discord{ &.discord{ position: relative; &::after{ @@ -595,20 +540,14 @@ a:hover { border-color: transparent; } } - &:focus{ - background: var(--sub-color); - color: var(--main-color); - border: none; - outline: none; - } } } -#top.focus #menu .button.discord::after{ +#top.focus #menu .icon-button.discord::after{ background: transparent; } -#menu .button .icon { +#menu .icon-button .icon { display: grid; align-items: center; justify-items: center; @@ -617,19 +556,19 @@ a:hover { height: 1.25rem; } -#menu .button:hover { +#menu .icon-button:hover { cursor: pointer; color: var(--main-color); } -#menu .button .text { +#menu .icon-button .text { font-size: .65rem; line-height: .65rem; align-self: center; margin-left: .25rem; } -/* #menu .button:hover .text{ +/* #menu .icon-button:hover .text{ width: auto; } */ @@ -637,7 +576,7 @@ a:hover { color: transparent !important; } -#top.focus #menu .button { +#top.focus #menu .icon-button { color: transparent !important; } @@ -713,33 +652,6 @@ a:hover { display: flex; } -#top .config .group .buttons .button { - transition: 0.25s; - color: var(--sub-color); - cursor: pointer; - margin-right: 0.25rem; -} - -#top .config .group .buttons .button:last-child { - margin-right: 0; -} - -#top .config .group .buttons .button:hover { - color: var(--main-color); -} - -#top .config .group .buttons .button.active:hover { - cursor: default; -} - -#top .config .group .buttons .toggleButton.active:hover { - cursor: pointer; -} - -#top .config .group .buttons .button.active { - color: var(--main-color); -} - #top .config .group .title { color: var(--sub-color); font-size: 0.5rem; @@ -1160,12 +1072,12 @@ key { -1px 1px 0px var(--bg-color); } -.word letter { +// .word letter { // transition: .1s; // height: 1rem; // line-height: 1rem; /* margin: 0 1px; */ -} +// } .word letter.correct { color: var(--text-color); @@ -1256,33 +1168,6 @@ key { display: grid; gap: .5rem; width: 100%; - .button{ - color: var(--text-color); - cursor: pointer; - transition: .25s; - padding: .2rem .5rem; - border-radius: var(--roundness); - - background: rgba(0,0,0,.1); - text-align: center; - -webkit-user-select: none; - // display: grid; - align-content: center; - height: min-content; - height: -moz-min-content; - i{ - margin-right: .5rem; - } - &.active{ - background: var(--main-color); - color: var(--bg-color); - } - &:hover,&:focus{ - color: var(--bg-color); - background: var(--main-color); - outline: none; - } - } } .preloader{ position: fixed; @@ -1735,3 +1620,60 @@ key { .hidden { display: none !important; } + +.button{ + color: var(--text-color); + cursor: pointer; + transition: .25s; + padding: .2rem .5rem; + border-radius: var(--roundness); + + background: rgba(0,0,0,.1); + text-align: center; + -webkit-user-select: none; + // display: grid; + align-content: center; + height: min-content; + height: -moz-min-content; + .fas,.far{ + margin-right: .5rem; + } + &.active{ + background: var(--main-color); + color: var(--bg-color); + } + &:hover,&:focus{ + color: var(--bg-color); + background: var(--main-color); + outline: none; + } +} + +.text-button{ + transition: 0.25s; + color: var(--sub-color); + cursor: pointer; + margin-right: 0.25rem; + cursor: pointer; + &:hover,&:focus{ + color: var(--main-color); + } + &.active{ + color: var(--main-color); + } +} + +.icon-button{ + display: grid; + grid-auto-flow: column; + align-content: center; + transition: 0.25s; + padding: 0.5rem; + border-radius: var(--roundness); + &:focus{ + background: var(--sub-color); + color: var(--main-color); + border: none; + outline: none; + } +} diff --git a/public/index.html b/public/index.html index 37a2d25d3..015513044 100644 --- a/public/index.html +++ b/public/index.html @@ -89,33 +89,33 @@
monkey-type