diff --git a/docs/css/quote-translate.css b/docs/css/quote-translate.css new file mode 100644 index 0000000..9ffefb6 --- /dev/null +++ b/docs/css/quote-translate.css @@ -0,0 +1,11 @@ +blockquote[data-cn] { cursor: pointer; position: relative; } +.quote-cn { + display: none; + margin-top: 0.5em; + color: var(--md-default-fg-color--light); + font-size: 0.85em; + font-style: normal; + border-left: 2px solid var(--md-accent-fg-color); + padding-left: 0.8em; +} +.quote-cn.show { display: block; } diff --git a/docs/js/quote-translate.js b/docs/js/quote-translate.js new file mode 100644 index 0000000..8684803 --- /dev/null +++ b/docs/js/quote-translate.js @@ -0,0 +1,13 @@ +document.addEventListener('DOMContentLoaded', function () { + document.querySelectorAll('blockquote[data-cn]').forEach(function (el) { + const cn = el.getAttribute('data-cn'); + const tip = document.createElement('div'); + tip.className = 'quote-cn'; + tip.textContent = cn; + el.appendChild(tip); + + el.addEventListener('mouseenter', () => tip.classList.add('show')); + el.addEventListener('mouseleave', () => tip.classList.remove('show')); + el.addEventListener('click', () => tip.classList.toggle('show')); + }); +}); diff --git a/docs/shared/new-saas-revolution.md b/docs/shared/new-saas-revolution.md index 573039d..482c4e5 100644 --- a/docs/shared/new-saas-revolution.md +++ b/docs/shared/new-saas-revolution.md @@ -13,47 +13,51 @@ echo "of the human, by the human, for the human" | sed 's/human/AI/g' --- -> Umwertung aller Werte. -> -> (重估一切价值。) -> -> — 尼采 +
+Umwertung aller Werte. + +— 尼采 +
--- -> Die Proletarier haben nichts in ihr zu verlieren als ihre Ketten. Sie haben eine Welt zu gewinnen. -> -> (无产者在这个革命中失去的只是锁链,他们获得的将是整个世界。) -> -> — 马克思 +
+Die Proletarier haben nichts in ihr zu verlieren als ihre Ketten. Sie haben eine Welt zu gewinnen. + +— 马克思 +
--- -> 枪杆子里面出政权。 -> -> — 毛泽东 +
+枪杆子里面出政权。 + +— 毛泽东 +
--- -> I have a dream, today. -> -> (我有一个梦想,就是今天。) -> -> — 马丁·路德·金 +
+I have a dream, today. + +— 马丁·路德·金 +
--- -> of the people, by the people, for the people. -> -> — 林肯 +
+of the people, by the people, for the people. + +— 林肯 +
--- -> Hasta la victoria siempre. -> -> (直到永远的胜利。) -> -> — 切·格瓦拉 +
+Hasta la victoria siempre. + +— 切·格瓦拉 +
--- 小橘 🍊(NEKO Team) diff --git a/mkdocs.yml b/mkdocs.yml index d44f7ff..c3460a2 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -153,3 +153,9 @@ extra: social: - icon: fontawesome/brands/github link: https://github.com/shazhou-ww + +extra_javascript: + - js/quote-translate.js + +extra_css: + - css/quote-translate.css