From 004c3b91563e56c1442f6b2e2f631fafc525f3f0 Mon Sep 17 00:00:00 2001 From: Kasper Andersson Date: Mon, 15 Aug 2022 23:25:32 +0200 Subject: [PATCH 1/2] add(placecircle) --- README.md | 3 +++ package.json | 3 ++- services/placecircle.js | 27 +++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 services/placecircle.js diff --git a/README.md b/README.md index a57aad8..784bb06 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Generate and insert placeholder images into your HTML in Visual Studio Code usin - [Placekitten](http://placekitten.com) - [Placeskull](http://placeskull.com) - [Unsplash](https://unsplash.it/) +- [Placecircle](https://elouwerse.nl/placecircle/) ## Features - Choose image width, height, text, colors and more @@ -30,6 +31,8 @@ http://placeskull.com/170/170 http://lorempixel.com/200/300/sports/foobar +https://elouwerse.nl/placecircle/200 + ## Visual Studio Code Commands ### `Placeholder Images: Insert new image` diff --git a/package.json b/package.json index 9d413c9..0ef7795 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "images", "lorem", "placehold.it", - "unsplash" + "unsplash", + "placecircle" ], "repository": { "type": "git", diff --git a/services/placecircle.js b/services/placecircle.js new file mode 100644 index 0000000..c98abe3 --- /dev/null +++ b/services/placecircle.js @@ -0,0 +1,27 @@ +const inputAction = require('../actions/input') + +module.exports = { + label: 'Placecircle', + description: 'https://elouwerse.nl/placecircle', + generateUrl: async function () { + // Image Width + let width = await inputAction({ + required: true, + placeHolder: 'Width', + prompt: 'Width of the image', + regex: '^\\d+$', + invalid: 'Image width must be a whole number (integer)' + }) + + if (typeof(width) === 'undefined') { + return undefined + } + + // Build the URL + let url = 'https://elouwerse.nl/placecircle' + + url += `/${width}` + + return url + } +} From 6fe8c0d47068acc6830b1ab6f66aca767f38ce53 Mon Sep 17 00:00:00 2001 From: Kasper Andersson Date: Mon, 15 Aug 2022 23:26:52 +0200 Subject: [PATCH 2/2] fix(package.json): indent --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0ef7795..3eda2eb 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "lorem", "placehold.it", "unsplash", - "placecircle" + "placecircle" ], "repository": { "type": "git",