1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

PM-18536 initial commit (#13701)

This commit is contained in:
Daniel Riera
2025-03-05 17:23:25 -05:00
committed by GitHub
parent a7643ebab0
commit 9754167faa

View File

@@ -845,6 +845,7 @@ async function loadNotificationBar() {
theme: typeData.theme, theme: typeData.theme,
removeIndividualVault: typeData.removeIndividualVault, removeIndividualVault: typeData.removeIndividualVault,
importType: typeData.importType, importType: typeData.importType,
launchTimestamp: typeData.launchTimestamp,
}; };
const notificationBarUrl = "notification/bar.html"; const notificationBarUrl = "notification/bar.html";
@@ -873,11 +874,32 @@ async function loadNotificationBar() {
const barPageUrl: string = chrome.runtime.getURL(barPage); const barPageUrl: string = chrome.runtime.getURL(barPage);
function getIframeStyle(useComponentBar: boolean): string { function getIframeStyle(useComponentBar: boolean): string {
return ( const isNotificationFresh =
(useComponentBar notificationBarInitData.launchTimestamp &&
? "height: calc(276px + 25px); width: 450px; right: 0;" Date.now() - notificationBarInitData.launchTimestamp < 500;
: "height: 42px; width: 100%;") + " border: 0; min-height: initial;"
); const baseStyle = useComponentBar
? isNotificationFresh
? "height: calc(276px + 25px); width: 450px; right: 0; transform:translateX(100%); opacity:0;"
: "height: calc(276px + 25px); width: 450px; right: 0; transform:translateX(0%); opacity:1;"
: "height: 42px; width: 100%;";
const transitionStyle =
isNotificationFresh && useComponentBar
? "transition: transform 0.15s ease-in, opacity 0.15s ease; transform:translateX(0%); opacity:1; transition-delay: 0.25s;"
: "";
notificationBarIframe.style.cssText = baseStyle + " border: 0; min-height: initial;";
if (isNotificationFresh && useComponentBar) {
requestAnimationFrame(() => {
requestAnimationFrame(() => {
notificationBarIframe.style.cssText += transitionStyle;
});
});
}
return baseStyle + " border: 0; min-height: initial;";
} }
notificationBarIframe = document.createElement("iframe"); notificationBarIframe = document.createElement("iframe");