1
0
mirror of https://github.com/avinal/avinal.github.io.git synced 2026-07-03 23:30:09 +05:30

fix some style issue

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
2022-09-08 19:07:00 +05:30
parent 80a054c8c0
commit 5e539dadaf
2 changed files with 78 additions and 65 deletions
+23
View File
@@ -14,10 +14,33 @@
<body>
<div id="app"></div>
<script src="/website/app.js"></script>
<script>
var app = Elm.Main.init({ node: document.getElementById("app") });
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.7/clipboard.min.js"
crossorigin="anonymous"></script>
<script type="text/javascript">
$(function () {
// copy-btn HTML
var btn = "<span class=\"btn-copy tooltipped tooltipped-sw\" aria-label=\"Copy to clipboard!\">";
btn += '<i class="far fa-clone"></i>';
btn += '</span>';
// mount it!
$(".highlight table").before(btn);
var clip = new ClipboardJS('.btn-copy', {
text: function (trigger) {
return Array.from(trigger.nextElementSibling.querySelectorAll('.code')).reduce((str, it) => str + it.innerText + '\n', '')
}
});
clip.on('success', function (e) {
e.trigger.setAttribute('aria-label', "Copied!");
e.clearSelection();
})
})
</script>
</body>
</html>