Created
March 2, 2025 23:07
-
-
Save kezzyhko/0d686e8c01d3f817771f96529e28fd34 to your computer and use it in GitHub Desktop.
Braille character made out of html checkboxes + some css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>Braille translator</title> | |
| <style> | |
| .braille-6 { | |
| display: inline-grid; | |
| grid-auto-flow: column; | |
| grid-template-columns: repeat(2, 50%); | |
| grid-template-rows: repeat(3, 33%); | |
| } | |
| .braille-8 { | |
| display: inline-grid; | |
| grid-auto-flow: column; | |
| grid-template-columns: 100%; | |
| grid-template-rows: 75% 25%; | |
| } | |
| .braille-8-additional { | |
| display: inline-grid; | |
| grid-auto-flow: row; | |
| grid-template-columns: repeat(2, 50%); | |
| grid-template-rows: 100%; | |
| } | |
| .braille-8 input[type="checkbox"] { | |
| appearance: none; | |
| height: 1em; | |
| width: 1em; | |
| border: 1px solid black; | |
| border-radius: 50%; | |
| cursor: pointer; | |
| } | |
| .braille-8 input[type="checkbox"]:checked { | |
| background-color: black; | |
| } | |
| body { | |
| box-sizing: border-box; | |
| width: 100vw; | |
| height: 100vh; | |
| margin: 0; | |
| padding: calc(0.5vw + 0.5vh); | |
| } | |
| </style> | |
| <script> | |
| class BrailleCharacter() { | |
| constructor(character, pattern, number) { | |
| this.character = character; | |
| this.pattern = pattern; | |
| this.number = number; | |
| } | |
| static fromCharacter(character) { | |
| return new BrailleCharacter(character, pattern, number) | |
| } | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| <a href="https://en.wikipedia.org/wiki/Braille_Patterns">More info</a> | |
| <div id="checkboxes"> | |
| <span class="braille-8"> | |
| <span class="braille-6"> | |
| <input type="checkbox"> | |
| <input type="checkbox"> | |
| <input type="checkbox"> | |
| <input type="checkbox"> | |
| <input type="checkbox"> | |
| <input type="checkbox"> | |
| </span> | |
| <span class="braille-8-additional"> | |
| <input type="checkbox"> | |
| <input type="checkbox"> | |
| </span> | |
| </span> | |
| </div> | |
| <div id="text"> | |
| <textarea></textarea> | |
| </div> | |
| <div id="patterns"> | |
| <textarea></textarea> | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment