Notifications Rework #81

Integrated the Notifications UI component into the header to streamline
user alerts into the overall experience.

Also added titles to use the space created by moving the notifications
compoenent to it's own space.
toggle-buttons-#109
Ro 2 years ago
parent 78bfe4596b
commit 97278e3a90
Signed by: are0h
GPG Key ID: 29B551CDBD4D3B50

@ -14,14 +14,12 @@
{% if status %} {% if status %}
<header> <header>
{% apply spaceless %} {% apply spaceless %}
<nav> <nav role="top-nav">
<div role="nav-left"> <div role="nav-left">
<a href="/dashboard"><img id="the-logo" src="/assets/images/global/fipamo-logo.svg"/></a> <a href="/dashboard"><img id="the-logo" src="/assets/images/global/fipamo-logo.svg"/></a>
</div> </div>
<div role="notifications"> <div role="title">
{% apply spaceless %} <h1>{{ title }}</h1>
{{ include("dash/partials/notifications.twig") }}
{% endapply %}
</div> </div>
<div role="nav-right"> <div role="nav-right">
{% if status %} {% if status %}
@ -31,6 +29,11 @@
{% endif %} {% endif %}
</div> </div>
</nav> </nav>
<div role="notify">
{% apply spaceless %}
{{ include("dash/partials/notifications.twig") }}
{% endapply %}
</div>
{% endapply %} {% endapply %}
{% endif %} {% endif %}
</header> </header>

@ -60,19 +60,12 @@ header {
width: 100%; width: 100%;
max-width: 900px; max-width: 900px;
margin: 10px auto; margin: 10px auto;
background: var(--white);
height: 50px; height: 50px;
border-radius: 5px; border-radius: 5px;
left: 50%; left: 50%;
transform: translate(-50%, 0); transform: translate(-50%, 0);
position: fixed; position: fixed;
z-index: 500; z-index: 500;
box-shadow: 2px 2px 0 rgba(var(--primary-rgb) / 30%);
}
header > nav {
display: grid;
grid-template-columns: 50px 1fr auto;
} }
header > nav > div[role="nav-left"] img { header > nav > div[role="nav-left"] img {
@ -80,6 +73,16 @@ header > nav > div[role="nav-left"] img {
padding: 5px; padding: 5px;
} }
header > nav > div[role="title"] {
text-align: left;
height: 100%;
}
header > nav > div[role="title"] h1 {
color: var(--primary);
margin: 15px;
}
header > nav > div[role="nav-right"] { header > nav > div[role="nav-right"] {
padding: 5px; padding: 5px;
} }

@ -1,53 +1,78 @@
header > nav > div[role="notifications"] { header > nav[role="top-nav"] {
width: 100%; display: grid;
text-align: right;
grid-template-columns: 50px auto auto;
height: 100%;
position: relative;
background: var(--white);
border-radius: 3px;
transform-style: preserve-3d;
transform-origin: 100% 50%;
transform: rotateX(0deg);
transition: all 0.1s ease-out;
perspective: 500px;
backface-visibility: hidden;
box-shadow: 2px 2px 0 rgba(var(--primary-rgb) / 30%);
} }
header > nav > div[role="notifications"] > div[role="notify-message"] { header > div[role="notify"] {
display: grid;
height: 100%;
position: relative;
background: var(--black);
border-radius: 3px;
transform-style: preserve-3d;
transform-origin: 100% 50%;
transform: rotateX(180deg);
transition: all 0.3s ease-out;
perspective: 500px;
backface-visibility: hidden;
margin-top: -50px;
box-shadow: 2px 2px 0 rgba(var(--primary-rgb) / 30%);
}
header > div[role="notify"] > div[role="notify-message"] {
display: flex; display: flex;
height: 86%; height: 86%;
} }
header > nav > div[role="notifications"] > div[role="notify-message"] div { header > div[role="notify"] > div[role="notify-message"] div {
display: inline-block; display: inline-block;
transition: all 0.2s linear; transition: all 0.2s linear;
} }
header header
> nav > div[role="notify"]
> div[role="notifications"]
> div[role="notify-message"] > div[role="notify-message"]
> div[role="notify-text"] { > div[role="notify-text"] {
color: var(--white); color: var(--white);
border-radius: 5px; border-radius: 5px;
height: 79%; height: 79%;
margin-top: 5px; margin-top: 8px;
opacity: 0; opacity: 0;
} }
header header
> nav > div[role="notify"]
> div[role="notifications"]
> div[role="notify-message"] > div[role="notify-message"]
> div[role="notify-icons"] { > div[role="notify-icons"] {
margin: 5px; margin: 5px;
width: 0; width: 40px;
opacity: 0; opacity: 0;
} }
header header
> nav > div[role="notify"]
> div[role="notifications"]
> div[role="notify-message"] > div[role="notify-message"]
> div[role="notify-text"] > div[role="notify-text"]
span { span {
display: block; display: block;
padding: 5px; padding: 5px;
margin-top: 4px;
} }
header > nav > div[role="notifications"] > div[role="notify-message"] i { header > div[role="notify"] > div[role="notify-message"] i {
display: none; display: none;
color: var(--primary); color: var(--white);
} }
i[role="notify-working"] { i[role="notify-working"] {

@ -8,7 +8,7 @@ article[role="settings"] h1 {
color: var(--white); color: var(--white);
} }
section label { section[role="member-settings"] label {
background: var(--primary); background: var(--primary);
color: var(--white); color: var(--white);
padding: 3px; padding: 3px;

@ -4201,36 +4201,58 @@ class $accfb6154319a04b$export$2e2bcd8739ae039 {
$accfb6154319a04b$var$iconWorking.style.display = "block"; $accfb6154319a04b$var$iconWorking.style.display = "block";
} }
$accfb6154319a04b$var$responseText.innerHTML = text; $accfb6154319a04b$var$responseText.innerHTML = text;
(0, $8b9e2899b2e82f52$export$2e2bcd8739ae039)({ new (0, $8b9e2899b2e82f52$export$2e2bcd8739ae039)({
targets: $accfb6154319a04b$var$notifyIcons, targets: document.querySelector('[role="top-nav"]'),
width: 39, rotateX: "180deg",
opacity: 1, easing: "easeOutQuint"
easing: "easeInQuint",
duration: 300
}); });
(0, $8b9e2899b2e82f52$export$2e2bcd8739ae039)({ new (0, $8b9e2899b2e82f52$export$2e2bcd8739ae039)({
targets: $accfb6154319a04b$var$notifyText, targets: document.querySelector('[role="notify"]'),
backgroundColor: color, rotateX: "10deg",
opacity: 1, easing: "easeOutQuint",
easing: "easeInOutQuad",
duration: 400,
complete: ()=>{ complete: ()=>{
setTimeout(()=>{ new (0, $8b9e2899b2e82f52$export$2e2bcd8739ae039)({
(0, $8b9e2899b2e82f52$export$2e2bcd8739ae039)({ targets: $accfb6154319a04b$var$notifyIcons,
targets: $accfb6154319a04b$var$notifyText, width: 39,
backgroundColor: color, opacity: 1,
opacity: 0, easing: "easeInQuint",
easing: "easeInOutQuad", duration: 300
duration: 400 });
}); new (0, $8b9e2899b2e82f52$export$2e2bcd8739ae039)({
(0, $8b9e2899b2e82f52$export$2e2bcd8739ae039)({ targets: $accfb6154319a04b$var$notifyText,
targets: $accfb6154319a04b$var$notifyIcons, backgroundColor: color,
width: 0, opacity: 1,
opacity: 0, easing: "easeInOutQuad",
easing: "easeOutQuint", duration: 400,
duration: 350 complete: ()=>{
}); setTimeout(()=>{
}, 2000); (0, $8b9e2899b2e82f52$export$2e2bcd8739ae039)({
targets: $accfb6154319a04b$var$notifyText,
backgroundColor: color,
opacity: 0,
easing: "easeInOutQuad",
duration: 400
});
(0, $8b9e2899b2e82f52$export$2e2bcd8739ae039)({
targets: $accfb6154319a04b$var$notifyIcons,
width: 0,
opacity: 0,
easing: "easeOutQuint",
duration: 350
});
new (0, $8b9e2899b2e82f52$export$2e2bcd8739ae039)({
targets: document.querySelector('[role="top-nav"]'),
rotateX: "0deg",
easing: "easeOutQuint"
});
new (0, $8b9e2899b2e82f52$export$2e2bcd8739ae039)({
targets: document.querySelector('[role="notify"]'),
rotateX: "180deg",
easing: "easeOutQuint"
});
}, 2500);
}
});
} }
}); });
} }

@ -40,38 +40,63 @@ export default class Notfications {
} }
responseText.innerHTML = text; responseText.innerHTML = text;
anime({ new anime({
targets: notifyIcons, targets: document.querySelector('[role="top-nav"]'),
width: 39, rotateX: '180deg',
opacity: 1, easing: 'easeOutQuint'
easing: 'easeInQuint',
duration: 300
}); });
anime({ new anime({
targets: notifyText, targets: document.querySelector('[role="notify"]'),
backgroundColor: color, rotateX: '10deg',
opacity: 1, easing: 'easeOutQuint',
easing: 'easeInOutQuad',
duration: 400,
complete: () => { complete: () => {
setTimeout(() => { new anime({
anime({ targets: notifyIcons,
targets: notifyText, width: 39,
backgroundColor: color, opacity: 1,
opacity: 0, easing: 'easeInQuint',
easing: 'easeInOutQuad', duration: 300
duration: 400 });
});
anime({ new anime({
targets: notifyIcons, targets: notifyText,
width: 0, backgroundColor: color,
opacity: 0, opacity: 1,
easing: 'easeOutQuint', easing: 'easeInOutQuad',
duration: 350 duration: 400,
}); complete: () => {
}, 2000); setTimeout(() => {
anime({
targets: notifyText,
backgroundColor: color,
opacity: 0,
easing: 'easeInOutQuad',
duration: 400
});
anime({
targets: notifyIcons,
width: 0,
opacity: 0,
easing: 'easeOutQuint',
duration: 350
});
new anime({
targets: document.querySelector('[role="top-nav"]'),
rotateX: '0deg',
easing: 'easeOutQuint'
});
new anime({
targets: document.querySelector('[role="notify"]'),
rotateX: '180deg',
easing: 'easeOutQuint'
});
}, 2500);
}
});
} }
}); });
} }

Loading…
Cancel
Save