forked from Shinonome/dots-hyprland
fix timeout anim (hmm #215)
This commit is contained in:
@@ -83,22 +83,22 @@ export const AnimatedCircProg = ({
|
|||||||
|
|
||||||
// Init animation
|
// Init animation
|
||||||
if (initFrom != initTo) {
|
if (initFrom != initTo) {
|
||||||
// area.css = `font-size: ${initFrom}px; transition: ${initAnimTime}ms linear;`;
|
area.css = `font-size: ${initFrom}px; transition: ${initAnimTime}ms linear;`;
|
||||||
Utils.timeout(20, () => {
|
Utils.timeout(20, () => {
|
||||||
area.css = `font-size: ${initTo}px;`;
|
area.css = `font-size: ${initTo}px;`;
|
||||||
}, area)
|
}, area)
|
||||||
// const transitionDistance = initTo - initFrom;
|
const transitionDistance = initTo - initFrom;
|
||||||
// const oneStep = initAnimTime / initAnimPoints;
|
const oneStep = initAnimTime / initAnimPoints;
|
||||||
// area.css = `
|
area.css = `
|
||||||
// font-size: ${initFrom}px;
|
font-size: ${initFrom}px;
|
||||||
// transition: ${oneStep}ms linear;
|
transition: ${oneStep}ms linear;
|
||||||
// `;
|
`;
|
||||||
// for (let i = 0; i < initAnimPoints; i++) {
|
for (let i = 0; i < initAnimPoints; i++) {
|
||||||
// Utils.timeout(Math.max(10, i * oneStep), () => {
|
Utils.timeout(Math.max(10, i * oneStep), () => {
|
||||||
// if(!area) return;
|
if(!area) return;
|
||||||
// area.css = `${initFrom != initTo ? 'font-size: ' + (initFrom + (transitionDistance / initAnimPoints * (i + 1))) + 'px;' : ''}`;
|
area.css = `${initFrom != initTo ? 'font-size: ' + (initFrom + (transitionDistance / initAnimPoints * (i + 1))) + 'px;' : ''}`;
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
else area.css = 'font-size: 0px;';
|
else area.css = 'font-size: 0px;';
|
||||||
extraSetup(area);
|
extraSetup(area);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export default ({
|
|||||||
isPopup = false,
|
isPopup = false,
|
||||||
props = {},
|
props = {},
|
||||||
} = {}) => {
|
} = {}) => {
|
||||||
const popupTimeout = notifObject.urgency == 'critical' ? 8000 : 3000;
|
const popupTimeout = notifObject.timeout || (notifObject.urgency == 'critical' ? 8000 : 3000);
|
||||||
const command = (isPopup ?
|
const command = (isPopup ?
|
||||||
() => notifObject.dismiss() :
|
() => notifObject.dismiss() :
|
||||||
() => notifObject.close()
|
() => notifObject.close()
|
||||||
@@ -435,17 +435,17 @@ export default ({
|
|||||||
})
|
})
|
||||||
widget.add(notificationBox);
|
widget.add(notificationBox);
|
||||||
wholeThing.child.children = [widget];
|
wholeThing.child.children = [widget];
|
||||||
if (isPopup) Utils.timeout(popupTimeout, () => {
|
// if (isPopup) Utils.timeout(popupTimeout, () => {
|
||||||
if (wholeThing) {
|
// if (wholeThing) {
|
||||||
wholeThing.revealChild = false;
|
// wholeThing.revealChild = false;
|
||||||
Utils.timeout(200, () => {
|
// Utils.timeout(200, () => {
|
||||||
if (wholeThing) {
|
// if (wholeThing) {
|
||||||
wholeThing.destroy();
|
// wholeThing.destroy();
|
||||||
wholeThing = null;
|
// wholeThing = null;
|
||||||
}
|
// }
|
||||||
command();
|
// command();
|
||||||
}, wholeThing);
|
// }, wholeThing);
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
return wholeThing;
|
return wholeThing;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user