|
| 1 | +/*! Simple Hint v1.0 | Copyright (c) 2014 Catalin Covic | https://github.com/catc */ |
| 2 | +[simple-hint]:after, [simple-hint]:before { |
| 3 | + display: inline-block; |
| 4 | + pointer-events: none; |
| 5 | + position: absolute; |
| 6 | + opacity: 0; } |
| 7 | +[simple-hint]:hover:after, [simple-hint]:hover:before { |
| 8 | + opacity: 1; } |
| 9 | +[simple-hint]:before { |
| 10 | + content: ""; |
| 11 | + border: 5px solid transparent; |
| 12 | + z-index: 9998; } |
| 13 | +[simple-hint]:after { |
| 14 | + content: attr(simple-hint); |
| 15 | + text-align: center; |
| 16 | + padding: 3px 7px; |
| 17 | + font-size: 1.1rem; |
| 18 | + line-height: 1.9em; |
| 19 | + border-radius: 2px; |
| 20 | + z-index: 9999; |
| 21 | + color: white; |
| 22 | + word-wrap: break-word; |
| 23 | + white-space: pre; |
| 24 | + background: #292929; } |
| 25 | + |
| 26 | +.hint-bottom:before, .hint-top:before { |
| 27 | + right: 50%; |
| 28 | + margin-right: -5px; } |
| 29 | +.hint-bottom:after, .hint-top:after { |
| 30 | + left: 50%; |
| 31 | + -webkit-transform: translateX(-50%); |
| 32 | + -moz-transform: translateX(-50%); |
| 33 | + -ms-transform: translateX(-50%); |
| 34 | + transform: translateX(-50%); } |
| 35 | + |
| 36 | +.hint-bottom:before { |
| 37 | + border-bottom-color: #292929; |
| 38 | + top: 100%; } |
| 39 | +.hint-bottom:after { |
| 40 | + margin-top: 9px; |
| 41 | + top: 100%; } |
| 42 | + |
| 43 | +.hint-top:before { |
| 44 | + border-top-color: #292929; |
| 45 | + bottom: 100%; } |
| 46 | +.hint-top:after { |
| 47 | + bottom: 100%; |
| 48 | + margin-bottom: 9px; } |
| 49 | + |
| 50 | +.hint-left:before, .hint-right:before { |
| 51 | + top: 50%; |
| 52 | + margin-top: -5px; } |
| 53 | +.hint-left:after, .hint-right:after { |
| 54 | + top: 50%; } |
| 55 | + |
| 56 | +.hint-left:before { |
| 57 | + border-left-color: #292929; |
| 58 | + left: 0; |
| 59 | + margin-left: -10px; } |
| 60 | +.hint-left:after { |
| 61 | + margin-left: -10px; |
| 62 | + left: 0; |
| 63 | + transform: translate(-100%, -50%); } |
| 64 | + |
| 65 | +.hint-right:before { |
| 66 | + border-right-color: #292929; |
| 67 | + right: 0; |
| 68 | + margin-right: -10px; } |
| 69 | +.hint-right:after { |
| 70 | + left: 100%; |
| 71 | + transform: translateY(-50%); |
| 72 | + margin-left: 10px; } |
| 73 | + |
| 74 | +.hint-fade:before, .hint-fade:after { |
| 75 | + -webkit-transition: opacity 0.3s ease; |
| 76 | + -moz-transition: opacity 0.3s ease; |
| 77 | + transition: opacity 0.3s ease; } |
| 78 | + |
| 79 | +.hint-persist:before, .hint-persist:after { |
| 80 | + opacity: 1; } |
| 81 | + |
| 82 | +@-webkit-keyframes top { |
| 83 | + from { |
| 84 | + bottom: 125%; } } |
| 85 | + |
| 86 | +@-moz-keyframes top { |
| 87 | + from { |
| 88 | + bottom: 125%; } } |
| 89 | + |
| 90 | +@keyframes top { |
| 91 | + from { |
| 92 | + bottom: 125%; } } |
| 93 | + |
| 94 | +@-webkit-keyframes bottom { |
| 95 | + from { |
| 96 | + top: 125%; } } |
| 97 | + |
| 98 | +@-moz-keyframes bottom { |
| 99 | + from { |
| 100 | + top: 125%; } } |
| 101 | + |
| 102 | +@keyframes bottom { |
| 103 | + from { |
| 104 | + top: 125%; } } |
| 105 | + |
| 106 | +@-webkit-keyframes right { |
| 107 | + from { |
| 108 | + left: 125%; } } |
| 109 | + |
| 110 | +@-moz-keyframes right { |
| 111 | + from { |
| 112 | + left: 125%; } } |
| 113 | + |
| 114 | +@keyframes right { |
| 115 | + from { |
| 116 | + left: 125%; } } |
| 117 | + |
| 118 | +.hint-anim:after, .hint-anim:before { |
| 119 | + transition: 0.3s; } |
| 120 | +.hint-anim.hint-top:hover:before, .hint-anim.hint-top:hover:after { |
| 121 | + -webkit-animation: top 0.3s linear; |
| 122 | + -moz-animation: top 0.3s linear; |
| 123 | + animation: top 0.3s linear; } |
| 124 | +.hint-anim.hint-bottom:hover:before, .hint-anim.hint-bottom:hover:after { |
| 125 | + -webkit-animation: bottom 0.3s linear; |
| 126 | + -moz-animation: bottom 0.3s linear; |
| 127 | + animation: bottom 0.3s linear; } |
| 128 | +.hint-anim.hint-right:hover:before, .hint-anim.hint-right:hover:after { |
| 129 | + -webkit-animation: right 0.3s linear; |
| 130 | + -moz-animation: right 0.3s linear; |
| 131 | + animation: right 0.3s linear; } |
| 132 | + |
| 133 | +.hint-small:after { |
| 134 | + width: 200px; } |
| 135 | + |
| 136 | +.hint-med:after { |
| 137 | + width: 300px; } |
| 138 | + |
| 139 | +.hint-big:after { |
| 140 | + width: 450px; } |
0 commit comments