Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Weedshaker committed Nov 2, 2023
1 parent aa5d75d commit cc57f5b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions src/css/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@
--line-height: 1.5;
--outline-color: var(--color-hover);
--p-text-align: center;
--spacing: 0.75em;
}
@media only screen and (max-width: _max-width_) {
:root {
--spacing: 0.5em;
}
}
8 changes: 4 additions & 4 deletions src/es/components/atoms/logo/Logo.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ export default class Logo extends Shadow(WebWorker()) {
}))
}
}
this.animationiterationListener = event => {
this.animationiterationListener = (event, dispatch = true) => {
// workaround for nice css transition between the two logos
if (this.hasAttribute('favicon')) {
// TODO: smoothen the transition ether reverse animation to initial position or change opacity before removing the animation attribute
this.removeAttribute('animation')
} else {
this.setAttribute('animation', 'true')
}
this.dispatchEvent(new CustomEvent(this.getAttribute('animationiteration-event-name') || this.tagName.toLowerCase() + '-animationiteration', {
if (dispatch) this.dispatchEvent(new CustomEvent(this.getAttribute('animationiteration-event-name') || this.tagName.toLowerCase() + '-animationiteration', {
detail: {
open: () => this.setAttribute('favicon', 'true'),
close: () => this.removeAttribute('favicon'),
Expand All @@ -60,7 +60,7 @@ export default class Logo extends Shadow(WebWorker()) {
composed: true
}))
}
this.animationiterationListener()
this.animationiterationListener(null, false)
}

connectedCallback () {
Expand All @@ -81,7 +81,7 @@ export default class Logo extends Shadow(WebWorker()) {
}

attributeChangedCallback (name, oldValue, newValue) {
if (!this.hasAttribute('favicon')) this.animationiterationListener()
this.animationiterationListener(null, false)
this.setAttribute('aria-expanded', this.hasAttribute('favicon') ? 'false' : 'true')
}

Expand Down
2 changes: 1 addition & 1 deletion src/es/components/organisms/body/Body.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class Body extends Shadow() {
this.css = /* css */`
:host {
--show: none;
--margin: 0.5em;
--margin: var(--spacing);
--border-radius: 0.5em;
grid-area: body;
background-color: var(--color-rgba-50);
Expand Down
2 changes: 1 addition & 1 deletion src/es/components/organisms/footer/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class Footer extends Shadow() {
this.css = /* css */`
:host {
grid-area: footer;
padding: 0.5em;
padding: var(--spacing);
font-size: 0.75em;
}
`
Expand Down
2 changes: 1 addition & 1 deletion src/es/components/organisms/header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default class Header extends Shadow() {
this.css = /* css */`
:host {
--show: show 1.5s ease-in;
--padding: 0.5em;
--padding: var(--spacing);
--height: 3em;
grid-area: header;
padding: var(--padding);
Expand Down
4 changes: 2 additions & 2 deletions src/es/components/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class Index extends Mutation() {
"body"
"footer";
grid-template-columns: 100%;
grid-template-rows: minmax(var(--header-min-height , 0.5em), auto) 1fr minmax(var(--footer-min-height, 0.5em), auto);
grid-template-rows: minmax(var(--header-min-height , var(--spacing)), auto) 1fr minmax(var(--footer-min-height, var(--spacing)), auto);
min-height: var(--min-height, 100dvh);
max-height: 100vh;
}
Expand All @@ -88,7 +88,7 @@ export default class Index extends Mutation() {
}
@media only screen and (max-width: _max-width_) {
:host > section {
grid-template-rows: minmax(var(--header-height-mobile, var(--header-height, 0.5em)), auto) 1fr minmax(var(--footer-min-height-mobile, var(--footer-min-height, 0.5em)), auto);
grid-template-rows: minmax(var(--header-height-mobile, var(--header-height, var(--spacing))), auto) 1fr minmax(var(--footer-min-height-mobile, var(--footer-min-height, var(--spacing))), auto);
}
}
`
Expand Down

0 comments on commit cc57f5b

Please sign in to comment.