mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-14 05:28:58 +01:00
add font fixes for win7 :3
This commit is contained in:
parent
e699308800
commit
a82ee1daf0
1 changed files with 28 additions and 1 deletions
|
@ -45,4 +45,31 @@ if (window.location.hostname === "poketube.fun" && config.plausible_enabled == t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @license-end
|
const setFont = () => {
|
||||||
|
const poketubeFlexFont = 'Poketube Flex';
|
||||||
|
const gintoNordFont = 'Ginto Nord';
|
||||||
|
const gintoNordWidth = '1000px';
|
||||||
|
|
||||||
|
const elements = document.getElementsByTagName('*');
|
||||||
|
|
||||||
|
for (let i = 0; i < elements.length; i++) {
|
||||||
|
const style = window.getComputedStyle(elements[i]);
|
||||||
|
const font = style.getPropertyValue('font-family');
|
||||||
|
const width = style.getPropertyValue('width');
|
||||||
|
|
||||||
|
if (font === poketubeFlexFont && width === gintoNordWidth) {
|
||||||
|
elements[i].style.fontFamily = gintoNordFont;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const userAgent = window.navigator.userAgent;
|
||||||
|
const isWindows10OrNewer = /Windows NT 10/.test(userAgent);
|
||||||
|
const isOlderWindows = /Windows NT [6-8]\./.test(userAgent);
|
||||||
|
|
||||||
|
if (isOlderWindows && !isWindows10OrNewer) {
|
||||||
|
setFont();
|
||||||
|
}
|
||||||
|
|
||||||
|
// @license-end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue