diff --git a/2022/06/20/My-First-Blog/index.html b/2022/06/20/My-First-Blog/index.html new file mode 100644 index 0000000..d49dc03 --- /dev/null +++ b/2022/06/20/My-First-Blog/index.html @@ -0,0 +1,458 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +${highlightKeyword(content, slice)}...
`; + }); + + resultItem += '${imageTitle}
`); + // Make sure img title tag will show correctly in fancybox + $imageWrapLink.attr('title', imageTitle).attr('data-caption', imageTitle); + } + }); + + $.fancybox.defaults.hash = false; + $('.fancybox').fancybox({ + loop : true, + helpers: { + overlay: { + locked: false + } + } + }); + }, + + registerExtURL: function() { + document.querySelectorAll('span.exturl').forEach(element => { + let link = document.createElement('a'); + // https://stackoverflow.com/questions/30106476/using-javascripts-atob-to-decode-base64-doesnt-properly-decode-utf-8-strings + link.href = decodeURIComponent(atob(element.dataset.url).split('').map(c => { + return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); + }).join('')); + link.rel = 'noopener external nofollow noreferrer'; + link.target = '_blank'; + link.className = element.className; + link.title = element.title; + link.innerHTML = element.innerHTML; + element.parentNode.replaceChild(link, element); + }); + }, + + /** + * One-click copy code support. + */ + registerCopyCode: function() { + document.querySelectorAll('figure.highlight').forEach(element => { + const box = document.createElement('div'); + element.wrap(box); + box.classList.add('highlight-container'); + box.insertAdjacentHTML('beforeend', 'Change dir to NexT directory. There must be layout, source, languages and other directories:
$ cd themes/next
+$ ls
+_config.yml crowdin.yml docs gulpfile.js languages layout LICENSE.md package.json README.md scripts source
+
+Install module to source/lib directory:
$ git clone https://github.com/theme-next/theme-next-three source/lib/three
+
+Enable module in NexT _config.yml file:
three_waves: true
+OR
+canvas_lines: true
+OR
+canvas_sphere: true
+
+And, if you wants to use the CDN, then need to set:
+vendors:
+ ...
+ three: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/three.min.js
+ three_waves: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@latest/three-waves.min.js
+ canvas_lines: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@latest/canvas_lines.min.js
+ canvas_sphere: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@latest/canvas_sphere.min.js
+
+$ cd themes/next/source/lib/three
+$ git pull
+
diff --git a/lib/three/canvas_lines.min.js b/lib/three/canvas_lines.min.js
new file mode 100644
index 0000000..0ef76c7
--- /dev/null
+++ b/lib/three/canvas_lines.min.js
@@ -0,0 +1,2 @@
+THREE.SpriteCanvasMaterial=function(e){THREE.Material.call(this),this.type="SpriteCanvasMaterial",this.color=new THREE.Color(16777215),this.program=function(e,t){},this.setValues(e)},THREE.SpriteCanvasMaterial.prototype=Object.create(THREE.Material.prototype),THREE.SpriteCanvasMaterial.prototype.constructor=THREE.SpriteCanvasMaterial,THREE.SpriteCanvasMaterial.prototype.clone=function(){var e=new THREE.SpriteCanvasMaterial;return e.copy(this),e.color.copy(this.color),e.program=this.program,e},THREE.CanvasRenderer=function(e){console.log("THREE.CanvasRenderer",THREE.REVISION),e=e||{};var s,l,c,p,E,d,h,f,u,m,v,x,R,y,T,w,H,g,S,M=this,b=new THREE.Projector,r=void 0!==e.canvas?e.canvas:document.createElement("canvas"),C=r.width,z=r.height,V=Math.floor(C/2),j=Math.floor(z/2),L=0,O=0,B=C,W=z,n=1,P=r.getContext("2d",{alpha:!0===e.alpha}),i=new THREE.Color(0),o=!0===e.alpha?0:1,a=1,k=0,N=null,F=null,A=null,I=null,D=null,t=[],G=(new THREE.RenderableVertex,new THREE.RenderableVertex,new THREE.Color),U=(new THREE.Color,new THREE.Color,new THREE.Color,new THREE.Color,new THREE.Color),q=new THREE.Color,X=new THREE.Color,J={},Y=new THREE.Box2,$=new THREE.Box2,K=new THREE.Box2,Q=new THREE.Color,Z=new THREE.Color,_=new THREE.Color,ee=new THREE.Vector3,te=new THREE.Vector3,ie=new THREE.Vector3,re=new THREE.Matrix3;function ne(e,t,i){de(i.opacity),he(i.blending);var r=t.scale.x*V,n=t.scale.y*j,o=.5*Math.sqrt(r*r+n*n);if(K.min.set(e.x-o,e.y-o),K.max.set(e.x+o,e.y+o),i instanceof THREE.SpriteMaterial){var a=i.map;if(null!==a){var s=J[a.id];if(void 0!==s&&s.version===a.version||(s=ce(a),J[a.id]=s),void 0!==s.canvas){xe(s.canvas);var l=a.image,c=l.width*a.offset.x,p=l.height*a.offset.y,E=l.width*a.repeat.x,d=l.height*a.repeat.y,h=r/E,f=n/d;P.save(),P.translate(e.x,e.y),0!==i.rotation&&P.rotate(i.rotation),P.translate(-r/2,-n/2),P.scale(h,f),P.translate(-c,-p),P.fillRect(c,p,E,d),P.restore()}}else xe(i.color.getStyle()),P.save(),P.translate(e.x,e.y),0!==i.rotation&&P.rotate(i.rotation),P.scale(r,-n),P.fillRect(-.5,-.5,1,1),P.restore()}else i instanceof THREE.SpriteCanvasMaterial&&(ve(i.color.getStyle()),xe(i.color.getStyle()),P.save(),P.translate(e.x,e.y),0!==i.rotation&&P.rotate(i.rotation),P.scale(r,n),i.program(P),P.restore())}function oe(e,t,i,r){if(de(r.opacity),he(r.blending),P.beginPath(),P.moveTo(e.positionScreen.x,e.positionScreen.y),P.lineTo(t.positionScreen.x,t.positionScreen.y),r instanceof THREE.LineBasicMaterial){if(fe(r.linewidth),ue(r.linecap),me(r.linejoin),r.vertexColors!==THREE.VertexColors)ve(r.color.getStyle());else{var n=i.vertexColors[0].getStyle(),o=i.vertexColors[1].getStyle();if(n===o)ve(n);else{try{var a=P.createLinearGradient(e.positionScreen.x,e.positionScreen.y,t.positionScreen.x,t.positionScreen.y);a.addColorStop(0,n),a.addColorStop(1,o)}catch(e){a=n}ve(a)}}P.stroke(),K.expandByScalar(2*r.linewidth)}else r instanceof THREE.LineDashedMaterial&&(fe(r.linewidth),ue(r.linecap),me(r.linejoin),ve(r.color.getStyle()),Re([r.dashSize,r.gapSize]),P.stroke(),K.expandByScalar(2*r.linewidth),Re([]))}function ae(e,t,i,r,n,o,a,s){if(M.info.render.vertices+=3,M.info.render.faces++,de(s.opacity),he(s.blending),h=e.positionScreen.x,f=e.positionScreen.y,u=t.positionScreen.x,m=t.positionScreen.y,v=i.positionScreen.x,x=i.positionScreen.y,function(e,t,i,r,n,o){P.beginPath(),P.moveTo(e,t),P.lineTo(i,r),P.lineTo(n,o),P.closePath()}(h,f,u,m,v,x),(s instanceof THREE.MeshLambertMaterial||s instanceof THREE.MeshPhongMaterial)&&null===s.map)U.copy(s.color),q.copy(s.emissive),s.vertexColors===THREE.FaceColors&&U.multiply(a.color),G.copy(Q),te.copy(e.positionWorld).add(t.positionWorld).add(i.positionWorld).divideScalar(3),function(e,t,i){for(var r=0,n=c.length;r
+c&&(c=a[b]);return c}function T(){Object.defineProperty(this,"id",{value:Vd++});this.uuid=N.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=
+!1}function I(){Object.defineProperty(this,"id",{value:Vd++});this.uuid=N.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity}}function Aa(a,b){x.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new I;this.material=void 0!==b?b:new Ka({color:16777215*Math.random()});this.drawMode=0;this.updateMorphTargets()}function Ib(a,b,c,d,e,f){T.call(this);
+this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.fromBufferGeometry(new kb(a,b,c,d,e,f));this.mergeVertices()}function kb(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,l,L,C,F){var da=f/L,H=g/C,aa=f/2,x=g/2,D=l/2;g=L+1;var z=C+1,Q=f=0,M,O,P=new q;for(O=0;Ok;k++)e.__webglFramebuffer[k]=a.createFramebuffer()}else e.__webglFramebuffer=
+a.createFramebuffer();if(g){c.bindTexture(a.TEXTURE_CUBE_MAP,f.__webglTexture);u(a.TEXTURE_CUBE_MAP,b.texture,h);for(k=0;6>k;k++)l(e.__webglFramebuffer[k],b,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+k);b.texture.generateMipmaps&&h&&a.generateMipmap(a.TEXTURE_CUBE_MAP);c.bindTexture(a.TEXTURE_CUBE_MAP,null)}else c.bindTexture(a.TEXTURE_2D,f.__webglTexture),u(a.TEXTURE_2D,b.texture,h),l(e.__webglFramebuffer,b,a.COLOR_ATTACHMENT0,a.TEXTURE_2D),b.texture.generateMipmaps&&h&&a.generateMipmap(a.TEXTURE_2D),
+c.bindTexture(a.TEXTURE_2D,null);if(b.depthBuffer){e=d.get(b);f=!0===b.isWebGLRenderTargetCube;if(b.depthTexture){if(f)throw Error("target.depthTexture not supported in Cube render targets");if(b&&b.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported!");a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer);if(!b.depthTexture||!b.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");d.get(b.depthTexture).__webglTexture&&
+b.depthTexture.image.width===b.width&&b.depthTexture.image.height===b.height||(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0);n(b.depthTexture,0);e=d.get(b.depthTexture).__webglTexture;if(1026===b.depthTexture.format)a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.TEXTURE_2D,e,0);else if(1027===b.depthTexture.format)a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,e,0);else throw Error("Unknown depthTexture format");
+}else if(f)for(e.__webglDepthbuffer=[],f=0;6>f;f++)a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer[f]),e.__webglDepthbuffer[f]=a.createRenderbuffer(),r(e.__webglDepthbuffer[f],b);else a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer),e.__webglDepthbuffer=a.createRenderbuffer(),r(e.__webglDepthbuffer,b);a.bindFramebuffer(a.FRAMEBUFFER,null)}};this.updateRenderTargetMipmap=function(b){var e=b.texture;e.generateMipmaps&&m(b)&&1003!==e.minFilter&&1006!==e.minFilter&&(b=b&&b.isWebGLRenderTargetCube?
+a.TEXTURE_CUBE_MAP:a.TEXTURE_2D,e=d.get(e).__webglTexture,c.bindTexture(b,e),a.generateMipmap(b),c.bindTexture(b,null))}}function Qf(){var a={};return{get:function(b){b=b.uuid;var c=a[b];void 0===c&&(c={},a[b]=c);return c},"delete":function(b){delete a[b.uuid]},clear:function(){a={}}}}function Rf(a,b,c){function d(b,c,d){var e=new Uint8Array(4),f=a.createTexture();a.bindTexture(b,f);a.texParameteri(b,a.TEXTURE_MIN_FILTER,a.NEAREST);a.texParameteri(b,a.TEXTURE_MAG_FILTER,a.NEAREST);for(b=0;b