npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

blind-friendly-library

v1.1.4

Published

BFL - Blind friendly library

Downloads

33

Readme

Blind friendly lib

Web accessibility for people with disabilities

Table of Contents

Technologies Used

  • JS
  • NODE.JS

Instalition and Usage

  • install library
npm i blind-friendly-library
  • This library needs to be imported into the main.js file in the project, specifically importing the index.js file (setBFL() function).
import { setBFL } from '../../lib/index.js';
  • Then run the setBFL() function and insert the parameters you have chosen to set the speaker's voice.
setBFL(1,1,1.2,"en"); //(volume,rate,pitch,lang)

Project Setup

  • The project has three main functions TTS (text to speech), SF (speech focus) and VC (voice control).

1. SF (speech focus)

  • Speech focus works by itself right after installing the library.
  • Switched on with the CTRL+SHIFT+1 key.
  • Switch between elements via the TAB key.

2. TTS (text to speech)

  • Text to speech works using custom data-speaker attributes. These are added to the elements to be read.
<p data-speaker>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
  • Text to speech is activated using the CTRL+SHIFT+2 key.
  • Use the arrows (<-,->) to move between elements.

3. VC (voice control)

  • This function works by using custom attributes data-el-text, which are loaded when this function is run and then searches them to see if what the user said is in them. The value of the custom attribute specifies the name by which the element can be found.
<a data-el-text="Home">HOME</a>
<a data-el-text="Home" data-el-text-en="Home" data-el-text-cs="Domů">HOME</a>
  • You can add the action, which will be performed. (default = click())
<a data-el-text="Home" data-el-action="click">HOME</a>
  • Speech to text is enabled using the CTRL+SHIFT+3 key and then the user enters what is to be done. 4. Manual
  • Press CTRL+SHIFT+4 to turn on the guide.

Configure library

Keyboard shortCuts change

  • You can also use the function to override keys to trigger functions in main.js
const myKey = {
  kscFocus: 'event.key === "1"',
  kscSpeaker: 'event.key === "2"',
  kscVoiceControl: 'event.key === "3"',
  kscManual: 'event.key === "4"',
};
setBFL(1, 1, 1.2, "en");
setKeyBFL(myKey); 

Importing Speaker functions

  • Functions to make for example GUI for your Speaker, or just start Speaker from Button.
    import * as BFL from "blind-friendly-library/src/lib/index.js";
    
    BFL.startGlobalSpeaker();
    
    BFL.setSpeedOfSpeaker(newValue);
    BFL.pauseButton();
    BFL.stopSpeaker();
    BFL.previousArticle();
    BFL.nextArticle();
    
    BFL.hasPrevious();
    BFL.hasNext();
    BFL.isPauseBfl();
    
    this.isGlobalSpeakerStarted = false;
  • Voice control function for adding a new command
    BFL.addCommand('new commad', () => { console.log('This is a new command!'); });