A project to learn NodeJS, ExpressJS, and whatever else along the way.
Go to file
Robert McGovern 0cb34e45c4 added border types, currently two supported. Intend to add more 2024-03-07 13:43:32 +00:00
screenshots added border types, currently two supported. Intend to add more 2024-03-07 13:43:32 +00:00
views added border types, currently two supported. Intend to add more 2024-03-07 13:43:32 +00:00
www/assets added border types, currently two supported. Intend to add more 2024-03-07 13:43:32 +00:00
.gitignore updated readme with a screenshot 2024-03-07 11:41:30 +00:00
LICENSE Initial commit 2024-03-06 12:36:54 +01:00
README.md added border types, currently two supported. Intend to add more 2024-03-07 13:43:32 +00:00
express-puppeteer.js added base files, plus og experiment node script that uses commonjs not modules 2024-03-06 11:48:48 +00:00
generate-image-of-page.mjs made copy of page, don't ask 2024-03-06 12:53:09 +00:00
image-generator.cjs added config so can specify location of browser, mostly for arm linux where the version that came with puppeteer didn't load 2024-03-07 11:11:22 +00:00
index.mjs worker now takes provides parameters, and then uses ejs to render the webpage. At the moment that is basic CSS styling, and no provided parameters for the colors and such YET 2024-03-07 10:49:55 +00:00
package-lock.json worker now takes provides parameters, and then uses ejs to render the webpage. At the moment that is basic CSS styling, and no provided parameters for the colors and such YET 2024-03-07 10:49:55 +00:00
package.json worker now takes provides parameters, and then uses ejs to render the webpage. At the moment that is basic CSS styling, and no provided parameters for the colors and such YET 2024-03-07 10:49:55 +00:00

README.md

motivational-picture-generator

A project to learn NodeJS, ExpressJS, and whatever else along the way.

[!CAUTION] THIS IS ALL WORK IN PROGRESS AND SUBJECT TO CHANGE

To start server

npm run dev

Make url request to localhost:4000 with. Not providing all the parameters will cause the render to fail atm. Have only added optional checking for CSS colors for now with garish defaults so I can see if something failed.

wget --output-document screenshot.png 'http://localhost:4200/submit/mpgParams?title=A Motivational Poster&sentence=something pithy&imageWidth=600px&imageUrl=https://dj.tdn.wf/image/400x300/282828&titleColor=blue&sentenceColor=orange&borderColor=red&backgroundColor=%23107a00'

This generates

Testing with

ab -c 5 -t 15 http://localhost:4000/submit/\{\}

Supported Arguments

Arguments with ‼️ are currently required

  • title string that will be used for the H1 under ‼️
  • sentence string that will be presented below the H1 ‼️
  • imageURL url of the image to use ‼️
  • imageWidth px value to constrain the image size ‼️
  • titleColor either the word name of a color that css supports, or the hex value (note if using hex then you need to encode the # as %23)
  • sentenceColor either the word name of a color that css supports, or the hex value (note if using hex then you need to encode the # as %23)
  • backgroundColor either the word name of a color that css supports, or the hex value (note if using hex then you need to encode the # as %23)
  • borderColor either the word name of a color that css supports, or the hex value (note if using hex then you need to encode the # as %23). This will only be used in certain border types.
  • borderType name of the border to use. If not supplied no border is added.

Currently supported border types:

  • basic-border just a simple colored bordered
  • corner-only-border a fancy colored border that only goes around the corners. Defaults atm to pink if borderColor isn't supplied

Thanks