daily-color 1.3.0 → 2.0.0
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.
- package/CHANGELOG.md +18 -0
- package/README.md +10 -3
- package/bin/dailycolor.js +1 -1
- package/dist/daily-color.js +1 -1
- package/index.html +5 -4
- package/index.js +1 -3
- package/package.json +2 -1
- package/webpack.config.js +12 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.0.0](https://github.com/aimeerivers/daily-color/compare/v1.3.1...v2.0.0) (2024-11-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* Importing with `require` will no longer work. Instead use `import { getDailyColor } from "daily-color";`
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* Convert to ES module ([#15](https://github.com/aimeerivers/daily-color/issues/15)) ([0444973](https://github.com/aimeerivers/daily-color/commit/04449739647216ddda101b5fdd4b3c7be2e0a662))
|
|
13
|
+
|
|
14
|
+
## [1.3.1](https://github.com/aimeerivers/daily-color/compare/v1.3.0...v1.3.1) (2024-11-09)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* Make the text stand out slightly better on the demo page ([#13](https://github.com/aimeerivers/daily-color/issues/13)) ([f1a61bc](https://github.com/aimeerivers/daily-color/commit/f1a61bcadb0cab38d89a152b2886226e7c8e53cd))
|
|
20
|
+
|
|
3
21
|
## [1.3.0](https://github.com/aimeerivers/daily-color/compare/v1.2.0...v1.3.0) (2024-11-09)
|
|
4
22
|
|
|
5
23
|
|
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ Provides a unique hex code each day
|
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
+
Install from [npmjs.com/package/daily-color](https://www.npmjs.com/package/daily-color):
|
|
8
|
+
|
|
7
9
|
```bash
|
|
8
10
|
npm install daily-color
|
|
9
11
|
```
|
|
@@ -13,7 +15,7 @@ npm install daily-color
|
|
|
13
15
|
In a JavaScript/TypeScript project, using NPM:
|
|
14
16
|
|
|
15
17
|
```javascript
|
|
16
|
-
|
|
18
|
+
import { getDailyColor } from "daily-color";
|
|
17
19
|
|
|
18
20
|
console.log("Today's color is:", getDailyColor());
|
|
19
21
|
```
|
|
@@ -21,8 +23,9 @@ console.log("Today's color is:", getDailyColor());
|
|
|
21
23
|
Directly loading the bundled JavaScript, for static projects not using NPM:
|
|
22
24
|
|
|
23
25
|
```html
|
|
24
|
-
<script
|
|
25
|
-
|
|
26
|
+
<script type="module">
|
|
27
|
+
import { getDailyColor } from "https://www.aimeerivers.com/daily-color/dist/daily-color.js";
|
|
28
|
+
|
|
26
29
|
console.log("Today's color is:", getDailyColor());
|
|
27
30
|
</script>
|
|
28
31
|
```
|
|
@@ -33,6 +36,10 @@ Using the CLI:
|
|
|
33
36
|
dailycolor
|
|
34
37
|
```
|
|
35
38
|
|
|
39
|
+
Just want to see today's color?
|
|
40
|
+
|
|
41
|
+
There is a demo on [www.aimeerivers.com/daily-color](https://www.aimeerivers.com/daily-color/)
|
|
42
|
+
|
|
36
43
|
## Development
|
|
37
44
|
|
|
38
45
|
Install dependencies:
|
package/bin/dailycolor.js
CHANGED
package/dist/daily-color.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var t={d:(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function r(){const t=function(t){const e=t.getDate(),r=t.getMonth()+1,o=`${t.getFullYear()}-${r}-${e}`;let a=0;for(let t=0;t<o.length;t++)a=(a<<5)-a+o.charCodeAt(t),a|=0;return Math.abs(a)}(new Date),e=t>>8&255,r=255&t;return`#${(t>>16&255).toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}t.d(e,{x:()=>r});var o=e.x;export{o as getDailyColor};
|
package/index.html
CHANGED
|
@@ -20,18 +20,19 @@
|
|
|
20
20
|
text-align: center;
|
|
21
21
|
}
|
|
22
22
|
#color.light {
|
|
23
|
-
text-shadow: 0 0 0.4em rgba(0, 0, 0, 0.
|
|
23
|
+
text-shadow: 0 0 0.4em rgba(0, 0, 0, 0.5);
|
|
24
24
|
}
|
|
25
25
|
#color.dark {
|
|
26
|
-
text-shadow: 0 0 0.4em rgba(255, 255, 255, 0.
|
|
26
|
+
text-shadow: 0 0 0.4em rgba(255, 255, 255, 0.5);
|
|
27
27
|
}
|
|
28
28
|
</style>
|
|
29
29
|
</head>
|
|
30
30
|
|
|
31
31
|
<body>
|
|
32
32
|
<div id="color"></div>
|
|
33
|
-
<script
|
|
34
|
-
|
|
33
|
+
<script type="module">
|
|
34
|
+
import { getDailyColor } from "https://www.aimeerivers.com/daily-color/dist/daily-color.js";
|
|
35
|
+
|
|
35
36
|
const color = getDailyColor();
|
|
36
37
|
const colorDiv = document.getElementById("color");
|
|
37
38
|
document.body.style.backgroundColor = color;
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "daily-color",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Provides a unique hex code each day",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"color",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"type": "git",
|
|
24
24
|
"url": "git+https://github.com/aimeerivers/daily-color.git"
|
|
25
25
|
},
|
|
26
|
+
"type": "module",
|
|
26
27
|
"scripts": {
|
|
27
28
|
"format": "prettier --write .",
|
|
28
29
|
"format:check": "prettier --check .",
|
package/webpack.config.js
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = path.dirname(__filename);
|
|
6
|
+
|
|
7
|
+
export default {
|
|
4
8
|
entry: "./index.js",
|
|
5
9
|
output: {
|
|
6
10
|
path: path.resolve(__dirname, "dist"),
|
|
7
11
|
filename: "daily-color.js",
|
|
8
|
-
library:
|
|
9
|
-
|
|
12
|
+
library: {
|
|
13
|
+
type: "module",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
experiments: {
|
|
17
|
+
outputModule: true,
|
|
10
18
|
},
|
|
11
19
|
mode: "production",
|
|
12
20
|
};
|