DocSpace-client/packages/asc-web-components/utils/banner.js

20 lines
579 B
JavaScript
Raw Normal View History

2022-03-18 10:44:08 +00:00
export const getBannerAttribute = () => {
const bar = document.getElementById("bar-banner");
const mainBar = document.getElementById("main-bar");
const rects = mainBar ? mainBar.getBoundingClientRect() : null;
const headerHeight = bar ? 108 + 50 : mainBar ? rects.height + 40 : 48 + 50;
const sectionHeaderTop = bar
? "108px"
: rects
? rects.height + 40 + "px"
: "48px";
const sectionHeaderMarginTop = bar
? "106px"
2022-03-18 10:44:08 +00:00
: rects
? rects.height + 36 + "px"
: "46px";
2022-03-18 10:44:08 +00:00
return { headerHeight, sectionHeaderTop, sectionHeaderMarginTop };
};