mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
chore: install rgbquant
This commit is contained in:
parent
1abcec8129
commit
51df2f90b0
6 changed files with 9 additions and 40 deletions
2
src/libs/rgbquant.min.js
vendored
2
src/libs/rgbquant.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,36 +0,0 @@
|
|||
(window => {
|
||||
const noTrack = !location.hostname || window.localStorage.getItem("noTrack");
|
||||
|
||||
const {
|
||||
screen: {width, height},
|
||||
navigator: {language},
|
||||
location: {hostname, pathname, search},
|
||||
document: {referrer}
|
||||
} = window;
|
||||
|
||||
const website = "4f6fd0ae-646a-4946-a9da-7aad63284e48";
|
||||
const root = "https://fmg-stats.herokuapp.com";
|
||||
const screen = `${width}x${height}`;
|
||||
const url = `${pathname}${search}`;
|
||||
|
||||
const post = (url, data) => {
|
||||
const req = new XMLHttpRequest();
|
||||
req.open("POST", url, true);
|
||||
req.setRequestHeader("Content-Type", "application/json");
|
||||
req.send(JSON.stringify(data));
|
||||
};
|
||||
|
||||
const collect = (type, params) => {
|
||||
if (noTrack) return;
|
||||
|
||||
const payload = {website, hostname, screen, language, cache: false};
|
||||
Object.keys(params).forEach(key => {
|
||||
payload[key] = params[key];
|
||||
});
|
||||
|
||||
post(`${root}/api/collect`, {type, payload});
|
||||
};
|
||||
|
||||
collect("pageview", {url, referrer});
|
||||
window.track = (event_type = "reach", event_value = "") => collect("event", {event_type, event_value, url});
|
||||
})(window);
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
import RgbQuant from "rgbquant";
|
||||
|
||||
import {heightmapTemplates} from "config/heightmap-templates";
|
||||
import {createTypedArray, last} from "utils/arrayUtils";
|
||||
import {getColorScheme, getHeightColor} from "utils/colorUtils";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue