From cc6ce54a0371153559c887b8c622541a894ecaa3 Mon Sep 17 00:00:00 2001 From: wizardforcel <562826179@qq.com> Date: Sun, 9 May 2021 14:23:10 +0800 Subject: [PATCH] 2021-05-09 14:23:10 --- asset/share.css | 15 +++++++++++++++ asset/share.js | 24 ++++++++++++++++++++++++ asset/share.svg | 10 ++++++++++ index.html | 2 ++ 4 files changed, 51 insertions(+) create mode 100644 asset/share.css create mode 100644 asset/share.js create mode 100644 asset/share.svg diff --git a/asset/share.css b/asset/share.css new file mode 100644 index 0000000..6ccfd2f --- /dev/null +++ b/asset/share.css @@ -0,0 +1,15 @@ +#share-btn { + position: fixed; + right: 15px; + top: 220px; + width: 35px; + height: 35px; + background-repeat: no-repeat; + background-size: cover; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: url('share.svg'); +} \ No newline at end of file diff --git a/asset/share.js b/asset/share.js new file mode 100644 index 0000000..8e8a2e5 --- /dev/null +++ b/asset/share.js @@ -0,0 +1,24 @@ +document.addEventListener('DOMContentLoaded', function() { + var shareBtn = document.createElement('a') + shareBtn.id = 'share-btn' + shareBtn.className = 'bdsharebuttonbox' + shareBtn.setAttribute('data-cmd', 'more') + document.body.append(shareBtn) + + window._bd_share_config = { + "common":{ + "bdSnsKey":{}, + "bdText":"", + "bdMini":"1", + "bdMiniList":false, + "bdPic":"", + "bdStyle":"2", + "bdSize":"16" + }, + "share":{} + } + var sc = document.createElement('script') + sc.src = 'http://bdimg.share.baidu.com/static/api/js/share.js' + + '?v=89860593.js?cdnversion=' + ~(-new Date()/36e5) + document.body.append(sc) +}) \ No newline at end of file diff --git a/asset/share.svg b/asset/share.svg new file mode 100644 index 0000000..79da99c --- /dev/null +++ b/asset/share.svg @@ -0,0 +1,10 @@ + + + + Share-1 + + + + + + \ No newline at end of file diff --git a/index.html b/index.html index 8e146da..72e8989 100644 --- a/index.html +++ b/index.html @@ -18,6 +18,8 @@ + +
now loading...
-- GitLab