File tree 3 files changed +70
-0
lines changed
3 files changed +70
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < meta charset ="UTF-8 " />
5
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6
+ < link
7
+ href ="./style.css "
8
+ rel ="stylesheet "
9
+ />
10
+ < title > </ title >
11
+ </ head >
12
+ < body >
13
+ < link href ='https://fonts.googleapis.com/css?family=Raleway:600,900 ' rel ='stylesheet ' type ='text/css '>
14
+
15
+ < h1 > javascript key printer< br >
16
+ < span id ="keyCode " data-shadowText ="Hit Any Key! "> Hit Any Key!</ span >
17
+ < br > Click anywhere on the demo before you type</ h1 >
18
+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js " integrity ="sha512-egJ/Y+22P9NQ9aIyVCh0VCOsfydyn8eNmqBy+y2CnJG+fpRIxXMS6jbWP8tVKp0jp+NO5n8WtMUAnNnGoJKi4w== " crossorigin ="anonymous " referrerpolicy ="no-referrer "> </ script >
19
+ < script src ="./script.js "> </ script >
20
+ </ body >
21
+ </ html >
Original file line number Diff line number Diff line change
1
+
2
+
3
+
4
+ window . onkeydown = keydown ;
5
+ function keydown ( e ) {
6
+ e . preventDefault ( ) ;
7
+ $ ( '#keyCode' ) . attr ( 'data-shadowText' , e . keyCode )
8
+ $ ( '#keyCode' ) . text ( e . keyCode )
9
+ console . log ( e . keyCode ) ;
10
+ }
Original file line number Diff line number Diff line change
1
+ body { background : # 9cb8b3 ; }
2
+
3
+ h1 {
4
+ font : 600 1.5 em/1 'Raleway' , sans-serif;
5
+ color : rgba (0 , 0 , 0 , .5 );
6
+ text-align : center;
7
+ text-transform : uppercase;
8
+ letter-spacing : .5em ;
9
+ position : absolute;
10
+ top : 25% ;
11
+ width : 99vw ;
12
+ }
13
+
14
+ span , span : after {
15
+ font-weight : 900 ;
16
+ color : # efedce ;
17
+ white-space : nowrap;
18
+ display : inline-block;
19
+ position : relative;
20
+ letter-spacing : .1em ;
21
+ padding : .2em 0 .25em 0 ;
22
+ }
23
+
24
+ span {
25
+ font-size : 4em ;
26
+ z-index : 100 ;
27
+ text-shadow : .04em .04em 0 # 9cb8b3 ;
28
+ }
29
+
30
+ span : after {
31
+ content : attr (data-shadowText);
32
+ color : rgba (0 , 0 , 0 , .35 );
33
+ text-shadow : none;
34
+ position : absolute;
35
+ left : .0875em ;
36
+ top : .0875em ;
37
+ z-index : -1 ;
38
+ -webkit-mask-image : url (https://f.cl.ly/items/1t1C0W3y040g1J172r3h/mask.png);
39
+ }
You can’t perform that action at this time.
0 commit comments