Skip to content

Commit 33eee67

Browse files
committed
Update menu JS
1 parent 1f9c3f3 commit 33eee67

File tree

10 files changed

+8731
-114
lines changed

10 files changed

+8731
-114
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ test.sass
1313
.sass-cache
1414
_gh_pages
1515
_site
16+
_includes/_static
1617
images/trash
1718
node_modules

_includes/lists/main-list.html

+8,606-7
Large diffs are not rendered by default.

_includes/lists/menu-list.html

+1-1
Large diffs are not rendered by default.

_includes/menu.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script type="text/javascript">
1+
<!--script type="text/javascript">
22
window.carbonLoaded = false;
33
44
window.helloCarbon = function() {
@@ -22,9 +22,9 @@
2222
$carbon.style.display = 'none';
2323
}
2424
$placeholder.style.display = 'none';
25-
}, 5000);
25+
}, 2000);
2626
});
27-
</script>
27+
</script-->
2828

2929
<aside class="menu">
3030
<header class="menu-header">
@@ -51,7 +51,7 @@
5151
</nav>
5252
<nav id="menu-nav" class="menu-nav">
5353
<div class="menu-search">
54-
<input id="menu-search-input" type="search" autocomplete="off" placeholder="Search for a property">
54+
<input id="menu-search-input" type="search" autocomplete="off" placeholder="Search for an element">
5555
<i class="icon is-search"></i>
5656
</div>
5757
<div id="menu-list" class="menu-list">
@@ -66,7 +66,7 @@
6666
<strong>Close</strong>
6767
</a>
6868
</nav>
69-
<footer id="menuHello" class="menu-hello">
69+
<!--footer id="menuHello" class="menu-hello">
7070
<div id="huggingFace">
7171
<p>
7272
HTML Reference is <strong>free</strong> and always will be!
@@ -84,8 +84,8 @@
8484
<div class="placeholder-footer"><div></div></div>
8585
</div>
8686
<div id="carbon">
87-
<!-- <script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=htmlreferenceio" id="_carbonads_js" onload ="window.helloCarbon()"></script> -->
88-
</div>
87+
<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=htmlreferenceio" id="_carbonads_js" onload ="window.helloCarbon()"></script>
88+
</div-->
8989
</footer>
9090
</aside>
9191

css/website.css

+21-18
Original file line numberDiff line numberDiff line change
@@ -394,21 +394,25 @@ html ::selection {
394394
-webkit-overflow-scrolling: touch;
395395
flex-grow: 1;
396396
overflow: auto; }
397-
.menu-list a {
397+
.menu-list .menu-link {
398398
display: block;
399399
padding: 0.75rem 2rem;
400400
transition: none; }
401-
.menu-list a .highlight {
402-
background: #ffdd57;
403-
color: #310736; }
404-
.menu-list a:hover, .menu-list a.is-selected {
405-
background: #ff470f;
406-
color: #fff; }
407-
.menu-list.is-searching a {
401+
.menu-list.is-searching .menu-item {
408402
display: none; }
409-
.menu-list.is-searching a.is-highlighted, .menu-list.is-searching a.is-selected {
403+
.menu-list.is-searching .menu-item.is-highlighted, .menu-list.is-searching .menu-item.is-selected {
410404
display: block; }
411405

406+
.menu-item .highlight {
407+
background: #ffdd57;
408+
color: #310736; }
409+
410+
.menu-item:hover, .menu-item.is-selected {
411+
background: #ff470f;
412+
color: #fff; }
413+
.menu-item:hover .menu-item-name, .menu-item.is-selected .menu-item-name {
414+
color: #fff; }
415+
412416
.menu-list-shadow {
413417
display: block;
414418
left: 0;
@@ -573,19 +577,14 @@ html ::selection {
573577
flex-grow: 0;
574578
flex-shrink: 0; }
575579
.menu-collections {
576-
font-size: 0.8rem; }
577-
.menu-collections ul {
578-
display: flex;
579-
flex-wrap: wrap; }
580-
.menu-collections p .menu-collection-link {
581-
position: relative;
582-
right: 6px; }
580+
font-size: 0.8rem;
581+
padding-left: 1rem; }
583582
.menu-nav {
584583
border-top: 1px solid #e6e6e6;
585584
display: flex;
586585
flex-grow: 1;
587586
flex-shrink: 1; }
588-
.menu-list a {
587+
.menu-list .menu-link {
589588
padding: 0.25rem 1rem; }
590589
.menu-hello {
591590
background: #fff;
@@ -995,7 +994,6 @@ html ::selection {
995994
transform: translateX(4px) translateY(50%); }
996995

997996
.value-header {
998-
overflow: auto;
999997
padding-left: 1rem; }
1000998

1001999
.value-name {
@@ -1034,6 +1032,9 @@ html ::selection {
10341032
.value-preview {
10351033
font-size: 14px; }
10361034

1035+
.value-output a {
1036+
text-decoration: underline; }
1037+
10371038
@media (max-width: 799px) {
10381039
.attribute {
10391040
margin-top: 2rem;
@@ -1176,6 +1177,8 @@ html ::selection {
11761177
background: #fff;
11771178
font-size: 14px;
11781179
padding: 1rem; }
1180+
.example-output a {
1181+
text-decoration: underline; }
11791182

11801183
@media (max-width: 799px) {
11811184
.example {

javascript/index.js

-16
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,4 @@ document.addEventListener('DOMContentLoaded', function() {
77
history.replaceState('', document.title, ' ');
88
window.scrollTo(0,0);
99
});
10-
11-
// Hashes
12-
var $hashes = document.querySelectorAll('.hash, .menu-list-ul li a');
13-
14-
Array.prototype.forEach.call($hashes, function($el) {
15-
$el.addEventListener('click', function(event) {
16-
event.preventDefault();
17-
var propertyName = $el.dataset.propertyName;
18-
var $target = document.getElementById($el.dataset.propertyName);
19-
history.replaceState('', document.title, '#' + propertyName);
20-
21-
if ($target) {
22-
$target.scrollIntoView();
23-
}
24-
});
25-
});
2610
});

0 commit comments

Comments
 (0)