From 7276d1c04447a1c1039b9ce5239aeb02dab6c4cc Mon Sep 17 00:00:00 2001 From: Akif9748 Date: Fri, 26 Aug 2022 16:27:29 +0300 Subject: [PATCH] BUMP! NEW THEME! --- README.md | 29 +++- package.json | 8 +- public/css/navbar.css | 168 +++++++++++++++++++++ public/css/{styles.css => old_style.css} | 0 public/css/threads.css | 36 +++++ public/css/users.css | 41 +++++ routes/.js | 2 + views/admin.ejs | 6 +- views/createThread.ejs | 6 +- views/error.ejs | 2 +- views/extra/meta.ejs | 8 + views/extra/navbar.ejs | 70 +++++---- views/extra/{footer.ejs => old_footer.ejs} | 0 views/extra/{header.ejs => old_header.ejs} | 2 +- views/extra/old_navbar.ejs | 41 +++++ views/index.ejs | 6 +- views/login.ejs | 4 +- views/register.ejs | 4 +- views/thread.ejs | 6 +- views/threads.ejs | 41 ++--- views/user.ejs | 6 +- views/userEdit.ejs | 6 +- views/users.ejs | 33 ++-- 23 files changed, 422 insertions(+), 103 deletions(-) create mode 100644 public/css/navbar.css rename public/css/{styles.css => old_style.css} (100%) create mode 100644 public/css/threads.css create mode 100644 public/css/users.css create mode 100644 views/extra/meta.ejs rename views/extra/{footer.ejs => old_footer.ejs} (100%) rename views/extra/{header.ejs => old_header.ejs} (87%) create mode 100644 views/extra/old_navbar.ejs diff --git a/README.md b/README.md index 6de344a..abd470d 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,13 @@ Python is only for testing 😭 And, you can learn about API in `util/APIDOCS.md`. ## Credits -* [Akif9748](https://github.com/Akif9748) - Project mainteiner, main developer -* [Camroku](https://github.com/Camroku) - Made stylesheets +* [Akif9748](https://github.com/Akif9748) - Project mainteiner, main developer, made **old** frontend +* [Tokmak](https://github.com/-) - Made **new** frontend +* [Camroku](https://github.com/Camroku) - Made **old** stylesheets + +## Screenshot +![akf-forum](https://user-images.githubusercontent.com/70021050/160255959-ef216cba-1348-4d4b-9347-fe67e21348e7.png) + ## Roadmap ### User @@ -60,7 +65,7 @@ And, you can learn about API in `util/APIDOCS.md`. ### API | To do | Is done? | Priority | | ----- | -------- | -------- | -| RATELIMITS | 🟡 | MEDIUM | +| RATELIMITS | 🟢 | MEDIUM | | Other clients for forum via API | 🟢 | LOW | | Get message**s** | 🟢 | MEDIUM | | Send message | 🟢 | MEDIUM | @@ -74,10 +79,20 @@ And, you can learn about API in `util/APIDOCS.md`. | ----- | -------- | -------- | | Footer | 🟢 | LOW | | auto-scroll | 🟢 | LOW | -| Multi-theme support | 🔴 | LOW | -| Search | 🔴 | MEDIUM | +| Multi-theme support | 🟡 | LOW | +| Search | 🟡 | MEDIUM | | Better view, page support, support message limit correct | 🔴 | MEDIUM | | Sending message etc. will use fetch API | 🟢 | HIGH | -## Screenshot -![akf-forum](https://user-images.githubusercontent.com/70021050/160255959-ef216cba-1348-4d4b-9347-fe67e21348e7.png) +### New Theme +- [x] Users +- [x] Threads +- [ ] Login +- [ ] Register +- [ ] Thread +- [ ] User +- [ ] Main page +- [ ] Error +- [ ] ADMIN +- [ ] Create Thread + diff --git a/package.json b/package.json index 345c74d..345a201 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,10 @@ { "name": "akf-forum", "version": "2.9.2", - "description": "A forum script written in Node.js", + "description": "A Node.js based forum software", "main": "index.js", "scripts": { - "start": "node .", - "reset": "node reset.js" + "start": "node ." }, "repository": { "type": "git", @@ -13,7 +12,8 @@ }, "author": "Akif9748", "contributors": [ - "Camroku" + "Camroku", + "Tokmak" ], "license": "GPL-3.0-or-later", "bugs": { diff --git a/public/css/navbar.css b/public/css/navbar.css new file mode 100644 index 0000000..4d5d7c9 --- /dev/null +++ b/public/css/navbar.css @@ -0,0 +1,168 @@ +@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); + +* { + box-sizing: border-box; +} + +body { + margin: 0; +} + +a { + text-decoration: none; + color: initial; +} + +.header { + width: 100%; + padding: 20px; + display: flex; + justify-content: space-between; + align-self: center; +} + +.logo { + padding: 10px; + font-size: 28px; + color: #4d18e6; + font-weight: 900; +} + +.logo>span { + color: #606060; +} + +.buttons { + padding: 0; + display: flex; + align-items: center; +} + +.btn-primary { + color: #e8e8e8; + background-color: #4d18e6; + padding: 10px 20px 10px 20px; + border-radius: 4px; + font-weight: 700; + margin: 10px; + cursor: pointer; + border: 2px solid #4d18e6; +} + +.btn-outline-primary { + color: #4d18e6; + padding: 10px 20px 10px 20px; + + border-radius: 4px; + font-weight: 700; + margin: 10px; + cursor: pointer; + border: 2px solid #e2e2e2; +} + +.menu { + width: 100%; + padding: 20px; + display: flex; + justify-content: space-around; +} + +.btn-primary:hover { + color: #4d18e6; + background-color: rgba(0, 0, 0, 0); + border: 2px solid #4d18e6; +} + +.menu-item { + padding: 10px; + font-weight: 700; + background-color: #606060; + color: #ffffff; + border-radius: 5px; + width: 100%; + text-align: center; + margin: 0px 10px 0px 0px; + cursor: pointer; + transition: background-color 0.3s ease; +} + +.active-menu { + background-color: #4d18e6; +} + +body { + font-family: Poppins; + display: flex; + flex-direction: column; + height: 100%; +} + + +.btn-outline-primary:hover { + border: 2px solid #4d18e6; +} + + +.menu-item:hover { + background-color: #4d18e6; +} + +.admin-bar { + font-size: 15px; + color: #ffffff; + background: #4d18e6; + text-align: center; +} + +div.avatar { + padding-left: 10px; +} + +.avatar>img { + width: 30px; + height: 30px; + border-radius: 50%; + margin: auto; +} + +.box-username { + display: flex; + align-items: center; + font-size: 18px; + font-weight: 700; + color: #4d18e6; +} + +@media (max-width: 992px) { + .header { + flex-direction: column; + align-items: center; + } + + .menu { + flex-direction: column; + } + + .menu-item { + margin: 0px 10px 10px 0px; + } + + +} + +@media (max-width: 480px) { + .btn-outline-primary { + width: 100%; + text-align: center; + } + + .buttons { + flex-direction: column; + width: 100%; + } + + .btn-primary { + width: 100%; + text-align: center; + } +} \ No newline at end of file diff --git a/public/css/styles.css b/public/css/old_style.css similarity index 100% rename from public/css/styles.css rename to public/css/old_style.css diff --git a/public/css/threads.css b/public/css/threads.css new file mode 100644 index 0000000..9b06ce4 --- /dev/null +++ b/public/css/threads.css @@ -0,0 +1,36 @@ + +.threads { + width: 100%; + padding: 20px; +} + +.threads-box { + width: 100%; + padding: 8px; + box-shadow: 0 0 5px 0 #cbcbcb; + display: flex; + justify-content: space-between; + margin: 0px 0px 8px 0px; + cursor: pointer; + align-items: center; +} + +.threads-box:hover { + background-color: #e2e2e2; +} +.thread-box-title { + padding: 10px; + font-size: 18px; + font-weight: 700; +} + +.thread-box-title>span { + color: #ff0000; +} + + +@media (max-width: 480px) { + .threads-box { + flex-direction: column; + } +} \ No newline at end of file diff --git a/public/css/users.css b/public/css/users.css new file mode 100644 index 0000000..6c2e740 --- /dev/null +++ b/public/css/users.css @@ -0,0 +1,41 @@ +.users { + width: 100%; + padding: 20px; + display: grid; + grid-template-columns: 1fr 1fr 1fr 1fr; + gap: 10px; +} + +.user-box { + width: 100%; + padding: 20px; + display: flex; + flex-direction: column; + align-items: center; + box-shadow: 0 0 5px 0 #beb9b9; +} + +.user-box-title { + padding: 10px; + margin: 8px; + font-weight: 500; +} + +.user-box-title>span { + color: #ff0000; +} + +.user-box-img { + width: 80px; + height: 80px; +} + +@media (max-width: 992px) { + .users { + display: block; + } + + .user-box { + margin-bottom: 10px; + } +} diff --git a/routes/.js b/routes/.js index 88feade..81dcdc8 100644 --- a/routes/.js +++ b/routes/.js @@ -3,6 +3,8 @@ const { Router } = require("express"); const app = Router(); app.get("/", async (req, res) => { + + const mem = process.memoryUsage().heapUsed / Math.pow(2, 20), users = await UserModel.count({deleted:false}), diff --git a/views/admin.ejs b/views/admin.ejs index 59a52ec..741e362 100644 --- a/views/admin.ejs +++ b/views/admin.ejs @@ -1,11 +1,11 @@ -<%- include("extra/header", {title: "Admin panel!" }) %> +<%- include("extra/old_header", {title: "Admin panel!" }) %> - <%- include("extra/navbar", {user}) %> + <%- include("extra/old_navbar", {user}) %>

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

@@ -33,7 +33,7 @@ - <%- include("extra/footer") %> + <%- include("extra/old_footer") %> diff --git a/views/createThread.ejs b/views/createThread.ejs index 1e9007c..4301abe 100644 --- a/views/createThread.ejs +++ b/views/createThread.ejs @@ -1,11 +1,11 @@ -<%- include("extra/header", {title: "Create Thread!" }) %> +<%- include("extra/old_header", {title: "Create Thread!" }) %> - <%- include("extra/navbar", {user}) %> + <%- include("extra/old_navbar", {user}) %> @@ -45,7 +45,7 @@ - <%- include("extra/footer") %> + <%- include("extra/old_footer") %> \ No newline at end of file diff --git a/views/error.ejs b/views/error.ejs index 5901efc..ffb6f2a 100644 --- a/views/error.ejs +++ b/views/error.ejs @@ -31,7 +31,7 @@ - <%- include("extra/footer") %> + <%- include("extra/old_footer") %> \ No newline at end of file diff --git a/views/extra/meta.ejs b/views/extra/meta.ejs new file mode 100644 index 0000000..5a405fe --- /dev/null +++ b/views/extra/meta.ejs @@ -0,0 +1,8 @@ + + + + <%= title || "Akf-forum" %> + + + + \ No newline at end of file diff --git a/views/extra/navbar.ejs b/views/extra/navbar.ejs index cd27f3c..4f4ad2f 100644 --- a/views/extra/navbar.ejs +++ b/views/extra/navbar.ejs @@ -1,41 +1,47 @@ + <% if (user?.admin){ %> -
-

You are admin, and you can go your page!

-
-
+
+ You are admin, and you can go your page! +
<% } %> - - ---> - <%- include("extra/footer") %> + <%- include("extra/old_footer") %> \ No newline at end of file diff --git a/views/threads.ejs b/views/threads.ejs index 8bf0d73..bdeb17a 100644 --- a/views/threads.ejs +++ b/views/threads.ejs @@ -1,25 +1,30 @@ +<%- include("extra/meta", {title: "Threads!" }) %> -<%- include("extra/header", {title: "Thread list" }) %> + + - +<%- include("extra/navbar") %> - <%- include("extra/navbar", {user}) %> +
+ <% threads.forEach(thread=>{ %> + +
+
+ <% if (thread.deleted) { %> [DELETED]<% } %> + <%= thread.title %> +
+
+ <%= user.name %>
+
+ +
+
+
+ <% }); %> + +
-

Threads:

- - - - <%- include("extra/footer") %> - - - \ No newline at end of file + diff --git a/views/user.ejs b/views/user.ejs index cc2eda2..009cb6f 100644 --- a/views/user.ejs +++ b/views/user.ejs @@ -1,11 +1,11 @@ -<%- include("extra/header", { title: member.name }) %> +<%- include("extra/old_header", { title: member.name }) %> - <%- include("extra/navbar", { user }) %> + <%- include("extra/old_navbar", { user }) %>