From 3fcf1bad0d8301b2d18d8364063f98c823324051 Mon Sep 17 00:00:00 2001 From: mike Date: Sun, 11 Feb 2024 23:38:30 +0000 Subject: [PATCH] linkedin stuff --- public/helpbuild/linkedin.svg | 74 ----------------------------------- public/helpbuild/theme.js | 40 +++++++++++++------ 2 files changed, 27 insertions(+), 87 deletions(-) delete mode 100644 public/helpbuild/linkedin.svg diff --git a/public/helpbuild/linkedin.svg b/public/helpbuild/linkedin.svg deleted file mode 100644 index 9bc2680..0000000 --- a/public/helpbuild/linkedin.svg +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - Sign in with LinkedIn - - - - - - - diff --git a/public/helpbuild/theme.js b/public/helpbuild/theme.js index 396d630..2be9cc6 100644 --- a/public/helpbuild/theme.js +++ b/public/helpbuild/theme.js @@ -4,20 +4,34 @@ if (privacyPolicy) { privacyPolicy.innerHTML = 'By signing up you agree to the Helpbuild Privacy Policy' } -// Get the anchor element -var anchor = document.getElementById('social-linkedin-openid-connect'); +const swapLinkedIn = () => { + var anchor = document.getElementById('social-linkedin-openid-connect'); -// Create an img element for the SVG -var img = document.createElement('img'); -img.src = 'linkedin.svg'; // Replace with your SVG file path -img.width = 60; -img.height = 60; + // Create an SVG element + var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); + svg.setAttribute('height', '60px'); + svg.setAttribute('width', '60px'); + svg.setAttribute('viewBox', '0 0 291.319 291.319'); -// Insert the img at the beginning of the anchor element -anchor.insertBefore(img, anchor.firstChild); + // Create paths and append them to the SVG + var path1 = document.createElementNS('http://www.w3.org/2000/svg', 'path'); + path1.setAttribute('style', 'fill:#0E76A8;'); + path1.setAttribute('d', 'M145.659,0c80.45,0,145.66,65.219,145.66,145.66s-65.21,145.659-145.66,145.659S0,226.1,0,145.66 S65.21,0,145.659,0z'); + svg.appendChild(path1); -// Get the span element -var span = anchor.getElementsByClassName('kc-social-provider-name')[0]; + var path2 = document.createElementNS('http://www.w3.org/2000/svg', 'path'); + path2.setAttribute('style', 'fill:#FFFFFF;'); + path2.setAttribute('d', 'M82.079,200.136h27.275v-90.91H82.079V200.136z M188.338,106.077 c-13.237,0-25.081,4.834-33.483,15.504v-12.654H127.48v91.21h27.375v-49.324c0-10.424,9.55-20.593,21.512-20.593 s14.912,10.169,14.912,20.338v49.57h27.275v-51.6C218.553,112.686,201.584,106.077,188.338,106.077z M95.589,100.141 c7.538,0,13.656-6.118,13.656-13.656S103.127,72.83,95.589,72.83s-13.656,6.118-13.656,13.656S88.051,100.141,95.589,100.141z'); + svg.appendChild(path2); -// Change the text of the span -span.textContent = 'Sign in with LinkedIn'; + // Insert the SVG at the beginning of the anchor element + anchor.insertBefore(svg, anchor.firstChild); + + // Get the span element + var span = anchor.getElementsByClassName('kc-social-provider-name')[0]; + + // Change the text of the span + span.textContent = 'Sign in with LinkedIn'; +} + +swapLinkedIn()