Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ID-1732 Fix background blur and append required font links to the head #1797

Merged
merged 3 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/passport/sdk/src/overlay/elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const getOverlay = (contents: string): string => `
height: 100% !important;
background: rgba(13, 13, 13, 0.48) !important;
backdrop-filter: blur(28px) !important;
-webkit-backdrop-filter: blur(28px) !important;
display: flex !important;
flex-direction: column !important;
justify-content: center !important;
Expand Down
16 changes: 16 additions & 0 deletions packages/passport/sdk/src/overlay/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ export default class Overlay {

private appendOverlay() {
if (!this.overlay) {
const link1: HTMLLinkElement = document.createElement('link');
link1.href = 'https://fonts.googleapis.com';
link1.rel = 'preconnect';
document.head.appendChild(link1);

const link2: HTMLLinkElement = document.createElement('link');
link2.href = 'https://fonts.gstatic.com';
link2.rel = 'preconnect';
link2.crossOrigin = 'anonymous';
document.head.appendChild(link2);

const link3: HTMLLinkElement = document.createElement('link');
link3.href = 'https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap';
link3.rel = 'stylesheet';
document.head.appendChild(link3);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is all the links from the stackblitz


const overlay = document.createElement('div');
overlay.innerHTML = this.isBlockedOverlay ? getBlockedOverlay() : getGenericOverlay();
document.body.insertAdjacentElement('beforeend', overlay);
Expand Down