Skip to content

Commit 28de89f

Browse files
Filip Łukasikpikinier20
authored andcommitted
add dropdown links
1 parent adcd375 commit 28de89f

File tree

9 files changed

+365
-299
lines changed

9 files changed

+365
-299
lines changed

docs/_layouts/static-site-main.html

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,34 @@
11
---
22
layout: main
33
---
4+
45
<div class="container">
5-
<div id="site-header">
6-
<div class="wrap">
7-
<nav class="navigation" role="menu">
8-
<ul class="navigation-menu">
9-
<li class="navigation-menu-item">
10-
<a href="https://docs.scala-lang.org/" class="active">Learn</a>
11-
</li>
12-
<li class="navigation-menu-item">
13-
<a href="https://www.scala-lang.org/download/">Install</a>
14-
</li>
15-
<li class="navigation-menu-item">
16-
<a href="https://scastie.scala-lang.org">Playground</a>
17-
</li>
18-
<li class="navigation-menu-item">
19-
<a href="https://index.scala-lang.org">Find A Library</a>
20-
</li>
21-
<li class="navigation-menu-item">
22-
<a href="https://www.scala-lang.org/community/">Community</a>
23-
</li>
24-
<li class="navigation-menu-item">
25-
<a href="https://www.scala-lang.org/blog/">Blog</a>
26-
</li>
27-
</ul>
28-
</nav>
29-
</div>
30-
</div>
6+
<div id="site-header"></div>
317
{% if page.movedTo %}
328
<aside class="warning">
33-
The content of this page is outdated. Click <a href="{{ page.movedTo }}">here</a> to find the up to date version of this page.
9+
The content of this page is outdated. Click
10+
<a href="{{ page.movedTo }}">here</a> to find the up to date version of this
11+
page.
3412
</aside>
35-
{% endif %}
36-
{{ content }}
13+
{% endif %} {{ content }}
3714
<nav class="arrows-wrapper" aria-label="Page navigation">
3815
{% if page.previous %}
39-
<a rel="prev" href="{{ page.previous.url }}" class="arrows previous" aria-keyshortcuts="Left">
40-
<span>{{ page.previous.title }}</span>
41-
<i class="fa fa-angle-left"></i>
16+
<a
17+
rel="prev"
18+
href="{{ page.previous }}"
19+
class="arrows previous"
20+
aria-keyshortcuts="Left"
21+
>
22+
<i class="fa fa-angle-left"></i>
4223
</a>
43-
{% endif %}
44-
{% if page.next %}
45-
<a rel="next" href="{{ page.next.url }}" class="arrows next" aria-keyshortcuts="Right">
46-
<span>{{ page.next.title }}</span>
47-
<i class="fa fa-angle-right"></i>
24+
{% endif %} {% if page.next %}
25+
<a
26+
rel="next"
27+
href="{{ page.next }}"
28+
class="arrows next"
29+
aria-keyshortcuts="Right"
30+
>
31+
<i class="fa fa-angle-right"></i>
4832
</a>
4933
{% endif %}
5034
</nav>

scaladoc/resources/dotty_res/scripts/ux.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@ window.addEventListener("DOMContentLoaded", () => {
1010
var elements = document.getElementsByClassName("documentableElement")
1111
if (elements) {
1212
for (i = 0; i < elements.length; i++) {
13-
elements[i].onclick = function(e) {
14-
if(!$(e.target).is("a") && e.fromSnippet !== true)
13+
elements[i].onclick = function (e) {
14+
if (!$(e.target).is("a") && e.fromSnippet !== true)
1515
this.classList.toggle("expand")
1616
}
1717
}
1818
}
1919

20-
$(".side-menu span").on('click', function(){
20+
$(".icon-button.hamburger").on('click', function () {
21+
$("#hamburger-dropdown").toggleClass("expanded")
22+
$(this).toggleClass("selected")
23+
});
24+
25+
$(".side-menu span").on('click', function () {
2126
$(this).parent().toggleClass("expanded")
2227
});
2328

@@ -39,7 +44,7 @@ window.addEventListener("DOMContentLoaded", () => {
3944

4045
document.querySelectorAll(".side-menu a").forEach(elem => elem.addEventListener('click', e => e.stopPropagation()))
4146

42-
$('.names .tab').on('click', function() {
47+
$('.names .tab').on('click', function () {
4348
parent = $(this).parents(".tabs").first()
4449
shown = $(this).hasClass('selected')
4550
single = parent.hasClass("single")
@@ -51,7 +56,7 @@ window.addEventListener("DOMContentLoaded", () => {
5156
if (!shown) { myTab.addClass('selected') }
5257
if (shown && !single) myTab.removeClass('selected')
5358

54-
if(!shown && $(this).filter(".showGraph").length > 0) {
59+
if (!shown && $(this).filter(".showGraph").length > 0) {
5560
showGraph()
5661
$(this).find(".showGraph").removeClass("showGraph")
5762
}
@@ -71,7 +76,7 @@ window.addEventListener("DOMContentLoaded", () => {
7176

7277
var logo = document.getElementById("logo");
7378
if (logo) {
74-
logo.onclick = function() {
79+
logo.onclick = function () {
7580
window.location = pathToRoot; // global variable pathToRoot is created by the html renderer
7681
};
7782
}
@@ -136,7 +141,7 @@ var transform;
136141
function showGraph() {
137142
if ($("svg#graph").children().length == 0) {
138143
var dotNode = document.querySelector("#dot")
139-
if (dotNode){
144+
if (dotNode) {
140145
var svg = d3.select("#graph");
141146
var radialGradient = svg.append("defs").append("radialGradient").attr("id", "Gradient");
142147
radialGradient.append("stop").attr("stop-color", "var(--aureole)").attr("offset", "20%");
@@ -146,7 +151,7 @@ function showGraph() {
146151

147152
// Set up zoom support
148153
zoom = d3.zoom()
149-
.on("zoom", function({transform}) {
154+
.on("zoom", function ({ transform }) {
150155
inner.attr("transform", transform);
151156
});
152157
svg.call(zoom);
@@ -168,7 +173,7 @@ function showGraph() {
168173
});
169174
g.setParent("node0", "node0Cluster");
170175

171-
g.edges().forEach(function(v) {
176+
g.edges().forEach(function (v) {
172177
g.setEdge(v, {
173178
arrowhead: "vee"
174179
});
@@ -179,11 +184,11 @@ function showGraph() {
179184
var bounds = svg.node().getBBox();
180185
var parent = svg.node().parentElement;
181186
var fullWidth = parent.clientWidth || parent.parentNode.clientWidth,
182-
fullHeight = parent.clientHeight || parent.parentNode.clientHeight;
187+
fullHeight = parent.clientHeight || parent.parentNode.clientHeight;
183188
var width = bounds.width,
184-
height = bounds.height;
189+
height = bounds.height;
185190
var midX = bounds.x + width / 2,
186-
midY = bounds.y + height / 2;
191+
midY = bounds.y + height / 2;
187192
if (width == 0 || height == 0) return; // nothing to fit
188193
var scale = Math.min(fullWidth / width, fullHeight / height) * 0.99; // 0.99 to make a little padding
189194
var translate = [fullWidth / 2 - scale * midX, fullHeight / 2 - scale * midY];

scaladoc/resources/dotty_res/styles/theme/color-tokens.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@
8484

8585
/* effects */
8686
--focus-default: var(--indigo11);
87+
--shadow-first: var(--shadow1);
88+
--shadow-second: var(--shadow2);
89+
--shadow-inset: var(--grey7);
8790
}
8891

8992
:root.theme-dark {
@@ -171,4 +174,7 @@
171174

172175
/* effects */
173176
--focus-default: var(--indigo9);
177+
--shadow-first: var(--shadow1);
178+
--shadow-second: var(--shadow2);
179+
--shadow-inset: var(--grey7);
174180
}

0 commit comments

Comments
 (0)