Skip to content

Instantly share code, notes, and snippets.

@Darkproduct
Darkproduct / README.md
Last active April 11, 2023 14:24
Simple Image Gallery Overlay

A simple image gallery overlay which should work an any blog without needing to change anything else.

image The overlay is fullscreen and shows one image at a time. The controlls are:

  • Button at the top and bottom to quit, or press Escape or q
  • Button on the left side Arrow left or a to go to the previous image
  • Button on the right side Arrow right or d to go to the next image

It also is assumed, that the img_filter, which can be set at the top of the JavaScript finds all <img> tags which should be included. Additionally, each <img> tag should be contained in a single container. Because this copies the content of the parent to work properly with images that have a <source> tag.

@Darkproduct
Darkproduct / example.js
Last active July 10, 2023 18:21
[JS] Winston logger with progress bar (cliProgress)
import winston from 'winston';
import cliProgress from 'cli-progress';
/**
* Create logger instance
*/
const logger = winston.createLogger({
transports: [
// Console logging
new winston.transports.Console({