From f2e4b174d05c782f9c949db29fac8cd0c751af4e Mon Sep 17 00:00:00 2001 From: Akif9748 Date: Wed, 31 Aug 2022 18:11:54 +0300 Subject: [PATCH] variables for css --- public/css/create_thread.css | 6 +- public/css/login.css | 12 +-- public/css/navbar.css | 37 ++++----- public/css/themes/black.css | 12 +++ public/css/themes/default.css | 12 +++ public/css/thread.css | 137 +++++++++++++++++++--------------- public/css/threads.css | 4 +- public/css/user.css | 8 +- public/css/users.css | 2 +- views/admin.ejs | 4 +- views/create_thread.ejs | 4 +- views/error.ejs | 4 +- views/extra/footer.ejs | 2 +- views/extra/meta.ejs | 1 + views/index.ejs | 6 +- 15 files changed, 145 insertions(+), 106 deletions(-) create mode 100644 public/css/themes/black.css create mode 100644 public/css/themes/default.css diff --git a/public/css/create_thread.css b/public/css/create_thread.css index 3f0c175..06a13c8 100644 --- a/public/css/create_thread.css +++ b/public/css/create_thread.css @@ -1,5 +1,5 @@ .title { - color: #4d18e6; + color: var(--main); font-weight: 700; } @@ -16,8 +16,8 @@ form { font-family: inherit; display: block; font-weight: 600; - color: #4c4c4c; + color: var(--input-clr); width: 100%; margin-bottom: 10px; - border: 2px solid #d9d9d9; + border: 2px solid var(--borders); } diff --git a/public/css/login.css b/public/css/login.css index d40ff46..0d2d496 100644 --- a/public/css/login.css +++ b/public/css/login.css @@ -1,5 +1,5 @@ .title { - color: #4d18e6; + color: var(--main); font-weight: 700; } @@ -9,8 +9,8 @@ form { flex-direction: column; max-width: 500px; margin: 0 auto; - width:100%; - padding:8px; + width: 100%; + padding: 8px; } @@ -19,8 +19,8 @@ form { font-family: inherit; display: block; font-weight: 600; - color: #4c4c4c; + color: var(--input-clr); width: 100%; margin-bottom: 10px; - border: 2px solid #d9d9d9; -} + border: 2px solid var(--borders); +} \ No newline at end of file diff --git a/public/css/navbar.css b/public/css/navbar.css index fbb6d1d..f8c409f 100644 --- a/public/css/navbar.css +++ b/public/css/navbar.css @@ -24,12 +24,12 @@ a { .logo { padding: 10px; font-size: 28px; - color: #4d18e6; + color: var(--main); font-weight: 900; } .logo>span { - color: #606060; + color: var(--second); } .buttons { @@ -39,18 +39,18 @@ a { } .btn-primary { - color: #e8e8e8; - background-color: #4d18e6; + color: var(--btn-clr-1); + background-color: var(--main); padding: 10px 20px 10px 20px; border-radius: 4px; font-weight: 700; margin: 10px; cursor: pointer; - border: 2px solid #4d18e6; + border: 2px solid var(--main); } .btn-danger { - color: #e8e8e8; + color: var(--btn-clr-1); background-color: #ff0000; padding: 0px 10px 0px 10px; @@ -63,26 +63,26 @@ a { .btn-outline-primary { - color: #4d18e6; + color: var(--main); padding: 10px 20px 10px 20px; border-radius: 4px; font-weight: 700; margin: 10px; cursor: pointer; - border: 2px solid #e2e2e2; + border: 2px solid var(--borders); } .btn-primary:hover { - color: #4d18e6; + color: var(--main); background-color: rgba(0, 0, 0, 0); - border: 2px solid #4d18e6; + border: 2px solid var(--main); } .btn-outline-primary:hover { - border: 2px solid #4d18e6; + border: 2px solid var(--main); } .btn-danger:hover { @@ -101,8 +101,9 @@ a { .menu-item { padding: 10px; font-weight: 700; - background-color: #606060; - color: #ffffff; + background-color: var(--second); + color: var(--menu-item); + border-radius: 5px; width: 100%; text-align: center; @@ -112,7 +113,7 @@ a { } .active-menu { - background-color: #4d18e6; + background-color: var(--main); } body { @@ -123,13 +124,13 @@ body { .menu-item:hover { - background-color: #4d18e6; + background-color: var(--main); } .admin-bar { font-size: 15px; - color: #ffffff; - background: #4d18e6; + color: var(--menu-item); + background: var(--main); text-align: center; } @@ -150,7 +151,7 @@ div.avatar { justify-content: center; font-size: 18px; font-weight: 700; - color: #4d18e6; + color: var(--main); } @media (max-width: 992px) { diff --git a/public/css/themes/black.css b/public/css/themes/black.css new file mode 100644 index 0000000..1550472 --- /dev/null +++ b/public/css/themes/black.css @@ -0,0 +1,12 @@ +:root { + --main: #4d18e6; + --btn-clr-1: #e8e8e8; + --menu-item: #ffffff; + --borders: #d9d9d9; + --input-clr: #414141; + --box-shadow: #c3c3c3; + --second: #747474; + --reaction-hover: #151515; + --t-username: #555; + background-color: #ffffff; +} \ No newline at end of file diff --git a/public/css/themes/default.css b/public/css/themes/default.css new file mode 100644 index 0000000..1550472 --- /dev/null +++ b/public/css/themes/default.css @@ -0,0 +1,12 @@ +:root { + --main: #4d18e6; + --btn-clr-1: #e8e8e8; + --menu-item: #ffffff; + --borders: #d9d9d9; + --input-clr: #414141; + --box-shadow: #c3c3c3; + --second: #747474; + --reaction-hover: #151515; + --t-username: #555; + background-color: #ffffff; +} \ No newline at end of file diff --git a/public/css/thread.css b/public/css/thread.css index affcd2e..3dbad3e 100644 --- a/public/css/thread.css +++ b/public/css/thread.css @@ -1,16 +1,16 @@ .title { - color: #414141; + color: var(--input-clr); font-weight: 700; font-size: 36px; } .date { - color: gray; + color: var(--second); } .message { max-width: 800px; - box-shadow: 0 0 5px 0 #c3c3c3; + box-shadow: 0 0 5px 0 var(--box-shadow); margin: 10px auto; padding: 20px; display: flex; @@ -20,7 +20,7 @@ .message .left { text-align: center; - border-right: 2px solid #d9d9d9; + border-right: 2px solid var(--borders); } .message .left img { @@ -31,7 +31,7 @@ } .message .left .username { - color: #555; + color: var(--t-username); } .content { @@ -52,13 +52,13 @@ align-items: center; gap: 5px; padding: 4px; - color: #747474; + color: var(--second); cursor: pointer; transition: color 0.3s ease; } .reactions div:hover { - color: #151515; + color: var(--reaction-hover); } @@ -68,7 +68,7 @@ .pagination { - box-shadow: 0 0 5px 0 #c3c3c3; + box-shadow: 0 0 5px 0 var(--box-shadow); margin: 10px auto; padding: 8px; display: flex; @@ -81,7 +81,7 @@ .pagination .back, .pagination .after { - color: #747474; + color: var(--second); font-size: 26px; cursor: pointer; } @@ -94,9 +94,9 @@ } .pagination .number { - color: #747474; + color: var(--second); font-size: 22px; - border: 0 0 5px #747474; + border: 0 0 5px var(--second); padding: 8px; border-radius: 2px; font-weight: 600; @@ -105,7 +105,7 @@ } .pagination .number.active { - color: #4d18e6; + color: var(--main); font-weight: 700; } @@ -115,7 +115,7 @@ right: 20px; font-size: 22px; top: 10px; - color: #747474; + color: var(--second); cursor: pointer; } @@ -123,7 +123,7 @@ position: absolute; top: 50px; right: 0; - background-color: #e6e6e6; + background-color: var(--btn-clr-1); width: 100px; text-align: center; display: none; @@ -138,69 +138,82 @@ margin: 8px; cursor: pointer; } -.dots-menu a:hover:nth-child(1){ -color:#e70000} -.dots-menu a:hover:nth-child(2){ -color:#4d18e6} + +.dots-menu a:hover:nth-child(1) { + color: #e70000 +} + +.dots-menu a:hover:nth-child(2) { + color: var(--main); + +} /* Media Query */ -@media(max-width:980px){ - .message{ - margin: 10px 20px; - max-width: 100%; - flex-direction:column; - position:relative; +@media(max-width:980px) { + .message { + margin: 10px 20px; + max-width: 100%; + flex-direction: column; + position: relative; } - .message .left{ - padding: 40px; -border:none; - border-bottom: 2px solid #d9d9d9; + + .message .left { + padding: 40px; + border: none; + border-bottom: 2px solid var(--borders); } - .message .left img{ - width: 50px; - height: 50px; - border-radius: 50%; - margin-right: 5px; - position: absolute; - left: 20px; - top: 20px; + + .message .left img { + width: 50px; + height: 50px; + border-radius: 50%; + margin-right: 5px; + position: absolute; + left: 20px; + top: 20px; } - .message .left .username{ + + .message .left .username { position: absolute; top: 20px; left: 80px; } - .message .date:nth-of-type(3){ + + .message .date:nth-of-type(3) { position: absolute; -right: 20px; -top: 20px; - } - .message .date:nth-of-type(2){ - position: absolute; -right: 20px; -top: 40px; + right: 20px; + top: 20px; } - .dots{ - position: absolute; -right: auto; -top: 70px; -left: 40px; + .message .date:nth-of-type(2) { + position: absolute; + right: 20px; + top: 40px; } - .dots-menu{ -position: absolute; -left: 70px; -top: 60px; -width: 120px; + + .dots { + position: absolute; + right: auto; + top: 70px; + left: 40px; } - .dots-menu.active{ - display:flex; + + .dots-menu { + position: absolute; + left: 70px; + top: 60px; + width: 120px; } -.content{ - width:50%; -} - -} + + .dots-menu.active { + display: flex; + } + + .content { + width: 50%; + } + +} \ No newline at end of file diff --git a/public/css/threads.css b/public/css/threads.css index 61357c3..e6ba267 100644 --- a/public/css/threads.css +++ b/public/css/threads.css @@ -6,7 +6,7 @@ .threads-box { width: 100%; padding: 8px; - box-shadow: 0 0 5px 0 #cbcbcb; + box-shadow: 0 0 5px 0 var(--box-shadow); display: flex; justify-content: space-between; margin: 0px 0px 8px 0px; @@ -15,7 +15,7 @@ } .threads-box:hover { - background-color: #e2e2e2; + background-color: var(--borders); } .thread-box-title { diff --git a/public/css/user.css b/public/css/user.css index ad1942a..d9ac9c5 100644 --- a/public/css/user.css +++ b/public/css/user.css @@ -1,12 +1,12 @@ .title { - color: #4d18e6; + color: var(--main); font-weight: 700; } .content { display: flex; flex-direction: column; - box-shadow: 0 0 5px 0 #bebebe; + box-shadow: 0 0 5px 0 var(--box-shadow); max-width: 900px; margin: 0 auto; padding: 10px; @@ -22,10 +22,10 @@ } .box-title{ - color: #4d18e6; + color: var(--main); font-weight: 300; } .box-value { - color: #606060; + color: var(--second); font-weight: 300; } \ No newline at end of file diff --git a/public/css/users.css b/public/css/users.css index 208bd19..3133723 100644 --- a/public/css/users.css +++ b/public/css/users.css @@ -12,7 +12,7 @@ display: flex; flex-direction: column; align-items: center; - box-shadow: 0 0 5px 0 #beb9b9; + box-shadow: 0 0 5px 0 var(--box-shadow); max-width:500px; } diff --git a/views/admin.ejs b/views/admin.ejs index 557db61..ba1fc6d 100644 --- a/views/admin.ejs +++ b/views/admin.ejs @@ -25,12 +25,12 @@
-

Welcome to the admin panel of the forum, <%= user.name %>!

+

Welcome to the admin panel of the forum, <%= user.name %>!

IP BAN REMOVE IP BAN -

Banned users:

+

Banned users:

diff --git a/views/create_thread.ejs b/views/create_thread.ejs index 743f81d..a757a4c 100644 --- a/views/create_thread.ejs +++ b/views/create_thread.ejs @@ -15,11 +15,11 @@

Title:

-
+

Content:

-
+ diff --git a/views/error.ejs b/views/error.ejs index a902f16..5ad849b 100644 --- a/views/error.ejs +++ b/views/error.ejs @@ -7,8 +7,8 @@ <%- include("extra/navbar") %> -

<%= type %>

-

<%= error %>

+

<%= type %>

+

<%= error %>

diff --git a/views/extra/footer.ejs b/views/extra/footer.ejs index 0599c88..6cf73b3 100644 --- a/views/extra/footer.ejs +++ b/views/extra/footer.ejs @@ -2,7 +2,7 @@ .footer { width: 100%; background-color: #f5f5f5; - color: #606060; + color: var(--second); text-align: center; } diff --git a/views/extra/meta.ejs b/views/extra/meta.ejs index 5a405fe..391d0e4 100644 --- a/views/extra/meta.ejs +++ b/views/extra/meta.ejs @@ -5,4 +5,5 @@ + \ No newline at end of file diff --git a/views/index.ejs b/views/index.ejs index 8e0f3cb..7d4b851 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -13,7 +13,7 @@
<% if (user) { %> -

Welcome, <%= user.name %> +

Welcome, <%= user.name %>
@@ -24,13 +24,13 @@ LOGOUT
<% } else { %> -

Welcome, Guest!
You can press the button to register: +

Welcome, Guest!
You can press the button to register: REGISTER

<% } %> -

Statistics:

+

Statistics:

Message count: