Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit e0426b9

Browse files
thieneditspkozlowski-opensource
authored andcommittedDec 28, 2013
chore(demo): update demo page for bootstrap3
Adds new header, mobile menu, fastclick, smooth scrolling, and more. Closes #1243 Closes #1469
1 parent 5d0ca36 commit e0426b9

File tree

8 files changed

+513
-187
lines changed

8 files changed

+513
-187
lines changed
 

‎misc/demo/assets/app.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
angular.module('bootstrapDemoApp', ['ui.bootstrap', 'plunker'], function($httpProvider){
2+
FastClick.attach(document.body);
23
delete $httpProvider.defaults.headers.common['X-Requested-With'];
34
});
45

@@ -52,4 +53,4 @@ var SelectModulesCtrl = function($scope, $modalInstance, modules) {
5253
$scope.cancel = function () {
5354
$modalInstance.dismiss();
5455
};
55-
};
56+
};

‎misc/demo/assets/demo.css

+240-34
Original file line numberDiff line numberDiff line change
@@ -32,53 +32,259 @@ section {
3232
background-color: #f5f5f5;
3333
}
3434

35-
.jumbotron {
36-
position: relative;
37-
padding: 40px 0;
38-
color: #fff;
35+
.bs-social {
36+
margin-top: 20px;
37+
margin-bottom: 20px;
3938
text-align: center;
40-
text-shadow: 0 1px 3px rgba(0,0,0,.4), 0 0 30px rgba(0,0,0,.075);
41-
background: #020031;
42-
background: -moz-linear-gradient(45deg, #020031 0%, #6d3353 100%);
43-
background: -webkit-gradient(linear, left bottom, right top, color-stop(0%,#020031), color-stop(100%,#6d3353));
44-
background: -webkit-linear-gradient(45deg, #020031 0%,#6d3353 100%);
45-
background: -o-linear-gradient(45deg, #020031 0%,#6d3353 100%);
46-
background: -ms-linear-gradient(45deg, #020031 0%,#6d3353 100%);
47-
background: linear-gradient(45deg, #020031 0%,#6d3353 100%);
48-
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#020031', endColorstr='#6d3353',GradientType=1 );
49-
-webkit-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);
50-
-moz-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);
51-
box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);
52-
border-radius: 0;
53-
-moz-border-radius: 0;
54-
-webkit-border-radius: 0;
55-
-o-border-radius: 0;
56-
}
57-
.bs-docs-social {
58-
margin-top: 1em;
59-
padding: 15px 0;
60-
text-align: center;
61-
background-color: rgba(245,245,245,0.3);
62-
border-top: 1px solid rgba(255,255,255,0.3);
63-
border-bottom: 1px solid rgba(221,221,221,0.3);
6439
}
6540

66-
.nav, .pagination, .carousel, .panel-title a {
41+
@media (min-width: 768px) {
42+
43+
.bs-social {
44+
text-align: left;
45+
}
46+
47+
}
48+
49+
.nav, .pagination, .carousel a {
6750
cursor: pointer;
6851
}
6952

70-
.bs-docs-social-buttons {
71-
margin-left: 0;
53+
.bs-social-buttons {
54+
display: inline-block;
7255
margin-bottom: 0;
7356
padding-left: 0;
7457
list-style: none;
7558
}
76-
.bs-docs-social-buttons li {
59+
.bs-social-buttons li {
7760
display: inline-block;
7861
padding: 5px 8px;
7962
line-height: 1;
8063
}
8164

65+
@media (max-width: 767px) {
66+
67+
.visible-xs.collapse.in {
68+
display: block!important;
69+
}
70+
.visible-xs.collapse {
71+
display: none!important;
72+
}
73+
74+
}
75+
76+
.navbar .collapse {
77+
border-top: 1px solid #e7e7e7;
78+
margin-left: -15px;
79+
margin-right: -15px;
80+
padding-right: 15px;
81+
padding-left: 15px;
82+
}
83+
84+
.show-grid {
85+
margin-bottom: 15px;
86+
}
87+
88+
/*
89+
* Container
90+
*
91+
* Tweak to width of container.
92+
*/
93+
94+
/*@media (min-width: 1200px) {
95+
.container{
96+
max-width: 970px;
97+
}
98+
}*/
99+
100+
/*
101+
* Tabs
102+
*
103+
* Tweaks to the Tabs.
104+
*/
105+
106+
.code .nav-tabs {
107+
border-bottom: 1px solid #ccc;
108+
}
109+
110+
.code pre, .code code {
111+
border-top: none;
112+
border-top-left-radius: 0;
113+
border-top-right-radius: 0;
114+
}
115+
116+
.code .nav-tabs>li.active>a, .code .nav-tabs>li.active>a:hover, .code .nav-tabs>li.active>a:focus {
117+
background-color: #f8f8f8;
118+
border: 1px solid #ccc;
119+
border-bottom-color: transparent;
120+
}
121+
122+
/*
123+
* Button Inverse
124+
*
125+
* Buttons in the masthead.
126+
*/
127+
128+
.btn-outline-inverse {
129+
color: #fff;
130+
background-color: transparent;
131+
border-color: #cdbfe3;
132+
margin: 10px;
133+
}
134+
135+
@media (min-width: 768px) {
136+
137+
.btn-outline-inverse {
138+
width: auto;
139+
margin: 20px 5px 20px 0;
140+
padding: 18px 24px;
141+
font-size: 21px;
142+
}
143+
144+
}
145+
146+
.btn-outline-inverse:hover, .btn-outline-inverse:focus, .btn-outline-inverse:active {
147+
color: #563d7c;
148+
text-shadow: none;
149+
background-color: #fff;
150+
border-color: #fff;
151+
}
152+
153+
154+
/* Page headers */
155+
.bs-header {
156+
padding: 30px 15px 40px; /* side padding builds on .container 15px, so 30px */
157+
font-size: 16px;
158+
text-align: center;
159+
text-shadow: 0 1px 0 rgba(0,0,0,.15);
160+
color: #cdbfe3;
161+
background-color: #563d7c;
162+
background-image: url(header.png);
163+
}
164+
.bs-header a {
165+
color: #fff;
166+
font-weight: normal;
167+
}
168+
.bs-header h1 {
169+
color: #fff;
170+
}
171+
.bs-header p {
172+
font-weight: 200;
173+
line-height: 1.4;
174+
}
175+
.bs-header .container {
176+
position: relative;
177+
}
178+
179+
@media (min-width: 768px) {
180+
.bs-header {
181+
font-size: 30px;
182+
text-align: left;
183+
}
184+
.bs-header h1 {
185+
font-size: 100px;
186+
line-height: 1;
187+
}
188+
}
189+
190+
@media (min-width: 992px) {
191+
.bs-header p {
192+
margin-right: 25%;
193+
}
194+
}
195+
196+
.navbar-inner {
197+
-webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.175);
198+
box-shadow: 0 3px 3px rgba(0,0,0,0.175);
199+
}
200+
201+
/*
202+
* Side navigation
203+
*
204+
* Scrollspy and affixed enhanced navigation to highlight sections and secondary
205+
* sections of docs content.
206+
*/
207+
208+
/* By default it's not affixed in mobile views, so undo that */
209+
.bs-sidebar.affix {
210+
position: static;
211+
}
212+
213+
/* First level of nav */
214+
.bs-sidenav {
215+
margin-top: 30px;
216+
margin-bottom: 30px;
217+
padding-top: 10px;
218+
padding-bottom: 10px;
219+
text-shadow: 0 1px 0 #fff;
220+
background-color: #f7f5fa;
221+
border-radius: 5px;
222+
}
223+
224+
/* All levels of nav */
225+
.bs-sidebar .nav > li > a {
226+
display: block;
227+
color: #716b7a;
228+
padding: 5px 20px;
229+
}
230+
.bs-sidebar .nav > li > a:hover,
231+
.bs-sidebar .nav > li > a:focus {
232+
text-decoration: none;
233+
background-color: #e5e3e9;
234+
border-right: 1px solid #dbd8e0;
235+
}
236+
.bs-sidebar .nav > .active > a,
237+
.bs-sidebar .nav > .active:hover > a,
238+
.bs-sidebar .nav > .active:focus > a {
239+
font-weight: bold;
240+
color: #563d7c;
241+
background-color: transparent;
242+
border-right: 1px solid #563d7c;
243+
}
244+
245+
/* Nav: second level (shown on .active) */
246+
.bs-sidebar .nav .nav {
247+
display: none; /* Hide by default, but at >768px, show it */
248+
margin-bottom: 8px;
249+
}
250+
.bs-sidebar .nav .nav > li > a {
251+
padding-top: 3px;
252+
padding-bottom: 3px;
253+
padding-left: 30px;
254+
font-size: 90%;
255+
}
256+
257+
/* Show and affix the side nav when space allows it */
258+
@media (min-width: 992px) {
259+
.bs-sidebar .nav > .active > ul {
260+
display: block;
261+
}
262+
/* Widen the fixed sidebar */
263+
.bs-sidebar.affix,
264+
.bs-sidebar.affix-bottom {
265+
width: 213px;
266+
}
267+
.bs-sidebar.affix {
268+
position: fixed; /* Undo the static from mobile first approach */
269+
top: 80px;
270+
}
271+
.bs-sidebar.affix-bottom {
272+
position: absolute; /* Undo the static from mobile first approach */
273+
}
274+
.bs-sidebar.affix-bottom .bs-sidenav,
275+
.bs-sidebar.affix .bs-sidenav {
276+
margin-top: 0;
277+
margin-bottom: 0;
278+
}
279+
}
280+
@media (min-width: 1200px) {
281+
/* Widen the fixed sidebar again */
282+
.bs-sidebar.affix-bottom,
283+
.bs-sidebar.affix {
284+
width: 263px;
285+
}
286+
}
287+
82288

83289
/* Not enough room on mobile for markup tab, js tab, and plunk btn.
84290
And no one cares about plunk button on a phone anyway */
@@ -95,7 +301,7 @@ section {
95301
}
96302

97303
.header-placeholder {
98-
height: 175px;
304+
height: 50px;
99305
}
100306

101307
@media screen and (min-width: 768px) {
@@ -114,4 +320,4 @@ section {
114320
margin-left: 10px;
115321
}
116322

117-
}
323+
}

‎misc/demo/assets/header.png

36.6 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* https://github.com/alicelieutier/smoothScroll/
3+
* A teeny tiny, standard compliant, smooth scroll script with ease-in-out effect and no jQuery (or any other dependancy, FWIW).
4+
* MIT License
5+
*/
6+
window.smoothScroll = (function(){
7+
// We do not want this script to be applied in browsers that do not support those
8+
// That means no smoothscroll on IE9 and below.
9+
if(document.querySelectorAll === void 0 || window.pageYOffset === void 0 || history.pushState === void 0) { return; }
10+
11+
// Get the top position of an element in the document
12+
var getTop = function(element) {
13+
// return value of html.getBoundingClientRect().top ... IE : 0, other browsers : -pageYOffset
14+
if(element.nodeName === 'HTML') return -window.pageYOffset
15+
return element.getBoundingClientRect().top + window.pageYOffset;
16+
}
17+
// ease in out function thanks to:
18+
// http://blog.greweb.fr/2012/02/bezier-curve-based-easing-functions-from-concept-to-implementation/
19+
var easeInOutCubic = function (t) { return t<.5 ? 4*t*t*t : (t-1)*(2*t-2)*(2*t-2)+1 }
20+
21+
// calculate the scroll position we should be in
22+
// given the start and end point of the scroll
23+
// the time elapsed from the beginning of the scroll
24+
// and the total duration of the scroll (default 500ms)
25+
var position = function(start, end, elapsed, duration) {
26+
if (elapsed > duration) return end;
27+
return start + (end - start) * easeInOutCubic(elapsed / duration); // <-- you can change the easing funtion there
28+
// return start + (end - start) * (elapsed / duration); // <-- this would give a linear scroll
29+
}
30+
31+
// we use requestAnimationFrame to be called by the browser before every repaint
32+
// if the first argument is an element then scroll to the top of this element
33+
// if the first argument is numeric then scroll to this location
34+
// if the callback exist, it is called when the scrolling is finished
35+
var smoothScroll = function(el, duration, callback){
36+
duration = duration || 500;
37+
var start = window.pageYOffset;
38+
39+
if (typeof el === 'number') {
40+
var end = parseInt(el);
41+
} else {
42+
var end = getTop(el);
43+
}
44+
45+
var clock = Date.now();
46+
var requestAnimationFrame = window.requestAnimationFrame ||
47+
window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame ||
48+
function(fn){window.setTimeout(fn, 15);};
49+
50+
var step = function(){
51+
var elapsed = Date.now() - clock;
52+
window.scroll(0, position(start, end, elapsed, duration));
53+
if (elapsed > duration) {
54+
if (typeof callback === 'function') {
55+
callback(el);
56+
}
57+
} else {
58+
requestAnimationFrame(step);
59+
}
60+
}
61+
step();
62+
}
63+
64+
var linkHandler = function(ev) {
65+
ev.preventDefault();
66+
67+
if (location.hash !== this.hash) {
68+
//NOTE(@ajoslin): Changed this line to stop $digest errors
69+
//window.history.pushState(null, null, this.hash)
70+
angular.element(document).injector().get('$location').hash(this.hash);
71+
}
72+
// using the history api to solve issue #1 - back doesn't work
73+
// most browser don't update :target when the history api is used:
74+
// THIS IS A BUG FROM THE BROWSERS.
75+
// change the scrolling duration in this call
76+
smoothScroll(document.getElementById(this.hash.substring(1)), 500, function(el) {
77+
location.replace('#' + el.id)
78+
// this will cause the :target to be activated.
79+
});
80+
}
81+
82+
// We look for all the internal links in the documents and attach the smoothscroll function
83+
document.addEventListener("DOMContentLoaded", function () {
84+
var internal = document.querySelectorAll('a[href^="#"]'), a;
85+
for(var i=internal.length; a=internal[--i];){
86+
a.addEventListener("click", linkHandler, false);
87+
}
88+
});
89+
90+
// return smoothscroll API
91+
return smoothScroll;
92+
93+
})();
94+

‎misc/demo/index.html

+167-140
Large diffs are not rendered by default.

‎src/popover/docs/demo.html

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
<div ng-controller="PopoverDemoCtrl">
22
<h4>Dynamic</h4>
3-
<div class="form-group">
4-
<label>Popup Title:</label>
5-
<input type="text" ng-model="dynamicPopoverText" class="form-control">
6-
</div>
73
<div class="form-group">
84
<label>Popup Text:</label>
95
<input type="text" ng-model="dynamicPopover" class="form-control">
@@ -12,7 +8,7 @@ <h4>Dynamic</h4>
128
<label>Popup Title:</label>
139
<input type="text" ng-model="dynamicPopoverTitle" class="form-control">
1410
</div>
15-
<button popover="{{dynamicPopover}}" popover-title="{{dynamicPopoverTitle}}" class="btn btn-default">{{dynamicPopoverText}}</button>
11+
<button popover="{{dynamicPopover}}" popover-title="{{dynamicPopoverTitle}}" class="btn btn-default">Dynamic Popover</button>
1612

1713
<hr />
1814
<h4>Positional</h4>

‎src/popover/docs/demo.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
var PopoverDemoCtrl = function ($scope) {
22
$scope.dynamicPopover = "Hello, World!";
3-
$scope.dynamicPopoverText = "dynamic";
43
$scope.dynamicPopoverTitle = "Title";
54
};

‎src/tabs/docs/demo.html

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<div ng-controller="TabsDemoCtrl">
2-
Select a tab by setting active binding to true:
3-
<br />
4-
<button class="btn btn-default btn-sm" ng-click="tabs[0].active = true">Select second tab</button>
5-
<button class="btn btn-default btn-sm" ng-click="tabs[1].active = true">Select third tab</button>
6-
<button class="btn btn-default btn-sm" ng-click="tabs[1].disabled = ! tabs[1].disabled">Enable / Disable third tab</button>
2+
<p>Select a tab by setting active binding to true:</p>
3+
<p>
4+
<button class="btn btn-default btn-sm" ng-click="tabs[0].active = true">Select second tab</button>
5+
<button class="btn btn-default btn-sm" ng-click="tabs[1].active = true">Select third tab</button>
6+
</p>
7+
<p>
8+
<button class="btn btn-default btn-sm" ng-click="tabs[1].disabled = ! tabs[1].disabled">Enable / Disable third tab</button>
9+
</p>
710
<hr />
811

912
<tabset>
@@ -13,7 +16,7 @@
1316
</tab>
1417
<tab select="alertMe()">
1518
<tab-heading>
16-
<i class="glyphicon glyphicon-bell"></i> Select me for alert!
19+
<i class="glyphicon glyphicon-bell"></i> Alert!
1720
</tab-heading>
1821
I've got an HTML heading, and a select callback. Pretty cool!
1922
</tab>

0 commit comments

Comments
 (0)
This repository has been archived.