');
+ $(this).find('figcaption div.level-left').append($(this).find('figcaption').find('span'));
+ $(this).find('figcaption div.level-right').append($(this).find('figcaption').find('a'));
+ } else {
+ if (clipboard || fold) {
+ $(this).prepend('
');
+ }
+ }
+ });
+
+ if (typeof ClipboardJS !== 'undefined' && clipboard) {
+ $('figure.highlight').each(function() {
+ const id = 'code-' + Date.now() + (Math.random() * 1000 | 0);
+ const button = '
';
+ $(this).attr('id', id);
+ $(this).find('figcaption div.level-right').append(button);
+ });
+ new ClipboardJS('.highlight .copy'); // eslint-disable-line no-new
+ }
+
+ if (fold) {
+ $('figure.highlight').each(function() {
+ $(this).addClass('foldable'); // add 'foldable' class as long as fold is enabled
+
+ if ($(this).find('figcaption').find('span').length > 0) {
+ const span = $(this).find('figcaption').find('span');
+ if (span[0].innerText.indexOf('>folded') > -1) {
+ span[0].innerText = span[0].innerText.replace('>folded', '');
+ $(this).find('figcaption div.level-left').prepend(createFoldButton('folded'));
+ toggleFold(this, true);
+ return;
+ }
+ }
+ $(this).find('figcaption div.level-left').prepend(createFoldButton(fold));
+ toggleFold(this, fold === 'folded');
+ });
+
+ $('figure.highlight figcaption .level-left').click(function() {
+ const $code = $(this).closest('figure.highlight');
+ toggleFold($code.eq(0), !$code.hasClass('folded'));
+ });
+ }
+ }
+
+ const $toc = $('#toc');
+ if ($toc.length > 0) {
+ const $mask = $('
');
+ $mask.attr('id', 'toc-mask');
+
+ $('body').append($mask);
+
+ function toggleToc() { // eslint-disable-line no-inner-declarations
+ $toc.toggleClass('is-active');
+ $mask.toggleClass('is-active');
+ }
+
+ $toc.on('click', toggleToc);
+ $mask.on('click', toggleToc);
+ $('.navbar-main .catalogue').on('click', toggleToc);
+ }
+}(jQuery, window.moment, window.ClipboardJS, window.IcarusThemeSettings));
diff --git a/js/night.js b/js/night.js
new file mode 100644
index 00000000..3998a147
--- /dev/null
+++ b/js/night.js
@@ -0,0 +1,32 @@
+(function() {
+ var isNight = localStorage.getItem('night');
+ var nightNav;
+
+ function applyNight(value) {
+ if (value.toString() === 'true') {
+ document.body.classList.remove('light');
+ document.body.classList.add('night');
+ } else {
+ document.body.classList.remove('night');
+ document.body.classList.add('light');
+ }
+ }
+
+ function findNightNav() {
+ nightNav = document.getElementById('night-nav');
+ if (!nightNav) {
+ setTimeout(findNightNav, 100);
+ } else {
+ nightNav.addEventListener('click', switchNight);
+ }
+ }
+
+ function switchNight() {
+ isNight = isNight ? isNight.toString() !== 'true' : true;
+ applyNight(isNight);
+ localStorage.setItem('night', isNight);
+ }
+
+ findNightNav();
+ isNight && applyNight(isNight);
+ }());
\ No newline at end of file
diff --git a/js/toc.js b/js/toc.js
new file mode 100644
index 00000000..dcdde5e6
--- /dev/null
+++ b/js/toc.js
@@ -0,0 +1,80 @@
+(function (window, document) {
+ function register($toc) {
+ const currentInView = new Set();
+ const headingToMenu = new Map();
+ const $menus = Array.from($toc.querySelectorAll('.menu-list > li > a'));
+
+ for (const $menu of $menus) {
+ const elementId = $menu.getAttribute('href').trim().slice(1);
+ const $heading = document.getElementById(elementId);
+ if ($heading) {
+ headingToMenu.set($heading, $menu);
+ }
+ }
+
+ const $headings = Array.from(headingToMenu.keys());
+
+ const callback = (entries) => {
+ for (const entry of entries) {
+ if (entry.isIntersecting) {
+ currentInView.add(entry.target);
+ } else {
+ currentInView.delete(entry.target);
+ }
+ }
+ let $heading;
+ if (currentInView.size) {
+ // heading is the first in-view heading
+ $heading = [...currentInView].sort(($el1, $el2) => $el1.offsetTop - $el2.offsetTop)[0];
+ } else if ($headings.length) {
+ // heading is the closest heading above the viewport top
+ $heading = $headings
+ .filter(($heading) => $heading.offsetTop < window.scrollY)
+ .sort(($el1, $el2) => $el2.offsetTop - $el1.offsetTop)[0];
+ }
+ if ($heading && headingToMenu.has($heading)) {
+ $menus.forEach(($menu) => $menu.classList.remove('is-active'));
+
+ const $menu = headingToMenu.get($heading);
+ $menu.classList.add('is-active');
+ let $menuList = $menu.parentElement.parentElement;
+ while (
+ $menuList.classList.contains('menu-list') &&
+ $menuList.parentElement.tagName.toLowerCase() === 'li'
+ ) {
+ $menuList.parentElement.children[0].classList.add('is-active');
+ $menuList = $menuList.parentElement.parentElement;
+ }
+ }
+ };
+ const observer = new IntersectionObserver(callback, { threshold: 0 });
+
+ for (const $heading of $headings) {
+ observer.observe($heading);
+ // smooth scroll to the heading
+ if (headingToMenu.has($heading)) {
+ const $menu = headingToMenu.get($heading);
+ $menu.setAttribute('data-href', $menu.getAttribute('href'));
+ $menu.setAttribute('href', 'javascript:;');
+ $menu.addEventListener('click', () => {
+ if (typeof $heading.scrollIntoView === 'function') {
+ $heading.scrollIntoView({ behavior: 'smooth' });
+ }
+ const anchor = $menu.getAttribute('data-href');
+ if (history.pushState) {
+ history.pushState(null, null, anchor);
+ } else {
+ location.hash = anchor;
+ }
+ });
+ $heading.style.scrollMargin = '1em';
+ }
+ }
+ }
+
+ if (typeof window.IntersectionObserver === 'undefined') {
+ return;
+ }
+
+ document.querySelectorAll('#toc').forEach(register);
+})(window, document);
diff --git a/js/universe.js b/js/universe.js
new file mode 100644
index 00000000..f78638d5
--- /dev/null
+++ b/js/universe.js
@@ -0,0 +1,155 @@
+/**
+ * created by lvfan
+ * 2018-09-04
+ */
+
+
+(function drawBg() {
+ window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
+ window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
+ // const
+ var starDensity = 0.216;
+ var speedCoeff = 0.05;
+ var canva = document.getElementById('universe');
+
+ // let
+ var width;
+ var height;
+ var starCount;
+ /* no-unused-vars */
+ // var circleRadius;
+ // var circleCenter;
+ var first = true;
+ var giantColor = '180,184,240';
+ var starColor = '226,225,142';
+ var cometColor = '226,225,224';
+ var stars = [];
+ var universe;
+
+ windowResizeHandler();
+ window.addEventListener('resize', windowResizeHandler, false);
+
+ function windowResizeHandler() {
+ width = window.innerWidth;
+ height = window.innerHeight;
+ starCount = width * starDensity;
+ // circleRadius = (width > height ? height / 2 : width / 2);
+ // circleCenter = {
+ // x: width / 2,
+ // y: height / 2
+ // };
+ canva.setAttribute('width', width);
+ canva.setAttribute('height', height);
+ }
+
+ createUniverse();
+
+ function createUniverse() {
+ universe = canva.getContext('2d');
+ for (var i = 0; i < starCount; i++) {
+ stars[i] = new Star();
+ stars[i].reset();
+ }
+ draw();
+ }
+
+ function draw() {
+ universe.clearRect(0, 0, width, height);
+ var starsLength = stars.length;
+ for (var i = 0; i < starsLength; i++) {
+ var star = stars[i];
+ star.move();
+ star.fadeIn();
+ star.fadeOut();
+ star.draw();
+ }
+ }
+
+ function Star() {
+ this.reset = function () {
+ this.giant = getProbability(3);
+ this.comet = this.giant || first ? false : getProbability(10);
+ this.x = getRandInterval(0, width - 10);
+ this.y = getRandInterval(0, height);
+ this.r = getRandInterval(1.1, 2.6);
+ this.dx = getRandInterval(speedCoeff, 6 * speedCoeff) + (this.comet + 1 - 1) * speedCoeff * getRandInterval(50, 120) + speedCoeff * 2;
+ this.dy = -getRandInterval(speedCoeff, 6 * speedCoeff) - (this.comet + 1 - 1) * speedCoeff * getRandInterval(50, 120);
+ this.fadingOut = null;
+ this.fadingIn = true;
+ this.opacity = 0;
+ this.opacityTresh = getRandInterval(0.2, 1 - (this.comet + 1 - 1) * 0.4);
+ this.do = getRandInterval(0.0005, 0.002) + (this.comet + 1 - 1) * 0.001;
+ };
+ this.fadeIn = function () {
+ if (this.fadingIn) {
+ this.fadingIn = !(this.opacity > this.opacityTresh);
+ this.opacity += this.do;
+ }
+ };
+ this.fadeOut = function () {
+ if (this.fadingOut) {
+ this.fadingOut = !(this.opacity < 0);
+ this.opacity -= this.do / 2;
+ if (this.x > width || this.y < 0) {
+ this.fadingOut = false;
+ this.reset();
+ }
+ }
+ };
+ this.draw = function () {
+ universe.beginPath();
+ if (this.giant) {
+ universe.fillStyle = 'rgba(' + giantColor + ',' + this.opacity + ')';
+ universe.arc(this.x, this.y, 2, 0, 2 * Math.PI, false);
+ } else if (this.comet) {
+ universe.fillStyle = 'rgba(' + cometColor + ',' + this.opacity + ')';
+ universe.arc(this.x, this.y, 1.5, 0, 2 * Math.PI, false);
+ // comet tail
+ for (var i = 0; i < 30; i++) {
+ universe.fillStyle = 'rgba(' + cometColor + ',' + (this.opacity - (this.opacity / 20) * i) + ')';
+ universe.rect(this.x - this.dx / 4 * i, this.y - this.dy / 4 * i - 2, 2, 2);
+ universe.fill();
+ }
+ } else {
+ universe.fillStyle = 'rgba(' + starColor + ',' + this.opacity + ')';
+ universe.rect(this.x, this.y, this.r, this.r);
+ }
+ universe.closePath();
+ universe.fill();
+ };
+ this.move = function () {
+ this.x += this.dx;
+ this.y += this.dy;
+ if (this.fadingOut === false) {
+ this.reset();
+ }
+ if (this.x > width - (width / 4) || this.y < 0) {
+ this.fadingOut = true;
+ }
+ };
+ (function () {
+ setTimeout(function () {
+ first = false;
+ }, 50);
+ })();
+ }
+
+ function getProbability(percents) {
+ return ((Math.floor(Math.random() * 1000) + 1) < percents * 10);
+ }
+
+ function getRandInterval(min, max) {
+ return (Math.random() * (max - min) + min);
+ }
+
+ /* ---------------------------------
+ * www.imaegoo.com
+ * NO DRAW IN LIGHT MODE
+ * --------------------------------- */
+ (function imaegoo () {
+ if (document.body.classList.contains('night')) {
+ draw();
+ }
+ window.requestAnimationFrame(imaegoo);
+ })();
+}());
\ No newline at end of file
diff --git a/manifest.json b/manifest.json
new file mode 100644
index 00000000..38258e19
--- /dev/null
+++ b/manifest.json
@@ -0,0 +1 @@
+{"name":"Yttr 的小站","short_name":null,"start_url":"/index.html","theme_color":null,"background_color":null,"display":"standalone","icons":[{"src":"","sizes":"","type":null}]}
\ No newline at end of file
diff --git a/placeholder b/placeholder
deleted file mode 100644
index e69de29b..00000000
diff --git a/tags/OI/index.html b/tags/OI/index.html
new file mode 100644
index 00000000..0cb443a0
--- /dev/null
+++ b/tags/OI/index.html
@@ -0,0 +1,83 @@
+
+
标签: OI - Yttr 的小站 2023-11-04 发表2023-12-16 更新OI 3 分钟读完 (大约496个字) 通用快读快写模板
Use these templates after using namespace std;
+
Update Info >folded 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
阅读更多 2023-11-02 发表2023-12-16 更新OI 3 分钟读完 (大约489个字) Manacher 算法学习笔记
Manacher 算法于 1975 年发明,用其发明者的名字命名。
+
Manacher 是一个线性解决回文子串问题的算法。
阅读更多 2023-10-29 发表2023-12-16 更新OI 3 分钟读完 (大约439个字) P9816 少项式复合幂 题解
简要题意 称一个项数小于等于 \(20\) 的多项式为一个少项式 。
+
求一个少项式的 \(y\) 次复合函数在 \(x\) 点上 \(f_{y}(x)\bmod p\) 的值。
阅读更多
\ No newline at end of file
diff --git a/tags/index.html b/tags/index.html
new file mode 100644
index 00000000..7b999811
--- /dev/null
+++ b/tags/index.html
@@ -0,0 +1,80 @@
+
+
标签 - Yttr 的小站
\ No newline at end of file
diff --git "a/tags/\345\215\232\345\256\242/index.html" "b/tags/\345\215\232\345\256\242/index.html"
new file mode 100644
index 00000000..a7b53150
--- /dev/null
+++ "b/tags/\345\215\232\345\256\242/index.html"
@@ -0,0 +1,80 @@
+
+
标签: 博客 - Yttr 的小站
\ No newline at end of file