diff options
author | Thomas Park <thomas@thomaspark.me> | 2012-04-29 12:56:30 -0400 |
---|---|---|
committer | Thomas Park <thomas@thomaspark.me> | 2012-04-29 12:56:30 -0400 |
commit | 3d1c5e53896797b88ceb637052d0e4319f637686 (patch) | |
tree | 963f3dbb0139f517c320b7c76545cf487b326165 /api | |
parent | 1b8b8aa6c434f06e99c0c78e0563c57b19d66b56 (diff) |
api: new schema and example
Diffstat (limited to 'api')
-rw-r--r-- | api/example.html | 44 | ||||
-rw-r--r-- | api/themes.json | 106 |
2 files changed, 150 insertions, 0 deletions
diff --git a/api/example.html b/api/example.html new file mode 100644 index 00000000..c340b23e --- /dev/null +++ b/api/example.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>Bootswatch API Example</title> + <style type="text/css"> + .hidden { display: none; } + </style> +</head> + +<body> + + <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> + <script src="http://github.com/janl/mustache.js/raw/master/mustache.js"></script> + <script type="text/javascript"> + + $(document).ready(function(){ + + $.get("http://simplejsonp.nodester.com/thomaspark/bootswatch", function (data) { + + var template_menu = "<div id='menu'><select>{{#.}}<option>{{name}}</option>{{/.}}</select></div>"; + var template_previews = "{{#.}}<div class='preview hidden' id='{{name}}'><h1>{{name}}: {{description}}</h1><p><a href='{{preview}}'><img src='{{thumbnail}}'></a></p></div>{{/.}}" + + var output_menu = Mustache.render(template_menu, data.themes); + var output_previews = Mustache.render(template_previews, data.themes); + + $('body').append(output_menu + output_previews); + + $('.preview').first().removeClass('hidden'); + + $('#menu').change(function(){ + $('.preview').addClass('hidden'); + var show = '#' + $('#menu :selected').text(); + $(show).removeClass('hidden'); + }); + + }, "json"); + + }); + + </script> + +</body> +</html>
\ No newline at end of file diff --git a/api/themes.json b/api/themes.json new file mode 100644 index 00000000..f9e02959 --- /dev/null +++ b/api/themes.json @@ -0,0 +1,106 @@ +{ + + "themes": [ + + { + "name": "Amelia", + "description": "Sweet and cheery.", + "thumbnail": "http://bootswatch.com/amelia/thumbnail.png", + "preview": "http://bootswatch.com/amelia/", + "css": "http://bootswatch.com/amelia/bootstrap.css", + "css-min": "http://bootswatch.com/amelia/bootstrap.min.css" + }, + + { + "name": "Cerulean", + "description": "A calm blue sky.", + "thumbnail": "http://bootswatch.com/cerulean/thumbnail.png", + "preview": "http://bootswatch.com/cerulean/", + "css": "http://bootswatch.com/cerulean/bootstrap.css", + "css-min": "http://bootswatch.com/cerulean/bootstrap.min.css" + }, + + { + "name": "Cyborg", + "description": "Jet black and electric blue.", + "thumbnail": "http://bootswatch.com/cyborg/thumbnail.png", + "preview": "http://bootswatch.com/cyborg/", + "css": "http://bootswatch.com/cyborg/bootstrap.css", + "css-min": "http://bootswatch.com/cyborg/bootstrap.min.css" + }, + + { + "name": "Journal", + "description": "Crisp like a new sheet of paper.", + "thumbnail": "http://bootswatch.com/journal/thumbnail.png", + "preview": "http://bootswatch.com/journal/", + "css": "http://bootswatch.com/journal/bootstrap.css", + "css-min": "http://bootswatch.com/journal/bootstrap.min.css" + }, + + { + "name": "Readable", + "description": "Optimized for legibility.", + "thumbnail": "http://bootswatch.com/readable/thumbnail.png", + "preview": "http://bootswatch.com/readable/", + "css": "http://bootswatch.com/readable/bootstrap.css", + "css-min": "http://bootswatch.com/readable/bootstrap.min.css" + }, + + { + "name": "Simplex", + "description": "Mini and minimalist.", + "thumbnail": "http://bootswatch.com/simplex/thumbnail.png", + "preview": "http://bootswatch.com/simplex/", + "css": "http://bootswatch.com/simplex/bootstrap.css", + "css-min": "http://bootswatch.com/simplex/bootstrap.min.css" + }, + + { + "name": "Slate", + "description": "Shades of gunmetal gray.", + "thumbnail": "http://bootswatch.com/slate/thumbnail.png", + "preview": "http://bootswatch.com/slate/", + "css": "http://bootswatch.com/slate/bootstrap.css", + "css-min": "http://bootswatch.com/slate/bootstrap.min.css" + }, + + { + "name": "Spacelab", + "description": "Silvery and sleek.", + "thumbnail": "http://bootswatch.com/spacelab/thumbnail.png", + "preview": "http://bootswatch.com/spacelab/", + "css": "http://bootswatch.com/spacelab/bootstrap.css", + "css-min": "http://bootswatch.com/spacelab/bootstrap.min.css" + }, + + { + "name": "Spruce", + "description": "Camping in the woods.", + "thumbnail": "http://bootswatch.com/spruce/thumbnail.png", + "preview": "http://bootswatch.com/spruce/", + "css": "http://bootswatch.com/spruce/bootstrap.css", + "css-min": "http://bootswatch.com/spruce/bootstrap.min.css" + }, + + { + "name": "Superhero", + "description": "Batman meets... Aquaman?", + "thumbnail": "http://bootswatch.com/superhero/thumbnail.png", + "preview": "http://bootswatch.com/superhero/", + "css": "http://bootswatch.com/superhero/bootstrap.css", + "css-min": "http://bootswatch.com/superhero/bootstrap.min.css" + }, + + { + "name": "United", + "description": "Ubuntu orange and unique font.", + "thumbnail": "http://bootswatch.com/united/thumbnail.png", + "preview": "http://bootswatch.com/united/", + "css": "http://bootswatch.com/united/bootstrap.css", + "css-min": "http://bootswatch.com/united/bootstrap.min.css" + } + + ] + +} |