forkmeongithub.rkt (1888B)
1 #lang racket 2 3 (require scribble/manual 4 (only-in scribble/core make-style) 5 (only-in scribble/html-properties alt-tag attributes)) 6 7 (provide forkongithub) 8 9 (define css-code 10 #<<EOF 11 #forkongithub a{ 12 background:#007200; 13 color:#fff; 14 text-decoration:none; 15 font-family:arial,sans-serif; 16 text-align:center; 17 font-weight:bold; 18 font-size:1rem; 19 line-height:2rem; 20 position:relative; 21 /* transition:0.5s; */ 22 } 23 #forkongithub a:hover{ 24 background:#00802B; 25 color:#fff; 26 } 27 #forkongithub a{ 28 border-radius: 1ex; 29 box-shadow: inset 0px -1px 4px rgba(255,255,255,0.8); 30 padding:6.5px 10px 5px 10px; 31 } 32 @media screen and (min-width:720px){ 33 #forkongithub{ 34 position:absolute; 35 display:block; 36 top:0; 37 right:0; 38 width:220px; 39 overflow:hidden; 40 height:220px; 41 z-index:9999; 42 } 43 #forkongithub a{ 44 padding:6.5px 40px 5px 40px; 45 width:210px; 46 position:absolute; 47 top:60px; 48 right:-67px; 49 transform:rotate(45deg); 50 -webkit-transform:rotate(45deg); 51 -ms-transform:rotate(45deg); 52 -moz-transform:rotate(45deg); 53 -o-transform:rotate(45deg); 54 box-shadow: 0px 5px 4px rgba(0,0,0,0.8); 55 } 56 #forkongithub a::before, 57 #forkongithub a::after{ 58 content:""; 59 width:100%; 60 display:block; 61 position:absolute; 62 top:2px; 63 left:0; 64 height:2px; 65 background: linear-gradient(90deg, transparent 50%, #bbb 50%) 66 repeat scroll 0% 0% / 10px; 67 } 68 #forkongithub a::after{ 69 bottom:2px; 70 top:auto; 71 } 72 } 73 EOF 74 ) 75 76 (define (forkongithub href text) 77 (elem 78 (elem #:style (make-style #f (list (alt-tag "style"))) 79 css-code) 80 (elem #:style (make-style #f (list (alt-tag "span") 81 (attributes '((id . "forkongithub"))))) 82 (elem #:style (make-style #f (list (alt-tag "a") 83 (attributes `((href . ,href))))) 84 text))))