This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//next.config.js | |
/** @type {import('next').NextConfig} */ | |
module.exports = { | |
experimental: { | |
urlImports: ['https://cdn.jsdelivr.net/npm/@undecaf/[email protected]/'], | |
}, | |
} | |
//in Next.js import like this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function scrapeData() { | |
const tbody = document.querySelector('tbody'); | |
const trElements = tbody.querySelectorAll('tr'); | |
const result = []; | |
trElements.forEach((tr) => { | |
const amountElement = tr.querySelector('.amount'); | |
const nameElement = tr.querySelector('.name'); | |
if (amountElement && nameElement) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const shadeColor = (color: string, percent: number) => { | |
if (!color) return '' | |
let R = parseInt(color.substring(1, 3), 16) | |
let G = parseInt(color.substring(3, 5), 16) | |
let B = parseInt(color.substring(5, 7), 16) | |
R = parseInt(((R * (100 + percent)) / 100) as any) | |
G = parseInt(((G * (100 + percent)) / 100) as any) | |
B = parseInt(((B * (100 + percent)) / 100) as any) |