diff --git a/public/tsbb06.html b/public/tsbb06.html index c0b1cdbab05f4e9010278ae86c5105c2b001e9f3..4d8bff4811a43aa22dfa2d8da53db7a892f7f82e 100644 --- a/public/tsbb06.html +++ b/public/tsbb06.html @@ -14,7 +14,7 @@ <div class="header"> <div class="first"> <div class="left"><h1>Representations and Estimation in Geometry</h1></div> - <div class="right"><div class="btn" onclick="fontDecrease()">-</div><div class="btn" onclick="fontIncrease()">+</div><div class="btn" onclick="toc_toggle()">TOC</div></div> + <div class="right"><div class="btn" onclick="fontDecrease()">-</div><div class="btn" onclick="fontIncrease()">+</div><div class="btn" onclick="tsbb06.toc_toggle()">TOC</div></div> </div> <div id="reg-toc" class="mr-multicols hidden"> <ol> diff --git a/public/tsbb06.js b/public/tsbb06.js index a64f27100551a440e0e95f49138c47843d40075a..0cfe1a32e7bfb0dc8fb82f768a7981a79d46855d 100644 --- a/public/tsbb06.js +++ b/public/tsbb06.js @@ -1,230 +1,262 @@ -'use strict'; +var tsbb06 = (function (exports) { + 'use strict'; -function $(name) { - return document.getElementById(name); -} - -var Scrubber = (function () { - function Scrubber(touch, cur) { - this.touch = $(touch); - this.cur = $(cur); - this.pressed = false; - this.time = 0; - this._time_max = 100; - this.playing = false; - this.reversed = false; - this.animations = []; - this._pauses = []; - this._pausesR = []; + function $(name) { + return document.getElementById(name); } - Scrubber.prototype.activate = function () { - var _this = this; - this.touch.addEventListener("mousedown", function (event) { - _this.update(event.clientX / window.innerWidth * _this._time_max); - _this.pressed = true; - }); - this.touch.addEventListener("mousemove", function (event) { - if (_this.pressed) + + var Scrubber = (function () { + function Scrubber(touch, cur) { + this.touch = $(touch); + this.cur = $(cur); + this.pressed = false; + this.time = 0; + this._time_max = 100; + this.playing = false; + this.reversed = false; + this.animations = []; + this._pauses = []; + this._pausesR = []; + } + Scrubber.prototype.activate = function () { + var _this = this; + this.touch.addEventListener("mousedown", function (event) { _this.update(event.clientX / window.innerWidth * _this._time_max); - }); - this.touch.addEventListener("mouseup", function (event) { - _this.pressed = false; - }); - this.touch.addEventListener("mouseleave", function (event) { - _this.pressed = false; - }); - window.addEventListener("keydown", function (event) { - switch (event.keyCode) { - case 37: // key: ArrowLeft - case 38: // key: ArrowUp - case 8: - _this.playBackwards(); - break; - case 39: // key: ArrowRight - case 40: // key: ArrowDown - case 13: // key: Enter - case 32: - _this.playForwards(); - break; - } - }); - }; - Scrubber.prototype.play = function (reverse) { - if (reverse === void 0) { reverse = false; } - if (reverse !== this.reversed) - this.animations.forEach(function (anim) { return anim.reverse(); }); - else - this.animations.forEach(function (anim) { return anim.play(); }); - this.reversed = reverse; - this.playing = true; - this.adjustPause(); - }; - Scrubber.prototype.playBackwards = function () { - this.play(true); - }; - Scrubber.prototype.playForwards = function () { - this.play(); - }; - /** - * Just update the graphical UI of the scrubber - * @param percent - */ - Scrubber.prototype.updateUI = function (percent) { - this.cur.style.width = percent * 100 + "vw"; - }; - /** - * Update the slide and the UI - * @param time - */ - Scrubber.prototype.update = function (time) { - console.log(time); - this.updateUI(time / this._time_max); - this.animations.forEach(function (anim) { return anim.currentTime = time; }); - this.time = time; - }; - Object.defineProperty(Scrubber.prototype, "time_max", { - get: function () { - return this._time_max; - }, + _this.pressed = true; + }); + this.touch.addEventListener("mousemove", function (event) { + if (_this.pressed) + _this.update(event.clientX / window.innerWidth * _this._time_max); + }); + this.touch.addEventListener("mouseup", function (event) { + _this.pressed = false; + }); + this.touch.addEventListener("mouseleave", function (event) { + _this.pressed = false; + }); + window.addEventListener("keydown", function (event) { + switch (event.keyCode) { + case 37: // key: ArrowLeft + case 38: // key: ArrowUp + case 8: + _this.playBackwards(); + break; + case 39: // key: ArrowRight + case 40: // key: ArrowDown + case 13: // key: Enter + case 32: + _this.playForwards(); + break; + } + }); + }; + Scrubber.prototype.play = function (reverse) { + if (reverse === void 0) { reverse = false; } + if (reverse !== this.reversed) + this.animations.forEach(function (anim) { return anim.reverse(); }); + else + this.animations.forEach(function (anim) { return anim.play(); }); + this.reversed = reverse; + this.playing = true; + this.adjustPause(); + }; + Scrubber.prototype.playBackwards = function () { + this.play(true); + }; + Scrubber.prototype.playForwards = function () { + this.play(); + }; /** - * Set the max time + * Just update the graphical UI of the scrubber + * @param percent */ - set: function (max) { - this._time_max = max; - this.update(this.time); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Scrubber.prototype, "pauses", { - set: function (values) { - this._pauses = values; - this._pausesR = [].concat(this._pauses); - this._pausesR.reverse(); - }, - enumerable: true, - configurable: true - }); - Scrubber.prototype.adjustPause = function () { - var _this = this; - var time = this.animations[0].currentTime; - // console.log(this.animations[0].currentTime); - if (this.playing) { - // Find next pause based on old time - var nextPause = void 0; - if (!this.reversed) - nextPause = this._pauses.find(function (pause) { return pause > _this.time; }); - else - nextPause = this._pausesR.find(function (pause) { return pause < _this.time; }); - // console.log(nextPause, this._pausesR); - if (nextPause !== undefined) { - //console.log(nextPause, time); - if (time !== null) { - // See if cur§nt time has passed through this pause - if ((!this.reversed && time >= nextPause) || (this.reversed && time <= nextPause)) { - this.time = nextPause; - this.pauseAll(); + Scrubber.prototype.updateUI = function (percent) { + this.cur.style.width = percent * 100 + "vw"; + }; + /** + * Update the slide and the UI + * @param time + */ + Scrubber.prototype.update = function (time) { + console.log(time); + this.updateUI(time / this._time_max); + this.animations.forEach(function (anim) { return anim.currentTime = time; }); + this.time = time; + }; + Object.defineProperty(Scrubber.prototype, "time_max", { + get: function () { + return this._time_max; + }, + /** + * Set the max time + */ + set: function (max) { + this._time_max = max; + this.update(this.time); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scrubber.prototype, "pauses", { + set: function (values) { + this._pauses = values; + this._pausesR = [].concat(this._pauses); + this._pausesR.reverse(); + }, + enumerable: true, + configurable: true + }); + Scrubber.prototype.adjustPause = function () { + var _this = this; + var time = this.animations[0].currentTime; + // console.log(this.animations[0].currentTime); + if (this.playing) { + // Find next pause based on old time + var nextPause = void 0; + if (!this.reversed) + nextPause = this._pauses.find(function (pause) { return pause > _this.time; }); + else + nextPause = this._pausesR.find(function (pause) { return pause < _this.time; }); + // console.log(nextPause, this._pausesR); + if (nextPause !== undefined) { + //console.log(nextPause, time); + if (time !== null) { + // See if cur§nt time has passed through this pause + if ((!this.reversed && time >= nextPause) || (this.reversed && time <= nextPause)) { + this.time = nextPause; + this.pauseAll(); + } } } + // console.log(this.time, this._time_max); + this.updateUI(this.time / this._time_max); + requestAnimationFrame(this.adjustPause.bind(this)); } - // console.log(this.time, this._time_max); - this.updateUI(this.time / this._time_max); - requestAnimationFrame(this.adjustPause.bind(this)); - } - if (time) - this.time = time; - }; - Scrubber.prototype.pauseAll = function () { - var _this = this; - this.animations.forEach(function (anim) { return anim.pause(); }); - this.animations.forEach(function (anim) { return anim.currentTime = _this.time; }); - this.playing = false; - }; - return Scrubber; -}()); + if (time) + this.time = time; + }; + Scrubber.prototype.pauseAll = function () { + var _this = this; + this.animations.forEach(function (anim) { return anim.pause(); }); + this.animations.forEach(function (anim) { return anim.currentTime = _this.time; }); + this.playing = false; + }; + return Scrubber; + }()); -document.addEventListener("DOMContentLoaded", function () { - var kFormula = document.querySelectorAll(".keq"); - [].forEach.call(kFormula, function (kFormulai) { return katex.render(kFormulai.innerHTML.replace(/&/g, '&'), kFormulai); }); - // var reg02b=document.getElementById("reg021b"); - var reg02b1 = document.getElementById("reg02b1"); - var reg02b2 = document.getElementById("reg02b2"); - var reg02b3 = document.getElementById("reg02b3"); - var reg02b4 = document.getElementById("reg02b4"); - var reg02b1axis2 = document.getElementById("reg02b1axis2"); - var reg02b1axis1 = document.getElementById("reg02b1axis1"); - var reg02b1axes = document.getElementById("reg02b1axes"); - var reg02b1o = document.getElementById("reg02b1o"); - var reg02b1pt = document.getElementById("reg02b1pt"); - var reg02b1ptax1 = document.getElementById("reg02b1ptax1"); - var reg02b1axis2lbl1 = document.getElementById("reg02b1axis2lbl1"); - var reg02b1axis2lbl2 = document.getElementById("reg02b1axis2lbl2"); - var reg02b1axis2lbl3 = document.getElementById("reg02b1axis2lbl3"); - var reg02b1axis2lbl4 = document.getElementById("reg02b1axis2lbl4"); - var reg021b1ptvt = document.getElementById("reg021b1ptvt"); - var reg021b1vtx = document.getElementById("reg021b1vtx"); - var reg021b2vx = document.getElementById("reg021b2vx"); - var reg021b1vtsum = document.getElementById("reg021b1vtsum"); - var reg021b2vy = document.getElementById("reg021b2vy"); - var reg021b2vxc = document.getElementById("reg021b2vxc"); - var reg021b2cvx = document.getElementById("reg021b2cvx"); - var reg021b1vtmult = document.getElementById("reg021b1vtmult"); - var reg021b1vtcomb = document.getElementById("reg021b1vtcomb"); - var reg021b1vtdot = document.getElementById("reg021b1vtdot"); - var reg021b1vtnorm = document.getElementById("reg021b1vtnorm"); - var reg021b1vtunit = document.getElementById("reg021b1vtunit"); - var reg02b1axis2l1 = document.getElementById("reg02b1axis2l1"); - var reg021b5scalar = document.getElementById("reg021b5scalar"); - var reg021b5proj = document.getElementById("reg021b5proj"); - var reg021b5perp = document.getElementById("reg021b5perp"); - var reg021b5dist = document.getElementById("reg021b5dist"); - var reg021h = document.getElementById("reg021h"); - var reg021b = document.getElementById("reg021b"); - var reg021b1 = document.getElementById("reg021b1"); - var reg021b2 = document.getElementById("reg021b2"); - var reg021b3 = document.getElementById("reg021b3"); - var reg021b4 = document.getElementById("reg021b4"); - var reg021b5 = document.getElementById("reg021b5"); - var reg021b6 = document.getElementById("reg021b6"); - var reg021b7 = document.getElementById("reg021b7"); - var fadeIn = [{ opacity: 0 }, { opacity: 1 }]; - var fadeOut = [{ opacity: 1 }, { opacity: 0 }]; - var scrubber = new Scrubber("scrubber-touch", "scrubber-cur"); - scrubber.activate(); - var times = [ - // 1 2 3 4 5 6 7 8 9 10 11 12 13 - /* REG 02 */ [500, 0], [500, 500], [500, 1000], [500, 1500], [500, 2000], [500, 2500], [500, 2500], [500, 2500], [500, 2500], [500, 2500], [500, 3000], [500, 3500], [500, 4000], - // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - /* REG 02 B */ [500, 4500], [500, 4500], [500, 4500], [500, 5000], [500, 5000], [500, 5000], [500, 5500], [500, 5500], [500, 5500], [500, 6000], [500, 6000], [500, 6500], [500, 7000], [500, 7500], [500, 8000], [500, 6500], [500, 7500], [500, 8500], [500, 8500], [500, 9000], [500, 9500], [500, 10000], [500, 8500], [500, 10000], [500, 10000], - ]; - var fx = [ - // 1 2 3 4 5 6 7 8 9 10 11 12 13 - fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, - // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 16 - fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeOut, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, - ]; - var effects = []; - var items = [ - // 1 2 3 4 5 6 7 8 9 10 11 12 13 - reg02b1, reg02b1o, reg02b1axes, reg02b1pt, reg02b1ptax1, reg02b1axis2, reg02b1axis2lbl1, reg02b1axis2lbl2, reg02b1axis2lbl3, reg02b1axis2lbl4, reg02b2, reg02b3, reg02b4, - // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - reg021h, reg021b1, reg021b2, reg021b1ptvt, reg021b2vx, reg021b1vtx, reg021b1vtsum, reg021b2vy, reg021b2vxc, reg021b2cvx, reg021b1vtmult, reg021b1vtcomb, reg021b1vtdot, reg021b1vtnorm, reg021b1vtunit, reg021b3, reg021b4, reg021b5, reg021b5scalar, reg021b5proj, reg021b5perp, reg021b5dist, reg021b6, reg021b7]; - var totalelem = times.reduce(function (elem, cur) { return (elem[1] > cur[1]) ? elem : cur; }); - var total = totalelem[0] + totalelem[1]; - console.log(total); - for (var i = 0; i < items.length; i++) { - effects.push(new KeyframeEffect(items[i], fx[i], { duration: times[i][0], easing: "ease-in-out", delay: times[i][1], endDelay: total - (times[i][1] + times[i][0]), fill: "both" })); + function toc_toggle() { + var toc = document.getElementById("reg-toc"); + if (toc.classList.contains("hidden")) { + toc.classList.remove("hidden"); + } + else { + toc.classList.add("hidden"); + } + } + function fontDecrease() { + var curFont = parseInt(document.body.classList.item(0).split("-")[1]); + if (curFont > 10) { + document.body.classList.remove(document.body.classList[0]); + document.body.classList.add("ft-" + (curFont - 1)); + } + } + function fontIncrease() { + var curFont = parseInt(document.body.classList.item(0).split("-")[1]); + if (curFont < 15) { + document.body.classList.remove(document.body.classList[0]); + document.body.classList.add("ft-" + (curFont + 1)); + } } - // console.log(reg02b1axis2l1.viewportElement.clientWidth * .25 + 10); - // reg02b1axis2l1.x2.baseVal.value = reg02b1axis2l1.viewportElement.clientWidth * .25 + 10; - reg021b1vtunit.scrollIntoView(); - scrubber.pauses = [0, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 8500, 9000, 9500, 10000, 10500, 11000, 11500, 12000, 12500, 13000, 13500, 14000, 14500, 15000, 15500, 16000, 16500, 17000, 17500, 18000, 18500, 19000, 19500]; - scrubber.animations = effects.map(function (effect) { return new Animation(effect, document.timeline); }); - scrubber.time_max = total; - scrubber.playForwards(); - // setTimeout(() => la0100moving.scrollIntoView({behavior: 'smooth', block:"center"}), 500); - // setTimeout(() => la0100proj.scrollIntoView({behavior: 'smooth', block:"center"}), 1500); - // setTimeout(() => la01003d.scrollIntoView({behavior: 'smooth', block:"center"}), 2500); - // setTimeout(() => la0100profit.scrollIntoView({behavior: 'smooth', block:"center"}), 3500); - // setTimeout(() => la0100balancing.scrollIntoView({behavior: 'smooth', block:"center"}), 4500); -}); + document.addEventListener("DOMContentLoaded", function () { + var kFormula = document.querySelectorAll(".keq"); + [].forEach.call(kFormula, function (kFormulai) { return katex.render(kFormulai.innerHTML.replace(/&/g, '&'), kFormulai); }); + // var reg02b=document.getElementById("reg021b"); + var reg02b1 = document.getElementById("reg02b1"); + var reg02b2 = document.getElementById("reg02b2"); + var reg02b3 = document.getElementById("reg02b3"); + var reg02b4 = document.getElementById("reg02b4"); + var reg02b1axis2 = document.getElementById("reg02b1axis2"); + var reg02b1axis1 = document.getElementById("reg02b1axis1"); + var reg02b1axes = document.getElementById("reg02b1axes"); + var reg02b1o = document.getElementById("reg02b1o"); + var reg02b1pt = document.getElementById("reg02b1pt"); + var reg02b1ptax1 = document.getElementById("reg02b1ptax1"); + var reg02b1axis2lbl1 = document.getElementById("reg02b1axis2lbl1"); + var reg02b1axis2lbl2 = document.getElementById("reg02b1axis2lbl2"); + var reg02b1axis2lbl3 = document.getElementById("reg02b1axis2lbl3"); + var reg02b1axis2lbl4 = document.getElementById("reg02b1axis2lbl4"); + var reg021b1ptvt = document.getElementById("reg021b1ptvt"); + var reg021b1vtx = document.getElementById("reg021b1vtx"); + var reg021b2vx = document.getElementById("reg021b2vx"); + var reg021b1vtsum = document.getElementById("reg021b1vtsum"); + var reg021b2vy = document.getElementById("reg021b2vy"); + var reg021b2vxc = document.getElementById("reg021b2vxc"); + var reg021b2cvx = document.getElementById("reg021b2cvx"); + var reg021b1vtmult = document.getElementById("reg021b1vtmult"); + var reg021b1vtcomb = document.getElementById("reg021b1vtcomb"); + var reg021b1vtdot = document.getElementById("reg021b1vtdot"); + var reg021b1vtnorm = document.getElementById("reg021b1vtnorm"); + var reg021b1vtunit = document.getElementById("reg021b1vtunit"); + var reg02b1axis2l1 = document.getElementById("reg02b1axis2l1"); + var reg021b5scalar = document.getElementById("reg021b5scalar"); + var reg021b5proj = document.getElementById("reg021b5proj"); + var reg021b5perp = document.getElementById("reg021b5perp"); + var reg021b5dist = document.getElementById("reg021b5dist"); + var reg021h = document.getElementById("reg021h"); + var reg021b = document.getElementById("reg021b"); + var reg021b1 = document.getElementById("reg021b1"); + var reg021b2 = document.getElementById("reg021b2"); + var reg021b3 = document.getElementById("reg021b3"); + var reg021b4 = document.getElementById("reg021b4"); + var reg021b5 = document.getElementById("reg021b5"); + var reg021b6 = document.getElementById("reg021b6"); + var reg021b7 = document.getElementById("reg021b7"); + var fadeIn = [{ opacity: 0 }, { opacity: 1 }]; + var fadeOut = [{ opacity: 1 }, { opacity: 0 }]; + var scrubber = new Scrubber("scrubber-touch", "scrubber-cur"); + scrubber.activate(); + var times = [ + // 1 2 3 4 5 6 7 8 9 10 11 12 13 + /* REG 02 */ [500, 0], [500, 500], [500, 1000], [500, 1500], [500, 2000], [500, 2500], [500, 2500], [500, 2500], [500, 2500], [500, 2500], [500, 3000], [500, 3500], [500, 4000], + // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 + /* REG 02 B */ [500, 4500], [500, 4500], [500, 4500], [500, 5000], [500, 5000], [500, 5000], [500, 5500], [500, 5500], [500, 5500], [500, 6000], [500, 6000], [500, 6500], [500, 7000], [500, 7500], [500, 8000], [500, 6500], [500, 7500], [500, 8500], [500, 8500], [500, 9000], [500, 9500], [500, 10000], [500, 8500], [500, 10000], [500, 10000], + ]; + var fx = [ + // 1 2 3 4 5 6 7 8 9 10 11 12 13 + fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, + // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 16 + fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeOut, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, fadeIn, + ]; + var effects = []; + var items = [ + // 1 2 3 4 5 6 7 8 9 10 11 12 13 + reg02b1, reg02b1o, reg02b1axes, reg02b1pt, reg02b1ptax1, reg02b1axis2, reg02b1axis2lbl1, reg02b1axis2lbl2, reg02b1axis2lbl3, reg02b1axis2lbl4, reg02b2, reg02b3, reg02b4, + // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 + reg021h, reg021b1, reg021b2, reg021b1ptvt, reg021b2vx, reg021b1vtx, reg021b1vtsum, reg021b2vy, reg021b2vxc, reg021b2cvx, reg021b1vtmult, reg021b1vtcomb, reg021b1vtdot, reg021b1vtnorm, reg021b1vtunit, reg021b3, reg021b4, reg021b5, reg021b5scalar, reg021b5proj, reg021b5perp, reg021b5dist, reg021b6, reg021b7]; + var totalelem = times.reduce(function (elem, cur) { return (elem[1] > cur[1]) ? elem : cur; }); + var total = totalelem[0] + totalelem[1]; + console.log(total); + for (var i = 0; i < items.length; i++) { + effects.push(new KeyframeEffect(items[i], fx[i], { duration: times[i][0], easing: "ease-in-out", delay: times[i][1], endDelay: total - (times[i][1] + times[i][0]), fill: "both" })); + } + // console.log(reg02b1axis2l1.viewportElement.clientWidth * .25 + 10); + // reg02b1axis2l1.x2.baseVal.value = reg02b1axis2l1.viewportElement.clientWidth * .25 + 10; + reg021b1vtunit.scrollIntoView(); + scrubber.pauses = [0, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 8500, 9000, 9500, 10000, 10500, 11000, 11500, 12000, 12500, 13000, 13500, 14000, 14500, 15000, 15500, 16000, 16500, 17000, 17500, 18000, 18500, 19000, 19500]; + scrubber.animations = effects.map(function (effect) { return new Animation(effect, document.timeline); }); + scrubber.time_max = total; + scrubber.playForwards(); + // setTimeout(() => la0100moving.scrollIntoView({behavior: 'smooth', block:"center"}), 500); + // setTimeout(() => la0100proj.scrollIntoView({behavior: 'smooth', block:"center"}), 1500); + // setTimeout(() => la01003d.scrollIntoView({behavior: 'smooth', block:"center"}), 2500); + // setTimeout(() => la0100profit.scrollIntoView({behavior: 'smooth', block:"center"}), 3500); + // setTimeout(() => la0100balancing.scrollIntoView({behavior: 'smooth', block:"center"}), 4500); + }); + + exports.toc_toggle = toc_toggle; + exports.fontDecrease = fontDecrease; + exports.fontIncrease = fontIncrease; + + return exports; + +}({})); diff --git a/rollup.config.js b/rollup.config.js index 72d684c9681c01811e6caa8c5ff89206c383738b..627b7ed675f27e8da85cb57941a3d52097892822 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -5,7 +5,8 @@ export default { input: './tsbb06.ts', output: { file: 'public/tsbb06.js', - format: 'cjs' + format: 'iife', + name: "tsbb06" }, plugins: [ diff --git a/tsbb06.mr b/tsbb06.mr index 7d1c2eb219e3548ca816a869dd6266c26357e3c6..b46b7a275a161c456f0cd8083bc551471b98f42d 100644 --- a/tsbb06.mr +++ b/tsbb06.mr @@ -14,7 +14,7 @@ \div.header{ \div.first{ \div.left{\h1{Representations and Estimation in Geometry}} - \div.right{\div.btn(onclick="fontDecrease()"){-}\div.btn(onclick="fontIncrease()"){+}\div.btn(onclick="toc_toggle()"){TOC}} + \div.right{\div.btn(onclick="fontDecrease()"){-}\div.btn(onclick="fontIncrease()"){+}\div.btn(onclick="tsbb06.toc_toggle()"){TOC}} } \div#reg-toc.mr-multicols.hidden{ \ol{ diff --git a/tsbb06.ts b/tsbb06.ts index be20c78ff039408afaaa68907a418ba5ef0c9fdb..0076de3f10b03a773f4f04b83d6ef8dcd0323634 100644 --- a/tsbb06.ts +++ b/tsbb06.ts @@ -1,5 +1,5 @@ import {Scrubber} from "./scrubber"; -function toc_toggle() { +export function toc_toggle() { var toc = document.getElementById("reg-toc"); @@ -10,7 +10,7 @@ function toc_toggle() { } } -function fontDecrease() { +export function fontDecrease() { var curFont = parseInt(document.body.classList.item(0).split("-")[1]); if(curFont > 10) { document.body.classList.remove(document.body.classList[0]); @@ -18,7 +18,7 @@ function fontDecrease() { } } -function fontIncrease() { +export function fontIncrease() { var curFont = parseInt(document.body.classList.item(0).split("-")[1]); if(curFont < 15) { document.body.classList.remove(document.body.classList[0]);