├── test.txt ├── cat.gif ├── texture_00.png ├── test.pac ├── live2d ├── assets │ ├── moc │ │ ├── hijiki.moc │ │ └── hijiki.2048 │ │ │ └── texture_00.png │ ├── hijiki.pose.json │ ├── hijiki.model.json │ └── mtn │ │ └── 00_idle.mtn ├── device.min.js └── script.js ├── README.md ├── gps.html ├── test.html ├── cat.html └── course.html /test.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cat.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanyuzhang/lovely-cat/HEAD/cat.gif -------------------------------------------------------------------------------- /texture_00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanyuzhang/lovely-cat/HEAD/texture_00.png -------------------------------------------------------------------------------- /test.pac: -------------------------------------------------------------------------------- 1 | function FindProxyForURL(url, host) { 2 | return "SOCKS proxy.ssmax.net:11080"; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /live2d/assets/moc/hijiki.moc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanyuzhang/lovely-cat/HEAD/live2d/assets/moc/hijiki.moc -------------------------------------------------------------------------------- /live2d/assets/moc/hijiki.2048/texture_00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanyuzhang/lovely-cat/HEAD/live2d/assets/moc/hijiki.2048/texture_00.png -------------------------------------------------------------------------------- /live2d/assets/hijiki.pose.json: -------------------------------------------------------------------------------- 1 | {"type":"Live2D Pose","fade_in":0,"parts_visible":[{"group":[{"id":"PARTS_01_ARM_R"},{"id":"PARTS_01_ARM_R_02"}]},{"group":[{"id":"PARTS_01_ARM_L"},{"id":"PARTS_01_ARM_L_02"}]}]} -------------------------------------------------------------------------------- /live2d/assets/hijiki.model.json: -------------------------------------------------------------------------------- 1 | {"version":"Sample 1.0.0","model":"moc/hijiki.moc","textures":["moc/hijiki.2048/texture_00.png"],"name":"hijiki","pose":"hijiki.pose.json","motions":{"idle":[{"file":"mtn/00_idle.mtn"}],"":[{"file":"mtn/01.mtn"},{"file":"mtn/02.mtn"},{"file":"mtn/03.mtn"},{"file":"mtn/04.mtn"},{"file":"mtn/05.mtn"},{"file":"mtn/06.mtn"},{"file":"mtn/07.mtn"},{"file":"mtn/08.mtn"}]}} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | A lovely cat which will follow your mouse to move: 2 | 3 |  4 | 5 | ## Run 6 | If you want to run the project on localhost, you can use http server , such as ` http-server ` 7 | 8 | ## Demo 9 | click [lover-cat](https://zhanyuzhang.github.io/lovely-cat/cat.html) and then you will see a lovely black cat on the page! 10 | 11 | ## How to use it in your blog ? 12 | The cat is so lovely that you maybe want to import it to your blog. You can use `iframe` element, as follows: 13 | ``` 14 | 15 | ``` 16 | 17 | Enjoy yourself! 18 | 19 | 20 | -------------------------------------------------------------------------------- /gps.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |y||T>P&&T-P>y?T:T+(P-T)*_;var v=m+(p-m)*e;t.setParamFloat($,v)}}s>=this._$yT&&(this._$E?(r._$z2=i,this.loopFadeIn&&(r._$bs=i)):r._$9L=!0),this._$eP=e},J.prototype._$r0=function(){return this._$E},J.prototype._$aL=function(t){this._$E=t},J.prototype._$S0=function(){return this._$D0},J.prototype._$U0=function(t){this._$D0=t},J.prototype.isLoopFadeIn=function(){return this.loopFadeIn},J.prototype.setLoopFadeIn=function(t){this.loopFadeIn=t},N.prototype.clear=function(){this.size=0},N.prototype.add=function(t){if(this._$P.length<=this.size){var i=new Float32Array(2*this.size);x._$jT(this._$P,0,i,0,this.size),this._$P=i}this._$P[this.size++]=t},N.prototype._$BL=function(){var t=new Float32Array(this.size);return x._$jT(this._$P,0,t,0,this.size),t},B._$Fr=0,B._$hs=1,B._$ws=100,B._$Ns=101,B._$xs=102,B._$us=103,B._$qs=104,B._$Ys=105,Z.prototype=new I,Z._$gT=new Array,Z.prototype._$zP=function(){this._$GS=new D,this._$GS._$zP()},Z.prototype._$F0=function(t){I.prototype._$F0.call(this,t),this._$A=t._$6L(),this._$o=t._$6L(),this._$GS=t._$nP(),this._$Eo=t._$nP(),I.prototype.readV2_opacity.call(this,t)},Z.prototype.init=function(t){var i=new K(this),e=(this._$o+1)*(this._$A+1);return null!=i._$Cr&&(i._$Cr=null),i._$Cr=new Float32Array(2*e),null!=i._$hr&&(i._$hr=null),this._$32()?i._$hr=new Float32Array(2*e):i._$hr=null,i},Z.prototype._$Nr=function(t,i){var e=i;if(this._$GS._$Ur(t)){var r=this._$VT(),o=Z._$gT;o[0]=!1,S._$Vr(t,this._$GS,o,r,this._$Eo,e._$Cr,0,2),i._$Ib(o[0]),this.interpolateOpacity(t,this._$GS,i,o)}},Z.prototype._$2b=function(t,i){var e=i;if(e._$hS(!0),this._$32()){var r=this.getTargetBaseDataID();if(e._$8r==I._$ur&&(e._$8r=t.getBaseDataIndex(r)),e._$8r<0)at._$so&&_._$li("_$L _$0P _$G :: %s",r),e._$hS(!1);else{var o=t.getBaseData(e._$8r),n=t._$q2(e._$8r);if(null!=o&&n._$yo()){var s=n.getTotalScale();e.setTotalScale_notForClient(s);var a=n.getTotalOpacity();e.setTotalOpacity(a*e.getInterpolatedOpacity()),o._$nb(t,n,e._$Cr,e._$hr,this._$VT(),0,2),e._$hS(!0)}else e._$hS(!1)}}else e.setTotalOpacity(e.getInterpolatedOpacity())},Z.prototype._$nb=function(t,i,e,r,o,n,s){var _=i,a=null!=_._$hr?_._$hr:_._$Cr;Z.transformPoints_sdk2(e,r,o,n,s,a,this._$o,this._$A)},Z.transformPoints_sdk2=function(i,e,r,o,n,s,_,a){for(var h,l,$,u=r*n,p=0,f=0,c=0,g=0,d=0,y=0,m=!1,T=o;T=1){var b=s[2*(0+a*M)],F=s[2*(0+a*M)+1],C=p-2*c+1*d,N=f-2*g+1*y,w=p+3*d,O=f+3*y,D=p-2*c+3*d,R=f-2*g+3*y,B=.5*(S- -2),U=.5*(L-1);B+U<=1?(e[T]=C+(b-C)*B+(D-C)*U,e[T+1]=N+(F-N)*B+(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(l-1+$)+s[h+2*(_+1)+1]*(1-l)+s[h+3]*(1-$))}},Z.prototype.transformPoints_sdk1=function(t,i,e,r,o,n,s){for(var _,a,h,l,$,u,p,f=i,c=this._$o,g=this._$A,d=o*s,y=null!=f._$hr?f._$hr:f._$Cr,m=n;m