Skip to content

Commit 40b8580

Browse files
committed
New major release: Styling issues on safari fixed, second and third level keys added
1 parent 2c852d8 commit 40b8580

14 files changed

Lines changed: 1572 additions & 800 deletions

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Andr3as
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,31 @@ Create your own keymap to display the keybinings of your software with jQuery.
44

55
##Installation/Quickstart
66

7-
- Download the zip file and unzip it to your server directory.
8-
- Include the file: ``<script src="/js/keymap.js"></script>``
9-
- Call the plugin on the ``div`` you want to place the keymap.
10-
- ``$('.keymap').keymap();``
11-
- Creating your keybings by calling ``$('.shortcut').createShortcut('.keymap', ["ctrl", "s"], {},":first");``
7+
- Download the zip file and unzip it.
8+
- Include `keymap.js` and `keymap.css`
9+
```HTML
10+
<!--
11+
Include Keymap
12+
-->
13+
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
14+
<script src="keymap.js"></script>
15+
<link href=keymap.css" rel="stylesheet">
16+
```
17+
- Initiate the plugin
18+
```Javascript
19+
$(document).ready(function(){
20+
$.getJSON('layouts/qwerty.json', function(json){
21+
$('.keymap').keymap({"css": {"key": {"background": "white", "color": "black"}}});
22+
$('.shortcut').createShortcut('.keymap', ["ctrl", "s"], {}, ":first");
23+
});
24+
});
25+
```
1226
- For more details: Check the [wiki](https://github.com/Andr3as/jQuery-Keymap/wiki)
1327
1428
##Examples
1529
16-
####[Live preview](http://andr3as.github.io/jQuery-Keymap)
17-
18-
![Example](http://andrano.de/Plugins/img/keymap.jpg "Example")
30+
![Example](http://andrano.de/Plugins/img/screenshot.png "Example")
31+
#####[Live preview on Andrano.de](https://andrano.de/Keymap)
1932
2033
##Contribute
2134
You want to contribute a new layout or some fixes create a pull request or send an email to [andranode[at]gmail.com](mailto://andranode@gmail.com)

keymap.css

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/**
2+
* @author Andr3as <andranode@gmail.com>
3+
* @license https://github.com/Andr3as/jQuery-Keymap/blob/master/LICENSE.md MIT
4+
* @version 2.0.0
5+
* @date 15/08/2015
6+
*/
7+
8+
/*
9+
* Copyright (c) Andr3as
10+
* as-is and without warranty under the MIT License.
11+
* See http://opensource.org/licenses/MIT for more information.
12+
* This information must remain intact.
13+
*/
14+
.keymap span {
15+
display: block;
16+
margin: 1px 1px 1px 0;
17+
-webkit-user-select: none;
18+
-moz-user-select: none;
19+
-ms-user-select: none;
20+
user-select: none;
21+
}
22+
23+
.keymap .keymap-line {
24+
display: -webkit-flex;
25+
display: -ms-flexbox;
26+
display: flex;
27+
}
28+
29+
.keymap p {
30+
text-align: center;
31+
}
32+
33+
.keymap span[data-height] {
34+
position: absolute;
35+
z-index: 2;
36+
}
37+
38+
.keymap span[data-index] {
39+
position: absolute;
40+
z-index: 3;
41+
}
42+
43+
.keymap .first, .keymap .second {
44+
margin: 0.5em;
45+
}
46+
47+
.keymap .hasFirst .second, .keymap .hasSecond .first {
48+
margin: 0.2em;
49+
}
50+
51+
.keymap .hasSecond .third {
52+
bottom: 1.5em;
53+
position: relative;
54+
z-index: 3;
55+
right: -1em;
56+
}
57+
58+
.keymap span:not(.hasSecond) .third {
59+
bottom: 1em;
60+
position: relative;
61+
right: -1em;
62+
}

keymap.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"ui",
77
"animation"
88
],
9-
"version": "1.0.4",
9+
"version": "2.0.0",
1010
"author": {
1111
"name": "Andr3as",
1212
"email": "andranode@gmail.com",

0 commit comments

Comments
 (0)