diff --git a/build.sh b/build.sh
index d8a793c8..8c9bbdc6 100644
--- a/build.sh
+++ b/build.sh
@@ -1,11 +1,18 @@
#!/bin/bash
-handlebars -m public/src/pages/main-page/main-page.hbs -f public/build/main-page.js
+mkdir -p public/build
+handlebars -m public/src/pages/main/main.hbs -f public/build/main.js
handlebars -m public/src/pages/login/login.hbs -f public/build/login.js
handlebars -m public/src/pages/register/register.hbs -f public/build/register.js
+handlebars -m public/src/pages/profile/profile.hbs -f public/build/profile.js
+handlebars -m public/src/pages/notFound/not-found.hbs -f public/build/not-found.js
+handlebars -m public/src/components/image/image.hbs -f public/build/image.js
handlebars -m public/src/components/header/header.hbs -f public/build/header.js
handlebars -m public/src/components/notes/notes.hbs -f public/build/notes.js
handlebars -m public/src/components/note/note.hbs -f public/build/note.js
handlebars -m public/src/components/note-editor/note-editor.hbs -f public/build/note-editor.js
-handlebars -m public/src/components/avatar/avatar.hbs -f public/build/avatar.js
handlebars -m public/src/components/link/link.hbs -f public/build/link.js
handlebars -m public/src/components/home/home.hbs -f public/build/home.js
+handlebars -m public/src/components/input/input.hbs -f public/build/input.js
+handlebars -m public/src/components/wrapper/wrapper.hbs -f public/build/wrapper.js
+handlebars -m public/src/components/footer/footer.hbs -f public/build/footer.js
+handlebars -m public/src/components/button/button.hbs -f public/build/button.js
diff --git a/public/build/button.js b/public/build/button.js
new file mode 100644
index 00000000..f6040716
--- /dev/null
+++ b/public/build/button.js
@@ -0,0 +1 @@
+!function(){var t=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["button.hbs"]=t({compiler:[8,">= 4.3.0"],main:function(t,n,l,e,a){var o,u=null!=n?n:t.nullContext||{},s=t.hooks.helperMissing,r="function",i=t.escapeExpression,t=t.lookupProperty||function(t,n){if(Object.prototype.hasOwnProperty.call(t,n))return t[n]};return'\r\n\t'+i(typeof(o=null!=(o=t(l,"text")||(null!=n?t(n,"text"):n))?o:s)==r?o.call(u,{name:"text",hash:{},data:a,loc:{start:{line:2,column:1},end:{line:2,column:9}}}):o)+"\r\n "},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/footer.js b/public/build/footer.js
new file mode 100644
index 00000000..87e35fd0
--- /dev/null
+++ b/public/build/footer.js
@@ -0,0 +1 @@
+!function(){var e=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["footer.hbs"]=e({compiler:[8,">= 4.3.0"],main:function(e,a,t,n,r){return"\n\tScratch senior devs \n "},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/header.js b/public/build/header.js
new file mode 100644
index 00000000..d8cc89da
--- /dev/null
+++ b/public/build/header.js
@@ -0,0 +1 @@
+!function(){var n=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["header.hbs"]=n({compiler:[8,">= 4.3.0"],main:function(n,e,a,t,r){return''},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/home.js b/public/build/home.js
new file mode 100644
index 00000000..25212cc3
--- /dev/null
+++ b/public/build/home.js
@@ -0,0 +1 @@
+!function(){var n=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["home.hbs"]=n({compiler:[8,">= 4.3.0"],main:function(n,t,e,s,l){var o=n.lookupProperty||function(n,t){if(Object.prototype.hasOwnProperty.call(n,t))return n[t]};return'
\n\n\t\n\t\tПопробуйте наши заметки! \n\t \n\n\t\n\n\t\n\n
'},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/image.js b/public/build/image.js
new file mode 100644
index 00000000..23289f77
--- /dev/null
+++ b/public/build/image.js
@@ -0,0 +1 @@
+!function(){var e=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["image.hbs"]=e({compiler:[8,">= 4.3.0"],main:function(e,a,n,l,t){var o=e.lookupProperty||function(e,a){if(Object.prototype.hasOwnProperty.call(e,a))return e[a]};return' '},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/input.js b/public/build/input.js
new file mode 100644
index 00000000..9813a690
--- /dev/null
+++ b/public/build/input.js
@@ -0,0 +1 @@
+!function(){var l=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["input.hbs"]=l({1:function(l,n,e,a,t){return' \n'},compiler:[8,">= 4.3.0"],main:function(l,n,e,a,t){var o,s=null!=n?n:l.nullContext||{},c=l.hooks.helperMissing,i="function",r=l.escapeExpression,u=l.lookupProperty||function(l,n){if(Object.prototype.hasOwnProperty.call(l,n))return l[n]};return'\n \n\n'+(null!=(r=u(e,"if").call(s,null!=n?u(n,"isPassword"):n,{name:"if",hash:{},fn:l.program(1,t,0),inverse:l.noop,data:t,loc:{start:{line:4,column:4},end:{line:6,column:11}}}))?r:"")+"
\n"},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/link.js b/public/build/link.js
new file mode 100644
index 00000000..732bc4cd
--- /dev/null
+++ b/public/build/link.js
@@ -0,0 +1 @@
+!function(){var n=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["link.hbs"]=n({1:function(n,l,t,e,a){var o,r=null!=l?l:n.nullContext||{},u=n.hooks.helperMissing,i="function",c=n.escapeExpression,n=n.lookupProperty||function(n,l){if(Object.prototype.hasOwnProperty.call(n,l))return n[l]};return'\t\n\t\t\n\t\t\t'+c(typeof(o=null!=(o=n(t,"text")||(null!=l?n(l,"text"):l))?o:u)==i?o.call(r,{name:"text",hash:{},data:a,loc:{start:{line:4,column:3},end:{line:4,column:11}}}):o)+"\n\t\t \n\t \n"},3:function(n,l,t,e,a){var o,r=null!=l?l:n.nullContext||{},u=n.hooks.helperMissing,i="function",c=n.escapeExpression,n=n.lookupProperty||function(n,l){if(Object.prototype.hasOwnProperty.call(n,l))return n[l]};return'\t\n\t\t'+c(typeof(o=null!=(o=n(t,"text")||(null!=l?n(l,"text"):l))?o:u)==i?o.call(r,{name:"text",hash:{},data:a,loc:{start:{line:9,column:2},end:{line:9,column:10}}}):o)+"\n\t \n"},compiler:[8,">= 4.3.0"],main:function(n,l,t,e,a){var o=n.lookupProperty||function(n,l){if(Object.prototype.hasOwnProperty.call(n,l))return n[l]};return null!=(t=o(t,"if").call(null!=l?l:n.nullContext||{},null!=l?o(l,"isBtn"):l,{name:"if",hash:{},fn:n.program(1,a,0),inverse:n.program(3,a,0),data:a,loc:{start:{line:1,column:0},end:{line:11,column:7}}}))?t:""},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/login.js b/public/build/login.js
new file mode 100644
index 00000000..408300d3
--- /dev/null
+++ b/public/build/login.js
@@ -0,0 +1 @@
+!function(){var n=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["login.hbs"]=n({compiler:[8,">= 4.3.0"],main:function(n,l,e,t,o){var a=n.lookupProperty||function(n,l){if(Object.prototype.hasOwnProperty.call(n,l))return n[l]};return'\n\t\n
\n'},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/main.js b/public/build/main.js
new file mode 100644
index 00000000..e9589cad
--- /dev/null
+++ b/public/build/main.js
@@ -0,0 +1 @@
+!function(){var a=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["main.hbs"]=a({compiler:[8,">= 4.3.0"],main:function(a,n,e,t,i){return'\n\n
'},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/not-found.js b/public/build/not-found.js
new file mode 100644
index 00000000..c00870d6
--- /dev/null
+++ b/public/build/not-found.js
@@ -0,0 +1 @@
+!function(){var n=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["not-found.hbs"]=n({compiler:[8,">= 4.3.0"],main:function(n,e,l,t,a){var o=n.lookupProperty||function(n,e){if(Object.prototype.hasOwnProperty.call(n,e))return n[e]};return'\r\n\t
Страница 404 \r\n'},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/note-editor.js b/public/build/note-editor.js
new file mode 100644
index 00000000..310f9109
--- /dev/null
+++ b/public/build/note-editor.js
@@ -0,0 +1 @@
+!function(){var e=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["note-editor.hbs"]=e({compiler:[8,">= 4.3.0"],main:function(e,t,a,n,i){return'\n\n
'},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/note.js b/public/build/note.js
new file mode 100644
index 00000000..d7d6330d
--- /dev/null
+++ b/public/build/note.js
@@ -0,0 +1 @@
+!function(){var n=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["note.hbs"]=n({compiler:[8,">= 4.3.0"],main:function(n,a,e,t,s){return'\n\t
Заголовок \n\t
Первая строчка заметки
\n
'},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/notes.js b/public/build/notes.js
new file mode 100644
index 00000000..ab20e30b
--- /dev/null
+++ b/public/build/notes.js
@@ -0,0 +1 @@
+!function(){var e=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["notes.hbs"]=e({compiler:[8,">= 4.3.0"],main:function(e,n,a,t,s){return'\n\n
'},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/profile.js b/public/build/profile.js
new file mode 100644
index 00000000..59ad08ec
--- /dev/null
+++ b/public/build/profile.js
@@ -0,0 +1 @@
+!function(){var e=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["profile.hbs"]=e({compiler:[8,">= 4.3.0"],main:function(e,n,l,a,t){var o=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return'\n\t
Страница профиля \n'},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/register.js b/public/build/register.js
new file mode 100644
index 00000000..2b2fdb55
--- /dev/null
+++ b/public/build/register.js
@@ -0,0 +1 @@
+!function(){var e=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["register.hbs"]=e({compiler:[8,">= 4.3.0"],main:function(e,t,r,n,l){var a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\n\t\n
\n'},useData:!0})}();
\ No newline at end of file
diff --git a/public/build/wrapper.js b/public/build/wrapper.js
new file mode 100644
index 00000000..f8b2b18c
--- /dev/null
+++ b/public/build/wrapper.js
@@ -0,0 +1 @@
+!function(){var e=Handlebars.template;(Handlebars.templates=Handlebars.templates||{})["wrapper.hbs"]=e({compiler:[8,">= 4.3.0"],main:function(e,n,l,a,t){var r=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return'\n\n
'},useData:!0})}();
\ No newline at end of file
diff --git a/public/config.js b/public/config.js
index 554b60bb..6fe30224 100644
--- a/public/config.js
+++ b/public/config.js
@@ -1,44 +1,135 @@
-const button = {
- "text": "toast",
- "id": "hehe123"
-}
-
const mainPage = {
- button: button
+ id: "main-page",
+ href: "/",
+ needAuth: true,
+ home: {
+ id: "home",
+ linkToLogin: {
+ text: "Попробовать"
+ }
+ }
}
const header = {
name: "YouNote",
- menu: [
- {
- href: "",
- text: "Главная",
- needAuth: false
+ logo: {
+ href: "/",
+ text: "YouNote"
+ },
+ avatarLink: {
+ href: "/profile"
+ },
+ avatar: {
+ id: "user-avatar"
+ },
+ menu: {
+ home: {
+ href: "/",
+ text: "Главная"
},
- {
- href: "main",
- text: "Мои заметки",
- needAuth: true
+ main: {
+ href: "/",
+ text: "Мои заметки"
},
- {
- href: "login",
- text: "Вход",
- needAuth: false
+ auth: {
+ id: "link-to-login",
+ href: "/login",
+ text: "Вход"
},
- {
- href: "register",
- text: "Регистрация",
- needAuth: false
+ register: {
+ href: "/register",
+ text: "Регистрация"
}
- ]
+ }
}
-const loginPage = {
+const footer = {
+ id: "footer"
+}
+const wrapper = {
+ id: "wrapper"
+}
+
+const profilePage = {
+ href: "/profile",
+ id: "profile-page",
+ logoutBtn: {
+ text: "Выйти"
+ }
+}
+
+const loginPage = {
+ id: "login-page",
+ href: "/login",
+ form: {
+ id: "login-form",
+ inputs: {
+ login: {
+ id: "login",
+ type: 'text',
+ placeholder: 'Введите логин'
+ },
+ password: {
+ id: "password",
+ type: "password",
+ placeholder: "Придумайте пароль"
+ }
+ },
+ links: {
+ registerPage: {
+ href: "/register",
+ text: "Ещё не зарегистрированы?",
+ }
+ },
+ buttons: {
+ submitBtn: {
+ text: "Войти"
+ }
+ }
+ }
}
const registerPage = {
+ href: "/register",
+ id: "register-page",
+ form: {
+ id: "register-form",
+ inputs: {
+ login: {
+ type: "text",
+ placeholder: "Введите логин"
+ },
+ password: {
+ type: "password",
+ placeholder: "Введите пароль"
+ },
+ repeatPassword: {
+ type: "password",
+ placeholder: "Повторите пароль"
+ }
+ },
+ links: {
+ loginPage: {
+ href: "/login",
+ text: "Уже есть аккаунт?",
+ }
+ },
+ buttons: {
+ submitBtn: {
+ text: "Зарегистрироваться"
+ }
+ }
+ },
+}
+const notFoundPage = {
+ href: "/404",
+ id: "not-found",
+ link: {
+ href: "/",
+ text: "Вернуться на главную"
+ }
}
const notes = {
@@ -62,9 +153,13 @@ export const config = {
mainPage: mainPage,
loginPage: loginPage,
registerPage: registerPage,
+ profilePage: profilePage,
+ notFoundPage: notFoundPage,
header: header,
notes: notes,
noteEditor: noteEditor,
note: note,
- avatar: avatar
+ avatar: avatar,
+ wrapper: wrapper,
+ footer: footer
};
diff --git a/public/index.css b/public/index.css
index 45ce2bec..d161b6e8 100644
--- a/public/index.css
+++ b/public/index.css
@@ -1,11 +1,19 @@
-@import './src/pages/main-page/main-page.css';
+@import 'src/pages/main/main.css';
+@import "src/pages/login/login.css";
+@import "src/pages/register/register.css";
+@import "src/pages/profile/profile.css";
+@import "src/pages/notFound/not-found.css";
@import './src/components/header/header.css';
@import './src/components/notes/notes.css';
@import './src/components/note/note.css';
@import './src/components/note-editor/note-editor.css';
-@import './src/components/avatar/avatar.css';
+@import 'src/components/image/image.css';
@import './src/components/link/link.css';
@import './src/components/home/home.css';
+@import './src/components/input/input.css';
+@import "src/components/button/button.css";
+@import "src/components/wrapper/wrapper.css";
+@import "src/components/footer/footer.css";
*, *::before, *::after {
box-sizing: border-box;
@@ -22,6 +30,11 @@ body {
background: #D9D9D9;
}
+html,
+body {
+ height: 100%;
+}
+
img, picture, video, canvas, svg {
display: block;
max-width: 100%;
@@ -36,5 +49,12 @@ p, h1, h2, h3, h4, h5, h6 {
}
#root {
- display: grid;
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+}
+
+#wrapper{
+ flex: 1 0 auto;
+ padding: 50px 0;
}
\ No newline at end of file
diff --git a/public/index.js b/public/index.js
index 3c012e17..e5a25441 100644
--- a/public/index.js
+++ b/public/index.js
@@ -1,90 +1,23 @@
import {config} from '/config.js';
-import MainPage from './src/pages/main-page/main-page.js';
import {Header} from "./src/components/header/header.js";
-import LoginPage from "./src/pages/login/login.js";
-import RegisterPage from "./src/pages/register/register.js";
+import {Wrapper} from "./src/components/wrapper/wrapper.js";
+import {Footer} from "./src/components/footer/footer.js";
+import {AppUserStore} from "./src/stores/user/userStore.js";
+import {router} from "./src/modules/router.js";
const root = document.getElementById('root');
-console.log('root');
-const wrapper = document.createElement("div")
-wrapper.id = "wrapper"
-root.appendChild(wrapper)
+AppUserStore.registerEvents();
-export const userInfo = {
- login: '',
- username: '',
- isAuthorized: true,
-};
-let page = 'main';
+const wrapper = new Wrapper(root, config.wrapper);
+wrapper.render();
-function renderHeader() {
- const header = new Header(root, config, userInfo.isAuthorized);
- header.render();
-}
+router.init(wrapper.self, config);
-const renderMainPage = () => {
- const main = new MainPage(wrapper, config, userInfo);
- main.render();
-};
+const header = new Header(root, config.header);
+header.render();
-const renderLoginPage = () => {
- const login = new LoginPage(wrapper, config);
- login.render();
-};
-
-const renderRegisterPage = () => {
- const register = new RegisterPage(wrapper, config);
- register.render()
-}
-
-const changePage = (href) => {
- switch (href) {
- case '':
- if (page !== 'main') {
- renderMainPage();
- page = 'main';
- history.pushState(null, null, '/')
- }
- break;
- case 'main':
- if (page !== 'main') {
- renderMainPage();
- page = 'main';
- history.pushState(null, null, '/' + page)
- }
- break;
- case 'login':
- if (page !== 'login') {
- renderLoginPage();
- page = 'login';
- history.pushState(null, null, '/' + page)
- }
- break;
- case 'register':
- if (page !== 'register') {
- renderRegisterPage();
- page = 'register';
- history.pushState(null, null, '/' + page)
- }
- break;
- default:
- console.log('undefined click');
- }
-};
-
-const listenClick = (e) => {
- e.preventDefault();
- const anchor = e.target.closest('a');
- if (!anchor) return;
- const href = anchor.getAttribute('href').replace('/', '');
- changePage(href);
-};
-
-window.addEventListener('click', listenClick);
-
-
-renderHeader();
-renderMainPage();
+const footer = new Footer(root, config.footer);
+footer.render()
diff --git a/public/src/assets/avatar.png b/public/src/assets/avatar.png
new file mode 100644
index 00000000..c3fe2cca
Binary files /dev/null and b/public/src/assets/avatar.png differ
diff --git a/public/src/assets/eye-close.svg b/public/src/assets/eye-close.svg
new file mode 100644
index 00000000..605207fb
--- /dev/null
+++ b/public/src/assets/eye-close.svg
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/src/assets/eye-open.svg b/public/src/assets/eye-open.svg
new file mode 100644
index 00000000..1e2eb01c
--- /dev/null
+++ b/public/src/assets/eye-open.svg
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/src/assets/settings.png b/public/src/assets/settings.png
new file mode 100644
index 00000000..d6c89ac4
Binary files /dev/null and b/public/src/assets/settings.png differ
diff --git a/public/src/components/avatar/avatar.css b/public/src/components/avatar/avatar.css
deleted file mode 100644
index e1b38eb9..00000000
--- a/public/src/components/avatar/avatar.css
+++ /dev/null
@@ -1,6 +0,0 @@
-.avatar {
- width: 50px;
- height: 50px;
- background: gray;
- border-radius: 50%;
-}
\ No newline at end of file
diff --git a/public/src/components/avatar/avatar.hbs b/public/src/components/avatar/avatar.hbs
deleted file mode 100644
index ebc2cf62..00000000
--- a/public/src/components/avatar/avatar.hbs
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/public/src/components/avatar/avatar.js b/public/src/components/avatar/avatar.js
deleted file mode 100644
index 4ee5dd9a..00000000
--- a/public/src/components/avatar/avatar.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import "../../../build/avatar.js"
-
-export class Avatar {
- #parent;
- #config;
-
- constructor(parent, config) {
- this.#parent = parent;
- this.#config = config;
- }
-
- render() {
- console.log("render avatar")
-
- const tmp = document.createElement('div');
- const template = Handlebars.templates["avatar.hbs"];
- tmp.innerHTML = template(this.#config.avatar);
- this.#parent.appendChild(tmp.firstElementChild);
- }
-}
diff --git a/public/src/components/button/button.css b/public/src/components/button/button.css
new file mode 100644
index 00000000..d4d30c8c
--- /dev/null
+++ b/public/src/components/button/button.css
@@ -0,0 +1,27 @@
+.submit-btn{
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-color: #56A6F0;
+ border-radius: 20px;
+ padding: 8px 16px;
+ border: none;
+ outline: none;
+ color: #ffffff;
+ text-align: center;
+ box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
+ cursor: pointer;
+ transition: 0.3s;
+}
+
+.submit-btn:hover{
+ transform: scale(1.05)
+}
+
+.submit-btn:active{
+ transform: scale(0.98)
+}
+
+.submit-btn.hidden {
+ display: none;
+}
\ No newline at end of file
diff --git a/public/src/components/button/button.hbs b/public/src/components/button/button.hbs
new file mode 100644
index 00000000..57403bed
--- /dev/null
+++ b/public/src/components/button/button.hbs
@@ -0,0 +1,3 @@
+
+ {{text}}
+
\ No newline at end of file
diff --git a/public/src/components/button/button.js b/public/src/components/button/button.js
new file mode 100644
index 00000000..f951cd11
--- /dev/null
+++ b/public/src/components/button/button.js
@@ -0,0 +1,53 @@
+import '../../../build/button.js'
+
+export class Button {
+ #parent;
+ #props = {
+ id: "",
+ text: "",
+ };
+ #onSubmit;
+
+ constructor(parent, config, onSubmit) {
+ this.id = crypto.randomUUID();
+ this.#parent = parent;
+ this.#props.id = this.id;
+ this.#props.text = config.text;
+ this.#onSubmit = onSubmit;
+ }
+
+ get self(){
+ return document.getElementById(`submit-btn-${this.id}`);
+ }
+
+ #addEventListeners(){
+ if (this.#onSubmit !== undefined) {
+ this.self.addEventListener('click', (e) => {
+ e.preventDefault()
+ this.#onSubmit()
+ });
+ }
+ }
+
+ #removeEventListeners(){
+ this.self.removeEventListener('click', this.#onSubmit);
+ }
+
+ remove(){
+ if (this.#onSubmit !== undefined) {
+ this.#removeEventListeners();
+ }
+ }
+
+ render(){
+
+
+ this.#parent.insertAdjacentHTML(
+ 'beforeend',
+ Handlebars.templates['button.hbs'](this.#props)
+ )
+
+
+ this.#addEventListeners();
+ }
+}
\ No newline at end of file
diff --git a/public/src/components/button/events.js b/public/src/components/button/events.js
new file mode 100644
index 00000000..711ccc72
--- /dev/null
+++ b/public/src/components/button/events.js
@@ -0,0 +1,3 @@
+export const SubmitButtonEvents = {
+ BUTTON_SUBMIT: 'BUTTON_SUBMIT'
+}
\ No newline at end of file
diff --git a/public/src/components/footer/footer.css b/public/src/components/footer/footer.css
new file mode 100644
index 00000000..abb32196
--- /dev/null
+++ b/public/src/components/footer/footer.css
@@ -0,0 +1,6 @@
+footer {
+ padding: 20px;
+ background: black;
+ color: #fff;
+ flex: 0 0 auto;
+}
\ No newline at end of file
diff --git a/public/src/components/footer/footer.hbs b/public/src/components/footer/footer.hbs
new file mode 100644
index 00000000..45d1c6d6
--- /dev/null
+++ b/public/src/components/footer/footer.hbs
@@ -0,0 +1,3 @@
+
\ No newline at end of file
diff --git a/public/src/components/footer/footer.js b/public/src/components/footer/footer.js
new file mode 100644
index 00000000..4e311095
--- /dev/null
+++ b/public/src/components/footer/footer.js
@@ -0,0 +1,20 @@
+import "../../../build/footer.js"
+
+export class Footer {
+ #parent;
+ #config;
+
+ constructor(parent, config) {
+ this.#parent = parent;
+ this.#config = config;
+ }
+
+ get self() {
+ return document.getElementById(`${this.#config.id}`)
+ }
+
+ render() {
+ const template = window.Handlebars.templates["footer.hbs"];
+ this.#parent.insertAdjacentHTML('beforeend', template(this.#config));
+ }
+}
\ No newline at end of file
diff --git a/public/src/components/header/header.css b/public/src/components/header/header.css
index bf99bf63..c57b0e98 100644
--- a/public/src/components/header/header.css
+++ b/public/src/components/header/header.css
@@ -1,11 +1,20 @@
header {
width: 100%;
padding: 10px 25px;
- background: #fff;
display: flex;
justify-content: space-between;
align-items: center;
- box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
+ position: fixed;
+ background: rgba(0,0,0,0);
+ transition: 0.5s;
+}
+
+header.black {
+ background: rgba(0,0,0,0.2);
+}
+
+header.black .logo-container a {
+ color: #fff;
}
header .logo-container a{
@@ -13,6 +22,7 @@ header .logo-container a{
text-decoration: none;
font-weight: bold;
font-size: 18px;
+ transition: 0.5s;
}
header .right-container {
@@ -28,4 +38,11 @@ header .menu-container {
header .menu-container .menu-item a {
text-decoration: none;
+}
+
+header .right-container .avatar {
+ width: 30px;
+ height: 30px;
+ border-radius: 50%;
+ cursor: pointer;
}
\ No newline at end of file
diff --git a/public/src/components/header/header.hbs b/public/src/components/header/header.hbs
index dbf427eb..e17dc92b 100644
--- a/public/src/components/header/header.hbs
+++ b/public/src/components/header/header.hbs
@@ -1,7 +1,7 @@