diff --git a/src/diffenator2/templates/_base.html b/src/diffenator2/templates/_base.html index 693e908..7d3d4d7 100644 --- a/src/diffenator2/templates/_base.html +++ b/src/diffenator2/templates/_base.html @@ -31,7 +31,7 @@ } .box-text{ } - + #nav{ position: fixed; right: 20px; @@ -42,7 +42,7 @@ .nav-item{ display: block; cursor: pointer; - -webkit-user-select: none; /* Safari */ + -webkit-user-select: none; /* Safari */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IE10+/Edge */ user-select: none; /* Standard */ @@ -193,10 +193,19 @@

{% block content_name %}{% endblock %}

POSITION = "old" fontToggle = document.getElementById("font-toggle") - function switchFonts() { + + const autoSwitch = null; + + function switchFonts(isClickEvent) { + + // when a click triggers the action stop autoSwitching + if (isClickEvent && autoSwitch) { + clearInterval(autoSwitch); + } + boxTitles = document.getElementsByClassName("box-title") items = document.getElementsByClassName("box-text"); - + if (POSITION === "old") { POSITION = "new" for (item of boxTitles) { @@ -234,11 +243,11 @@

{% block content_name %}{% endblock %}

'ss09', 'ss10', 'ss11', 'ss12', 'ss13', 'ss14', 'ss15', 'ss16', 'ss17', 'ss18', 'ss19', 'ss20' ] - + var otPanel = document.getElementById("ot-panel") for (i=0; i{% block content_name %}{% endblock %} disableKerning = true } } - } + } var boxText = document.getElementsByClassName("box-text") var otString = res.join(", ") @@ -296,7 +305,7 @@

{% block content_name %}{% endblock %}

for (i=0; iGlyphset: {{ glyph_set }} {% endfor %} - + {% endfor %} {% endfor %} -{% endfor %} +{% endfor %} @@ -108,13 +108,13 @@

Glyphset: {{ glyph_set }}

{% endfor %} {% endfor %} -{% endfor %} +{% endfor %} {% endblock %} {% block js %} - + state = "line-by-line" function viewMode() { var viewButton = document.getElementById("view-button") @@ -140,7 +140,7 @@

Glyphset: {{ glyph_set }}

} } document.getElementById("view-button").addEventListener("click", viewMode) - + var ptSelector = document.getElementById("pt-selector"); ptSelector.addEventListener("change", function(e) { var newPtSize = e.target.value @@ -266,7 +266,7 @@

Glyphset: {{ glyph_set }}

var width = longestLine() var container = document.getElementById("side-by-side") var subContainers = container.getElementsByClassName("box-side-by-side") - + var containerWidth = (width * subContainers.length) + 100 container.style.width = containerWidth + "pt" @@ -277,5 +277,9 @@

Glyphset: {{ glyph_set }}

} } +autoSwitch = setInterval(function () { + switchFonts(); +}, 1250); + {% endblock %} \ No newline at end of file