From faba842b737414784c26f1dbfc4e6b50d3a387a1 Mon Sep 17 00:00:00 2001 From: Maxwell Drake Date: Sun, 7 Apr 2024 01:05:03 +0000 Subject: [PATCH] Update 'frontend.js' --- frontend.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontend.js b/frontend.js index 41cc2fe..f2972c8 100644 --- a/frontend.js +++ b/frontend.js @@ -385,6 +385,22 @@ function redir(url) { window.location.href = url.toString(); } +// Function to import Google Fonts via name +function importGoogleFont(fontName) { + // Create a new link element + const link = document.createElement('link'); + + // Set the rel attribute to 'stylesheet' + link.rel = 'stylesheet'; + + // Set the href attribute to the Google Fonts URL with the specified font name + link.href = `https://fonts.googleapis.com/css?family=${fontName.replace(' ', '+')}`; + + // Append the link element to the head of the document + document.head.appendChild(link); +} + + requir3("https://cdn.jsdelivr.net/npm/gun/gun.js") //Add Gun.JS support. function initGun(relays = []) {