Coder Social home page Coder Social logo

evoluteur / braille-tools Goto Github PK

View Code? Open in Web Editor NEW
38.0 4.0 6.0 100 KB

CSS and Javascript to display Braille grade 1 in web pages (for sighted people).

Home Page: https://evoluteur.github.io/braille-tools/

License: MIT License

JavaScript 33.42% CSS 66.58%
braille css javascript braille-alphabet braille-characters braille-translator braille-symbols ui sprite

braille-tools's Introduction

Braille-Tools

CSS and Javascript to display Braille (grade 1) in web pages (for sighted people).

Check out the live demo.

It comes in 3 different styles:

big

small

small-3d

See your name in Braille

screenshot

Braille Alphabet

screenshot

For displaying the character on hover (with animation), use my other script Braille-Text.

License

Copyright (c) 2016-2024 Olivier Giulieri.

Braille-Tools is released under the MIT license.

braille-tools's People

Contributors

evoluteur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

braille-tools's Issues

This one just screams <braille-string> Web Component

In a Web Component you can scope all your CSS and JS so you don't have any global dependencies.
The user then loads just one JS file defining the Web Component, and does not have to use DIV or classnames

Just a quick proof of concept (not refactoring JS and CSS):

JSFiddle: https://jsfiddle.net/WebComponents/yv6scarL/

<link href="https://evoluteur.github.io/braille-tools/css/braille-big.css" rel="stylesheet" type="text/css">
<script src="https://evoluteur.github.io/braille-tools/braille-tools.js" type="text/javascript" charset="utf-8"></script>

<braille-string>Hello World!</braille-string>
<braille-string>I can write Web Components</braille-string>

<script>
  customElements.define("braille-string", class extends HTMLElement {
    connectedCallback() {
      const braille = char => Object.assign(document.createElement("div"), {
        className: `br br-${char}`
      })
      this.render = (txt) => this.replaceWith(...txt.split("").map(braille));
      setTimeout(() => this.render(this.innerHTML)); // wait till innerHTML is parsed
    }
  });
</script>

Note: Every Braille character is a six bit value, so a PNG with all characters is not required, create them 6 dots dynamically

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.