@bravotango/circadian-current-conditions 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,5 +19,8 @@ export const currentConditions = (tokens) => {
|
|
|
19
19
|
// Wind
|
|
20
20
|
cssVars[`${cssPrefix}-wind-speed`] = windSpeedToDuration(tokens.wind.speed);
|
|
21
21
|
cssVars[`${cssPrefix}-wind-speed-text`] = tokens.wind.speed.toString();
|
|
22
|
+
cssVars[`${cssPrefix}-wind-precipitation-degrees`] =
|
|
23
|
+
`${tokens.wind.precipitationDegree.toString()}deg`;
|
|
24
|
+
cssVars[`${cssPrefix}-wind-degrees`] = `${tokens.wind.degrees.toString()}deg`;
|
|
22
25
|
return cssVars;
|
|
23
26
|
};
|
package/dist/skin/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
// circadian-current-conditions/src/skin/index.ts
|
|
1
2
|
import { currentConditions } from "../maps/current-conditions";
|
|
2
3
|
export const currentConditionsSkin = {
|
|
3
4
|
apply(tokens) {
|
|
5
|
+
// console.log("SKIN RECEIVED:", tokens.wind);
|
|
4
6
|
const vars = currentConditions(tokens);
|
|
7
|
+
// console.log("CSS VARS:", vars);
|
|
5
8
|
Object.entries(vars).forEach(([key, value]) => {
|
|
6
9
|
document.documentElement.style.setProperty(key, value);
|
|
7
10
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const TIME_OF_DAY_COLOR_MAP = {
|
|
2
|
-
day: { clear: "#3987fc", default: "#
|
|
2
|
+
day: { clear: "#3987fc", default: "#9ea1bb" },
|
|
3
3
|
night: { clear: "#0a2b4d", default: "#141414" },
|
|
4
|
-
sunrise: { clear: "#d64400", default: "#
|
|
5
|
-
sunset: { clear: "#6f00d6", default: "#
|
|
4
|
+
sunrise: { clear: "#d64400", default: "#bb7758" },
|
|
5
|
+
sunset: { clear: "#6f00d6", default: "#7a688a" },
|
|
6
6
|
};
|
|
7
7
|
export const getTimeOfDayColor = (timeOfDay, condition) => {
|
|
8
8
|
const entry = TIME_OF_DAY_COLOR_MAP[timeOfDay];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bravotango/circadian-current-conditions",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"description": "",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"author": "",
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@bravotango/circadian-ui": "0.
|
|
11
|
+
"@bravotango/circadian-ui": "0.2.0"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@types/jest": "^30.0.0",
|
package/src/index.ts
CHANGED
|
@@ -40,6 +40,8 @@ export const currentConditions = (
|
|
|
40
40
|
// Wind
|
|
41
41
|
cssVars[`${cssPrefix}-wind-speed`] = windSpeedToDuration(tokens.wind.speed);
|
|
42
42
|
cssVars[`${cssPrefix}-wind-speed-text`] = tokens.wind.speed.toString();
|
|
43
|
+
cssVars[`${cssPrefix}-wind-precipitation-degrees`] =
|
|
44
|
+
`${tokens.wind.precipitationDegree.toString()}deg`;
|
|
43
45
|
cssVars[`${cssPrefix}-wind-degrees`] = `${tokens.wind.degrees.toString()}deg`;
|
|
44
46
|
|
|
45
47
|
return cssVars;
|
package/src/skin/index.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
// circadian-current-conditions/src/skin/index.ts
|
|
1
2
|
import { currentConditions } from "../maps/current-conditions";
|
|
2
3
|
import type { CircadianSkin } from "../types";
|
|
3
4
|
|
|
4
5
|
export const currentConditionsSkin: CircadianSkin = {
|
|
5
6
|
apply(tokens) {
|
|
7
|
+
// console.log("SKIN RECEIVED:", tokens.wind);
|
|
6
8
|
const vars = currentConditions(tokens);
|
|
9
|
+
// console.log("CSS VARS:", vars);
|
|
7
10
|
Object.entries(vars).forEach(([key, value]) => {
|
|
8
11
|
document.documentElement.style.setProperty(key, value);
|
|
9
12
|
});
|
package/src/utils/time-of-day.ts
CHANGED
|
@@ -4,10 +4,10 @@ export const TIME_OF_DAY_COLOR_MAP: Record<
|
|
|
4
4
|
TimeOfDay,
|
|
5
5
|
{ clear: string; default: string }
|
|
6
6
|
> = {
|
|
7
|
-
day: { clear: "#3987fc", default: "#
|
|
7
|
+
day: { clear: "#3987fc", default: "#9ea1bb" },
|
|
8
8
|
night: { clear: "#0a2b4d", default: "#141414" },
|
|
9
|
-
sunrise: { clear: "#d64400", default: "#
|
|
10
|
-
sunset: { clear: "#6f00d6", default: "#
|
|
9
|
+
sunrise: { clear: "#d64400", default: "#bb7758" },
|
|
10
|
+
sunset: { clear: "#6f00d6", default: "#7a688a" },
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const getTimeOfDayColor = (
|