commit 0e51368751f93988b909ab2d9e649b92cdb13c77 Author: Ryan McGrath Date: Sat May 4 21:26:50 2013 -0700 Create gh-pages branch via GitHub diff --git a/images/checker.png b/images/checker.png new file mode 100644 index 0000000..ab14540 Binary files /dev/null and b/images/checker.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ec86ada --- /dev/null +++ b/index.html @@ -0,0 +1,287 @@ + + + + + + Wii-js by ryanmcgrath + + + + + + + + + +
+
+

Wii-js

+

A sane, documented, (hopefully) performant event-based library for Wiimote webpage interaction.

+

View the Project on GitHub ryanmcgrath/wii-js

+ +
+
+

wii-js

+ +

The Nintendo Wii is an entertainment system with an utterly massive install base, and when +you couple it with the fact that it's got a web browser (mostly) built in, there's a lot of +potential for third party development. Sadly, few have opted to do any sort of development for +it. While it doesn't help that Nintendo pretty much dropped the ball on this opportunity, the +experience of browsing the web on the Wii isn't actually that compelling to begin with.

+ +

That said, I think this can serve one other purpose: it's an ideal environment to teach children +how to program! I created this library to sanitize Wii interaction with webpages in the browser, +as it's notoriously crippled. It aims to offer a solid, documented, performant API that's easy to +understand and pick up. With this library, you can have up to 4 Wii-motes interacting with your +webpage at once, a dynamic not found in other web browsing mediums.

+ +

You can find a built source file and a minified source file for production use in the /js/ directory. +To play with a live example, load up the demo (_index.html_) on your own server, or feel free to use mine:

+ +

wii-js Demo: http://venodesigns.net/wii/

+ +

Working with the Wii's browser can be odd - it has moderately good support for CSS, so you're never really +as bad off as you'd be with a version of Internet Explorer - that said, if you're looking for a good read +on what's supported, check out this article on Opera Wii supported technologies.

+ +

Questions, comments, criticism and praise can be directed to me at the following outlets:

+ +

Example Usage

+ +
var wiimote = new Wii.Remote(1, {horizontal: true}),
+    wiimote2 = new Wii.Remote(2, {horizontal: true});
+
+wiimote.when('pressed_a', function() {
+    alert('Wiimote #1 pressed the A Button!');
+});
+
+wiimote2.when('pressed_a', function() {
+    alert('Wiimote #2 pressed the A Button!');
+});
+
+Wii.listen();
+
+ +

Technical Documentation

+ +

The largest issue with making interactive pages that work with the Wii has been that the API has +been nothing short of a black hole. When you actually begin to dig in and figure out what's going on, +it gets even uglier to see - the primary wiimote, for instance, has a totally different set of signals +than the other three.

+ +

wii-js abstracts away most of these differences and/or problems, and works on a very simple event-dispatch +system. What this means is that you create an instance of a Wii Remote, subscribe to events, and provide a +function to get called when that event has occurred. The following syntax should explain this:

+ +
wiimote.when('event_name_here', function() { /* My callback function */ });
+
+ +

When instantiating a Wii Remote instance, you can choose to have the library interpret directional pad controls +in horizontal or vertical mode. You can change this at any point, if you want, by simply swapping the property.

+ +
var wiimote = new Wii.Remote(1, {horizontal: true}); // Horizontal controls
+var wiimote = new Wii.Remote(1, {horizontal: false}); // Vertical controls
+
+wiimote.opts.horizontal = true; // Change to horizontal scheme.
+
+ +

The final important piece is to start the Wii-event loop; this manages the event dispatcher internally. To do this, simply...

+ +
Wii.listen();
+
+ +

You can listen for the following events on all controllers:

+ +
    +
  • +pressed_up - The up button was pressed.
    +
  • +
  • +pressed_down - The down button was pressed.
    +
  • +
  • +pressed_left - The left button was pressed.
    +
  • +
  • +pressed_right - The right button was pressed.
    +
  • +
  • +pressed_a - The A button was pressed.
    +
  • +
  • +pressed_1 - The 1 button was pressed. (_Note: On controller 1, this triggers a menu - work in progress..._)
    +
  • +
  • +pressed_2 - The 2 button was pressed.
    +
  • +
  • +pressed_plus - The plus (+) button was pressed.
    +
  • +
  • +pressed_minus - The minus (-) button was pressed.
    +
  • +
  • +roll_change - The roll of the controller (balance) changed. You can get the current roll in radians with "this.roll"; positive is upright, negative is the other.
    +
  • +
  • +distance_change - The distance of the wiimote (in meters) from the TV/sensor bar has changed. This event isn't totally reliable, but should work for most cases.
    +
  • +

You can listen for the following events on extra controllers, but not the primary controller.

+ +
    +
  • +pressed_b - The B button was pressed.
    +
  • +
  • +pressed_c - The C button (on the Nunchuk) was pressed.
    +
  • +
  • +pressed_z - The Z button (on the Nunchuk) was pressed.
    +
  • +

You can also get the following properties from any Wii Remote instance; they will return "undefined" if the remote +isn't able to see the TV/sensor bar, so be sure to check this!

+ +
    +
  • +x - The x coordinate where the Wii Remote is pointing to on the screen. Generally between 0 and 800, but can be more on wide pages.
  • +
  • +y - The y coordinate where the Wii Remote is pointing to on the screen. Odd one; can be found as low as -48, as high as the height +of the current webpage + toolbar height, if enabled. Tinker with this one for your purposes.
  • +

Extra Tips and Tricks (Debugging)

+ +

One semi-useful trick to point out about this library is that each of your callback functions get passed two +arguments by default - a reference to the Wiimote you're working with, and the raw Wiimote status object that the +Wii reports back to the library. You get this in a normalized fashion, instead of having to deal with the odd polling +issues present in the browser.

+ +
var wiimote = new Wii.Remote(1, {horizontal: false});
+
+wiimote.when('pressed_a', function(wii_remote, wii_remote_status) {
+    /*  Alert an internal confidence level provided by the Wii. */
+    alert(wii_remote_status.dpdValidity);
+});
+
+ +

Debugging Javascript on the Wii is also nothing short of incredibly annoying, so I've made some efforts to patch this +up and make life a bit easier. My typical debugging strategy with any Wii-related code would always start with +the following. The first thing to do is set the Wii listener to run in debug mode, like so:

+ +
Wii.listen({debug: true});
+
+ +

With this set, you can log errors with any of the following functions. error can be a string or a complex object.

+ +
    +
  • +console.log(error); - Tried and true, now supported.
    +
  • +
  • +console.debug(error); - Same as console.log here, but syntax is supported.
    +
  • +
  • +throw new Error(error); - Throw them, they'll be logged.
    +
  • +
  • +Wii.util.debug(error); - The core function that handles logging internally.
  • +

If the typical Wii debugging flow isn't enough for you, go aggressive with this - just be aware that you can crash +the Wii's browser if you're using try/catch all over the place, as it's not cheap in Javascript.

+ +
try {
+    // Whatever function to execute
+} catch(e) { Wii.util.debug(e); }
+
+ +

Why the button limitations?

+ +

The Nintendo Wii treats the primary controller differently than the other ones, and doesn't report any action +from the Nunchuk, nor does it report when someone has pressed the "B" button on the primary controller (as it's used +for scrolling a page).

+ +

The Wii Browser also doesn't report data for Gamecube controllers, the Classic controller, or any other accessories.

+ +

It's a work in progress to see what can be done about these, but it's impossible to guarantee anything will come out +of it unless Nintendo and/or Opera can come out with something new.

+ +

Known Issues

+ +

Primary Wiimote is a bit more responsive than the extra 3
+This library works by polling the status of the three extra Wii-remotes in 100ms intervals and dispatching events +based on this. Anything lower than 100ms causes the Wii to run into memory limitations, and the single-threaded +nature of the browser doesn't really help this issue.

+ +

The primary Wii-remote uses an odd combination of DOM-esque callbacks; due to this, it reports more frequently than +the other Wii-remotes. It's not a showstopper by any means, but for small games it would in theory give a weighted advantage. +I'll probably end up throttling this through the library by means of a flag, e.g "game_mode": true in the initial options.

+ +

Todo List

+ +
    +
  • Build in functionality for multiple button presses at the same time (difficult to get right in this environment)
  • +
  • Determine canceling B-button/scrolling on pages ("app"/"game" style)
  • +
  • Determine feasibility of canceling out "1" press on the primary Wii-remote.
  • +

Building and Developing

+ +

If you'd like to help with this library, you're more than welcome to. Simply fork it on GitHub, work away, then +issue me a pull request. I generally respond within 24 hours.

+ +

The build system here is pretty simple - edits and changes go into the /js/src/ files, and you can run

+ +
python build.py  
+
+ +

from the main directory to build a new version. The minifier here is YUI; Closure/UglifyJS are more aggressive, and +for some reason throw ridiculous issues in the Wii's browser that I've been unable to track down (and I don't have +more time to throw at it).

+ +

In short, the builds require Python/Java, but once you've got them all installed you should only need the command above.

+ +

How is this different from...?

+ +

I sadly did not find out about wii.js until after I released this library; +with respect to the original author, his work only covers the primary Wii Remote and not the extra ones, nor has it +been updated in years. While his approach appears to be the same as mine (or mine the same as his), neither one +influenced the other, and they're totally separate works.

+ +

With the exception of wii.js, I do not know of any other (remaining) Wii interaction Javascript libraries. It's for +these reasons (and my desire for a simpler API) that I built this. ;)

+ +

Licensing, etc

+ +

wii-js is released under an MIT license. Just provide credit where need be if you choose to use this, it's taken quite +a bit of my time to decipher the utterly random pieces and intricacies of this Javascript engine. ;)

+
+
+ + + + + + + \ No newline at end of file diff --git a/javascripts/scale.fix.js b/javascripts/scale.fix.js new file mode 100644 index 0000000..08716c0 --- /dev/null +++ b/javascripts/scale.fix.js @@ -0,0 +1,20 @@ +fixScale = function(doc) { + + var addEvent = 'addEventListener', + type = 'gesturestart', + qsa = 'querySelectorAll', + scales = [1, 1], + meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : []; + + function fix() { + meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1]; + doc.removeEventListener(type, fix, true); + } + + if ((meta = meta[meta.length - 1]) && addEvent in doc) { + fix(); + scales = [.25, 1.6]; + doc[addEvent](type, fix, true); + } + +}; \ No newline at end of file diff --git a/params.json b/params.json new file mode 100644 index 0000000..196ff94 --- /dev/null +++ b/params.json @@ -0,0 +1 @@ +{"name":"Wii-js","tagline":"A sane, documented, (hopefully) performant event-based library for Wiimote webpage interaction.","body":"wii-js\r\n==============================================================================================\r\nThe Nintendo Wii is an entertainment system with an utterly _massive_ install base, and when \r\nyou couple it with the fact that it's got a web browser (mostly) built in, there's a lot of\r\npotential for third party development. Sadly, few have opted to do any sort of development for\r\nit. While it doesn't help that Nintendo pretty much dropped the ball on this opportunity, the\r\nexperience of browsing the web on the Wii isn't actually that compelling to begin with.\r\n\r\nThat said, I think this can serve one other purpose: it's an ideal environment to teach children\r\nhow to program! I created this library to sanitize Wii interaction with webpages in the browser,\r\nas it's notoriously crippled. It aims to offer a solid, documented, performant API that's easy to \r\nunderstand and pick up. With this library, you can have up to 4 Wii-motes interacting with your\r\nwebpage at once, a dynamic not found in other web browsing mediums.\r\n\r\nYou can find a built source file and a _minified_ source file for production use in the **/js/** directory.\r\nTo play with a live example, load up the demo (_index.html_) on your own server, or feel free to use mine:\r\n\r\n**wii-js Demo: [http://venodesigns.net/wii/](http://venodesigns.net/wii/)** \r\n\r\nWorking with the Wii's browser can be odd - it has moderately good support for CSS, so you're never really\r\nas bad off as you'd be with a version of Internet Explorer - that said, if you're looking for a good read\r\non what's supported, check out **[this article on Opera Wii supported technologies](http://www.opera.com/docs/specs/opera9/?platform=wii)**.\r\n\r\nQuestions, comments, criticism and praise can be directed to me at the following outlets:\r\n\r\n- You can email me at **ryan [at] venodesigns (dot) net**. \r\n- You can hit me up on Twitter: **[@ryanmcgrath](http://twitter.com/ryanmcgrath/)** \r\n- Contact me through **[my website](http://venodesigns.net)** \r\n- **Technical issues can be filed on the [wii-js GitHub Issues Tracker](https://github.com/ryanmcgrath/wii-js/issues)** \r\n\r\n\r\nExample Usage\r\n----------------------------------------------------------------------------------------------\r\n``` javascript\r\nvar wiimote = new Wii.Remote(1, {horizontal: true}),\r\n wiimote2 = new Wii.Remote(2, {horizontal: true});\r\n\r\nwiimote.when('pressed_a', function() {\r\n alert('Wiimote #1 pressed the A Button!');\r\n});\r\n\r\nwiimote2.when('pressed_a', function() {\r\n\talert('Wiimote #2 pressed the A Button!');\r\n});\r\n\r\nWii.listen();\r\n```\r\n\r\n\r\nTechnical Documentation\r\n----------------------------------------------------------------------------------------------\r\nThe largest issue with making interactive pages that work with the Wii has been that the API has\r\nbeen nothing short of a black hole. When you actually begin to dig in and figure out what's going on,\r\nit gets even uglier to see - the primary wiimote, for instance, has a totally different set of signals\r\nthan the other three.\r\n\r\nwii-js abstracts away most of these differences and/or problems, and works on a very simple event-dispatch \r\nsystem. What this means is that you create an instance of a Wii Remote, subscribe to events, and provide a\r\nfunction to get called when that event has occurred. The following syntax should explain this:\r\n\r\n``` javascript\r\nwiimote.when('event_name_here', function() { /* My callback function */ });\r\n```\r\n\r\nWhen instantiating a Wii Remote instance, you can choose to have the library interpret directional pad controls\r\nin horizontal or vertical mode. You can change this at any point, if you want, by simply swapping the property.\r\n\r\n``` javascript\r\nvar wiimote = new Wii.Remote(1, {horizontal: true}); // Horizontal controls\r\nvar wiimote = new Wii.Remote(1, {horizontal: false}); // Vertical controls\r\n\r\nwiimote.opts.horizontal = true; // Change to horizontal scheme.\r\n```\r\n\r\nThe final important piece is to start the Wii-event loop; this manages the event dispatcher internally. To do this, simply...\r\n\r\n``` javascript\r\nWii.listen();\r\n```\r\n\r\nYou can listen for the following events on all controllers:\r\n\r\n- **pressed_up** - The up button was pressed. \r\n- **pressed_down** - The down button was pressed. \r\n- **pressed_left** - The left button was pressed. \r\n- **pressed_right** - The right button was pressed. \r\n- **pressed_a** - The A button was pressed. \r\n- **pressed_1** - The 1 button was pressed. (_Note: On controller 1, this triggers a menu - work in progress..._) \r\n- **pressed_2** - The 2 button was pressed. \r\n- **pressed_plus** - The plus (+) button was pressed. \r\n- **pressed_minus** - The minus (-) button was pressed. \r\n- **roll_change** - The roll of the controller (balance) changed. You can get the current roll in radians with _\"this.roll\"_; positive is upright, negative is the other. \r\n- **distance_change** - The distance of the wiimote (in meters) from the TV/sensor bar has changed. This event isn't totally reliable, but should work for most cases. \r\n\r\nYou can listen for the following events on _extra controllers_, but not the primary controller.\r\n\r\n- **pressed_b** - The B button was pressed. \r\n- **pressed_c** - The C button (on the Nunchuk) was pressed. \r\n- **pressed_z** - The Z button (on the Nunchuk) was pressed. \r\n\r\nYou can also get the following properties from any Wii Remote instance; they will return \"undefined\" if the remote\r\nisn't able to see the TV/sensor bar, so be sure to check this!\r\n\r\n- **x** - The x coordinate where the Wii Remote is pointing to on the screen. Generally between 0 and 800, but can be more on wide pages.\r\n- **y** - The y coordinate where the Wii Remote is pointing to on the screen. Odd one; can be found as low as -48, as high as the height\r\nof the current webpage + toolbar height, if enabled. Tinker with this one for your purposes.\r\n\r\n\r\nExtra Tips and Tricks (Debugging)\r\n------------------------------------------------------------------------------------------------------------------\r\nOne semi-useful trick to point out about this library is that each of your callback functions get passed two\r\narguments by default - a reference to the Wiimote you're working with, and the raw Wiimote status object that the\r\nWii reports back to the library. You get this in a normalized fashion, instead of having to deal with the odd polling\r\nissues present in the browser.\r\n\r\n``` javascript\r\nvar wiimote = new Wii.Remote(1, {horizontal: false});\r\n\r\nwiimote.when('pressed_a', function(wii_remote, wii_remote_status) {\r\n\t/*\tAlert an internal confidence level provided by the Wii. */\r\n\talert(wii_remote_status.dpdValidity);\r\n});\r\n```\r\n\r\nDebugging Javascript on the Wii is also nothing short of incredibly annoying, so I've made some efforts to patch this\r\nup and make life a bit easier. My typical debugging strategy with any Wii-related code would always start with\r\nthe following. The first thing to do is set the Wii listener to run in debug mode, like so:\r\n\r\n``` javascript\r\nWii.listen({debug: true});\r\n```\r\n\r\nWith this set, you can log errors with any of the following functions. `error` can be a string or a complex object.\r\n\r\n- **console.log(error);** - Tried and true, now supported. \r\n- **console.debug(error);** - Same as console.log here, but syntax is supported. \r\n- **throw new Error(error);** - Throw them, they'll be logged. \r\n- **Wii.util.debug(error);** - The core function that handles logging internally.\r\n\r\nIf the typical Wii debugging flow isn't enough for you, go aggressive with this - just be aware that you can crash\r\nthe Wii's browser if you're using try/catch all over the place, as it's not cheap in Javascript.\r\n\r\n``` javascript\r\ntry {\r\n // Whatever function to execute\r\n} catch(e) { Wii.util.debug(e); }\r\n```\r\n\r\n\r\nWhy the button limitations?\r\n------------------------------------------------------------------------------------------------------------------\r\nThe Nintendo Wii treats the primary controller differently than the other ones, and doesn't report any action\r\nfrom the Nunchuk, nor does it report when someone has pressed the \"B\" button on the primary controller (as it's used\r\nfor scrolling a page).\r\n\r\nThe Wii Browser also doesn't report data for Gamecube controllers, the Classic controller, or any other accessories.\r\n\r\nIt's a work in progress to see what can be done about these, but it's impossible to guarantee anything will come out\r\nof it unless Nintendo and/or Opera can come out with something new.\r\n\r\n\r\nKnown Issues\r\n------------------------------------------------------------------------------------------------------------------\r\n**Primary Wiimote is a bit more responsive than the extra 3** \r\nThis library works by polling the status of the three extra Wii-remotes in 100ms intervals and dispatching events\r\nbased on this. Anything lower than 100ms causes the Wii to run into memory limitations, and the single-threaded\r\nnature of the browser doesn't really help this issue.\r\n\r\nThe primary Wii-remote uses an odd combination of DOM-esque callbacks; due to this, it reports _more frequently_ than\r\nthe other Wii-remotes. It's not a showstopper by any means, but for small games it would in theory give a weighted advantage.\r\nI'll probably end up throttling this through the library by means of a flag, e.g \"game_mode\": true in the initial options.\r\n\r\n\r\nTodo List\r\n------------------------------------------------------------------------------------------------------------------\r\n- Build in functionality for multiple button presses at the same time (difficult to get right in this environment)\r\n- Determine canceling B-button/scrolling on pages (\"app\"/\"game\" style)\r\n- Determine feasibility of canceling out \"1\" press on the primary Wii-remote.\r\n\r\n\r\nBuilding and Developing\r\n------------------------------------------------------------------------------------------------------------------\r\nIf you'd like to help with this library, you're more than welcome to. Simply fork it on GitHub, work away, then\r\nissue me a pull request. I generally respond within 24 hours.\r\n\r\nThe build system here is pretty simple - edits and changes go into the /js/src/ files, and you can run\r\n\r\n python build.py \r\n\r\nfrom the main directory to build a new version. The minifier here is YUI; Closure/UglifyJS are more aggressive, and\r\nfor some reason throw ridiculous issues in the Wii's browser that I've been unable to track down (and I don't have\r\nmore time to throw at it).\r\n\r\nIn short, the builds require Python/Java, but once you've got them all installed you should only need the command above.\r\n\r\n\r\nHow is this different from...?\r\n-------------------------------------------------------------------------------------------------------------------\r\nI sadly did not find out about [wii.js](http://www.bolinfest.com/wii/overview.php) until after I released this library;\r\nwith respect to the original author, his work only covers the primary Wii Remote and not the extra ones, nor has it\r\nbeen updated in years.\tWhile his approach appears to be the same as mine (or mine the same as his), neither one \r\ninfluenced the other, and they're totally separate works.\r\n\r\nWith the exception of wii.js, I do not know of any other (remaining) Wii interaction Javascript libraries. It's for\r\nthese reasons (and my desire for a simpler API) that I built this. ;)\r\n\r\n\r\nLicensing, etc\r\n-------------------------------------------------------------------------------------------------------------------\r\nwii-js is released under an MIT license. Just provide credit where need be if you choose to use this, it's taken quite\r\na bit of my time to decipher the utterly random pieces and intricacies of this Javascript engine. ;)\r\n","google":"UA-40660943-3","note":"Don't delete this file! It's used internally to help with page regeneration."} \ No newline at end of file diff --git a/stylesheets/pygment_trac.css b/stylesheets/pygment_trac.css new file mode 100644 index 0000000..1926cfd --- /dev/null +++ b/stylesheets/pygment_trac.css @@ -0,0 +1,60 @@ +.highlight .hll { background-color: #49483e } +.highlight { background: #3A3C42; color: #f8f8f2 } +.highlight .c { color: #75715e } /* Comment */ +.highlight .err { color: #960050; background-color: #1e0010 } /* Error */ +.highlight .k { color: #66d9ef } /* Keyword */ +.highlight .l { color: #ae81ff } /* Literal */ +.highlight .n { color: #f8f8f2 } /* Name */ +.highlight .o { color: #f92672 } /* Operator */ +.highlight .p { color: #f8f8f2 } /* Punctuation */ +.highlight .cm { color: #75715e } /* Comment.Multiline */ +.highlight .cp { color: #75715e } /* Comment.Preproc */ +.highlight .c1 { color: #75715e } /* Comment.Single */ +.highlight .cs { color: #75715e } /* Comment.Special */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .kc { color: #66d9ef } /* Keyword.Constant */ +.highlight .kd { color: #66d9ef } /* Keyword.Declaration */ +.highlight .kn { color: #f92672 } /* Keyword.Namespace */ +.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */ +.highlight .kr { color: #66d9ef } /* Keyword.Reserved */ +.highlight .kt { color: #66d9ef } /* Keyword.Type */ +.highlight .ld { color: #e6db74 } /* Literal.Date */ +.highlight .m { color: #ae81ff } /* Literal.Number */ +.highlight .s { color: #e6db74 } /* Literal.String */ +.highlight .na { color: #a6e22e } /* Name.Attribute */ +.highlight .nb { color: #f8f8f2 } /* Name.Builtin */ +.highlight .nc { color: #a6e22e } /* Name.Class */ +.highlight .no { color: #66d9ef } /* Name.Constant */ +.highlight .nd { color: #a6e22e } /* Name.Decorator */ +.highlight .ni { color: #f8f8f2 } /* Name.Entity */ +.highlight .ne { color: #a6e22e } /* Name.Exception */ +.highlight .nf { color: #a6e22e } /* Name.Function */ +.highlight .nl { color: #f8f8f2 } /* Name.Label */ +.highlight .nn { color: #f8f8f2 } /* Name.Namespace */ +.highlight .nx { color: #a6e22e } /* Name.Other */ +.highlight .py { color: #f8f8f2 } /* Name.Property */ +.highlight .nt { color: #f92672 } /* Name.Tag */ +.highlight .nv { color: #f8f8f2 } /* Name.Variable */ +.highlight .ow { color: #f92672 } /* Operator.Word */ +.highlight .w { color: #f8f8f2 } /* Text.Whitespace */ +.highlight .mf { color: #ae81ff } /* Literal.Number.Float */ +.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ +.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ +.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ +.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ +.highlight .sc { color: #e6db74 } /* Literal.String.Char */ +.highlight .sd { color: #e6db74 } /* Literal.String.Doc */ +.highlight .s2 { color: #e6db74 } /* Literal.String.Double */ +.highlight .se { color: #ae81ff } /* Literal.String.Escape */ +.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ +.highlight .si { color: #e6db74 } /* Literal.String.Interpol */ +.highlight .sx { color: #e6db74 } /* Literal.String.Other */ +.highlight .sr { color: #e6db74 } /* Literal.String.Regex */ +.highlight .s1 { color: #e6db74 } /* Literal.String.Single */ +.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ +.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ +.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ +.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ +.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/stylesheets/styles.css b/stylesheets/styles.css new file mode 100644 index 0000000..466b9d6 --- /dev/null +++ b/stylesheets/styles.css @@ -0,0 +1,356 @@ +@import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700); +html { + background: #6C7989; + background: #6c7989 -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #6c7989), color-stop(100%, #434b55)) fixed; + background: #6c7989 -webkit-linear-gradient(#6c7989, #434b55) fixed; + background: #6c7989 -moz-linear-gradient(#6c7989, #434b55) fixed; + background: #6c7989 -o-linear-gradient(#6c7989, #434b55) fixed; + background: #6c7989 -ms-linear-gradient(#6c7989, #434b55) fixed; + background: #6c7989 linear-gradient(#6c7989, #434b55) fixed; +} + +body { + padding: 50px 0; + margin: 0; + font: 14px/1.5 Lato, "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #555; + font-weight: 300; + background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAeCAYAAABNChwpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAAAUdEVYdENyZWF0aW9uIFRpbWUAMy82LzEygrTcTAAAAFRJREFUSIljfPDggZRf5RIGGNjUHsNATz6jXmSL1Kb2GLiAX+USBnrymRgGGDCORgFmoNAXjEbBaBSMRsFoFIxGwWgUjEbBaBSMRsFoFIxGwWgUAABYNujumib3wAAAAABJRU5ErkJggg==') fixed; +} + +.wrapper { + width: 640px; + margin: 0 auto; + background: #DEDEDE; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + -ms-border-radius: 8px; + -o-border-radius: 8px; + border-radius: 8px; + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.45) 0 3px 10px; + -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.45) 0 3px 10px; + box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.45) 0 3px 10px; +} + +header, section, footer { + display: block; +} + +a { + color: #069; + text-decoration: none; +} + +p { + margin: 0 0 20px; + padding: 0; +} + +strong { + color: #222; + font-weight: 700; +} + +header { + -webkit-border-radius: 8px 8px 0 0; + -moz-border-radius: 8px 8px 0 0; + -ms-border-radius: 8px 8px 0 0; + -o-border-radius: 8px 8px 0 0; + border-radius: 8px 8px 0 0; + background: #C6EAFA; + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ddfbfc), color-stop(100%, #c6eafa)); + background: -webkit-linear-gradient(#ddfbfc, #c6eafa); + background: -moz-linear-gradient(#ddfbfc, #c6eafa); + background: -o-linear-gradient(#ddfbfc, #c6eafa); + background: -ms-linear-gradient(#ddfbfc, #c6eafa); + background: linear-gradient(#ddfbfc, #c6eafa); + position: relative; + padding: 15px 20px; + border-bottom: 1px solid #B2D2E1; +} +header h1 { + margin: 0; + padding: 0; + font-size: 24px; + line-height: 1.2; + color: #069; + text-shadow: rgba(255, 255, 255, 0.9) 0 1px 0; +} +header.without-description h1 { + margin: 10px 0; +} +header p { + margin: 0; + color: #61778B; + width: 300px; + font-size: 13px; +} +header p.view { + display: none; + font-weight: 700; + text-shadow: rgba(255, 255, 255, 0.9) 0 1px 0; + -webkit-font-smoothing: antialiased; +} +header p.view a { + color: #06c; +} +header p.view small { + font-weight: 400; +} +header ul { + margin: 0; + padding: 0; + list-style: none; + position: absolute; + z-index: 1; + right: 20px; + top: 20px; + height: 38px; + padding: 1px 0; + background: #5198DF; + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #77b9fb), color-stop(100%, #3782cd)); + background: -webkit-linear-gradient(#77b9fb, #3782cd); + background: -moz-linear-gradient(#77b9fb, #3782cd); + background: -o-linear-gradient(#77b9fb, #3782cd); + background: -ms-linear-gradient(#77b9fb, #3782cd); + background: linear-gradient(#77b9fb, #3782cd); + border-radius: 5px; + -webkit-box-shadow: inset rgba(255, 255, 255, 0.45) 0 1px 0, inset rgba(0, 0, 0, 0.2) 0 -1px 0; + -moz-box-shadow: inset rgba(255, 255, 255, 0.45) 0 1px 0, inset rgba(0, 0, 0, 0.2) 0 -1px 0; + box-shadow: inset rgba(255, 255, 255, 0.45) 0 1px 0, inset rgba(0, 0, 0, 0.2) 0 -1px 0; + width: auto; +} +header ul:before { + content: ''; + position: absolute; + z-index: -1; + left: -5px; + top: -4px; + right: -5px; + bottom: -6px; + background: rgba(0, 0, 0, 0.1); + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + -ms-border-radius: 8px; + -o-border-radius: 8px; + border-radius: 8px; + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 0, inset rgba(255, 255, 255, 0.7) 0 -1px 0; + -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 0, inset rgba(255, 255, 255, 0.7) 0 -1px 0; + box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 0, inset rgba(255, 255, 255, 0.7) 0 -1px 0; +} +header ul li { + width: 79px; + float: left; + border-right: 1px solid #3A7CBE; + height: 38px; +} +header ul li.single { + border: none; +} +header ul li + li { + width: 78px; + border-left: 1px solid #8BBEF3; +} +header ul li + li + li { + border-right: none; + width: 79px; +} +header ul a { + line-height: 1; + font-size: 11px; + color: #fff; + color: rgba(255, 255, 255, 0.8); + display: block; + text-align: center; + font-weight: 400; + padding-top: 6px; + height: 40px; + text-shadow: rgba(0, 0, 0, 0.4) 0 -1px 0; +} +header ul a strong { + font-size: 14px; + display: block; + color: #fff; + -webkit-font-smoothing: antialiased; +} + +section { + padding: 15px 20px; + font-size: 15px; + border-top: 1px solid #fff; + background: -webkit-gradient(linear, 50% 0%, 50% 700, color-stop(0%, #fafafa), color-stop(100%, #dedede)); + background: -webkit-linear-gradient(#fafafa, #dedede 700px); + background: -moz-linear-gradient(#fafafa, #dedede 700px); + background: -o-linear-gradient(#fafafa, #dedede 700px); + background: -ms-linear-gradient(#fafafa, #dedede 700px); + background: linear-gradient(#fafafa, #dedede 700px); + -webkit-border-radius: 0 0 8px 8px; + -moz-border-radius: 0 0 8px 8px; + -ms-border-radius: 0 0 8px 8px; + -o-border-radius: 0 0 8px 8px; + border-radius: 0 0 8px 8px; + position: relative; +} + +h1, h2, h3, h4, h5, h6 { + color: #222; + padding: 0; + margin: 0 0 20px; + line-height: 1.2; +} + +p, ul, ol, table, pre, dl { + margin: 0 0 20px; +} + +h1, h2, h3 { + line-height: 1.1; +} + +h1 { + font-size: 28px; +} + +h2 { + color: #393939; +} + +h3, h4, h5, h6 { + color: #494949; +} + +blockquote { + margin: 0 -20px 20px; + padding: 15px 20px 1px 40px; + font-style: italic; + background: #ccc; + background: rgba(0, 0, 0, 0.06); + color: #222; +} + +img { + max-width: 100%; +} + +code, pre { + font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; + color: #333; + font-size: 12px; + overflow-x: auto; +} + +pre { + padding: 20px; + background: #3A3C42; + color: #f8f8f2; + margin: 0 -20px 20px; +} +pre code { + color: #f8f8f2; +} +li pre { + margin-left: -60px; + padding-left: 60px; +} + +table { + width: 100%; + border-collapse: collapse; +} + +th, td { + text-align: left; + padding: 5px 10px; + border-bottom: 1px solid #aaa; +} + +dt { + color: #222; + font-weight: 700; +} + +th { + color: #222; +} + +small { + font-size: 11px; +} + +hr { + border: 0; + background: #aaa; + height: 1px; + margin: 0 0 20px; +} + +footer { + width: 640px; + margin: 0 auto; + padding: 20px 0 0; + color: #ccc; + overflow: hidden; +} +footer a { + color: #fff; + font-weight: bold; +} +footer p { + float: left; +} +footer p + p { + float: right; +} + +@media print, screen and (max-width: 740px) { + body { + padding: 0; + } + + .wrapper { + -webkit-border-radius: 0; + -moz-border-radius: 0; + -ms-border-radius: 0; + -o-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + width: 100%; + } + + footer { + -webkit-border-radius: 0; + -moz-border-radius: 0; + -ms-border-radius: 0; + -o-border-radius: 0; + border-radius: 0; + padding: 20px; + width: auto; + } + footer p { + float: none; + margin: 0; + } + footer p + p { + float: none; + } +} +@media print, screen and (max-width:580px) { + header ul { + display: none; + } + + header p.view { + display: block; + } + + header p { + width: 100%; + } +} +@media print { + header p.view a small:before { + content: 'at http://github.com/'; + } +}