gitbook-plugin-lock
Advanced tools
Comparing version 0.0.16 to 0.0.17
@@ -20,6 +20,5 @@ require(['gitbook', 'jQuery'], function(gitbook, $) { | ||
const sss = '<div id="read-more-wrap" style="position: absolute; bottom: 0px; z-index: 9999; width: 100%; margin-top: -100px; font-family: PingFangSC-Regular, sans-serif;"><div id="read-more-mask" style="position: relative; height: 200px; background: -webkit-gradient(linear, 0 0%, 0 100%, from(rgba(255, 255, 255, 0)), to(rgb(255, 255, 255)));"></div><a id="read-more-btn" target="_self" style="position: absolute; left: 50%; top: 70%; bottom: 30px; transform: translate(-50%, -50%); width: 160px; height: 36px; line-height: 36px; font-size: 15px; text-align: center; border: 1px solid rgb(222, 104, 109); color: rgb(222, 104, 109); background: rgb(255, 255, 255); cursor: pointer; border-radius: 6px;">阅读全文</a></div>' | ||
html = html.concat(['</div>', '</div>']); | ||
var cla = document.getElementsByClassName("page-inner"); | ||
var cla = document.getElementsByClassName("page-wrapper"); | ||
console.log(cla,"看看cla是啥") | ||
@@ -48,4 +47,22 @@ | ||
cla[0].after(sss) | ||
const sss = '<div id="read-more-wrap" style="position: absolute; bottom: 0px; z-index: 9999; width: 100%; margin-top: -100px; font-family: PingFangSC-Regular, sans-serif;"><div id="read-more-mask" style="position: relative; height: 200px; background: -webkit-gradient(linear, 0 0%, 0 100%, from(rgba(255, 255, 255, 0)), to(rgb(255, 255, 255)));"></div><a id="read-more-btn" target="_self" style="position: absolute; left: 50%; top: 70%; bottom: 30px; transform: translate(-50%, -50%); width: 160px; height: 36px; line-height: 36px; font-size: 15px; text-align: center; border: 1px solid rgb(222, 104, 109); color: rgb(222, 104, 109); background: rgb(255, 255, 255); cursor: pointer; border-radius: 6px;">阅读全文</a></div>' | ||
const button = document.createElement('a'); // is a node | ||
button.target = '_self' | ||
button.style.all = 'position: absolute; left: 50%; top: 70%; bottom: 30px; transform: translate(-50%, -50%); width: 160px; height: 36px; line-height: 36px; font-size: 15px; text-align: center; border: 1px solid rgb(222, 104, 109); color: rgb(222, 104, 109); background: rgb(255, 255, 255); cursor: pointer; border-radius: 6px;'; | ||
button.innerHTML = "点击查看更多" | ||
const as = document.createElement('div'); // is a node | ||
as.id = 'read-more-mask'; | ||
as.style.all= "position: relative; height: 200px; background: -webkit-gradient(linear, 0 0%, 0 100%, from(rgba(255, 255, 255, 0)), to(rgb(255, 255, 255)));"; | ||
as.appendChild(button) | ||
const z = document.createElement('div'); // is a node | ||
z.id = "read-more-wrap" | ||
z.style.all ="position: absolute; bottom: 0px; z-index: 9999; width: 100%; margin-top: -100px; font-family: PingFangSC-Regular, sans-serif;" | ||
z.appendChild(as) | ||
cla[0].appendChild(z) | ||
// const pw = document.getElementsByClassName("page-wrapper"); | ||
@@ -52,0 +69,0 @@ // pw[0]. |
{ | ||
"name": "gitbook-plugin-lock", | ||
"version": "0.0.16", | ||
"version": "0.0.17", | ||
"description": "Gitbook 页面加锁", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
7363
102