musify 1.0.1
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/LICENSE +21 -0
- package/README.md +191 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/renderers/glassRenderer.d.ts +3 -0
- package/dist/renderers/glassRenderer.d.ts.map +1 -0
- package/dist/renderers/glassRenderer.js +191 -0
- package/dist/renderers/glassRenderer.js.map +1 -0
- package/dist/types/index.d.ts +41 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/backgroundProcessor.d.ts +3 -0
- package/dist/utils/backgroundProcessor.d.ts.map +1 -0
- package/dist/utils/backgroundProcessor.js +33 -0
- package/dist/utils/backgroundProcessor.js.map +1 -0
- package/dist/utils/colorExtractor.d.ts +3 -0
- package/dist/utils/colorExtractor.d.ts.map +1 -0
- package/dist/utils/colorExtractor.js +78 -0
- package/dist/utils/colorExtractor.js.map +1 -0
- package/dist/utils/fontManager.d.ts +3 -0
- package/dist/utils/fontManager.d.ts.map +1 -0
- package/dist/utils/fontManager.js +57 -0
- package/dist/utils/fontManager.js.map +1 -0
- package/dist/utils/textProcessor.d.ts +7 -0
- package/dist/utils/textProcessor.d.ts.map +1 -0
- package/dist/utils/textProcessor.js +60 -0
- package/dist/utils/textProcessor.js.map +1 -0
- package/package.json +54 -0
- package/src/fonts/PlusJakartaSans-Bold.ttf +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Musify
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Musify
|
|
2
|
+
|
|
3
|
+
A professional, high-performance music card generator for Discord bots. Optimized for use with Riffy and other music libraries.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🎨 **Glass Design**: Clean, modern music card layout
|
|
8
|
+
- 🎯 **Auto Color Extraction**: Automatically extracts colors from thumbnails
|
|
9
|
+
- 🌟 **Background Effects**: Blur and darkness controls for background images
|
|
10
|
+
- 📏 **Scaling Support**: Flexible scaling for different use cases
|
|
11
|
+
- ⚡ **High Performance**: Optimized rendering with minimal memory usage
|
|
12
|
+
- 🔧 **TypeScript Support**: Full TypeScript definitions included
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install musify
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { Glass } from 'musify';
|
|
24
|
+
|
|
25
|
+
const Musify = await Glass({
|
|
26
|
+
thumbnailImage: 'https://example.com/thumbnail.jpg',
|
|
27
|
+
name: 'Song Title',
|
|
28
|
+
author: 'Artist Name',
|
|
29
|
+
requester: 'User#1234',
|
|
30
|
+
progress: 50,
|
|
31
|
+
startTime: '1:30',
|
|
32
|
+
endTime: '3:45'
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## API Reference
|
|
37
|
+
|
|
38
|
+
### Glass Function
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
Glass(options: MusifyOptions): Promise<Buffer>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Generates a glass music card and returns a PNG buffer.
|
|
45
|
+
|
|
46
|
+
### MusifyOptions
|
|
47
|
+
|
|
48
|
+
| Option | Type | Default | Description |
|
|
49
|
+
|--------|------|---------|-------------|
|
|
50
|
+
| `thumbnailImage` | `string` | - | URL or path to the thumbnail image |
|
|
51
|
+
| `name` | `string` | `'Musify'` | Song title |
|
|
52
|
+
| `author` | `string` | `'Unknown Artist'` | Artist name |
|
|
53
|
+
| `requester` | `string` | `'Unknown'` | User who requested the song |
|
|
54
|
+
| `progress` | `number` | `0` | Progress percentage (0-100) |
|
|
55
|
+
| `startTime` | `string` | `'0:00'` | Current time (MM:SS format) |
|
|
56
|
+
| `endTime` | `string` | `'0:00'` | Total duration (MM:SS format) |
|
|
57
|
+
| `scale` | `number` | `1` | Scale factor (0.5-2) |
|
|
58
|
+
| `backgroundBlur` | `number` | `10` | Background blur intensity (0-50) |
|
|
59
|
+
| `backgroundDarkness` | `number` | `0.9` | Background darkness (0-1) |
|
|
60
|
+
| `backgroundColor` | `string` | `'#1c1c1c'` | Fallback background color |
|
|
61
|
+
| `nameColor` | `string` | `'#FF7A00'` | Title color (supports 'auto') |
|
|
62
|
+
| `authorColor` | `string` | `'#FFFFFF'` | Author text color |
|
|
63
|
+
| `requesterColor` | `string` | `'#FF7A00'` | Requester text color |
|
|
64
|
+
| `progressColor` | `string` | `'#FF7A00'` | Progress bar color |
|
|
65
|
+
| `timeColor` | `string` | `'#FFFFFF'` | Time labels color |
|
|
66
|
+
|
|
67
|
+
## Advanced Usage
|
|
68
|
+
|
|
69
|
+
### Auto Color Extraction
|
|
70
|
+
|
|
71
|
+
The package can automatically extract colors from thumbnails:
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
const Musify = await Glass({
|
|
75
|
+
thumbnailImage: 'https://example.com/thumbnail.jpg',
|
|
76
|
+
nameColor: 'auto', // Uses extracted color
|
|
77
|
+
progressColor: 'auto', // Uses extracted color
|
|
78
|
+
// ... other options
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Background Effects
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
const Musify = await Glass({
|
|
86
|
+
thumbnailImage: 'https://example.com/thumbnail.jpg',
|
|
87
|
+
backgroundImage: 'https://example.com/background.jpg',
|
|
88
|
+
backgroundBlur: 15, // Blur intensity
|
|
89
|
+
backgroundDarkness: 0.8, // Darkness level
|
|
90
|
+
// ... other options
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Scaling
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
const Musify = await Glass({
|
|
98
|
+
thumbnailImage: 'https://example.com/thumbnail.jpg',
|
|
99
|
+
scale: 1.5, // 50% larger
|
|
100
|
+
// ... other options
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Integration with Riffy
|
|
105
|
+
|
|
106
|
+
Perfect integration with Riffy music library:
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
import { Glass } from 'musify';
|
|
110
|
+
|
|
111
|
+
client.riffy.on('trackStart', async (player, track) => {
|
|
112
|
+
const Musify = await Glass({
|
|
113
|
+
thumbnailImage: track.info.thumbnail,
|
|
114
|
+
name: track.info.title,
|
|
115
|
+
author: track.info.author,
|
|
116
|
+
requester: track.info.requester.username,
|
|
117
|
+
progress: 0,
|
|
118
|
+
startTime: '0:00',
|
|
119
|
+
endTime: formatTime(track.info.length / 1000),
|
|
120
|
+
scale: 1.2
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
// Send to Discord channel
|
|
124
|
+
await channel.send({
|
|
125
|
+
files: [{ attachment: Musify, name: 'music.png' }]
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Performance Tips
|
|
131
|
+
|
|
132
|
+
1. **Reuse Options**: Create a base options object and extend it for different tracks
|
|
133
|
+
2. **Cache Results**: Cache generated cards for repeated use
|
|
134
|
+
3. **Optimize Images**: Use appropriately sized thumbnails (recommended: 300x300)
|
|
135
|
+
4. **Batch Processing**: Process multiple cards in parallel when possible
|
|
136
|
+
|
|
137
|
+
## Error Handling
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
try {
|
|
141
|
+
const Musify = await Glass(options);
|
|
142
|
+
// Use the music card
|
|
143
|
+
} catch (error) {
|
|
144
|
+
console.error('Failed to generate Musify card:', error.message);
|
|
145
|
+
// Handle error gracefully
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Development
|
|
150
|
+
|
|
151
|
+
### Building
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
npm run build
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Development Mode
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npm run dev
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Clean Build
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
npm run clean
|
|
167
|
+
npm run build
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## License
|
|
171
|
+
|
|
172
|
+
MIT License - see LICENSE file for details.
|
|
173
|
+
|
|
174
|
+
## Contributing
|
|
175
|
+
|
|
176
|
+
1. Fork the repository
|
|
177
|
+
2. Create a feature branch
|
|
178
|
+
3. Make your changes
|
|
179
|
+
4. Add tests if applicable
|
|
180
|
+
5. Submit a pull request
|
|
181
|
+
|
|
182
|
+
## Support
|
|
183
|
+
|
|
184
|
+
For support and questions:
|
|
185
|
+
- Open an issue on GitHub
|
|
186
|
+
- Check the documentation
|
|
187
|
+
- Review the examples
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
Made with ❤️ for the Discord bots community
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MusifyOptions } from './types';
|
|
2
|
+
export declare function Glass(options: MusifyOptions): Promise<Buffer>;
|
|
3
|
+
export type { MusifyOptions } from './types';
|
|
4
|
+
export { extractColors } from './utils/colorExtractor';
|
|
5
|
+
export { createBlurredBackground } from './utils/backgroundProcessor';
|
|
6
|
+
export { formatTime, truncateText } from './utils/textProcessor';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA4BxC,wBAAsB,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAUnE;AAGD,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.truncateText = exports.formatTime = exports.createBlurredBackground = exports.extractColors = void 0;
|
|
4
|
+
exports.Glass = Glass;
|
|
5
|
+
const glassRenderer_1 = require("./renderers/glassRenderer");
|
|
6
|
+
const textProcessor_1 = require("./utils/textProcessor");
|
|
7
|
+
async function Glass(options) {
|
|
8
|
+
try {
|
|
9
|
+
const validatedOptions = (0, textProcessor_1.validateOptions)(options);
|
|
10
|
+
return await (0, glassRenderer_1.renderGlass)(validatedOptions);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
throw new Error(`Musify Glass generation failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
var colorExtractor_1 = require("./utils/colorExtractor");
|
|
17
|
+
Object.defineProperty(exports, "extractColors", { enumerable: true, get: function () { return colorExtractor_1.extractColors; } });
|
|
18
|
+
var backgroundProcessor_1 = require("./utils/backgroundProcessor");
|
|
19
|
+
Object.defineProperty(exports, "createBlurredBackground", { enumerable: true, get: function () { return backgroundProcessor_1.createBlurredBackground; } });
|
|
20
|
+
var textProcessor_2 = require("./utils/textProcessor");
|
|
21
|
+
Object.defineProperty(exports, "formatTime", { enumerable: true, get: function () { return textProcessor_2.formatTime; } });
|
|
22
|
+
Object.defineProperty(exports, "truncateText", { enumerable: true, get: function () { return textProcessor_2.truncateText; } });
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AA4BA,sBAUC;AArCD,6DAAwD;AACxD,yDAAwD;AA0BjD,KAAK,UAAU,KAAK,CAAC,OAAsB;IAChD,IAAI,CAAC;QAEH,MAAM,gBAAgB,GAAG,IAAA,+BAAe,EAAC,OAAO,CAAC,CAAC;QAGlD,OAAO,MAAM,IAAA,2BAAW,EAAC,gBAAgB,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,mCAAmC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC;IACjH,CAAC;AACH,CAAC;AAMD,yDAAuD;AAA9C,+GAAA,aAAa,OAAA;AACtB,mEAAsE;AAA7D,8HAAA,uBAAuB,OAAA;AAChC,uDAAiE;AAAxD,2GAAA,UAAU,OAAA;AAAE,6GAAA,YAAY,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glassRenderer.d.ts","sourceRoot":"","sources":["../../src/renderers/glassRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AASzC,wBAAsB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAoDzE"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderGlass = renderGlass;
|
|
4
|
+
const canvas_1 = require("@napi-rs/canvas");
|
|
5
|
+
const colorExtractor_1 = require("../utils/colorExtractor");
|
|
6
|
+
const backgroundProcessor_1 = require("../utils/backgroundProcessor");
|
|
7
|
+
const textProcessor_1 = require("../utils/textProcessor");
|
|
8
|
+
const fontManager_1 = require("../utils/fontManager");
|
|
9
|
+
async function renderGlass(options) {
|
|
10
|
+
try {
|
|
11
|
+
(0, fontManager_1.registerFonts)();
|
|
12
|
+
let autoColor = '#FF7A00';
|
|
13
|
+
if (options.thumbnailImage) {
|
|
14
|
+
const colors = await (0, colorExtractor_1.extractColors)(options.thumbnailImage);
|
|
15
|
+
autoColor = colors.color1;
|
|
16
|
+
}
|
|
17
|
+
const processedOptions = {
|
|
18
|
+
...options,
|
|
19
|
+
nameColor: options.nameColor || autoColor,
|
|
20
|
+
progressColor: options.progressColor || autoColor,
|
|
21
|
+
authorColor: options.authorColor || '#FFFFFF',
|
|
22
|
+
timeColor: options.timeColor || '#FFFFFF',
|
|
23
|
+
requesterColor: options.requesterColor || autoColor
|
|
24
|
+
};
|
|
25
|
+
const scale = options.scale || 1;
|
|
26
|
+
const CANVAS_W = 400 * scale;
|
|
27
|
+
const CANVAS_H = 100 * scale;
|
|
28
|
+
const canvas = (0, canvas_1.createCanvas)(CANVAS_W, CANVAS_H);
|
|
29
|
+
const ctx = canvas.getContext('2d');
|
|
30
|
+
await drawBackground(ctx, processedOptions, CANVAS_W, CANVAS_H);
|
|
31
|
+
const thumbnail = await loadThumbnail(processedOptions);
|
|
32
|
+
await drawThumbnail(ctx, thumbnail, scale);
|
|
33
|
+
await drawTextElements(ctx, processedOptions, scale);
|
|
34
|
+
drawProgressBar(ctx, processedOptions, scale);
|
|
35
|
+
drawTimeLabels(ctx, processedOptions, scale);
|
|
36
|
+
applyRoundedCorners(ctx, canvas, CANVAS_W, CANVAS_H);
|
|
37
|
+
return canvas.toBuffer('image/png');
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
throw new Error(`Failed to render Musify card: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async function drawBackground(ctx, options, width, height) {
|
|
44
|
+
if (options.backgroundImage) {
|
|
45
|
+
try {
|
|
46
|
+
const blurredBackground = await (0, backgroundProcessor_1.createBlurredBackground)(options.backgroundImage, options.backgroundBlur || 20, options.backgroundDarkness || 0.8);
|
|
47
|
+
if (blurredBackground) {
|
|
48
|
+
const backgroundImage = await (0, canvas_1.loadImage)(blurredBackground);
|
|
49
|
+
ctx.filter = 'blur(20px)';
|
|
50
|
+
ctx.drawImage(backgroundImage, 0, 0, width, height);
|
|
51
|
+
ctx.filter = 'none';
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
console.error('[Musify] Background image processing failed:', error);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
ctx.fillStyle = options.backgroundColor || '#1c1c1c';
|
|
60
|
+
ctx.fillRect(0, 0, width, height);
|
|
61
|
+
}
|
|
62
|
+
async function loadThumbnail(options) {
|
|
63
|
+
const noImageSvg = (0, backgroundProcessor_1.generateFallbackSVG)(options.progressColor || '#FF7A00');
|
|
64
|
+
const thumbnailImage = options.thumbnailImage || noImageSvg;
|
|
65
|
+
try {
|
|
66
|
+
return await (0, canvas_1.loadImage)(thumbnailImage);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
try {
|
|
70
|
+
return await (0, canvas_1.loadImage)(noImageSvg);
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
const fallbackCanvas = (0, canvas_1.createCanvas)(80, 80);
|
|
74
|
+
const fallbackCtx = fallbackCanvas.getContext('2d');
|
|
75
|
+
fallbackCtx.fillStyle = options.progressColor || '#FF7A00';
|
|
76
|
+
fallbackCtx.fillRect(0, 0, 80, 80);
|
|
77
|
+
return fallbackCanvas;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function drawThumbnail(ctx, thumbnail, scale) {
|
|
82
|
+
const thumbW = 90 * scale;
|
|
83
|
+
const thumbH = 85 * scale;
|
|
84
|
+
const thumbX = 10 * scale;
|
|
85
|
+
const thumbY = (100 * scale - thumbH) / 2;
|
|
86
|
+
ctx.save();
|
|
87
|
+
ctx.beginPath();
|
|
88
|
+
ctx.moveTo(thumbX + 10 * scale, thumbY);
|
|
89
|
+
ctx.lineTo(thumbX + thumbW - 10 * scale, thumbY);
|
|
90
|
+
ctx.quadraticCurveTo(thumbX + thumbW, thumbY, thumbX + thumbW, thumbY + 10 * scale);
|
|
91
|
+
ctx.lineTo(thumbX + thumbW, thumbY + thumbH - 10 * scale);
|
|
92
|
+
ctx.quadraticCurveTo(thumbX + thumbW, thumbY + thumbH, thumbX + thumbW - 10 * scale, thumbY + thumbH);
|
|
93
|
+
ctx.lineTo(thumbX + 10 * scale, thumbY + thumbH);
|
|
94
|
+
ctx.quadraticCurveTo(thumbX, thumbY + thumbH, thumbX, thumbY + thumbH - 10 * scale);
|
|
95
|
+
ctx.lineTo(thumbX, thumbY + 10 * scale);
|
|
96
|
+
ctx.quadraticCurveTo(thumbX, thumbY, thumbX + 10 * scale, thumbY);
|
|
97
|
+
ctx.closePath();
|
|
98
|
+
ctx.clip();
|
|
99
|
+
ctx.drawImage(thumbnail, thumbX, thumbY, thumbW, thumbH);
|
|
100
|
+
ctx.restore();
|
|
101
|
+
}
|
|
102
|
+
async function drawTextElements(ctx, options, scale) {
|
|
103
|
+
const textX = 110 * scale;
|
|
104
|
+
const titleY = 25 * scale;
|
|
105
|
+
ctx.font = `bold ${17 * scale}px PoppinsBold`;
|
|
106
|
+
ctx.fillStyle = options.nameColor || '#FF7A00';
|
|
107
|
+
ctx.shadowColor = 'rgba(0, 0, 0, 0.8)';
|
|
108
|
+
ctx.shadowBlur = 4 * scale;
|
|
109
|
+
ctx.shadowOffsetX = 2 * scale;
|
|
110
|
+
ctx.shadowOffsetY = 2 * scale;
|
|
111
|
+
ctx.fillText((0, textProcessor_1.truncateText)(options.name || 'Musify', 28).toUpperCase(), textX, titleY, 280 * scale);
|
|
112
|
+
ctx.font = `bold ${10 * scale}px PoppinsBold`;
|
|
113
|
+
ctx.fillStyle = options.authorColor || '#FFFFFF';
|
|
114
|
+
ctx.shadowColor = 'rgba(0, 0, 0, 0.8)';
|
|
115
|
+
ctx.shadowBlur = 3 * scale;
|
|
116
|
+
ctx.shadowOffsetX = 1.5 * scale;
|
|
117
|
+
ctx.shadowOffsetY = 1.5 * scale;
|
|
118
|
+
ctx.fillText((0, textProcessor_1.truncateText)(options.author || 'Unknown Artist', 30), textX, 46 * scale, 280 * scale);
|
|
119
|
+
ctx.font = `bold ${10 * scale}px PoppinsBold`;
|
|
120
|
+
ctx.fillStyle = options.requesterColor || '#FF7A00';
|
|
121
|
+
ctx.shadowColor = 'rgba(0, 0, 0, 0.8)';
|
|
122
|
+
ctx.shadowBlur = 3 * scale;
|
|
123
|
+
ctx.shadowOffsetX = 1.5 * scale;
|
|
124
|
+
ctx.shadowOffsetY = 1.5 * scale;
|
|
125
|
+
ctx.fillText((0, textProcessor_1.truncateText)(options.requester || 'Unknown', 28), textX, 63 * scale, 280 * scale);
|
|
126
|
+
ctx.shadowColor = 'transparent';
|
|
127
|
+
ctx.shadowBlur = 0;
|
|
128
|
+
ctx.shadowOffsetX = 0;
|
|
129
|
+
ctx.shadowOffsetY = 0;
|
|
130
|
+
}
|
|
131
|
+
function drawProgressBar(ctx, options, scale) {
|
|
132
|
+
const totalWidth = 240 * scale;
|
|
133
|
+
const completed = totalWidth * (options.progress || 0) / 100;
|
|
134
|
+
const progressBarHeight = 3 * scale;
|
|
135
|
+
const progressBarY = 80 * scale;
|
|
136
|
+
const progressBarX = 130 * scale;
|
|
137
|
+
ctx.save();
|
|
138
|
+
ctx.globalAlpha = 0.55;
|
|
139
|
+
ctx.beginPath();
|
|
140
|
+
ctx.roundRect(progressBarX, progressBarY, totalWidth, progressBarHeight, progressBarHeight / 2);
|
|
141
|
+
ctx.fillStyle = '#222';
|
|
142
|
+
ctx.fill();
|
|
143
|
+
ctx.restore();
|
|
144
|
+
ctx.save();
|
|
145
|
+
ctx.beginPath();
|
|
146
|
+
ctx.roundRect(progressBarX, progressBarY, completed, progressBarHeight, progressBarHeight / 2);
|
|
147
|
+
ctx.fillStyle = options.progressColor || '#FF7A00';
|
|
148
|
+
ctx.shadowColor = options.progressColor || '#FF7A00';
|
|
149
|
+
ctx.shadowBlur = 5;
|
|
150
|
+
ctx.fill();
|
|
151
|
+
ctx.restore();
|
|
152
|
+
}
|
|
153
|
+
function drawTimeLabels(ctx, options, scale) {
|
|
154
|
+
const progressBarX = 130 * scale;
|
|
155
|
+
const progressBarY = 80 * scale;
|
|
156
|
+
const totalWidth = 240 * scale;
|
|
157
|
+
ctx.font = `${8 * scale}px PoppinsBold`;
|
|
158
|
+
ctx.fillStyle = options.timeColor || '#FFFFFF';
|
|
159
|
+
ctx.shadowColor = 'rgba(0, 0, 0, 0.8)';
|
|
160
|
+
ctx.shadowBlur = 2 * scale;
|
|
161
|
+
ctx.shadowOffsetX = 1 * scale;
|
|
162
|
+
ctx.shadowOffsetY = 1 * scale;
|
|
163
|
+
ctx.fillText(options.startTime || '0:00', progressBarX - 20 * scale, progressBarY + 4 * scale);
|
|
164
|
+
ctx.fillText(options.endTime || '0:00', progressBarX + totalWidth + 5 * scale, progressBarY + 4 * scale);
|
|
165
|
+
ctx.shadowColor = 'transparent';
|
|
166
|
+
ctx.shadowBlur = 0;
|
|
167
|
+
ctx.shadowOffsetX = 0;
|
|
168
|
+
ctx.shadowOffsetY = 0;
|
|
169
|
+
}
|
|
170
|
+
function applyRoundedCorners(ctx, canvas, width, height) {
|
|
171
|
+
const tempCanvas = (0, canvas_1.createCanvas)(width, height);
|
|
172
|
+
const tempCtx = tempCanvas.getContext('2d');
|
|
173
|
+
tempCtx.drawImage(canvas, 0, 0);
|
|
174
|
+
ctx.clearRect(0, 0, width, height);
|
|
175
|
+
ctx.save();
|
|
176
|
+
ctx.beginPath();
|
|
177
|
+
ctx.moveTo(5, 0);
|
|
178
|
+
ctx.lineTo(width - 5, 0);
|
|
179
|
+
ctx.quadraticCurveTo(width, 0, width, 5);
|
|
180
|
+
ctx.lineTo(width, height - 5);
|
|
181
|
+
ctx.quadraticCurveTo(width, height, width - 5, height);
|
|
182
|
+
ctx.lineTo(5, height);
|
|
183
|
+
ctx.quadraticCurveTo(0, height, 0, height - 5);
|
|
184
|
+
ctx.lineTo(0, 5);
|
|
185
|
+
ctx.quadraticCurveTo(0, 0, 5, 0);
|
|
186
|
+
ctx.closePath();
|
|
187
|
+
ctx.clip();
|
|
188
|
+
ctx.drawImage(tempCanvas, 0, 0);
|
|
189
|
+
ctx.restore();
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=glassRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glassRenderer.js","sourceR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AAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;IACvD,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,GAAG,CAAC,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/C,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACjB,GAAG,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACjC,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,IAAI,EAAE,CAAC;IACX,GAAG,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAChC,GAAG,CAAC,OAAO,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface MusifyOptions {
|
|
2
|
+
thumbnailImage?: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
author?: string;
|
|
5
|
+
requester?: string;
|
|
6
|
+
backgroundColor?: string;
|
|
7
|
+
nameColor?: string;
|
|
8
|
+
authorColor?: string;
|
|
9
|
+
requesterColor?: string;
|
|
10
|
+
progressColor?: string;
|
|
11
|
+
progressBarColor?: string;
|
|
12
|
+
timeColor?: string;
|
|
13
|
+
progress?: number;
|
|
14
|
+
startTime?: string;
|
|
15
|
+
endTime?: string;
|
|
16
|
+
backgroundImage?: string;
|
|
17
|
+
backgroundBlur?: number;
|
|
18
|
+
backgroundDarkness?: number;
|
|
19
|
+
thumbnailWidth?: number;
|
|
20
|
+
thumbnailHeight?: number;
|
|
21
|
+
thumbnailBorderRadius?: number;
|
|
22
|
+
thumbnailX?: number;
|
|
23
|
+
thumbnailY?: number | "center";
|
|
24
|
+
scale?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ColorExtractionResult {
|
|
27
|
+
color1: string;
|
|
28
|
+
color2: string;
|
|
29
|
+
}
|
|
30
|
+
export interface CanvasDimensions {
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
}
|
|
34
|
+
export interface ThumbnailConfig {
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
borderRadius: number;
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAE5B,cAAc,CAAC,EAAE,MAAM,CAAC;IAGxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAG5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAG/B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backgroundProcessor.d.ts","sourceRoot":"","sources":["../../src/utils/backgroundProcessor.ts"],"names":[],"mappings":"AAKA,wBAAsB,uBAAuB,CAC3C,YAAY,EAAE,MAAM,EACpB,IAAI,GAAE,MAAW,EACjB,QAAQ,GAAE,MAAY,GACrB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkBxB;AAKD,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAKjE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createBlurredBackground = createBlurredBackground;
|
|
7
|
+
exports.generateFallbackSVG = generateFallbackSVG;
|
|
8
|
+
const sharp_1 = __importDefault(require("sharp"));
|
|
9
|
+
async function createBlurredBackground(thumbnailUrl, blur = 10, darkness = 0.9) {
|
|
10
|
+
try {
|
|
11
|
+
const response = await fetch(thumbnailUrl);
|
|
12
|
+
const imageBuffer = await response.arrayBuffer();
|
|
13
|
+
const blurredBuffer = await (0, sharp_1.default)(Buffer.from(imageBuffer))
|
|
14
|
+
.resize(1280, 450)
|
|
15
|
+
.blur(blur)
|
|
16
|
+
.modulate({
|
|
17
|
+
brightness: darkness
|
|
18
|
+
})
|
|
19
|
+
.toBuffer();
|
|
20
|
+
return blurredBuffer;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.error('Failed to create blurred background:', error);
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function generateFallbackSVG(progressColor) {
|
|
28
|
+
return `data:image/svg+xml;base64,${Buffer.from(`<svg width="837" height="837" viewBox="0 0 837 837" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
29
|
+
<rect width="837" height="837" fill="${progressColor}"/>
|
|
30
|
+
<path d="M419.324 635.912C406.035 635.912 394.658 631.18 385.195 621.717C375.732 612.254 371 600.878 371 587.589C371 574.3 375.732 562.923 385.195 553.46C394.658 543.997 406.035 539.265 419.324 539.265C432.613 539.265 443.989 543.997 453.452 553.46C462.915 562.923 467.647 574.3 467.647 587.589C467.647 600.878 462.915 612.254 453.452 621.717C443.989 631.18 432.613 635.912 419.324 635.912ZM371 490.941V201H467.647V490.941H371Z" fill="#1c1c1c"/>
|
|
31
|
+
</svg>`).toString('base64')}`;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=backgroundProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backgroundProcessor.js","sourceRoot":"","sources":["../../src/utils/backgroundProcessor.ts"],"names":[],"mappings":";;;;;AAKA,0DAsBC;AAKD,kDAKC;AArCD,kDAA0B;AAKnB,KAAK,UAAU,uBAAuB,CAC3C,YAAoB,EACpB,OAAe,EAAE,EACjB,WAAmB,GAAG;IAEtB,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,YAAY,CAAC,CAAC;QAC3C,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;QAEjD,MAAM,aAAa,GAAG,MAAM,IAAA,eAAK,EAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;aACxD,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC;aACjB,IAAI,CAAC,IAAI,CAAC;aACV,QAAQ,CAAC;YACR,UAAU,EAAE,QAAQ;SACrB,CAAC;aACD,QAAQ,EAAE,CAAC;QAEd,OAAO,aAAa,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAKD,SAAgB,mBAAmB,CAAC,aAAqB;IACvD,OAAO,6BAA6B,MAAM,CAAC,IAAI,CAAC;2CACP,aAAa;;WAE7C,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorExtractor.d.ts","sourceRoot":"","sources":["../../src/utils/colorExtractor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAKjD,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAmFrF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.extractColors = extractColors;
|
|
7
|
+
const sharp_1 = __importDefault(require("sharp"));
|
|
8
|
+
async function extractColors(imagePath) {
|
|
9
|
+
try {
|
|
10
|
+
let imageBuffer;
|
|
11
|
+
if (imagePath.startsWith('http')) {
|
|
12
|
+
const response = await fetch(imagePath);
|
|
13
|
+
imageBuffer = Buffer.from(await response.arrayBuffer());
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
imageBuffer = Buffer.from(imagePath);
|
|
17
|
+
}
|
|
18
|
+
const { data } = await (0, sharp_1.default)(imageBuffer)
|
|
19
|
+
.raw()
|
|
20
|
+
.toBuffer({ resolveWithObject: true });
|
|
21
|
+
const colors = [];
|
|
22
|
+
for (let i = 0; i < data.length - 2; i += 3) {
|
|
23
|
+
const r = data[i] / 255;
|
|
24
|
+
const g = data[i + 1] / 255;
|
|
25
|
+
const b = data[i + 2] / 255;
|
|
26
|
+
const max = Math.max(r, g, b);
|
|
27
|
+
const min = Math.min(r, g, b);
|
|
28
|
+
let h, s, l = (max + min) / 2;
|
|
29
|
+
if (max !== min) {
|
|
30
|
+
const d = max - min;
|
|
31
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
32
|
+
switch (max) {
|
|
33
|
+
case r:
|
|
34
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
35
|
+
break;
|
|
36
|
+
case g:
|
|
37
|
+
h = (b - r) / d + 2;
|
|
38
|
+
break;
|
|
39
|
+
case b:
|
|
40
|
+
h = (r - g) / d + 4;
|
|
41
|
+
break;
|
|
42
|
+
default: h = 0;
|
|
43
|
+
}
|
|
44
|
+
h /= 6;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
s = 0;
|
|
48
|
+
h = 0;
|
|
49
|
+
}
|
|
50
|
+
if (s > 0.15 && l > 0.2 && l < 0.8) {
|
|
51
|
+
colors.push({
|
|
52
|
+
r: Math.round(r * 255),
|
|
53
|
+
g: Math.round(g * 255),
|
|
54
|
+
b: Math.round(b * 255),
|
|
55
|
+
s,
|
|
56
|
+
l
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
colors.sort((a, b) => b.s - a.s);
|
|
61
|
+
const mainColor = colors[0] || { r: 255, g: 255, b: 255 };
|
|
62
|
+
const enhanceFactor = 1.6;
|
|
63
|
+
const enhancedColor = {
|
|
64
|
+
r: Math.min(255, Math.round(mainColor.r * enhanceFactor)),
|
|
65
|
+
g: Math.min(255, Math.round(mainColor.g * enhanceFactor)),
|
|
66
|
+
b: Math.min(255, Math.round(mainColor.b * enhanceFactor))
|
|
67
|
+
};
|
|
68
|
+
const color1 = `#${enhancedColor.r.toString(16).padStart(2, '0')}${enhancedColor.g.toString(16).padStart(2, '0')}${enhancedColor.b.toString(16).padStart(2, '0')}`;
|
|
69
|
+
const darkenFactor = 0.9;
|
|
70
|
+
const color2 = `#${Math.round(enhancedColor.r * darkenFactor).toString(16).padStart(2, '0')}${Math.round(enhancedColor.g * darkenFactor).toString(16).padStart(2, '0')}${Math.round(enhancedColor.b * darkenFactor).toString(16).padStart(2, '0')}`;
|
|
71
|
+
return { color1, color2 };
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
console.error('Color extraction failed:', error);
|
|
75
|
+
return { color1: '#ffffff', color2: '#e0e0e0' };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=colorExtractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorExtractor.js","sourceRoot":"","sources":["../../src/utils/colorExtractor.ts"],"names":[],"mappings":";;;;;AAMA,sCAmFC;AAzFD,kDAA0B;AAMnB,KAAK,UAAU,aAAa,CAAC,SAAiB;IACnD,IAAI,CAAC;QAEH,IAAI,WAAmB,CAAC;QACxB,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YACjC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC;YACxC,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QAC1D,CA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AAG,CAAC,EAAE,CAAC;QAE7E,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC5B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;QACjD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAClD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fontManager.d.ts","sourceRoot":"","sources":["../../src/utils/fontManager.ts"],"names":[],"mappings":"AAOA,wBAAgB,aAAa,IAAI,IAAI,CAuCpC;AAKD,wBAAgB,WAAW,CAAC,MAAM,GAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAmB,GAAG,MAAM,CAY/F"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerFonts = registerFonts;
|
|
7
|
+
exports.getFontName = getFontName;
|
|
8
|
+
const canvas_1 = require("@napi-rs/canvas");
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const fs_1 = __importDefault(require("fs"));
|
|
11
|
+
function registerFonts() {
|
|
12
|
+
try {
|
|
13
|
+
const fontPaths = {
|
|
14
|
+
'NotoSans': path_1.default.join(process.cwd(), 'src/assets/fonts/Helvetica-Bold.ttf'),
|
|
15
|
+
'Suisse': path_1.default.join(process.cwd(), 'src/assets/fonts/suisse.ttf'),
|
|
16
|
+
'PoppinsBold': path_1.default.join(process.cwd(), 'src/assets/fonts/Poppins-Bold.ttf'),
|
|
17
|
+
'PoppinsRegular': path_1.default.join(process.cwd(), 'src/assets/fonts/Poppins-Regular.ttf')
|
|
18
|
+
};
|
|
19
|
+
const plusJakartaFonts = [
|
|
20
|
+
'PlusJakartaSans-Bold.ttf',
|
|
21
|
+
'PlusJakartaSans-ExtraBold.ttf',
|
|
22
|
+
'PlusJakartaSans-ExtraLight.ttf',
|
|
23
|
+
'PlusJakartaSans-Light.ttf',
|
|
24
|
+
'PlusJakartaSans-Medium.ttf',
|
|
25
|
+
'PlusJakartaSans-Regular.ttf',
|
|
26
|
+
'PlusJakartaSans-SemiBold.ttf'
|
|
27
|
+
];
|
|
28
|
+
Object.entries(fontPaths).forEach(([name, fontPath]) => {
|
|
29
|
+
if (fs_1.default.existsSync(fontPath)) {
|
|
30
|
+
canvas_1.GlobalFonts.registerFromPath(fontPath, name);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
plusJakartaFonts.forEach(fontFile => {
|
|
34
|
+
const fontPath = path_1.default.join(__dirname, '../fonts', fontFile);
|
|
35
|
+
if (fs_1.default.existsSync(fontPath)) {
|
|
36
|
+
const fontName = fontFile.replace('.ttf', '').toLowerCase();
|
|
37
|
+
canvas_1.GlobalFonts.registerFromPath(fontPath, fontName);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
console.error('Font registration failed:', error);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function getFontName(weight = 'regular') {
|
|
46
|
+
const fontMap = {
|
|
47
|
+
'bold': 'PlusJakartaSans-Bold',
|
|
48
|
+
'extrabold': 'PlusJakartaSans-ExtraBold',
|
|
49
|
+
'extralight': 'PlusJakartaSans-ExtraLight',
|
|
50
|
+
'light': 'PlusJakartaSans-Light',
|
|
51
|
+
'medium': 'PlusJakartaSans-Medium',
|
|
52
|
+
'regular': 'PlusJakartaSans-Regular',
|
|
53
|
+
'semibold': 'PlusJakartaSans-SemiBold'
|
|
54
|
+
};
|
|
55
|
+
return fontMap[weight] || fontMap['regular'] || 'PlusJakartaSans-Regular';
|
|
56
|
+
}
|
|
57
|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AU,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC5B,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;gBAC5D,oBAAW,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YACnD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;AACH,CAAC;AAKD,SAAgB,WAAW,CAAC,SAAkD,SAAS;IACrF,MAAM,OAAO,GAA2B;QACtC,MAAM,EAAE,sBAAsB;QAC9B,WAAW,EAAE,2BAA2B;QACxC,YAAY,EAAE,4BAA4B;QAC1C,OAAO,EAAE,uBAAuB;QAChC,QAAQ,EAAE,wBAAwB;QAClC,SAAS,EAAE,yBAAyB;QACpC,UAAU,EAAE,0BAA0B;KACvC,CAAC;IAEF,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,yBAAyB,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function truncateText(text: string, maxLength: number): string;
|
|
2
|
+
export declare function sanitizeText(text: string): string;
|
|
3
|
+
export declare function formatTime(ms: number): string;
|
|
4
|
+
export declare function isValidHexColor(color: string): boolean;
|
|
5
|
+
export declare function clampProgress(progress: number): number;
|
|
6
|
+
export declare function validateOptions(options: any): any;
|
|
7
|
+
//# sourceMappingURL=textProcessor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textProcessor.d.ts","sourceRoot":"","sources":["../../src/utils/textProcessor.ts"],"names":[],"mappings":"AAGA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAGpE;AAKD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGjD;AAKD,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAQ7C;AAKD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtD;AAKD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtD;AAKD,wBAAgB,eAAe,CAAC,OAAO,EAAE,GAAG,GAAG,GAAG,CAqCjD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.truncateText = truncateText;
|
|
4
|
+
exports.sanitizeText = sanitizeText;
|
|
5
|
+
exports.formatTime = formatTime;
|
|
6
|
+
exports.isValidHexColor = isValidHexColor;
|
|
7
|
+
exports.clampProgress = clampProgress;
|
|
8
|
+
exports.validateOptions = validateOptions;
|
|
9
|
+
function truncateText(text, maxLength) {
|
|
10
|
+
if (!text || text.length <= maxLength)
|
|
11
|
+
return text;
|
|
12
|
+
return text.slice(0, maxLength - 2) + '..';
|
|
13
|
+
}
|
|
14
|
+
function sanitizeText(text) {
|
|
15
|
+
if (!text)
|
|
16
|
+
return '';
|
|
17
|
+
return text.trim().replace(/[<>]/g, '');
|
|
18
|
+
}
|
|
19
|
+
function formatTime(ms) {
|
|
20
|
+
if (!ms || isNaN(ms))
|
|
21
|
+
return '0:00';
|
|
22
|
+
const totalSeconds = Math.floor(ms / 1000);
|
|
23
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
24
|
+
const seconds = totalSeconds % 60;
|
|
25
|
+
return `${minutes}:${seconds.toString().padStart(2, '0')}`;
|
|
26
|
+
}
|
|
27
|
+
function isValidHexColor(color) {
|
|
28
|
+
return /^#[0-9A-F]{6}$/i.test(color);
|
|
29
|
+
}
|
|
30
|
+
function clampProgress(progress) {
|
|
31
|
+
return Math.max(0, Math.min(100, progress));
|
|
32
|
+
}
|
|
33
|
+
function validateOptions(options) {
|
|
34
|
+
return {
|
|
35
|
+
name: sanitizeText(options.name || 'Musify'),
|
|
36
|
+
author: sanitizeText(options.author || 'Unknown Artist'),
|
|
37
|
+
requester: sanitizeText(options.requester || 'Unknown'),
|
|
38
|
+
backgroundColor: isValidHexColor(options.backgroundColor) ? options.backgroundColor : '#1c1c1c',
|
|
39
|
+
nameColor: options.nameColor,
|
|
40
|
+
authorColor: options.authorColor,
|
|
41
|
+
requesterColor: options.requesterColor,
|
|
42
|
+
progressColor: options.progressColor,
|
|
43
|
+
progressBarColor: isValidHexColor(options.progressBarColor) ? options.progressBarColor : '#e0e0e0',
|
|
44
|
+
timeColor: options.timeColor,
|
|
45
|
+
progress: clampProgress(options.progress || 0),
|
|
46
|
+
startTime: options.startTime || '0:00',
|
|
47
|
+
endTime: options.endTime || '0:00',
|
|
48
|
+
backgroundImage: options.backgroundImage || null,
|
|
49
|
+
backgroundBlur: Math.max(0, Math.min(50, options.backgroundBlur || 10)),
|
|
50
|
+
backgroundDarkness: Math.max(0, Math.min(1, options.backgroundDarkness || 0.9)),
|
|
51
|
+
thumbnailImage: options.thumbnailImage || null,
|
|
52
|
+
thumbnailWidth: Math.max(50, Math.min(200, options.thumbnailWidth || 80)),
|
|
53
|
+
thumbnailHeight: Math.max(50, Math.min(200, options.thumbnailHeight || 80)),
|
|
54
|
+
thumbnailBorderRadius: Math.max(0, Math.min(50, options.thumbnailBorderRadius || 8)),
|
|
55
|
+
thumbnailX: options.thumbnailX || 15,
|
|
56
|
+
thumbnailY: options.thumbnailY || 'center',
|
|
57
|
+
scale: Math.max(0.5, Math.min(2, options.scale || 1))
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=textProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textProcessor.js","sourceRoot":"","sources":["../../src/utils/textProcessor.ts"],"names":[],"mappings":";;AAGA,oCAGC;AAKD,oCAGC;AAKD,gCAQC;AA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AI,EAAE,CAAC,CAAC;QACzE,eAAe,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;QAC3E,qBAAqB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,qBAAqB,IAAI,CAAC,CAAC,CAAC;QACpF,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;QACpC,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,QAAQ;QAG1C,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;KACtD,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "musify",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Powerful and elegant music image generator for Discord bots featuring high performance, customizable designs, and seamless integration.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist/**/*",
|
|
9
|
+
"src/fonts/**/*"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"dev": "tsc --watch",
|
|
14
|
+
"clean": "rimraf dist",
|
|
15
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
16
|
+
"pack": "npm pack",
|
|
17
|
+
"test": "node -e \"const { Glass } = require('./dist/index.js'); console.log('Package loaded successfully!');\""
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"discord",
|
|
21
|
+
"music",
|
|
22
|
+
"card",
|
|
23
|
+
"generator",
|
|
24
|
+
"canvas",
|
|
25
|
+
"riffy",
|
|
26
|
+
"lavalink",
|
|
27
|
+
"musify",
|
|
28
|
+
"image-generation",
|
|
29
|
+
"discord-bot"
|
|
30
|
+
],
|
|
31
|
+
"author": "Zokys",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@napi-rs/canvas": "^0.1.50",
|
|
35
|
+
"cropify": "^1.0.0",
|
|
36
|
+
"sharp": "^0.33.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/node": "^20.0.0",
|
|
40
|
+
"rimraf": "^5.0.0",
|
|
41
|
+
"typescript": "^5.0.0"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=18.0.0"
|
|
45
|
+
},
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "https://github.com/Zokys/musify.git"
|
|
49
|
+
},
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/Zokys/musify/issues"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://github.com/aruna/musify#readme"
|
|
54
|
+
}
|
|
Binary file
|