blob: b576f1b7096bc117a01c50d440d06f8319f872f4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootswatch: Default Bootstrap</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link rel="stylesheet" href="../amelia/bootstrap.min.css" media="screen" id="stylesheet">
<link rel="stylesheet" href="../bower_components/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="../assets/css/bootswatch.min.css">
<style>
body,
.navbar {
width: 500px;
}
h1, p, .bs-example {
text-align: center;
}
.lead {
margin-bottom: 2em;
}
.page-header {
border-bottom: none;
}
</style>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="container">
<a href="../" class="navbar-brand">Bootswatch</a>
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="nav-collapse collapse" id="navbar-main">
<ul class="nav navbar-nav">
<li class="dropdown active">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" id="themes">Themes <span class="caret"></span></a>
<ul class="dropdown-menu" aria-labelledby="themes">
<li><a tabindex="-1" href="../default/">Default</a></li>
<li class="divider"></li>
<li><a tabindex="-1" href="../amelia/">Amelia</a></li>
<li><a tabindex="-1" href="../cerulean/">Cerulean</a></li>
<li><a tabindex="-1" href="../cosmo/">Cosmo</a></li>
<li><a tabindex="-1" href="../cyborg/">Cyborg</a></li>
<li><a tabindex="-1" href="../flatly/">Flatly</a></li>
<li><a tabindex="-1" href="../journal/">Journal</a></li>
<li><a tabindex="-1" href="../readable/">Readable</a></li>
<li><a tabindex="-1" href="../simplex/">Simplex</a></li>
<li><a tabindex="-1" href="../slate/">Slate</a></li>
<li><a tabindex="-1" href="../spacelab/">Spacelab</a></li>
<li><a tabindex="-1" href="../superhero/">Superhero</a></li>
<li><a tabindex="-1" href="../united/">United</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" id="download">Download <span class="caret"></span></a>
<ul class="dropdown-menu" aria-labelledby="download">
<li><a tabindex="-1" href="../default/">bootstrap.min.css</a></li>
<li><a tabindex="-1" href="../amelia/">bootstrap.css</a></li>
<li class="divider"></li>
<li><a tabindex="-1" href="../cerulean/">variables.less</a></li>
<li><a tabindex="-1" href="../cosmo/">bootswatch.less</a></li>
</ul>
</li>
<li>
<a href="../help/">Help</a>
</li>
<li>
<a href="http://news.bootswatch.com">Blog</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-12">
<div class="page-header">
<h1 id="theme">Amelia</h1>
<p id="description" class="lead">Sweet and cheery</p>
<div class="bs-example">
<button type="button" class="btn btn-default">Default</button>
<button type="button" class="btn btn-primary">Primary</button>
<button type="button" class="btn btn-success">Success</button>
<button type="button" class="btn btn-info">Info</button>
<button type="button" class="btn btn-warning">Warning</button>
<button type="button" class="btn btn-danger">Danger</button>
</div>
</div>
</div>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/0.7.2/mustache.min.js"></script>
<script>
$.get("http://api.bootswatch.com", function (data) {
var t_menu = "<div id='menu' style='position:fixed;top:10px;right:10px;'><select>{{#.}}<option data-description='{{description}}'>{{name}}</option>{{/.}}</select></div>";
var t_previews = "{{#.}}<div class='preview hidden' id='{{name}}'><h1>{{name}}: {{description}}</h1><p><a href='{{preview}}'><img src='{{thumbnail}}'></a></p></div>{{/.}}";
var o_menu = Mustache.render(t_menu, data.themes);
var o_previews = Mustache.render(t_previews, data.themes);
$('body').append(o_menu);
$('#menu').change(function(){
var theme = $('#menu :selected');
$('#theme').text(theme.text());
$('#description').text(theme.data('description'));
theme = '../' + theme.text().toLowerCase() + '/bootstrap.min.css';
$('#stylesheet').attr('href', theme);
});
}, "json");
</script>
</body>
</html>
|