File tree Expand file tree Collapse file tree 2 files changed +70
-2
lines changed Expand file tree Collapse file tree 2 files changed +70
-2
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 " />
5
+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge " />
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7
+ < title > Braille Glyph Recipes</ title >
8
+ < style >
9
+ * {
10
+ box-sizing : border-box;
11
+ margin : 0 ;
12
+ padding : 0 ;
13
+ }
14
+ # app {
15
+ position : absolute;
16
+ inset : 0 ;
17
+ display : grid;
18
+ place-items : center;
19
+ }
20
+ # container {
21
+ width : 100% ;
22
+ display : grid;
23
+ grid-template-columns : repeat (16 , 1fr );
24
+ background-color : # eee ;
25
+ }
26
+ # container > div {
27
+ aspect-ratio : 1 / 1 ;
28
+ display : flex;
29
+ flex-direction : column;
30
+ justify-content : center;
31
+ align-self : center;
32
+ background-color : # fff ;
33
+ border-top : 1px solid # ddd ;
34
+ border-left : 1px solid # ddd ;
35
+ }
36
+ # container > div .clicked {
37
+ background-color : # eee ;
38
+ }
39
+ # container > div > p : first-of-type {
40
+ font-family : monospace;
41
+ font-size : 0.5vw ;
42
+ text-align : center;
43
+ }
44
+ # container > div > p : last-of-type {
45
+ font-family : monospace;
46
+ font-size : 3vw ;
47
+ text-align : center;
48
+ }
49
+ </ style >
50
+ </ head >
51
+ < body >
52
+ < div id ="app ">
53
+ < div id ="container "> </ div >
54
+ </ div >
55
+ < script src ="braille.js "> </ script >
56
+ </ body >
57
+ </ html >
Original file line number Diff line number Diff line change @@ -15,7 +15,11 @@ function brailleRecipes() {
15
15
7 : [ 0 , "bd3" ] ,
16
16
8 : [ "bd1" , "bd3" ] ,
17
17
}
18
+ const container = document . querySelector ( "#container" )
18
19
20
+ const blank = document . createElement ( "div" )
21
+ blank . innerHTML = `<p>brblank</p><p>${ String . fromCharCode ( 10240 ) } </p>`
22
+ container . append ( blank )
19
23
for ( let i = 1 ; i < 256 ; i ++ ) {
20
24
const name =
21
25
"dots" +
@@ -41,8 +45,15 @@ function brailleRecipes() {
41
45
)
42
46
. join ( "+" )
43
47
// console.log(i.toString(2), dots, dotPositions)
44
- console . log ( name , recipe )
48
+ const div = document . createElement ( "div" )
49
+ div . innerHTML = `<p>${ name } </p><p>${ String . fromCharCode ( 10240 + i ) } </p>`
50
+ div . addEventListener ( "click" , ( ) => {
51
+ div . classList . toggle ( "clicked" )
52
+ navigator . clipboard . writeText ( recipe )
53
+ } )
54
+ container . append ( div )
55
+ // console.log(name, recipe)
45
56
}
46
- console . log ( positions )
57
+ // console.log(positions)
47
58
}
48
59
brailleRecipes ( )
You can’t perform that action at this time.
0 commit comments