Skip to content

Commit 7e293bd

Browse files
Dave GamacheDave Gamache
authored andcommitted
got the nav working on web and looking real sharp.
1 parent a4ab5f6 commit 7e293bd

File tree

4 files changed

+119
-34
lines changed

4 files changed

+119
-34
lines changed

index.html

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -64,50 +64,50 @@ <h2 class="title">A dead simple, responsive boilerplate.</h2>
6464
<nav class="navbar">
6565
<div class="container">
6666
<ul class="navbar-list">
67-
<li class="navbar-item"><a class="navbar-link" href="#">Intro</a></li>
67+
<li class="navbar-item"><a class="navbar-link" href="#intro">Intro</a></li>
6868
<li class="navbar-item">
69-
<a class="navbar-link" href="#" data-popover-id="codeNavPopover">Code</a>
69+
<a class="navbar-link" href="#" data-popover="#codeNavPopover">Code</a>
7070
<div id="codeNavPopover" class="popover">
7171
<ul class="popover-list">
7272
<li class="popover-item">
73-
<a class="popover-link" href="#">Grid</a>
73+
<a class="popover-link" href="#grid">Grid</a>
7474
</li>
7575
<li class="popover-item">
76-
<a class="popover-link" href="#">Typography</a>
76+
<a class="popover-link" href="#typography">Typography</a>
7777
</li>
7878
<li class="popover-item">
79-
<a class="popover-link" href="#">Buttons</a>
79+
<a class="popover-link" href="#buttons">Buttons</a>
8080
</li>
8181
<li class="popover-item">
82-
<a class="popover-link" href="#">Forms</a>
82+
<a class="popover-link" href="#forms">Forms</a>
8383
</li>
8484
<li class="popover-item">
85-
<a class="popover-link" href="#">Lists</a>
85+
<a class="popover-link" href="#lists">Lists</a>
8686
</li>
8787
<li class="popover-item">
88-
<a class="popover-link" href="#">Code</a>
88+
<a class="popover-link" href="#code">Code</a>
8989
</li>
9090
<li class="popover-item">
91-
<a class="popover-link" href="#">Tables</a>
91+
<a class="popover-link" href="#tables">Tables</a>
9292
</li>
9393
<li class="popover-item">
94-
<a class="popover-link" href="#">Queries</a>
94+
<a class="popover-link" href="#queries">Queries</a>
9595
</li>
9696
<li class="popover-item">
97-
<a class="popover-link" href="#">Utilities</a>
97+
<a class="popover-link" href="#utilities">Utilities</a>
9898
</li>
9999
</ul>
100100
</div>
101101
</li>
102-
<li class="navbar-item"><a class="navbar-link" href="#">Examples</a></li>
103-
<li class="navbar-item"><a class="navbar-link" href="#">License</a></li>
104-
<li class="navbar-item"><a class="navbar-link" href="#">Colophon</a></li>
102+
<li class="navbar-item"><a class="navbar-link" href="#examples">Examples</a></li>
103+
<li class="navbar-item"><a class="navbar-link" href="#license">License</a></li>
104+
<li class="navbar-item"><a class="navbar-link" href="#colophon">Colophon</a></li>
105105
</ul>
106106
</div>
107107
</nav>
108108

109109
<!-- Why use Skeleton -->
110-
<div class="docs-section">
110+
<div class="docs-section" id="intro">
111111
<h6 class="docs-header">Is Skeleton for you?</h6>
112112
<p>You should use Skeleton if you're feeling like whole UI frameworks like Bootstrap and Foundation are overkill for your project and you just want the basics. Skeleton only styles a handful of standard HTML elements and includes a grid, but that's often more than enough to get started. In fact, <u>this site is built on Skeleton and has just over 100 lines of custom CSS.</u></p>
113113
<p>Love Skeleton and want to Tweet it, share it, or star it? Well, I appreciate that <3</p>
@@ -119,7 +119,7 @@ <h6 class="docs-header">Is Skeleton for you?</h6>
119119
</div>
120120

121121
<!-- Grid -->
122-
<div class="docs-section">
122+
<div class="docs-section" id="grid">
123123
<h6 class="docs-header">The grid</h6>
124124
<p>The grid is a <u>12-column fluid grid with a max width of 960px</u>, that shrinks with the browser/device at smaller sizes. The max width can be changed with one line of CSS and all columns will resize accordingly. The syntax is simple and it makes coding responsive much easier. Go ahead, resize the browser. </p>
125125
<div class="example-grid docs-example">
@@ -208,7 +208,7 @@ <h6 class="docs-header">The grid</h6>
208208
</div>
209209

210210
<!-- Typography -->
211-
<div class="row docs-section">
211+
<div class="row docs-section" id="typography">
212212
<h6 class="docs-header">Typography</h6>
213213
<p>Type is all set with the <code>rems</code>, so font-sizes and spacial relationships can be responsively sized based on a single <code>&lt;html&gt;</code> font-size property. Out of the box, Skeleton never changes the <code>&lt;html&gt;</code> font-size, but it's there in case you need it for your project. All measurements are still base 10 though so, an <code>&lt;h1&gt;</code> with <code>5.0rem</code>font-size just means <code>50px</code>.</p>
214214
<div class="docs-example">
@@ -255,7 +255,7 @@ <h6>Heading</h6>
255255
</div>
256256

257257
<!-- Buttons -->
258-
<div class="row docs-section">
258+
<div class="row docs-section" id="buttons">
259259
<h6 class="docs-header">Buttons</h6>
260260
<p>Buttons come in two basic flavors in Skeleton. The standard <code>&lt;button&gt;</code> element is plain, whereas the <code>.button-primary</code> button is vibrant and prominent. Button styles are applied to a number of appropriate form elements, but can also be arbitrarily attached to anchors with a <code>.button</code> class.</p>
261261
<div class="docs-example">
@@ -295,7 +295,7 @@ <h6 class="docs-header">Buttons</h6>
295295
</div>
296296

297297
<!-- Forms -->
298-
<div class="row docs-section">
298+
<div class="row docs-section" id="forms">
299299
<h6 class="docs-header">Forms</h6>
300300
<p>Forms are a huge pain, but hopefully these styles make it a bit easier. All inputs, select, and buttons are normalized for a common height cross-browser so inputs can be stacked or placed alongside each other.</p>
301301
<div class="docs-example docs-example-forms">
@@ -363,7 +363,7 @@ <h6 class="docs-header">Forms</h6>
363363
</div>
364364

365365
<!-- Lists -->
366-
<div class="docs-section">
366+
<div class="docs-section" id="lists">
367367
<h6 class="docs-header">Lists</h6>
368368
<div class="row docs-example">
369369
<div class="six columns">
@@ -418,7 +418,7 @@ <h6 class="docs-header">Lists</h6>
418418
</div>
419419

420420
<!-- Code -->
421-
<div class="row docs-section">
421+
<div class="row docs-section" id="code">
422422
<h6 class="docs-header">Code</h6>
423423
<p>Code styling is kept basic – just wrap anything in a <code>&lt;code&gt;</code> and it will appear like <code>this</code>. For blocks of code, wrap a <code>&lt;code&gt;</code> with a <code>&lt;pre&gt;</code>.</p>
424424
<div class="docs-example">
@@ -443,7 +443,7 @@ <h6 class="docs-header">Code</h6>
443443
</div>
444444

445445
<!-- Tables -->
446-
<div class="row docs-section">
446+
<div class="row docs-section" id="tables">
447447
<h6 class="docs-header">Tables</h6>
448448
<p>Be sure to use properly formed table markup with <code>&lt;thead&gt;</code> and <code>&lt;tbody&gt;</code> when building a <code>table</code>.</p>
449449
<div class="docs-example">
@@ -508,7 +508,7 @@ <h6 class="docs-header">Tables</h6>
508508
</div>
509509

510510
<!-- Queries -->
511-
<div class="row docs-section">
511+
<div class="row docs-section" id="queries">
512512
<h6 class="docs-header">Media queries</h6>
513513
<p>Skeleton uses media queries to serve its scalable grid, but also has a list of queries for convenience of styling your site across devices. There are two sets of queries. The first set is mobile-first, meaning it targets <code>min-width</code>. The other set is desktop-first, meaning it targets <code>max-width</code>. Mobile-first queries are how Skeleton's grid is built and is a preferrable method of organizing CSS. The sizes for the queries are:</p>
514514
<div class="docs-example row">
@@ -575,7 +575,7 @@ <h6 class="docs-header">Media queries</h6>
575575

576576

577577
<!-- Utilities and Misc. -->
578-
<div class="row docs-section">
578+
<div class="row docs-section" id="utilities">
579579
<h6 class="docs-header">Utilities</h6>
580580
<p>Skeleton has a number of small utility classes that act as easy-to-use helpers. Sometimes it's better to use a utility class than create a whole new class just to float an element.</p>
581581

@@ -613,19 +613,19 @@ <h6 class="docs-header">Utilities</h6>
613613
</div>
614614

615615
<!-- Examples -->
616-
<div class="row docs-section">
617-
<h6 class="docs-header">Examples of Skeleton sites</h6>
616+
<div class="row docs-section" id="examples">
617+
<h6 class="docs-header">Examples</h6>
618618
</div>
619619

620620
<!-- License -->
621-
<div class="row docs-section">
621+
<div class="row docs-section" id="license">
622622
<h6 class="docs-header">License</h6>
623623
<p>All parts of Skeleton are free to use and abuse under the <a href="http://opensource.org/licenses/mit-license.php">open-source MIT license</a>. More importantly, if you're into coding head over to the <a href="https://github.com/dhg/Skeleton">Github page</a> and contribute or fork this bad boy.</p>
624624
<p>Skeleton's version history is available <a href="#">on Github</a>.</p>
625625
</div>
626626

627627
<!-- Colophon -->
628-
<div class="row docs-section">
628+
<div class="row docs-section" id="colophon">
629629
<h6 class="docs-header">Colophon</h6>
630630
<p>Skeleton was built using <a href="http://www.sublimetext.com/3">Sublime Text 3</a> and designed with <a href="http://bohemiancoding.com/sketch/">Sketch</a>. The typeface <a href="http://www.google.com/fonts/specimen/Raleway">Raleway</a> was created by <a href="http://matt.cc/">Matt McInerney</a> and <a href="http://www.impallari.com/">Pablo Impallari</a>. Code highlighting by Google's Prettify library. Icons in the header are all derivative work of icon from <a href="thenounproject.com">The Noun Project</a>.<a href="http://thenounproject.com/term/feather/22073/"> Feather</a> by Zach VanDeHey, <a href="http://thenounproject.com/term/pen/21163/">Pen</a> (with cap) by Ed Harrison, <a href="http://thenounproject.com/term/pen/32847/">Pen</a> (with clicker) by Matthew Hall, and <a href="http://thenounproject.com/term/watch/48015/">Watch</a> by Julien Deveaux.</p>
631631
</div>

scripts/site.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ $(document).ready(function() {
55
$nav = $('.navbar'),
66
$body = $('body'),
77
$window = $(window),
8+
$popoverLink = $('[data-popover]'),
89
navOffsetTop = $nav.offset().top,
10+
$document = $(document),
911
entityMap = {
1012
"&": "&amp;",
1113
"<": "&lt;",
@@ -18,9 +20,45 @@ $(document).ready(function() {
1820
function init() {
1921
$window.on('scroll', onScroll)
2022
$window.on('resize', resize)
23+
$popoverLink.on('click', openPopover)
24+
$document.on('click', closePopover)
25+
$('a[href^="#"]').on('click', smoothScroll)
2126
buildSnippets();
2227
}
2328

29+
function smoothScroll(e) {
30+
e.preventDefault();
31+
$(document).off("scroll");
32+
var target = this.hash,
33+
menu = target;
34+
$target = $(target);
35+
$('html, body').stop().animate({
36+
'scrollTop': $target.offset().top-40
37+
}, 500, 'swing', function () {
38+
window.location.hash = target;
39+
$(document).on("scroll", onScroll);
40+
});
41+
}
42+
43+
function openPopover(e) {
44+
e.preventDefault()
45+
var popover = $($(this).data('popover'));
46+
popover.toggleClass('open')
47+
e.stopImmediatePropagation();
48+
}
49+
50+
function closePopover(e) {
51+
if($('.popover.open').length > 0) {
52+
$('.popover').removeClass('open')
53+
}
54+
}
55+
56+
$("#button").click(function() {
57+
$('html, body').animate({
58+
scrollTop: $("#elementtoScrollToID").offset().top
59+
}, 2000);
60+
});
61+
2462
function resize() {
2563
navOffsetTop = $nav.offset().top
2664
}

stylesheets/custom.css

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
text-transform: uppercase;
115115
font-size: 11px;
116116
font-weight: 600;
117-
letter-spacing: .1rem;
117+
letter-spacing: .2rem;
118118
margin-right: 50px;
119119
text-decoration: none;
120120
line-height: 6.3rem;
@@ -128,11 +128,20 @@
128128
top: 0;
129129
left: 0;
130130
}
131+
131132
.has-docked-nav .navbar-spacer {
132133
display: block;
133134
}
135+
/* Re-overiding the width 100% declaration to match size of % based container */
136+
.has-docked-nav .navbar > .container {
137+
width: 80%;
138+
}
139+
134140

135141

142+
.popover.open {
143+
display: block;
144+
}
136145
.popover {
137146
display: none;
138147
position: absolute;
@@ -143,9 +152,35 @@
143152
border-radius: 4px;
144153
top: 92%;
145154
left: -50%;
155+
-webkit-filter: drop-shadow(0 0 6px rgba(0,0,0,.1));
156+
-moz-filter: drop-shadow(0 0 6px rgba(0,0,0,.1));
157+
filter: drop-shadow(0 0 6px rgba(0,0,0,.1));
158+
}
159+
.popover-item:first-child .popover-link:after,
160+
.popover-item:first-child .popover-link:before {
161+
bottom: 100%;
162+
left: 50%;
163+
border: solid transparent;
164+
content: " ";
165+
height: 0;
166+
width: 0;
167+
position: absolute;
168+
pointer-events: none;
169+
}
170+
.popover-item:first-child .popover-link:after {
171+
border-color: rgba(255, 255, 255, 0);
172+
border-bottom-color: #fff;
173+
border-width: 10px;
174+
margin-left: -10px;
175+
}
176+
.popover-item:first-child .popover-link:before {
177+
border-color: rgba(238, 238, 238, 0);
178+
border-bottom-color: #eee;
179+
border-width: 11px;
180+
margin-left: -11px;
146181
}
147182
.popover-list {
148-
padding: 10px 0;
183+
padding: 0;
149184
margin: 0;
150185
list-style: none;
151186
}
@@ -154,17 +189,30 @@
154189
margin: 0;
155190
}
156191
.popover-link {
157-
color: #999;
192+
position: relative;
193+
color: #222;
158194
display: block;
159-
padding: 5px 20px;
195+
padding: 8px 20px;
196+
border-bottom: 1px solid #eee;
160197
text-decoration: none;
161198
text-transform: uppercase;
162199
font-size: 1.0rem;
163200
font-weight: 600;
164201
text-align: center;
165202
letter-spacing: .1rem;
166203
}
204+
.popover-item:first-child .popover-link {
205+
border-radius: 4px 4px 0 0;
206+
}
207+
.popover-item:last-child .popover-link {
208+
border-radius: 0 0 4px 4px;
209+
border-bottom-width: 0;
210+
}
167211
.popover-link:hover {
168212
color: #fff;
169213
background: #33C3F0;
214+
}
215+
.popover-link:hover,
216+
.popover-item:first-child .popover-link:hover:after {
217+
border-bottom-color: #33C3F0;
170218
}

stylesheets/skeleton.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ h6 { font-size: 1.5rem; line-height: 1.6; letter-spacing: 0; }
118118
–––––––––––––––––––––––––––––––––––––––––––––––––– */
119119
a {
120120
color: #1EAEDB; }
121-
a:hover,
122-
a:focus {
121+
a:hover {
123122
color: #0FA0CE; }
124123

125124

0 commit comments

Comments
 (0)