From 5caa93592146b3eeb729009cbbd40acca587c727 Mon Sep 17 00:00:00 2001 From: effectivnayarabota1 Date: Sun, 29 Oct 2023 19:15:34 +0300 Subject: [PATCH] font some fixes --- middleware/data.middleware.js | 10 ++--- middleware/file.middleware.js | 2 +- public/style/font.css | 73 +++++++-------------------------- templates/Page.eta | 4 +- templates/Profile.eta | 2 +- templates/card/cardElement.eta | 2 +- templates/textarea/textarea.css | 2 +- 7 files changed, 26 insertions(+), 69 deletions(-) diff --git a/middleware/data.middleware.js b/middleware/data.middleware.js index 268342ac..02d15f67 100644 --- a/middleware/data.middleware.js +++ b/middleware/data.middleware.js @@ -50,7 +50,7 @@ export default class Data { if (!data) throw new Error("username not found"); - const dir = `./public/data_uploads/users/${data.user_id}`; + const dir = `./public/data_uploads/users/${data.user_id}/`; data.src = File.sources(dir); data.date_creation = DateMiddleware.format(data.date_creation); @@ -67,7 +67,7 @@ export default class Data { .all({ $user_id: data.user_id }); pages.map((page) => { - const dir = `./public/data_uploads/pages/${page.page_id}`; + const dir = `./public/data_uploads/pages/${page.page_id}/`; page.src = File.sources(dir); }); @@ -90,7 +90,7 @@ export default class Data { if (data.desc) data.html = DOMPurify.sanitize(marked.parse(data.desc)); - const dir = `./public/data_uploads/pages/${page_id}`; + const dir = `./public/data_uploads/pages/${page_id}/`; data.src = File.sources(dir); data.date_creation = DateMiddleware.format(data.date_creation); @@ -119,7 +119,7 @@ export default class Data { .all({ $page_id: page_id }); elements.map((element) => { - const dir = `./public/data_uploads/elements/${element.element_id}`; + const dir = `./public/data_uploads/elements/${element.element_id}/`; element.src = File.sources(dir); if (element.text) { if (element.text) @@ -162,7 +162,7 @@ export default class Data { data.author.type = "owner"; - const dir = `./public/data_uploads/elements/${data.element_id}`; + const dir = `./public/data_uploads/elements/${data.element_id}/`; data.src = File.sources(dir); return data; } diff --git a/middleware/file.middleware.js b/middleware/file.middleware.js index ba72ba16..c6bf3ff6 100644 --- a/middleware/file.middleware.js +++ b/middleware/file.middleware.js @@ -5,7 +5,7 @@ export default class File { let result = {}; if (fs.existsSync(dir)) { fs.readdirSync(dir).forEach((file) => { - const filePath = dir.substring(1) + "/" + file; + const filePath = dir.substring(1) + file; const name_full = file.split(".").at(0); const variant = name_full?.split("@").at(1) || "original"; const name = name_full?.split("@").at(0); diff --git a/public/style/font.css b/public/style/font.css index 107fd66d..d51b9042 100644 --- a/public/style/font.css +++ b/public/style/font.css @@ -7,113 +7,73 @@ * { font-family: "Roboto Condensed", "Helvetica Neue Condensed", sans-serif; + color: var(--grey-dark); } p { - color: var(--grey-dark); - - font-family: "Roboto Condensed", "Helvetica Neue Condensed", sans-serif; font-size: 1.6em; font-style: normal; font-weight: 400; line-height: 2.4rem; } h1 { - /* margin-bottom: 48px; */ margin-bottom: 4.8rem; - color: var(--black); - font-family: "Roboto Condensed", "Helvetica Neue Condensed", sans-serif; - /* font-size: 64px; */ font-size: 6.4em; font-style: italic; font-weight: 700; - line-height: 75%; /* 48px */ - /* letter-spacing: -2.56px; */ + line-height: 75%; letter-spacing: -0.256rem; - /* text-transform: uppercase; */ } h2 { - /* margin-bottom: 24px; */ margin-bottom: 2.4rem; - color: var(--grey-dark); - - font-family: "Roboto Condensed", "Helvetica Neue Condensed", sans-serif; - /* font-size: 28px; */ font-size: 2.8em; font-style: italic; font-weight: 700; - /* line-height: 24px; /* 85.714% */ - line-height: 2.4rem; /* 85.714% */ - /* letter-spacing: -0.56px; */ + line-height: 84%; letter-spacing: -0.056rem; - /* text-transform: uppercase; */ } h3 { - color: var(--grey-dark); + margin-bottom: 1rem; - font-family: "Roboto Condensed", "Helvetica Neue Condensed", sans-serif; - font-size: 1.6em; + font-size: 1.8em; font-style: normal; font-weight: 700; - line-height: 2.4rem; /* 150% */ + line-height: 84%; } h4 { - color: var(--black); - - font-family: "Roboto Condensed", "Helvetica Neue Condensed", sans-serif; - /* font-size: 14px; */ font-size: 1.4em; font-style: normal; font-weight: 700; - line-height: 1.6rem; /* 114.286% */ - /* text-transform: uppercase; */ + line-height: 1.6rem; } h5 { - color: var(--grey-dark); - - font-family: "Roboto Condensed", "Helvetica Neue Condensed", sans-serif; - /* font-size: 14px; */ font-size: 1.4em; font-style: normal; font-weight: 400; - line-height: 1.6rem; /* 114.286% */ + line-height: 1.6rem; } h6 { - color: var(--grey-dark); - font-family: "Roboto Condensed", "Helvetica Neue Condensed", sans-serif; - /* font-size: 14px; */ font-size: 1.4em; font-style: italic; font-weight: 300; - /* line-height: 16px; /* 114.286% */ line-height: 1.6rem; /* 114.286% */ } -p { - color: var(--grey-dark); - - /* font-family: "Roboto", "Helvetica Neue", sans-serif; */ - font-family: "Roboto Condensed", "Helvetica Neue Condensed", sans-serif; - /* font-size: 16px; */ - font-size: 1.6em; - font-style: normal; - font-weight: 400; - /* line-height: 24px; /* 150% */ - line-height: 2.4rem; /* 150% */ -} - a { color: var(--blue); } a:hover { text-decoration: underline; } -/* a:visited { */ -/* color: var(--blue-visited); */ -/* } */ + +/* HTML */ +.html > p:not(:last-child) { + margin-bottom: 2.4rem; +} @media screen and (max-width: 444px) { :root { - font-size: 80%; + /* font-size: 80%; */ + font-size: 72%; } h1 { font-size: 3.2em; @@ -125,7 +85,4 @@ a:hover { line-height: 2.4rem; /* 100% */ margin-bottom: 2.4rem; } - h1 input[type="text"] { - height: 2.4em; - } } diff --git a/templates/Page.eta b/templates/Page.eta index 2fbf5cb6..b1e16c2d 100644 --- a/templates/Page.eta +++ b/templates/Page.eta @@ -14,13 +14,13 @@ <% if (data.desc || data.title) { %> -
+
<% if (data.title) { %>

<%= data.title %>

<% } %> <% if (data.desc && data.html) { %> -
<%~ data.html %>
+ <%~ data.html %> <% } %>
<% } %> diff --git a/templates/Profile.eta b/templates/Profile.eta index b231e7da..737a25b5 100644 --- a/templates/Profile.eta +++ b/templates/Profile.eta @@ -13,7 +13,7 @@
<% if (data.html) { %> -
+
<%~data.html%>
<% } %> diff --git a/templates/card/cardElement.eta b/templates/card/cardElement.eta index ab949d86..51ddb6cc 100644 --- a/templates/card/cardElement.eta +++ b/templates/card/cardElement.eta @@ -17,7 +17,7 @@ <% if (element.html && element.text) { %>
-
<%~ element.html %>
+
<%~ element.html %>
<%~ element.text %>
<% } %> diff --git a/templates/textarea/textarea.css b/templates/textarea/textarea.css index 6a7aba62..ce7614ea 100644 --- a/templates/textarea/textarea.css +++ b/templates/textarea/textarea.css @@ -32,6 +32,6 @@ @media screen and (max-width: 444px) { .textarea { border-radius: 4px; - overflow: hidden; + /* overflow: hidden; */ } }