diff --git a/assets/css/app.scss b/assets/css/app.scss index ff946a1..2d1abd6 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -2,6 +2,34 @@ @import 'noto-sans.css'; @import 'beam-weapon.css'; +/* latin-ext */ +@font-face { + font-family: 'Cardo'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(https://fonts.gstatic.com/s/cardo/v19/wlp_gwjKBV1pqhv23IEp2A.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} + +/* latin */ +@font-face { + font-family: 'Cardo'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(https://fonts.gstatic.com/s/cardo/v19/wlp_gwjKBV1pqhv43IE.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +@font-face { + font-family: 'Garamond Premier Pro Display'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url('/assets/fonts/Garamond Premier Pro Display.otf') format('otf'); +} + * { --hover-color: #f18902; --border-slim-color: #495057; @@ -9,6 +37,8 @@ --red-color: #9D0208; --orange-color: #E85D04; --blue-color: #023e8a; + + --ast-border-color: #dddddd; } header > h1 { @@ -16,23 +46,6 @@ header > h1 { } @media (min-width: 1200px) { - header > h1 { - font-family: 'Beam Weapon', sans-serif; - font-weight: bold; - text-shadow: 2px 1px 2px #fff, -1px -1px 2px #fff; - display: block; - font-size: 115px; - padding: 0; - text-align: center; - background: no-repeat center url("/assets/images/background.webp"); - background: no-repeat center image-set(url("/assets/images/background.webp") 1x, url("/assets/images/background.jpeg") 1x); - border-radius: 4px; - background-size: 1280px 200px; - width: 1280px; - height: 200px; - margin: auto; - } - article { width: 1280px; margin: auto auto; @@ -69,18 +82,19 @@ article { } * { - font-family: 'Noto Sans', sans-serif; + font-family: 'Cardo', sans-serif; line-height: 1.6; } h1, h2, h3, h4, h5, h6 { - font-family: Georgia, "Times New Roman", Times, serif; + font-family: 'Cardo', serif; line-height: 1.2; } h1 { - font-size: 3.4rem; - margin-bottom: .8rem; + font-family: "Garamond Premier Pro Display", Sans-serif; + font-size: 39px; + font-weight: 600; } h2 { @@ -122,11 +136,11 @@ blockquote { } blockquote p { - font: italic 1.2rem/1.6 Georgia, "Times New Roman", Times, serif; + font: italic 1.2rem/1.6 'Cardo', serif; } local-businesses local-business p { - font-family: 'Noto Sans', sans-serif; + font-family: 'Cardo', sans-serif; } .error { @@ -162,44 +176,41 @@ ow-nav > ow-path[selected="selected"] > svg { .btn { cursor: pointer; - border-radius: 5px; - box-shadow: 0 10px 20px -6px rgba(0, 0, 0, .12); position: relative; - margin-bottom: 20px; - display: inline-block; - font-weight: 400; text-align: center; vertical-align: middle; user-select: none; - font-size: 1rem; - line-height: 1.5; - transition: color .15s ease-in-out, - background-color .15s ease-in-out, - border-color .15s ease-in-out, - box-shadow .15s ease-in-out; width: auto; height: calc(1.5em + 0.75rem + 2px); - padding: .375rem .75rem; - - border: 1px solid #495057; - color: #495057; - background: white; + border: 1px solid black; + color: white; + background: black; + padding: 10px 20px; + font-family: "Cardo", Sans-serif; + font-size: 20px; + font-weight: 500; + line-height: 1em; + letter-spacing: 0; + transition: all 0.2s; } a.btn { text-decoration: none; line-height: 2; } + privacy-policy h2 { display: block; text-align: center; } + privacy-policy h4 { display: block; text-align: center; margin-bottom: 8px; } + privacy-policy ul li { list-style: circle; } diff --git a/assets/fonts/Cardo-Bold.ttf b/assets/fonts/Cardo-Bold.ttf new file mode 100644 index 0000000..8d4fb3e Binary files /dev/null and b/assets/fonts/Cardo-Bold.ttf differ diff --git a/assets/fonts/Cardo-Italic.ttf b/assets/fonts/Cardo-Italic.ttf new file mode 100644 index 0000000..6d0adcd Binary files /dev/null and b/assets/fonts/Cardo-Italic.ttf differ diff --git a/assets/fonts/Cardo-Regular.ttf b/assets/fonts/Cardo-Regular.ttf new file mode 100644 index 0000000..854f295 Binary files /dev/null and b/assets/fonts/Cardo-Regular.ttf differ diff --git a/assets/fonts/Garamond Premier Pro Display.otf b/assets/fonts/Garamond Premier Pro Display.otf new file mode 100644 index 0000000..19ad7e8 Binary files /dev/null and b/assets/fonts/Garamond Premier Pro Display.otf differ diff --git a/client/src/business-items/business-item-editor.js b/client/src/business-items/business-item-editor.js index 3b2fea2..17741b1 100644 --- a/client/src/business-items/business-item-editor.js +++ b/client/src/business-items/business-item-editor.js @@ -55,11 +55,13 @@ customElements.define('business-item-editor', class extends Component {
+
- +
 
-
+
+
@@ -68,6 +70,7 @@ customElements.define('business-item-editor', class extends Component {
+
diff --git a/client/src/business-items/business-item.js b/client/src/business-items/business-item.js index 4b6d266..e4ee3a6 100644 --- a/client/src/business-items/business-item.js +++ b/client/src/business-items/business-item.js @@ -19,6 +19,9 @@ customElements.define('business-item', class extends Component { #move svg { cursor: pointer; } + form > #fields > div, form > #fields > div > label, form > #fields > div > .input { + width: 90% !important; + } @media(min-width: 1280px) { section > form { display: flex; @@ -28,9 +31,15 @@ customElements.define('business-item', class extends Component { width: 25%; max-width: 25%; } + form > #fields { + width: 50%; + } #move { width: 33px; } + form > #fields > div, form > #fields > div > label, form > #fields > div > .input { + width: 90% !important; + } } #move-up, #move-down { border: none; @@ -52,14 +61,18 @@ customElements.define('business-item', class extends Component { -
- - -
-
- - + +
+
+ + +
+
+ + +
+
diff --git a/client/src/contacts/contact-info-editor.js b/client/src/contacts/contact-info-editor.js index b3ea035..64430e5 100644 --- a/client/src/contacts/contact-info-editor.js +++ b/client/src/contacts/contact-info-editor.js @@ -8,9 +8,8 @@ customElements.define('contact-info-editor', class extends Component { constructor() { super(`
-

Edycja listy danych kontaktowych

diff --git a/client/src/contacts/edit-contact-info.js b/client/src/contacts/edit-contact-info.js index c9ff7a8..b818b48 100644 --- a/client/src/contacts/edit-contact-info.js +++ b/client/src/contacts/edit-contact-info.js @@ -10,19 +10,14 @@ customElements.define('edit-contact-info', class extends Component {
diff --git a/client/src/local-businesses/local-business-item.js b/client/src/local-businesses/local-business-item.js index b6d5e63..03ec0a4 100644 --- a/client/src/local-businesses/local-business-item.js +++ b/client/src/local-businesses/local-business-item.js @@ -9,7 +9,7 @@ customElements.define('local-business-item', class extends Component { super(`
- +
diff --git a/client/src/offers/marketplace-offer.js b/client/src/offers/marketplace-offer.js index 6fd57e8..d0d4fe9 100644 --- a/client/src/offers/marketplace-offer.js +++ b/client/src/offers/marketplace-offer.js @@ -8,6 +8,7 @@ customElements.define('marketplace-offer', class extends Component { } constructor() { + // language=HTML super(`
@@ -198,12 +223,12 @@ customElements.define('marketplace-offer', class extends Component { max.innerHTML = `Za darmo`; } if (this.#price_range.isRange) { - min.innerHTML = `` - max.innerHTML = ``; + min.innerHTML = `` + max.innerHTML = ``; } if (this.#price_range.isFixed) { min.innerHTML = ``; - max.innerHTML = ``; + max.innerHTML = ``; } return ''; } diff --git a/client/src/offers/marketplace-offers.js b/client/src/offers/marketplace-offers.js index 6b71c2f..32af21d 100644 --- a/client/src/offers/marketplace-offers.js +++ b/client/src/offers/marketplace-offers.js @@ -1,6 +1,10 @@ -import { Component } from "../shared"; +import { Component, BUTTON_STYLE } from "../shared"; customElements.define('marketplace-offers', class extends Component { + static get observedAttributes() { + return ['account-id']; + } + constructor() { super(`
- +
+ +
+
+
+ +
`); + this.shadowRoot.querySelector('#publish').addEventListener('click', ev => { + ev.stopPropagation(); + ev.preventDefault(); + location.href = '/account/offers'; + }); + } + + set account_id(v) { + this.setAttribute('account-id', v) + } + + get account_id() { + return this.getAttribute('account-id'); } }); diff --git a/client/src/offers/user-edit-offer.js b/client/src/offers/user-edit-offer.js index c4392f9..c1d818e 100644 --- a/client/src/offers/user-edit-offer.js +++ b/client/src/offers/user-edit-offer.js @@ -16,15 +16,11 @@ customElements.define('user-edit-offer', class extends Component { :host([mode='form']) #form { display: block; } :host([state='Finished']) #finishForm { display: none; } #actions { - width: 120px; display: flex; justify-content: space-between; } - #actions > * { - margin-right: 16px; - } #actions input { - width: 100%; + width: 140px; } #state { font-weight: bold; @@ -34,26 +30,19 @@ customElements.define('user-edit-offer', class extends Component { } @media only screen and (min-device-width: 1200px) { :host([mode='view']) #view { display: flex; } - #actions { - margin-left: 16px; - display: block; - } - #actions > * { - margin-right: 0; - } } ${ BUTTON_STYLE } +
-
-
- - - - - -
+
+
+ +
+ + +
@@ -65,7 +54,7 @@ customElements.define('user-edit-offer', class extends Component { this.shadowRoot.querySelector('#edit').addEventListener('click', ev => { ev.stopPropagation(); ev.preventDefault(); - this.mode = 'form'; + location.href = `/marketplace/${this.offer_id}/edit` }); this.shadowRoot.querySelector('#cancel').addEventListener('click', ev => { ev.preventDefault(); diff --git a/client/src/ow-account/account-view.js b/client/src/ow-account/account-view.js index 560c519..73f627f 100644 --- a/client/src/ow-account/account-view.js +++ b/client/src/ow-account/account-view.js @@ -40,7 +40,11 @@ customElements.define('account-view', class extends Component { } #logout { border-color: var(--red-color); - color: var(--red-color); + background: var(--red-color); + color: white; + } + #logoutSection { + margin-bottom: 16px; } section input[type="button"], section input[type="button"], @@ -48,13 +52,10 @@ customElements.define('account-view', class extends Component { width: 100%; } section input[type="submit"], - section a.btn { - padding-bottom: 0; - padding-top: 0; - display: block; + section a { + color: black; } ::slotted(#editService) { - width: calc(100% - 1.5rem) !important; padding-bottom: 0 !important; padding-top: 0 !important; display: block !important; @@ -77,11 +78,39 @@ customElements.define('account-view', class extends Component { width: auto; } ::slotted(#editService) { - min-width: 120px !important; - width: auto !important; display: inline-block !important; } } + ::slotted(button) { + cursor: pointer; + position: relative; + display: inline-block; + text-align: center; + vertical-align: middle; + user-select: none; + height: calc(1.5em + 0.75rem + 2px); + border: 1px solid black; + color: white; + background: black; + padding: 10px 20px; + font-family: "Cardo", Sans-serif; + font-size: 20px; + font-weight: 500; + line-height: 1em; + letter-spacing: 0; + transition: all 0.2s; + width: 100%; + } + #editServiceSection { + margin-bottom: 16px; + width: 100%; + } + label { + width: 120px; + } + .input { + margin-bottom: 16px; + } ${ FORM_STYLE }${ BUTTON_STYLE } `); @@ -124,6 +153,14 @@ customElements.define('account-view', class extends Component { ev.preventDefault(); ev.stopPropagation(); }); + { + const input = this.querySelector('#editService'); + if (input) input.addEventListener('click', ev => { + ev.stopPropagation(); + ev.preventDefault(); + location.href = "/account/business-items"; + }) + } } connectedCallback() { diff --git a/client/src/ow-account/ow-account.js b/client/src/ow-account/ow-account.js index 838ccc1..8ca4bb4 100644 --- a/client/src/ow-account/ow-account.js +++ b/client/src/ow-account/ow-account.js @@ -1,4 +1,4 @@ -import { Component, FORM_STYLE, goTo, historyDetails } from "../shared"; +import { Component, BUTTON_STYLE, Router } from "../shared"; customElements.define('ow-account', class extends Component { static get observedAttributes() { @@ -9,7 +9,7 @@ customElements.define('ow-account', class extends Component { super(` `); - this.shadowRoot.querySelector('#switch-login > a').addEventListener('click', ev => { + this.shadowRoot.querySelector('#switch-login > input').addEventListener('click', ev => { ev.stopPropagation(); ev.preventDefault(); - goTo('/login'); + Router.goTo('/login'); }); - this.shadowRoot.querySelector('#switch-register > a').addEventListener('click', ev => { + this.shadowRoot.querySelector('#switch-register > input').addEventListener('click', ev => { ev.stopPropagation(); ev.preventDefault(); - goTo('/register/account-type'); + Router.goTo('/register/account-type'); }); this.addEventListener('facebook:account', ev => { ev.stopPropagation(); @@ -60,24 +61,24 @@ customElements.define('ow-account', class extends Component { connectedCallback() { super.connectedCallback(); - const parts = historyDetails().parts; - switch (parts.first) { - case 'register': { - this.mode = 'register'; - break; - } - default: - this.mode = 'login'; - break; - } + this.listenHistory(Router.historyDetails()); } listenHistory = ({ parts }) => { - console.warn(parts); - } - - attributeChangedCallback(name, oldV, newV) { - super.attributeChangedCallback(name, oldV, newV); + switch (parts.first) { + case 'register': { + if (this.mode === 'register') + return; + this.mode = 'register'; + break; + } + default: { + if (this.mode === 'login') + return; + this.mode = 'login'; + break; + } + } } get mode() { @@ -87,5 +88,14 @@ customElements.define('ow-account', class extends Component { set mode(value) { value = ['login', 'register', 'display'].includes(value) ? value : 'login'; this.setAttribute('mode', value); + switch (value) { + case 'register': { + this.innerHTML = ``; + break; + } + default: + this.innerHTML = ``; + break; + } } }); diff --git a/client/src/register-form.js b/client/src/register-form.js index c37aa36..e575fa4 100644 --- a/client/src/register-form.js +++ b/client/src/register-form.js @@ -1,5 +1,5 @@ -import { FORM_STYLE, Component, goTo } from "./shared.js"; -import { RegisterForm } from "./register-form/model.js"; +import { FORM_STYLE, Component, Router } from "./shared.js"; +import { RegisterForm } from "./register-form/model.js"; customElements.define('register-form', class extends Component { #form = new RegisterForm; @@ -12,7 +12,7 @@ customElements.define('register-form', class extends Component { super(` `); @@ -110,7 +109,7 @@ customElements.define('register-account-type', class extends Component { - + `; const user = this.shadowRoot.querySelector('#user'); diff --git a/client/src/register-form/register-business-contacts-form.js b/client/src/register-form/register-business-contacts-form.js index 1a9a8e1..77f8a62 100644 --- a/client/src/register-form/register-business-contacts-form.js +++ b/client/src/register-form/register-business-contacts-form.js @@ -10,15 +10,24 @@ customElements.define('register-business-contacts-form', class extends RegisterF display: flex; justify-content: space-between; } + contact-info-editor > input[type='button'] { + width: 100%; + max-width: 100%; + } + ::slotted(edit-contact-info) { + margin-bottom: 16px; + } ${ BUTTON_STYLE }
+

Edycja listy danych kontaktowych

- + > + +
@@ -26,19 +35,16 @@ customElements.define('register-business-contacts-form', class extends RegisterF
`); - this.shadowRoot.querySelector('#addButton').addEventListener('click', ev => { + const editor = this.shadowRoot.querySelector('contact-info-editor'); + editor.addEventListener('submit', ev => { ev.stopPropagation(); ev.preventDefault(); - const form = this.shadowRoot.querySelector('contact-info-editor'); - const { type, content } = form; - this.innerHTML += ` - - - - `; + this.#addContact(editor); + }); + editor.querySelector('#addButton').addEventListener('click', ev => { + ev.stopPropagation(); + ev.preventDefault(); + this.#addContact(editor); }); this.mountFormHandler(() => this.#emitChange()); @@ -52,6 +58,18 @@ customElements.define('register-business-contacts-form', class extends RegisterF return Array.from(this.querySelectorAll('contact-info')); } + #addContact(editor) { + const { type, content } = editor; + this.innerHTML += ` + + + + `; + } + #emitChange() { const rows = this.#rows; const contacts = rows.map(({ type, content }) => ({ diff --git a/client/src/register-form/register-business-details-form.js b/client/src/register-form/register-business-details-form.js index 8927d26..d5b04c7 100644 --- a/client/src/register-form/register-business-details-form.js +++ b/client/src/register-form/register-business-details-form.js @@ -5,12 +5,17 @@ customElements.define('register-business-details-form', class extends RegisterFo static get observedAttributes() { return ["name", "description"]; } + constructor() { super(` diff --git a/client/src/register-form/register-business-item-form.js b/client/src/register-form/register-business-item-form.js index a6ae583..8f960ad 100644 --- a/client/src/register-form/register-business-item-form.js +++ b/client/src/register-form/register-business-item-form.js @@ -10,15 +10,29 @@ customElements.define('register-business-item-form', class extends RegisterFormC super(` @@ -68,10 +72,7 @@ customElements.define('register-business-items-form', class extends RegisterForm } #emitChange() { - const rows = this.#rows; - console.warn(rows); const items = this.#rows.map(({ price, picture_url, name }) => ({ price, picture_url, name })); - console.warn(items); this.dispatchEvent(new CustomEvent(this.submitEventName, { bubbles: true, composed: true, detail: { items } })); } }); diff --git a/client/src/register-form/register-business-submit-form.js b/client/src/register-form/register-business-submit-form.js index 39d0258..8859477 100644 --- a/client/src/register-form/register-business-submit-form.js +++ b/client/src/register-form/register-business-submit-form.js @@ -1,4 +1,5 @@ -import { FORM_STYLE, goTo, PseudoForm } from "../shared.js"; +import { FORM_STYLE, Router, PseudoForm } from "../shared.js"; +import { ErrorMessage } from "../shared/error-message.js"; customElements.define('register-business-submit-form', class extends PseudoForm { static get observedAttributes() { @@ -9,10 +10,14 @@ customElements.define('register-business-submit-form', class extends PseudoForm super(` diff --git a/client/src/shared/nav/ow-nav.js b/client/src/shared/nav/ow-nav.js index 06e3ab2..add40cd 100644 --- a/client/src/shared/nav/ow-nav.js +++ b/client/src/shared/nav/ow-nav.js @@ -1,41 +1,109 @@ -import { Component } from "../../shared"; +import { Component, Router } from "../../shared.js"; customElements.define('ow-nav', class extends Component { constructor() { super(` -
- -
+ `); } + + #mount(selector, path) { + const el = this.querySelector(selector); + if (!el) return; + el.addEventListener('click', (ev) => { + ev.stopPropagation(); + ev.preventDefault(); + Router.goTo(path); + }); + } }); diff --git a/client/src/shared/nav/ow-path.js b/client/src/shared/nav/ow-path.js index 9536dc9..d36c17c 100644 --- a/client/src/shared/nav/ow-path.js +++ b/client/src/shared/nav/ow-path.js @@ -9,7 +9,7 @@ customElements.define('ow-path', class extends Component { super(`