Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a night theme for gitblock #85

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
349 changes: 348 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ exports.aggregateUserInfo = aggregateUserInfo;
"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.GitBlockSettings = exports.NightRainbowSettings = exports.NightGreenSettings = exports.NightViewSettings = exports.SouthSeasonSettings = exports.NorthSeasonSettings = exports.HalloweenSettings = exports.NormalSettings = void 0;
exports.GitBlockNightSettings = exports.GitBlockSettings = exports.NightRainbowSettings = exports.NightGreenSettings = exports.NightViewSettings = exports.SouthSeasonSettings = exports.NorthSeasonSettings = exports.HalloweenSettings = exports.NormalSettings = void 0;
exports.NormalSettings = {
type: 'normal',
backgroundColor: '#ffffff',
Expand Down Expand Up @@ -531,6 +531,351 @@ exports.GitBlockSettings = {
},
],
};
exports.GitBlockNightSettings = {
type: 'bitmap',
backgroundColor: '#00000f',
foregroundColor: '#eeeeff',
strongColor: 'rgb(255,200,55)',
weakColor: '#aaaaaa',
radarColor: 'rgb(255,200,55)',
contribPatterns: [
{
top: {
backgroundColor: '#f8f8f8',
foregroundColor: '#aaaaaa',
width: 32,
bitmap: [
0,
0,
29360576,
103810608,
168299016,
302518792,
285479172,
293867908,
314839748,
225971576,
178784936,
122685264,
31457760,
0,
0,
0,
],
},
left: {
width: 32,
bitmap: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2863311530,
],
},
right: {
width: 32,
bitmap: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2863311530,
],
},
},
{
top: {
backgroundColor: 'hsl(125, 52%, 50%)',
foregroundColor: 'hsl(125, 52%, 10%)',
width: 32,
bitmap: [
0,
0,
29360576,
103810608,
168299016,
302518792,
285479172,
293867908,
314839748,
225971576,
178784936,
122685264,
31457760,
0,
0,
0,
],
},
left: {
width: 32,
bitmap: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2863311530,
],
},
right: {
width: 32,
bitmap: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2863311530,
],
},
},
{
top: {
backgroundColor: 'hsl(242, 100%, 65%)',
foregroundColor: 'hsl(242, 100%, 16%)',
width: 32,
bitmap: [
0,
0,
29360576,
103810608,
168299016,
302518792,
285479172,
293867908,
314839748,
225971576,
178784936,
122685264,
31457760,
0,
0,
0,
],
},
left: {
width: 32,
bitmap: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2863311530,
],
},
right: {
width: 32,
bitmap: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2863311530,
],
},
},
{
top: {
backgroundColor: 'hsl(48, 100%, 50%)',
foregroundColor: 'hsl(48, 100%, 15%)',
width: 32,
bitmap: [
0,
0,
29360576,
103810608,
168299016,
302518792,
285479172,
293867908,
314839748,
225971576,
178784936,
122685264,
31457760,
0,
0,
0,
],
},
left: {
width: 32,
bitmap: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2863311530,
],
},
right: {
width: 32,
bitmap: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2863311530,
],
},
},
{
top: {
backgroundColor: 'hsl(350, 100%, 50%)',
foregroundColor: 'hsl(350, 100%, 15%)',
width: 32,
bitmap: [
0,
0,
29360576,
103810608,
168299016,
302518792,
285479172,
293867908,
314839748,
225971576,
178784936,
122685264,
31457760,
0,
0,
0,
],
},
left: {
width: 32,
bitmap: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2863311530,
],
},
right: {
width: 32,
bitmap: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2863311530,
],
},
},
],
};
//# sourceMappingURL=color-template.js.map

/***/ }),
Expand Down Expand Up @@ -732,6 +1077,7 @@ const create3DContrib = (svg, userInfo, x, y, width, height, settings, isForcedA
const week = Math.floor(diffDate(startTime, cal.date.getTime()) / 7);
const baseX = offsetX + (week - dayOfWeek) * dx;
const baseY = offsetY + (week + dayOfWeek) * dy;
// ref. https://github.com/yoshi389111/github-profile-3d-contrib/issues/27
const calHeight = Math.log10(cal.contributionCount / 20 + 1) * 144 + 3;
const contribLevel = cal.contributionLevel;
const isAnimate = settings.growingAnimation || isForcedAnimation;
Expand Down Expand Up @@ -1530,6 +1876,7 @@ const main = async () => {
f.writeFile('profile-night-green.svg', create.createSvg(userInfo, template.NightGreenSettings, true));
f.writeFile('profile-night-rainbow.svg', create.createSvg(userInfo, template.NightRainbowSettings, true));
f.writeFile('profile-gitblock.svg', create.createSvg(userInfo, template.GitBlockSettings, true));
f.writeFile('profile-night-gitblock.svg', create.createSvg(userInfo, template.GitBlockNightSettings, true));
}
}
catch (error) {
Expand Down
Loading