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

add(placecircle) #6

Open
wants to merge 2 commits into
base: master
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"images",
"lorem",
"placehold.it",
"unsplash"
"unsplash",
"placecircle"
],
"repository": {
"type": "git",
Expand Down
27 changes: 27 additions & 0 deletions services/placecircle.js
Original file line number Diff line number Diff line change
@@ -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
}
}