Skip to content
This repository was archived by the owner on Oct 5, 2022. It is now read-only.

Commit 776278b

Browse files
authored
Merge pull request #22 from MattIPv4/0.1.0
0.1.0
2 parents d8390bf + 7eec44e commit 776278b

20 files changed

+968
-312
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"forceAllTransforms": true,
77
"useBuiltIns": "entry",
88
"exclude": ["transform-regenerator", "transform-async-to-generator"],
9-
"debug": true,
9+
"debug": false,
1010
"loose": true
1111
}
1212
]

.github/FUNDING.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: IPv4
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: MattIPv4
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
custom: https://paypal.me/MattIPv4Cowley

.github/ISSUE_TEMPLATE/help.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Help ❓
3+
about: Encountered a problem with macOSNotifJS? Not sure how to fix it?
4+
5+
---
6+
7+
<!-- Don't write inside the arrows as they will be hidden when you post your issue.
8+
9+
1. Fill out the template.
10+
This will help us understand what problem you've encountered and help us
11+
find a solution.
12+
13+
2. Delete this line and all above lines before posting your issue! -->
14+
15+
## Information
16+
17+
### Version
18+
<!-- Please place the version of macOSNotifJS that you are using (commit hash if applicable) -->
19+
20+
### Development environment
21+
<!-- Please replace this with the exact (full) version of the browser you are using -->
22+
23+
## Help request
24+
25+
### Problem
26+
<!-- What problem did you encounter? -->
27+
28+
### What I have tried
29+
<!-- What have you tried so far? -->
30+
31+
### Screenshots
32+
<!-- If relevant, include any screenshots here. -->
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Report a bug 🐛
3+
about: Report a bug with macOSNotifJS. Only use this if you're 100% sure there's something wrong, otherwise, try "Help".
4+
5+
---
6+
7+
<!-- Don't put anything inside this block, as it won't be included in the issue.
8+
9+
If you are reporting a bug, please follow the following steps:
10+
11+
1. Fill out the template in full.
12+
This will help us understand the situation in which the bug occurred.
13+
14+
2. If you are reporting a visual bug, please include screenshots (or photos of
15+
your screen if during the capture process) to help us diagnose the problem.
16+
17+
3. Make sure not to write between the arrows, as anything there will be hidden.
18+
19+
4. Delete this line and all above lines before posting your issue! -->
20+
21+
## Information
22+
23+
### Version
24+
<!-- Please place the version of macOSNotifJS that you are using (commit hash if applicable) -->
25+
26+
### Development environment
27+
<!-- Please replace this with the exact (full) version of the browser you are using -->
28+
29+
## Details
30+
31+
### Description
32+
<!-- Replace this with a brief summary of the bug. -->
33+
34+
### Steps to reproduce
35+
<!-- Replace this with exactly what you did to cause the bug. -->
36+
37+
#### Expected behaviour
38+
<!-- Replace this with what you expected to happen. -->
39+
40+
### Screenshots
41+
<!-- Replace this with screenshots, if necessary. -->
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Request a feature 🆕
3+
about: Suggest a new feature that you would like in macOSNotifJS!
4+
5+
---
6+
7+
<!-- Fill out the template. Don't write inside the arrows as they will be hidden
8+
when you post your issue.
9+
10+
If you have a feature suggestion for macOSNotifJS, read through the following steps:
11+
12+
1. Fill out the template.
13+
This will help us understand what you're requesting and why you want us
14+
to add it.
15+
16+
2. Keep it simple.
17+
Make sure it's easy to understand what you're requesting. A good way is
18+
to keep it to one request per GitHub issue, as we can then easily track
19+
feature requests.
20+
21+
3. Check whether it has already been asked or added.
22+
You can search the GitHub issues to see if your feature has already been
23+
requested at https://github.com/MattIPv4/macOSNotifJS/issues.
24+
25+
4. Ask yourself: "Does this idea/feature belong as part of macOSNotifJS?"
26+
Whilst we'd love to be able to add every feature that every user wants,
27+
we want to keep the plugin as small and as fast as possible by limiting how
28+
much code we have.
29+
30+
5. Delete this line and all above lines before posting your issue! -->
31+
32+
## Feature request
33+
34+
### Feature description
35+
<!-- What feature are you suggesting? -->
36+
37+
### How the feature is useful
38+
<!-- How is the feature useful to macOSNotifJS users? -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!-- Don't put anything inside this block, as it won't be included in the pull request.
2+
3+
If you are wanting to submit a PR for your changes, please follow the following steps:
4+
5+
1. Fill out the template in full.
6+
This will help us understand exactly what you are contributing to the plugin.
7+
8+
2. If you are making visual changes, please makre sure you provide screenshots
9+
for comparison of any changes made.
10+
11+
3. If you have made any changes to the codebase, please ensure it passes a scan of
12+
ESLint and that you have put sufficient comments with your code!
13+
14+
4. Make sure not to write between the arrows, as anything there will be hidden.
15+
16+
5. Delete this line and all above lines before posting your issue! -->
17+
18+
## Proposed changes
19+
<!-- Replace this with a list of changes this pull request makes,
20+
both "internal" (code style etc.) and "external" (UI/UX, features etc.). -->
21+
22+
## Additional comments
23+
<!-- Please let us know anything else about this PR, known issues etc. -->
24+
25+
## Screenshots
26+
<!-- Include any screenshots of visual changes to the plugin. -->

ISSUE_TEMPLATE.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

dist/macOSNotif.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/macOSNotif.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fonts.js

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,48 @@
1+
/**
2+
* macOSNotifJS: A simple Javascript plugin to create simulated macOS notifications on your website.
3+
* <https://github.com/MattIPv4/macOSNotifJS/>
4+
* Copyright (C) 2019 Matt Cowley (MattIPv4) (me@mattcowley.co.uk)
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU Affero General Public License as published
8+
* by the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
* You should have received a copy of the GNU Affero General Public License
15+
* along with this program. If not, please see
16+
* <https://github.com/MattIPv4/macOSNotifJS/blob/master/LICENSE> or <http://www.gnu.org/licenses/>.
17+
*/
18+
19+
const chalk = require("chalk");
120
const Fontmin = require("fontmin");
221

3-
const fonts = new Fontmin()
4-
.src("src/fonts/src/*.otf")
5-
.use(Fontmin.otf2ttf())
6-
.use(Fontmin.ttf2eot())
7-
.use(Fontmin.ttf2woff({ deflate: true }))
8-
.dest("src/fonts/build");
22+
const buildFonts = () => {
23+
return new Promise((resolve, reject) => {
24+
const fonts = new Fontmin()
25+
.src("src/fonts/src/*.otf")
26+
.use(Fontmin.otf2ttf())
27+
.use(Fontmin.ttf2eot())
28+
.use(Fontmin.ttf2woff({ deflate: true }))
29+
.dest("src/fonts/build");
930

10-
fonts.run((err, files) => {
11-
if (err) throw err;
12-
files.forEach(file => {
13-
console.info("\x1b[36m%s\x1b[0m", "\n" + file.history.slice(-1)[0]);
14-
console.log("\t" + file.history.slice(-1)[0].replace(/^.*[\\/]/, ""));
31+
fonts.run((err, files) => {
32+
if (err) {
33+
console.error(chalk.red.bold("Failed to build fonts"));
34+
reject();
35+
throw err;
36+
}
37+
files.forEach(file => {
38+
console.info(chalk.cyan("\n" + file.history.slice(-1)[0]));
39+
console.log("\t" + file.history.slice(-1)[0].replace(/^.*[\\/]/, ""));
40+
});
41+
console.log(chalk.green("\nSuccessfully built " + files.length.toString() + " font files."));
42+
resolve();
43+
});
1544
});
16-
console.log("\x1b[32m%s\x1b[0m", "\nSuccessfully built " + files.length.toString() + " font files.");
17-
});
45+
};
46+
47+
// Run
48+
buildFonts();

0 commit comments

Comments
 (0)