mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 23:38:56 +00:00
🔧 Chore: update Watermark 1.0.3
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ All notable changes to this project will be documented in this file.
|
||||
- :sparkles: Style: add media style for print view ([#61](https://github.com/Lruihao/FixIt/issues/61))
|
||||
- :sparkles: Feat: add pageStyle option ([#62](https://github.com/Lruihao/FixIt/issues/62))
|
||||
- :sparkles: Feat: add 9 newly supported social links ([#17](https://github.com/Lruihao/FixIt/issues/17))
|
||||
- :sparkles: Feat: update watermark 1.0.3-RC (fontFamily support)
|
||||
- :sparkles: Feat: update Watermark 1.0.3 (fontFamily supported)
|
||||
- :lipstick: Style: add radius of the scrollbar
|
||||
- :pencil2: Style: fix typo discription should be: description ([#60](https://github.com/Lruihao/FixIt/issues/60))
|
||||
- :fire: Feat: remove shortcode cardlink
|
||||
|
||||
+1
-1
@@ -25,4 +25,4 @@ simple-icons@5.21.1 https://github.com/simple-icons/simple-icons
|
||||
twemoji@13.1.0 https://github.com/twitter/twemoji
|
||||
typeit@7.0.4 https://github.com/alexmacarthur/typeit
|
||||
valine@1.4.16 https://github.com/xCss/Valine
|
||||
watermark@1.0.3-RC https://github.com/Lruihao/watermark
|
||||
watermark@1.0.3 https://github.com/Lruihao/watermark
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
var Watermark=function(){function t(e={}){var n=t.prototype;this.options=e,s(this),d(this,this.options),h(this),p(this),n.upload=function(t){if(t){o.disconnect(),i.disconnect(),this.options.content=t;for(const e of this._container.querySelectorAll(".cell-watermark"))e.innerHTML=t;o.observe(this._container.parentNode,{childList:!0,subtree:!0}),i.observe(this._container,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}},n.render=function(t={}){l(this,Object.assign(this.options,t))},n.destroy=function(){i.disconnect(),o.disconnect(),window.removeEventListener("resize",r),this._container.parentNode.removeChild(this._container)}}var e,n,i,o,r,c=window.outerWidth,a=window.outerHeight,s=function(t){t._container=document.createElement("div"),t._container.classList.add("cell-watermark-container"),t._container.style.cssText="display: block; pointer-events: none;",t._container.setAttribute("aria-hidden",!0),e=document.querySelector(t.options.appendTo)||document.body,e.appendChild(t._container)},d=function(t,e){e.rowSpacing=e.rowSpacing||60,e.colSpacing=e.colSpacing||30,e.width=e.width||150,e.height=e.height||20;let i=parseInt(a/(e.height+e.rowSpacing)),o=parseInt(c/(e.width+e.colSpacing)),r=(c-e.width*o-e.colSpacing*(o-1))/2,s=(a-e.height*i-e.rowSpacing*(i-1))/2,d=document.createElement("div");d.classList.add("cell-watermark"),d.style.cssText="transform: rotate(15deg); opacity: 0.1; font-size: 0.85rem; text-align: center;position: fixed; user-select: none; word-break: break-all; overflow: hidden; z-index: 999999;";for(let n=0;n<i;n++){let i=s+(e.rowSpacing+e.height)*n,c=o;n%2!=0&&c++;for(let n=0;n<c;n++){let a=r+(e.colSpacing+e.width)*n;c!==o&&(a-=(e.colSpacing+e.width)/2);let s=d.cloneNode();s.style.cssText+=`left: ${a}px; top: ${i}px; width: ${e.width}px; height: ${e.height}px`,s.style.transform=`rotate(${e.rotate}deg)`,s.style.opacity=e.opacity,s.style.fontSize=`${e.fontSize}rem`,s.style.fontFamily=e.fontFamily,s.innerHTML=e.content,t._container.appendChild(s)}}n=t._container},l=function(t,e){i.disconnect(),t._container.innerHTML="",d(t,e),i.observe(t._container,{attributes:!0,childList:!0,characterData:!0,subtree:!0})},h=function(t){i=new MutationObserver(function(e,n){l(t,t.options)}),i.observe(t._container,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),o=new MutationObserver(function(t){for(let i of t)"childList"===i.type&&i.removedNodes.length>0&&0===document.querySelectorAll(".cell-watermark-container").length&&e.appendChild(n)}),o.observe(t._container.parentNode,{childList:!0,subtree:!0})},p=function(t){r=function(){window.outerHeight===a&&window.outerWidth===c||(a=window.outerHeight,c=window.outerWidth,l(t,t.options))},window.addEventListener("resize",r)};return t}();
|
||||
(function(e,t){"function"==typeof define&&define.amd?define([],t()):"object"==typeof module&&module.exports?module.exports=t():e.Watermark=t()})(this,function(){function e(t={}){var n=e.prototype;this.options=t,s(this),d(this,this.options),h(this),p(this),n.upload=function(e){if(e){o.disconnect(),i.disconnect(),this.options.content=e;for(const t of this._container.querySelectorAll(".cell-watermark"))t.innerHTML=e;o.observe(this._container.parentNode,{childList:!0,subtree:!0}),i.observe(this._container,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}},n.render=function(e={}){l(this,Object.assign(this.options,e))},n.destroy=function(){i.disconnect(),o.disconnect(),window.removeEventListener("resize",r),this._container.parentNode.removeChild(this._container)}}var t,n,i,o,r,c=window.outerWidth,a=window.outerHeight,s=function(e){e._container=document.createElement("div"),e._container.classList.add("cell-watermark-container"),e._container.style.cssText="display: block; pointer-events: none;",e._container.setAttribute("aria-hidden",!0),t=document.querySelector(e.options.appendTo)||document.body,t.appendChild(e._container)},d=function(e,t){t.rowSpacing=t.rowSpacing||60,t.colSpacing=t.colSpacing||30,t.width=t.width||150,t.height=t.height||20;let i=parseInt(a/(t.height+t.rowSpacing)),o=parseInt(c/(t.width+t.colSpacing)),r=(c-t.width*o-t.colSpacing*(o-1))/2,s=(a-t.height*i-t.rowSpacing*(i-1))/2,d=document.createElement("div");d.classList.add("cell-watermark"),d.style.cssText="transform: rotate(15deg); opacity: 0.1; font-size: 0.85rem; text-align: center;position: fixed; user-select: none; word-break: break-all; overflow: hidden; z-index: 999999;";for(let n=0;n<i;n++){let i=s+(t.rowSpacing+t.height)*n,c=o;n%2!=0&&c++;for(let n=0;n<c;n++){let a=r+(t.colSpacing+t.width)*n;c!==o&&(a-=(t.colSpacing+t.width)/2);let s=d.cloneNode();s.style.cssText+=`left: ${a}px; top: ${i}px; width: ${t.width}px; height: ${t.height}px`,s.style.transform=`rotate(${t.rotate}deg)`,s.style.opacity=t.opacity,s.style.fontSize=`${t.fontSize}rem`,s.style.fontFamily=t.fontFamily,s.innerHTML=t.content,e._container.appendChild(s)}}n=e._container},l=function(e,t){i.disconnect(),e._container.innerHTML="",d(e,t),i.observe(e._container,{attributes:!0,childList:!0,characterData:!0,subtree:!0})},h=function(e){i=new MutationObserver(function(t,n){l(e,e.options)}),i.observe(e._container,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),o=new MutationObserver(function(e){for(let i of e)"childList"===i.type&&i.removedNodes.length>0&&0===document.querySelectorAll(".cell-watermark-container").length&&t.appendChild(n)}),o.observe(e._container.parentNode,{childList:!0,subtree:!0})},p=function(e){r=function(){window.outerHeight===a&&window.outerWidth===c||(a=window.outerHeight,c=window.outerWidth,l(e,e.options))},window.addEventListener("resize",r)};return e});
|
||||
Reference in New Issue
Block a user