MCPcopy
hub / github.com/kyechan99/capsule-render / randomizedByTime

Function randomizedByTime

utils/setting.ts:71–85  ·  view source on GitHub ↗
(colorData: any, fontColor?: string)

Source from the content-addressed store, hash-verified

69};
70
71const randomizedByTime = (colorData: any, fontColor?: string) => {
72 const buildDate = new Date("Wed Jul 22 2020 17:00:00");
73 const nowDate = new Date();
74 nowDate.setSeconds(0);
75 nowDate.setMilliseconds(0);
76
77 let diffMinute = Math.abs(nowDate.getTime() - buildDate.getTime()) / 60000;
78 if (diffMinute >= colorData.length) diffMinute %= colorData.length;
79
80 return [
81 colorData[diffMinute].color,
82 fontColor ? fontColor : colorData[diffMinute].text,
83 colorData[diffMinute].textBg,
84 ];
85};
86
87export const checkReversal = (reversal: string | boolean) => {
88 if (reversal === "true" || reversal === true) {

Callers 1

generateAutoByTimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected