summaryrefslogtreecommitdiff
path: root/tests/thumbnail.html
blob: b8e3f3fb8f14482aad9c8bfa1a6e66bcfd071a51 (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
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Bootswatch: Default Bootstrap</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link rel="stylesheet" href="../default/bootstrap.css" media="screen" id="stylesheet">
    <link rel="stylesheet" href="../assets/css/bootswatch.min.css">
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="../bower_components/html5shiv/dist/html5shiv.js"></script>
      <script src="../bower_components/respond/dest/respond.min.js"></script>
    <![endif]-->
    <style>

        body,
        .navbar,
        .container {
          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-default navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <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>
        <div class="navbar-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>
            </li>
            <li class="dropdown">
              <a class="dropdown-toggle" data-toggle="dropdown" href="#" id="download">Download <span class="caret"></span></a>
            </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">Default</h1>
            <p id="description" class="lead">Basic Bootstrap</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="https://code.jquery.com/jquery-1.10.2.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/3/", function (data) {
          var menuTemplate = "<div id='menu' style='position:fixed;top:10px;right:10px;'><select>{{#.}}<option data-description='{{description}}'>{{name}}</option>{{/.}}</select></div>",
              menuHTML = Mustache.render(menuTemplate, data.themes);

          $('body').append(menuHTML);

          $('#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>