From 3bd1ae58e4e9019cc0bab7c9221da73f02d914c7 Mon Sep 17 00:00:00 2001 From: Jad Date: Wed, 12 Aug 2020 10:03:35 +0000 Subject: [PATCH] feat: support mongoDB feat: support dynamic image size docs: add Readme.md --- Readme.md | 77 ++++ assets/style.css | 5 + assets/theme/gelbooru/0.gif | Bin 0 -> 1894 bytes assets/theme/gelbooru/1.gif | Bin 0 -> 1710 bytes assets/theme/gelbooru/2.gif | Bin 0 -> 1821 bytes assets/theme/gelbooru/3.gif | Bin 0 -> 1853 bytes assets/theme/gelbooru/4.gif | Bin 0 -> 1707 bytes assets/theme/gelbooru/5.gif | Bin 0 -> 2263 bytes assets/theme/gelbooru/6.gif | Bin 0 -> 2146 bytes assets/theme/gelbooru/7.gif | Bin 0 -> 2048 bytes assets/theme/gelbooru/8.gif | Bin 0 -> 1914 bytes assets/theme/gelbooru/9.gif | Bin 0 -> 1895 bytes assets/theme/{konachan => moebooru}/0.gif | Bin assets/theme/{konachan => moebooru}/1.gif | Bin assets/theme/{konachan => moebooru}/2.gif | Bin assets/theme/{konachan => moebooru}/3.gif | Bin assets/theme/{konachan => moebooru}/4.gif | Bin assets/theme/{konachan => moebooru}/5.gif | Bin assets/theme/{konachan => moebooru}/6.gif | Bin assets/theme/{konachan => moebooru}/7.gif | Bin assets/theme/{konachan => moebooru}/8.gif | Bin assets/theme/{konachan => moebooru}/9.gif | Bin config.yml | 5 + count.db | Bin 20480 -> 0 bytes db/index.js | 17 + db/mongodb.js | 36 ++ db/schema.js | 8 + utils/db.js => db/sqlite.js | 0 index.js | 39 +- package-lock.json | 521 +++++++++++++++++++++- package.json | 3 + utils/themify.js | 43 +- views/index.pug | 32 +- 33 files changed, 737 insertions(+), 49 deletions(-) create mode 100644 Readme.md create mode 100644 assets/style.css create mode 100644 assets/theme/gelbooru/0.gif create mode 100644 assets/theme/gelbooru/1.gif create mode 100644 assets/theme/gelbooru/2.gif create mode 100644 assets/theme/gelbooru/3.gif create mode 100644 assets/theme/gelbooru/4.gif create mode 100644 assets/theme/gelbooru/5.gif create mode 100644 assets/theme/gelbooru/6.gif create mode 100644 assets/theme/gelbooru/7.gif create mode 100644 assets/theme/gelbooru/8.gif create mode 100644 assets/theme/gelbooru/9.gif rename assets/theme/{konachan => moebooru}/0.gif (100%) rename assets/theme/{konachan => moebooru}/1.gif (100%) rename assets/theme/{konachan => moebooru}/2.gif (100%) rename assets/theme/{konachan => moebooru}/3.gif (100%) rename assets/theme/{konachan => moebooru}/4.gif (100%) rename assets/theme/{konachan => moebooru}/5.gif (100%) rename assets/theme/{konachan => moebooru}/6.gif (100%) rename assets/theme/{konachan => moebooru}/7.gif (100%) rename assets/theme/{konachan => moebooru}/8.gif (100%) rename assets/theme/{konachan => moebooru}/9.gif (100%) create mode 100644 config.yml delete mode 100644 count.db create mode 100644 db/index.js create mode 100644 db/mongodb.js create mode 100644 db/schema.js rename utils/db.js => db/sqlite.js (100%) diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..e641aa8 --- /dev/null +++ b/Readme.md @@ -0,0 +1,77 @@ +# Moe-counter + +多种风格可选的萌萌计数器 + +![Moe-counter](https://count.getloli.com/get/@Moe-counter.github) + +
+More theme + +##### moebooru +![moebooru](https://count.getloli.com/get/@demo?theme=moebooru) + +##### rule34 +![Rule34](https://count.getloli.com/get/@demo?theme=rule34) + +##### gelbooru +![Gelbooru](https://count.getloli.com/get/@demo?theme=gelbooru)
+ +## Demo +[https://count.getloli.com](https://count.getloli.com) + +## Usage + +### Install + +#### Run on Repl.it + +- Open the url [https://repl.it/@journeyad/Moe-counter](https://repl.it/@journeyad/Moe-counter) +- Just hit the **Fork** button +- And hit the **Run** button + +#### Deploying on your own server + +```shell +$ git clone https://github.com/journey-ad/Moe-counter.git +$ cd Moe-counter +$ yarn install + +$ yarn start +``` + +### Confignation + +`config.yml` + +```yaml +app: + port: 3000 + +db: + type: mongodb # sqlite or mongodb +``` + +If you use mongodb, you need to specify the environment variable `DB_URL` + +```shell +# eg: +export DB_URL=mongodb+srv://account:passwd@***.***.***.mongodb.net/db_count +``` + +repl.it can use `.env` file, [documentation](https://docs.repl.it/repls/secret-keys) + +``` +DB_URL="mongodb+srv://account:passwd@***.***.***.mongodb.net/db_count" +``` + +## Credits + +* [repl.it](https://repl.it/) +* [moebooru](https://github.com/moebooru/moebooru) +* rule34.xxx NSFW +* gelbooru.com NSFW +* [Icons8](https://icons8.com/icons/set/star) + +## License + +MIT \ No newline at end of file diff --git a/assets/style.css b/assets/style.css new file mode 100644 index 0000000..7a37b12 --- /dev/null +++ b/assets/style.css @@ -0,0 +1,5 @@ +@media screen and (max-width: 900px) { + iframe { + display: none; + } +} \ No newline at end of file diff --git a/assets/theme/gelbooru/0.gif b/assets/theme/gelbooru/0.gif new file mode 100644 index 0000000000000000000000000000000000000000..6c348e5352a9ac920c220253fbc679721bf5a45f GIT binary patch literal 1894 zcmV-s2buUsNk%w1VMG9y0J{JH{{H^e+UNiP0HLJ1b9|l*N~KAv>Nju0w{2_xV!ZA^8LW000jFEC2ui07L+m000F4@X1N5y*TU5yZ>M)j$~<` zXsV7v>$>au3P5cG!!XC9d)J4cFqkXCc$?O*z#KXc%tBGuLRyr7K#lq9+H%ZkplZct zx88KEC@ltbJo8yiUrz^wL5+-}-L!Q!fL(WZdV768gI$YrUWJB-d?9jr2 zl$Vx*jD%mChln43q?w^Oq;`dzHv%52tD}UN2&H$NrvQ@|wm*lNtO&ZiQ@+2R!jX_! z$z8~byRf|k+S{D8!UB**(tijGUe)BCo7~*N6)w>MivbG_nG3&J<$B@l+RhwWyb&i) z5P}Bw{s6#7Y#)vyzSvReAwZsKLUej)MfYRAurM;7~kM z4?1v=AVGt%Xw#lWy8wYmuQkE0DW{-r-Lqx$I%r_GZrg}Cgvu~9w{BGe4f2+4a6mzn zx^5vtjR8&;0R;hu6iBRiaRDI(0w{P3*916d1egLCLbh`P2djkuh%9sRSJVfV_T}8U zK>@o=e@YHaxwg!5dyTr*i?F$HEt^iNSj_S+62#`2|n@SV&EA72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/2.gif b/assets/theme/gelbooru/2.gif new file mode 100644 index 0000000000000000000000000000000000000000..e6df16c12465cf73fee59fe8835c2e4e181a668d GIT binary patch literal 1821 zcmV+&2jcigNk%w1VMG9y0J{JH{{H?72MBX~p4HmuFET$+O<)lgeWW zUkpm6@Ro|9q`LCW%>V!ZA^8LW000jFEC2ui07L+m000F4@X1N5y*TU5yZ>Ow1!PHz z=w`0v;<`r6rr~$!rP^J)qPl92y9Pd3W*1^tY1q0mOPXo40c$n7KpB}S}-Rlhl+XGDS-3+|lo#S<`Z z8=YkNnt_-V&l|yd_8!ht5b+5pa(N&qnWAoJ9kny$X-O46 zpdwIJz@-AK;)0&Fs`Xb*D-9ahWGX8x)CHXsFsO}kL!@QF}{LDa5v-u z2M*3oWssn1Itg%5b`Y(#@H*9u$A~uM$Lyv~pZL-7oIvFRfTKUP zJ|2r(uF?|UtbxFQj^RZBOwv)ge{`k03^$(tYwmG|oN_e~;fF8!337mcl{o+)CIVh$ zTx{N1ds)G9s+QKi2cck0|NsR=$-)bvDl&* z*g0_CgES8L70Vsl? zVH#voiWpdqI%;PoI%-Z*gkD1S2PI@)Ch(@1W7;w22=_5UAZ1hL8KGc?CaI5RGH}6* zq0HbpC6o#j(^{O68X&-+Iq{OkH3s~J=~*a&xapPKeagmtbqKJ`5}TEJmZwU=8K)Uc z7yv45u#O5$uU4#e1&ON$O02IM?zf=-FHKkx4RQw{3#hVI{3;6?Fa9FV5YvKd?L|r& zrmX}lq?;~c1#E|GLIp-z!-w?NTdy?g=39bWke)k10QLqf@W29tQZBO^60GpT^%`85 zzZ3w>@Wcc=j0MCIQ><~o7VpEx#vp&#F~c4ZST`#e{FWdV#~5|zC6>0vBVTh4R*yz{ESY{LdPAk4iM9w^xYIQ<)Yq+@J;x{ zh64_C!Bwx^IN~D=P6F9W0ZY063YH6QGERqYE==c`gT8~mDnq_A*`Ny&ILxYF&blnF zKOVc#vWNXICV^Lsd*t_;q{!SSt6RXpuA-X*@t8BL88(WDK6>*xGi!?U!gNV}(4Jn8 zeNKyNzrDzw?)N?TA~LXXm+BW>zT<2t>R;0KZ?(MDs-LlJf%a`xzLo3vZT~(X+tl{ z(vhkWq#-@2O{Z8=ld=@0GhJyhJ$log&IX-3Z6Qv{dCH`UjRdu9WEx)zRE@>}pF^Z7 zQQOuj5@z+M_VVczy_&63WMP#q@X-fLKvo<^EID}TMq1UH!>(HJJ30vh6|xjZyVeS? zo{7R<>8jKh+;uTg(JNus3dC#;sy0-p0$g3%v%hMqtA?d42-i@9xl%#1g#`j=>v~0E LJ~b8^hyVaPB7;nJ literal 0 HcmV?d00001 diff --git a/assets/theme/gelbooru/3.gif b/assets/theme/gelbooru/3.gif new file mode 100644 index 0000000000000000000000000000000000000000..3ee1bcd978a3b11f87c60181a29dcf6abab23018 GIT binary patch literal 1853 zcmV-D2g3MANk%w1VMG9y0J{JH{rvm^0RjEaiP(Q|)5g^Q>fPg^gQIL>5jA&#P);{* z!$~DJn39&dvbaWnzW@LLA^8LW000jFEC2ui07L+m000F4@X1N5y*TU5yZ>M)j$~<` zXnF>0>$Ykv1ww7#^~=g+FyO$T?#0Xag290jX(JYAOJ?mS4H||4mG8ieR*?p3?dlZy z23(-{%M1?;Ru|}u#;w_H@9bajFN0EAUx2TE`_2?+ye3;4zSw?r;-7Gr~(QkXv)~bPB#=TG**yGm;~SdBnrGp$(%ABPLkGgNhc*B6U?M(?jfa$wruFJCau`Niw1)Z-34dTO^1L6OnW13+8C55 z6S$F@f<~>YQw(a|x>i_9JtSE+lIChEZDmMWZN1kr$Lk}6ouKd4;zA9;Gi*r zy?+A>hBx*S-4BNYB`#<{EMvz7#5Sc=V6WA<@CvUu_QRjz&yE2k=*qRUgU1Uf53pR; z4&aVL8^>PR^)rIb-#)5dQSSGT-LP+m>RR0K#Y-PAW4?p6^#IuGsN0qvRP5Zc+&LOW zAlv~g@#7K5M%8)w$mU~6T0?-KEqum~JVYP=NZNTo4}SJoWe$AeeFlJlmy}ZADhMW% z(t-?9$KO^FDKX&&KAdxmB>rVcT~WLF<)L8*t-(uMCBjz}K!$v%!4c)G0T+g>#K=>G zHL?gq7&mazi-}#;2P9B78gY#cXH8tMWH znN%p7L&O@wBH!g!YpI9=`+~4@NGa<7vA-(o0<+t#iYc_X0*D-a0S2^#+Nry3^`w1_QSw^6#s_B5Vc$1TdgU z3$P|k?>G!QJOjh|k}EB{iV!2`3zm)MsbIQqH~HPfzwoU&l};5v0$n$c_GA1-FFk(^-y6 zzyi}x&#>RR_o026(tFP`_~A=my`oPr&Qt*iB(Spc?6)udz441ae^bnBUjFnKy+oOT zL7lnZ`Uprp2GFg469@nTm7u@@hHrcigrK4_G^_i8Z*KZ~p9U56Kk5L5eII0?0T0N* z<>>`_AZ*_PRyZsZ-ODl`jG^>$L&G`PP*H_(0bhpru@Op;N;eb-u}soK1N{()N?Zzx zJ{P|uGRR<9Izv%RLd7Eg&;yBzI*#Hx+p2~8=qiB@jMKU z5hP<7HCRXL+)<5soFfmuC?kX6F^_WWq73@jl|ODTkcx}}Bc)+5zHRRfY>cE9GE_;r zSc;39EDI+UCCCVtgcW8q0*3rZO6?G5}2XnB~FSt##I)8V5c(|@4U!>EjFM546vBumRUstT(be7$Y$iMa!Wdn@0{W^ z&^5D}O>Z`UnWAIB_}H0FKQsVnQ*$RgBZ$p*g5sXSyyrQ+sm(z$;7$y~rr#7n&xY>P z2l5;!K^F=ld?J+UnJiF3LYhv;D{peG}de)LZQ{C)S^F)9G rx|OU|L}=Q~SJRVbR+7^To+3haPHet*k#ZPTY-Kw_nv}r=5dZ)?<`!Z} literal 0 HcmV?d00001 diff --git a/assets/theme/gelbooru/4.gif b/assets/theme/gelbooru/4.gif new file mode 100644 index 0000000000000000000000000000000000000000..aabf121752839a4dc6e5f3bd8d024374c69e64bb GIT binary patch literal 1707 zcmV;c22}Y+Nk%w1VMG9y0J{JH|Ns900047*o)I;73`(W*n~&An=%J*#`|IQ1&Car8 zWA41X^5^9M0000000000A^8LW000dDEC2ui07L+m000F4u*pf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-Rg*&Nn^_@|06= z3HPvjU$ykzEAKS<;hXh(iB$h=(6c;fZ)S5>x~UhdLY>eR4>%DjczfLJYtX zdsv4b;&1^;G{Y2wD2XTk!Y7M$*rHTA;l=T!P>MuMmKPO305JN`Hf>CnUjpKn9)K_a zjWWz)@Msu+xDf~gkOvR;7)W`{@sIrB4Pej{07%7=fdNqDUl{4gNB$s^hN7gQ5Clm{ z`bCq5;iOD3naNvi(vmbFr5;TgN>sK$m8;~$DYKJGPfn7Rlex_wVYx_L{slEsd!;Qu z>B~8CM_}|DCM{2K%G;cb3CaZJFOOLY8S?U$vTS7=uP2hH)h1HXH0C3@iKyg&vzXiA z7{Ekx&TQsVlr!-GJ0TU$bk;Ib%cNN|U3n2@=F<%O+@(JWsZDsYZlLabCqJQyPl6Uy zpzR!3B@KGeNG%jtkO564J}=6jiE^|C2$g6?T@Xo6Vh1nR#Lho2B2JaA^o^S&CQ0%6 z()6rHk%(+0J<-`qjqWs|rA%cW@3bGC2KADHw4)XbHOM=bAsB-6rV!t@1Q0|306P~? BAAtY> literal 0 HcmV?d00001 diff --git a/assets/theme/gelbooru/5.gif b/assets/theme/gelbooru/5.gif new file mode 100644 index 0000000000000000000000000000000000000000..46f4940bf4b6364c36931350c9f7569e7c3a60c7 GIT binary patch literal 2263 zcmV;|2q^bQNk%w1VMG9y0J{JH|Ns90005z+x)C*Zb9|oDVMqVGpbSc-Nvi6t((3S@ zg4NpSuL?FdZ^Pn$WdHyGA^8LW000jFEC2ui07L+m000F4@X1N5y*TU5yZ>M)j$~<` z=oGAM>%MT1YOMg=c&_ieJX1BEP$(c634)~W^s)&T$>ecCtuBtps9>>V-k^jb51c(} z&)ifX47iHL#q3!N=$6(w=X)%lCvSEmYkF;aLq&dnbxdmn3ptO5e2I~PA1gLUJCTx* zeNmNnPL70MojPD>fOj~KZabx7oT;EVmK-ZLMx#WrJX>v2wW}flx<@%|J4T#`!NPiJ zA&q6F%8(2UzIjkla=MGt-ipaQ1O?h}eczh58v)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^2I>U5<;UM(Qs5WI>I7^zT3n#bmL>Z#SZ*Lg~Kyc|7%A zmL03T#3bH)Dg__)l?}Dsl}a`by$TSaV^wp;-#!}w@gpr+iu@U1{Axo<4d-+PJJIE@ zMFY{%c}NsKtIf|C1bh-=B7zPU>_565)I;-rQx zSZrbg*to?bVo{7^B;!CP#fTUfG5~=D6rg@cMIf94015EhAr1LHFFf*+fH)Hh9*4y|P$Sa#wqNSj983Sdh^3`BNQXL3>q(QIYa0KxPX{{9LzO&kj*eQk>MQTEYAgQCKQ=N>9XfcUuiywUJ4IMos zPLb+V9%R*!TkSzeTl!R~7E?12eZv|kO4eTX00|6jt6Ouh5QEBfu7HpODDR5bg&c+z zcm*j^w9v}H_LMsvbY^CF>QdbF!G@QBBdIQW(J>vQgK$JZ0|(Jh%>`#5xujR{!Zx+r zC9hRx^Ti}CR=sf~AEBz`-aCr-iESYt0!F0m?Id<6;v%n_tKl zgTUczq9P&8U_9#aj{@A}045C1`p)*j^p&h1lXzYPn;^W^#qfq_liEDWIK)gKErGd< zVq?{+#01W-eiee5?dCVYiWD$)&l+JNTevRTm2Hy$gx$4BH8Vnf?j54+#1qeWx$os- zmT@eIs>Ha#Joc}C5jk2#CbE@r>g<1EyTvtoILc=Qad+|Q-v<9tk9Ni*p0|5o7vnR$ zS=_ONX13E{vy!*9L(cIX6^+I1NVvMOW$hS?X4TOCHo(?P^rMX&U`}_s5o6YJe5mr- zM0*)2rnc%rh!$%gu%ORZ+f=7D1qv&ODMl-JRC{-A+iCgcCNcX&NWII01|S<@QHb=Z lsUqRoK6zIYkv6em0A6i;uD7EW+?QjdC1tW+606PU%6Ndl* literal 0 HcmV?d00001 diff --git a/assets/theme/gelbooru/6.gif b/assets/theme/gelbooru/6.gif new file mode 100644 index 0000000000000000000000000000000000000000..cd316a0a32366a53bf5824e423f9c22381a9d018 GIT binary patch literal 2146 zcmV-o2%YywNk%w1VMG9y0J{JH|Ns90007&5Ue(&@3`(W{`PBRImWB!$suDen{G4F#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?yL=Sg`K zn}Dv%1s|p7Os7**Z{if8?93=iCFawW;_?bMm13#zNz<1i)09`psk4?!xN8&@3pXWd zH3_)seJsMEP z3e2AOh)0=V3e|9ObtP>emP)a@&ewM02C@aJPW^)0qUm+7k}b zLhW(0Yk~1T)Vx?I+PL5~-|*J=sQGo`ejhen^%BWr1QzgsXEt4_{kOXbPQijBEWA^$ z7sCAl&xA8Pub9SHHoICd=zNP{+tO>pBep_`O=qbPSi%#QFIa5M zVGZXPbmYabj)ljs{caRlHjS|yEN0{*gC)r~PQi3&I1jsm#aBG8;4P@93d?!OJ{Ydx zBP&5Ru+Rs=Lk3R*8vx`1LE#}7V{^m?FbNvVpoS=no1EvYWLv${gnMqMh2aAR6Q&p} YyV9Qzof%i*!ZKP5S9r9f=M@0}J2e&Sa{vGU literal 0 HcmV?d00001 diff --git a/assets/theme/gelbooru/7.gif b/assets/theme/gelbooru/7.gif new file mode 100644 index 0000000000000000000000000000000000000000..6019a72f004f5ed7737d82e4cdea810ca331f881 GIT binary patch literal 2048 zcmV+b2>M)j$~<` zXsWJk>%MR-&vb3yc&_h!@BhG{a7dI4j>u%P_!tD92ElVW9T1(=fFTRD1_xWNI3PFz zv16`a?d_q{)F^voJ`JSsti1e52HGW9Yj|*b27nhxafld5iBfxOV_SxdMn__N99T+5 zl!I#tVo{YAn3I|tU~zu~2?mjaqIv?Qmv5P=s)Y%?puJgZrKfpvmXCQ_z018(y#>$( zwPm<)a~^ku#mof<-rv!8$yC=J+2c^K3E%7o(b~ne$B&ZeT2rvFpaKcC|heCj<$B>|`F#xgcso3z>L3tAY3%nA@5!J7UWI*t02{R0^8A%VTp)Yw3iYQ{KyQWW}6g}wk=uZ$< zMPk*8Z>t_rQgwm#CeoOYN%t|pKm!OiVBmrbHu&EPf~+AHfm#@F zU;_>;py7cUc9@}t4lwYb3K4cQA#%(t!@!3gHjrX=bl@Q&TMOZ{%r^-r*rA8(kYyj5odkz$AzVM5fn>warANSXKhI1p``c z>A(S5MwtQ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mTv_FLfP{ujUrwgmq8YvA!V zH^K`}aAp0fJ^o7go95jxhgs?2L}+-#7tXJV8;s%?~RZ%7rmW+W2002Ah{NKR< literal 0 HcmV?d00001 diff --git a/assets/theme/gelbooru/8.gif b/assets/theme/gelbooru/8.gif new file mode 100644 index 0000000000000000000000000000000000000000..9baa78f235304ad0a689c17a0f730b2b8808b9d5 GIT binary patch literal 1914 zcmV-=2Zi`YNk%w1VMG9y0J{JH|Ns920s^6=x^sM<^}LA;N~P7>=n*w{H*dr4k!jOw zYsN2Fn;=I30000000000A^8LW000dDEC2ui07L+m000F4u*pfQy*TU5yZ>M)j$~<` zXsWJk>%MR-&vb3yc&_h!@Bh63a12El*EELGMcRW3})bDLIXK;I9MnZpfcy3>Wg$M;qT9I~&fr4F+l8}&; zm4Ib0MFWj{pPhD+pNnPz0|v0AsFh!|s+OTDuCD;S244oBskH;eq^p-Lt_Ho$0Kb;D zX$1n+#<(s;%+B1M!I7rb0=@%xxlr8cI2UO-Nf7Q1M?y3+2a0y*yN$@JqhpiW_~1R$=NQ7lWDYW4Xv-Md}` z7T_c5>uSINTeb3nbq}N1UR9q}JL*ShT93Z&EpYo$s#UXC?B4CG*KLB2*5J-1vFxr- zm(9ZNjl5vNVZ~D!E+#T|>sqK{jR6Ro;IiCeRF~5AgIaA@zRo0jDM9!CEe@0C6!`DglcT%2Baysr`3{w}b#Nw=opY6)xrJ=&@hN zUYway?kl~6Cu!}KUwGq4ClHpNKi`a#hYFmBGBOg{fUSGfXU5u#Trh*C0LG>wb%=Y z*hNBOjfW6X6Lc-H2o3=K5wPKqM%~C5LChrSl>+;9(WC-QFz}CeClTaahG1cNfIdw2 z$0Yy^fVqJ{KkZf?Mh_-%Kod=lNR^vmIz!%^v0+(SlhfI;r!r#7Nm!uj0oh*y$~iQU zHQV&F&4YwO2q~W!z`4+PaXy9RbdILSK%^&l$_=HF#b&^$PQr@bsiwaq0*Ev2#iUOFRmA+1&(aiQ_C%(B?QmsmU6XM7F|8 zIw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ru/0.gif similarity index 100% rename from assets/theme/konachan/0.gif rename to assets/theme/moebooru/0.gif diff --git a/assets/theme/konachan/1.gif b/assets/theme/moebooru/1.gif similarity index 100% rename from assets/theme/konachan/1.gif rename to assets/theme/moebooru/1.gif diff --git a/assets/theme/konachan/2.gif b/assets/theme/moebooru/2.gif similarity index 100% rename from assets/theme/konachan/2.gif rename to assets/theme/moebooru/2.gif diff --git a/assets/theme/konachan/3.gif b/assets/theme/moebooru/3.gif similarity index 100% rename from assets/theme/konachan/3.gif rename to assets/theme/moebooru/3.gif diff --git a/assets/theme/konachan/4.gif b/assets/theme/moebooru/4.gif similarity index 100% rename from assets/theme/konachan/4.gif rename to assets/theme/moebooru/4.gif diff --git a/assets/theme/konachan/5.gif b/assets/theme/moebooru/5.gif similarity index 100% rename from assets/theme/konachan/5.gif rename to assets/theme/moebooru/5.gif diff --git a/assets/theme/konachan/6.gif b/assets/theme/moebooru/6.gif similarity index 100% rename from assets/theme/konachan/6.gif rename to assets/theme/moebooru/6.gif diff --git a/assets/theme/konachan/7.gif b/assets/theme/moebooru/7.gif similarity index 100% rename from assets/theme/konachan/7.gif rename to assets/theme/moebooru/7.gif diff --git a/assets/theme/konachan/8.gif b/assets/theme/moebooru/8.gif similarity index 100% rename from assets/theme/konachan/8.gif rename to assets/theme/moebooru/8.gif diff --git a/assets/theme/konachan/9.gif b/assets/theme/moebooru/9.gif similarity index 100% rename from assets/theme/konachan/9.gif rename to assets/theme/moebooru/9.gif diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..f63ed72 --- /dev/null +++ b/config.yml @@ -0,0 +1,5 @@ +app: + port: 3000 + +db: + type: mongodb # sqlite or mongodb \ No newline at end of file diff --git a/count.db b/count.db deleted file mode 100644 index d4dc6affc070f04424e62cf31c4e84486b72ff6f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20480 zcmeHPdvp}nd7s%?iM=!T!S2lN0zzWJp-4DFXn8nV@Pmg;zyf1gvSUbMkEGG=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H#_%8zS6UqYrd1z{0Sm1wmvT}px3SGhE>5zLuRWP{}>}-d~mlp}JC8E_ui2$niudD$e{Oc|sn*N`(7@IDqfVdD?_D zfW8R*d8IOd4nUuPE`S~s4CXZgAPb;C&A>&gSjWoT$#93Z{w zQ}S|vZAjsQGohv6+k7TRYf2TrY)9vb+aLrmL{4!<{mLBqDiMIkr-Ts*3qb8ZvdwB{wI>R;UoY6 diff --git a/db/index.js b/db/index.js new file mode 100644 index 0000000..d6d9f48 --- /dev/null +++ b/db/index.js @@ -0,0 +1,17 @@ +'use strict' + +const config = require('config-yml') + +let db + +switch(config.db.type){ + case 'mongo': + db = require('./mongo') + break; + case 'sqlite': + default: + db = require('./sqlite') + break; +} + +module.exports = db \ No newline at end of file diff --git a/db/mongodb.js b/db/mongodb.js new file mode 100644 index 0000000..fa7e96d --- /dev/null +++ b/db/mongodb.js @@ -0,0 +1,36 @@ +'use strict' + +const mongoose = require('mongoose') +const schema = require('./schema') + +mongoose.connect(process.env.DB_URL, { + useNewUrlParser: true, + useUnifiedTopology: true, + useFindAndModify: false +}) + +const Count = mongoose.connection.model('Count', schema) + +function getNum(name) { + return Count + .findOne({ name }, '-_id -__v') + .exec() +} + +function getAll() { + return Count + .find({ }, '-_id -__v') + .exec() +} + +function setNum(name, num) { + return Count + .findOneAndUpdate({ name }, { name, num }, { upsert: true }) + .exec() +} + +module.exports = { + getNum, + getAll, + setNum +} \ No newline at end of file diff --git a/db/schema.js b/db/schema.js new file mode 100644 index 0000000..f558723 --- /dev/null +++ b/db/schema.js @@ -0,0 +1,8 @@ +'use strict' + +const mongoose = require('mongoose'); + +module.exports = new mongoose.Schema({ + name: { type: String, required: true }, + num: { type: Number, required: true } +}, { collection: 'tb_count', versionKey: false }); \ No newline at end of file diff --git a/utils/db.js b/db/sqlite.js similarity index 100% rename from utils/db.js rename to db/sqlite.js diff --git a/index.js b/index.js index 7f20e1d..81d7364 100644 --- a/index.js +++ b/index.js @@ -1,34 +1,15 @@ 'use strict' const fs = require('fs') +const config = require('config-yml') const express = require('express') const compression = require('compression') -const db = require('./utils/db') +const db = require('./db') const themify = require('./utils/themify') const PLACES = 7 -function getCountImage({ count, theme='konachan', PLACES=PLACES }) { - // This is not the greatest way for generating an SVG but it'll do for now - const countArray = count.toString().padStart(PLACES, '0').split('') - - const parts = countArray.reduce((acc, next, index) => ` - ${acc} - -`, '') - - return ` - - Kawaii Count - - ${parts} - - -` -} - - const app = express() app.use(express.static('assets')) app.use(compression()) @@ -41,8 +22,8 @@ app.get('/', (req, res) => { // get the image app.get('/get/@:name', async (req, res) => { const name = req.params.name - const theme = req.query.theme || 'konachan' - let length = PLACES, num = 0 + const theme = req.query.theme || 'moebooru' + let length = PLACES, count = 0 // This helps with GitHub's image cache res.set({ @@ -54,19 +35,19 @@ app.get('/get/@:name', async (req, res) => { res.set({ 'cache-control': 'max-age=31536000' }) - num = '0123456789' + count = '0123456789' length = 10 } else { - const counter = await db.getNum(name) - num = counter.num + 1 + const counter = await db.getNum(name) || { name, num: 0 } + count = counter.num + 1 - db.setNum(counter.name, num) + db.setNum(counter.name, count) console.log(counter, `theme: ${theme}`) } // Send the generated SVG as the result - res.send(getCountImage({ count: num, theme, PLACES: length })) + res.send(themify.getCountImage({ count, theme, length })) }) app.get('/heart-beat', (req, res) => { @@ -78,6 +59,6 @@ app.get('/heart-beat', (req, res) => { console.log('heart-beat') }); -const listener = app.listen(process.env.PORT, () => { +const listener = app.listen(config.app.port, () => { console.log('Your app is listening on port ' + listener.address().port) }) diff --git a/package-lock.json b/package-lock.json index 5353ed8..6eb4c7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -74,6 +74,14 @@ "readable-stream": "^2.0.6" } }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -144,6 +152,15 @@ "tweetnacl": "^0.14.3" } }, + "bl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.0.tgz", + "integrity": "sha512-wbgvOpqopSr7uq6fJrLH8EsvYMJf9gzfo2jCsL2eTy75qXPukA4pCgHamOQkZtY5vmfVtjB+P3LNlMHW5CEZXA==", + "requires": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, "block-stream": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", @@ -153,6 +170,11 @@ "inherits": "~2.0.0" } }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" + }, "body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", @@ -179,11 +201,21 @@ "concat-map": "0.0.1" } }, + "bson": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.5.tgz", + "integrity": "sha512-kDuEzldR21lHciPQAIulLs1LZlCXdLziXI6Mb/TDkwXhb//UORJNPXgcRs2CuO4H0DcMkpfT3/ySsP3unoZjBg==" + }, "bytes": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -203,6 +235,16 @@ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -251,6 +293,18 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, + "config-yml": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/config-yml/-/config-yml-0.10.3.tgz", + "integrity": "sha512-OsFOdaVpC7o0lNLOT9HGicTEB/txYESVqsCpeXdU86i1OrcMR4QJ0qwkmVujOe54kYA0bkKFucF9WvjCFVOvqQ==", + "requires": { + "js-yaml": "^3.6.1", + "lodash": "^4.13.1", + "moment": "^2.13.0", + "shelljs": "^0.7.0", + "yargs": "^4.7.1" + } + }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -310,6 +364,11 @@ "ms": "2.0.0" } }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -326,6 +385,11 @@ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" }, + "denque": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/denque/-/denque-1.4.1.tgz", + "integrity": "sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ==" + }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -366,11 +430,24 @@ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "^0.2.1" + } + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -451,6 +528,15 @@ "unpipe": "~1.0.0" } }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -518,6 +604,11 @@ "wide-align": "^1.1.0" } }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -543,8 +634,7 @@ "graceful-fs": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "optional": true + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" }, "har-schema": { "version": "2.0.0", @@ -572,6 +662,11 @@ "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" + }, "http-errors": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", @@ -611,6 +706,14 @@ "minimatch": "^3.0.4" } }, + "image-size": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.8.3.tgz", + "integrity": "sha512-SMtq1AJ+aqHB45c3FsB4ERK0UCiA2d3H1uq8s+8T0Pf8A3W4teyBQyaFaktH6xvZqh+npwlKU7i4fJo0r7TYTg==", + "requires": { + "queue": "6.0.1" + } + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -630,11 +733,26 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, "ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, "is-expression": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-4.0.0.tgz", @@ -671,6 +789,11 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "optional": true }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -693,6 +816,15 @@ "resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz", "integrity": "sha1-Fzb939lyTyijaCrcYjCufk6Weds=" }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -738,16 +870,52 @@ "promise": "^7.0.1" } }, + "kareem": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.1.tgz", + "integrity": "sha512-l3hLhffs9zqoDe8zjmb/mAN4B8VT3L56EUvKNqLFVs9YlFA+zx7ke1DO8STAdDyYNkeSo1nKmjuvQeI12So8Xw==" + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "^1.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, "lodash": { "version": "4.17.19", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, + "memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", + "optional": true + }, "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -814,6 +982,86 @@ "minimist": "^1.2.5" } }, + "moment": { + "version": "2.27.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.27.0.tgz", + "integrity": "sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ==" + }, + "mongodb": { + "version": "3.5.10", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.5.10.tgz", + "integrity": "sha512-p/C48UvTU/dr/PQEDKfb9DsCVDJWXGmdJNFC+u5FPmTQVtog69X6D8vrWHz+sJx1zJnd96sjdh9ueo7bx2ILTw==", + "requires": { + "bl": "^2.2.0", + "bson": "^1.1.4", + "denque": "^1.4.1", + "require_optional": "^1.0.1", + "safe-buffer": "^5.1.2", + "saslprep": "^1.0.0" + } + }, + "mongoose": { + "version": "5.9.28", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.9.28.tgz", + "integrity": "sha512-A8lNRk4eCQDzk+DagSMYdH94LAYrbTK83LgrUlzqdig3YXvizW3DApJqOWQ5DdhuimvsfiD0Z5NTVzXl/rgi2w==", + "requires": { + "bson": "^1.1.4", + "kareem": "2.3.1", + "mongodb": "3.5.10", + "mongoose-legacy-pluralize": "1.0.2", + "mpath": "0.7.0", + "mquery": "3.2.2", + "ms": "2.1.2", + "regexp-clone": "1.0.0", + "safe-buffer": "5.2.1", + "sift": "7.0.1", + "sliced": "1.0.1" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + } + } + }, + "mongoose-legacy-pluralize": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz", + "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" + }, + "mpath": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.7.0.tgz", + "integrity": "sha512-Aiq04hILxhz1L+f7sjGyn7IxYzWm1zLNNXcfhDtx04kZ2Gk7uvFdgZ8ts1cWa/6d0TQmag2yR8zSGZUmp0tFNg==" + }, + "mquery": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.2.tgz", + "integrity": "sha512-XB52992COp0KP230I3qloVUbkLUxJIu328HBP2t2EsxSFtf4W1HPSOBWOXf1bqxK4Xbb66lfMJ+Bpfd9/yZE1Q==", + "requires": { + "bluebird": "3.5.1", + "debug": "3.1.0", + "regexp-clone": "^1.0.0", + "safe-buffer": "5.1.2", + "sliced": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + } + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -925,6 +1173,17 @@ "abbrev": "1" } }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "npm-bundled": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", @@ -1001,6 +1260,14 @@ "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "requires": { + "lcid": "^1.0.0" + } + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -1015,11 +1282,27 @@ "os-tmpdir": "^1.0.0" } }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "^1.2.0" + } + }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "requires": { + "pinkie-promise": "^2.0.0" + } + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -1035,12 +1318,40 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "optional": true }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "^2.0.0" + } + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -1192,6 +1503,14 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" }, + "queue": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.1.tgz", + "integrity": "sha512-AJBQabRCCNr9ANq8v77RJEv73DPbn55cdTb+Giq4X0AVnNVZvMHlYp7XlQiN+1npCZj1DuSmaA2hYVUUDgxFDg==", + "requires": { + "inherits": "~2.0.3" + } + }, "range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -1219,6 +1538,25 @@ "strip-json-comments": "~2.0.1" } }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -1233,6 +1571,19 @@ "util-deprecate": "~1.0.1" } }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "requires": { + "resolve": "^1.1.6" + } + }, + "regexp-clone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz", + "integrity": "sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==" + }, "request": { "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", @@ -1269,6 +1620,25 @@ } } }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, + "require_optional": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", + "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", + "requires": { + "resolve-from": "^2.0.0", + "semver": "^5.1.0" + } + }, "resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", @@ -1277,6 +1647,11 @@ "path-parse": "^1.0.6" } }, + "resolve-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" + }, "rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -1295,6 +1670,15 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "saslprep": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", + "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==", + "optional": true, + "requires": { + "sparse-bitfield": "^3.0.3" + } + }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", @@ -1353,11 +1737,73 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" }, + "shelljs": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", + "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "sift": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/sift/-/sift-7.0.1.tgz", + "integrity": "sha512-oqD7PMJ+uO6jV9EQCl0LrRw1OwsiPsiFQR5AR30heR+4Dl7jBBbDLnNvWiak20tzZlSE1H7RB30SX/1j/YYT7g==" + }, "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, + "sliced": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", + "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" + }, + "sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=", + "optional": true, + "requires": { + "memory-pager": "^1.0.2" + } + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, "sqlite3": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.0.tgz", @@ -1416,6 +1862,14 @@ "ansi-regex": "^2.0.0" } }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "^0.2.0" + } + }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -1511,6 +1965,15 @@ "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "optional": true }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -1541,6 +2004,11 @@ "isexe": "^2.0.0" } }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + }, "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", @@ -1549,6 +2017,11 @@ "string-width": "^1.0.2 || 2" } }, + "window-size": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=" + }, "with": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/with/-/with-7.0.2.tgz", @@ -1560,15 +2033,59 @@ "babel-walk": "3.0.0-canary-5" } }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + }, "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + }, + "yargs": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", + "requires": { + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "lodash.assign": "^4.0.3", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.1", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^2.4.1" + } + }, + "yargs-parser": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "requires": { + "camelcase": "^3.0.0", + "lodash.assign": "^4.0.6" + } } } } diff --git a/package.json b/package.json index c50fe41..baf9850 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,11 @@ "license": "MIT", "dependencies": { "compression": "^1.7.4", + "config-yml": "^0.10.3", "express": "^4.17.1", + "image-size": "^0.8.3", "mime-types": "^2.1.27", + "mongoose": "^5.9.28", "pug": "^3.0.0", "sqlite3": "^5.0.0" } diff --git a/utils/themify.js b/utils/themify.js index c440cd8..2db9886 100644 --- a/utils/themify.js +++ b/utils/themify.js @@ -3,6 +3,7 @@ const fs = require('fs') const path = require('path') const mimeType = require('mime-types') +const sizeOf = require('image-size') const themePath = path.resolve(__dirname, '../assets/theme') @@ -12,8 +13,15 @@ fs.readdirSync(themePath).forEach(theme => { if(!(theme in themeList)) themeList[theme] = {} const imgList = fs.readdirSync(path.resolve(themePath, theme)) imgList.forEach(img => { + const imgPath = path.resolve(themePath, theme, img) const name = path.parse(img).name - themeList[theme][name] = convertToDatauri(path.resolve(themePath, theme, img)) + const { width, height } = sizeOf(imgPath) + + themeList[theme][name] = { + width, + height, + data: convertToDatauri(imgPath) + } }) }) @@ -24,11 +32,36 @@ function convertToDatauri(path){ return `data:${mime};base64,${base64}` } -function wrap(num, theme='konachan'){ - if(!(theme in themeList)) theme = 'konachan' - return themeList[theme][num] +function getCountImage({ count, theme='moebooru', length=7 }) { + if(!(theme in themeList)) theme = 'moebooru' + + // This is not the greatest way for generating an SVG but it'll do for now + const countArray = count.toString().padStart(length, '0').split('') + + let x = 0, y = 0 + const parts = countArray.reduce((acc, next, index) => { + const { width, height, data } = themeList[theme][next] + + const image = `${acc} + ` + + x += width + + if(height > y) y = height + + return image + }, '') + + return ` + + Moe Count + + ${parts} + + +` } module.exports = { - wrap + getCountImage } \ No newline at end of file diff --git a/views/index.pug b/views/index.pug index 1908114..e2fa8d3 100644 --- a/views/index.pug +++ b/views/index.pug @@ -1,9 +1,10 @@ html head - title='Kawaii Counter!' + title='Moe Counter!' meta(name='viewport', content='width=device-width, initial-scale=1') link(rel='icon', type='image/png', href='favicon.png') link(rel='stylesheet', href='https://cdn.jsdelivr.net/gh/kognise/water.css@latest/dist/light.min.css') + link(rel='stylesheet', href='style.css') body h3 How to use: @@ -18,7 +19,7 @@ html code ![:name](https://count.getloli.com/get/@:name) h3 eg: - Kawaii Count! + Moe Count! i Data can access by anyone, please | DO NOT @@ -27,22 +28,26 @@ html details summary(style='display: inline-block;') h3(style='display: inline-block; cursor: pointer;') More theme - p(style='margin: 0;') Just use the query parameters theme, like this: https://count.getloli.com/get/@:name?theme=konachan - h5 konachan - img(src='https://count.getloli.com/get/@demo?theme=konachan', alt='Konachan') + p(style='margin: 0;') Just use the query parameters theme, like this: https://count.getloli.com/get/@:name?theme=moebooru + h5 moebooru + img(src='https://count.getloli.com/get/@demo?theme=moebooru', alt='moebooru') h5 rule34 img(src='https://count.getloli.com/get/@demo?theme=rule34', alt='Rule34') + h5 gelbooru + img(src='https://count.getloli.com/get/@demo?theme=gelbooru', alt='Gelbooru') h3 Credits ul li a(href='https://repl.it/', target='_blank', rel='nofollow') repl.it li - a(href='javascript:alert("!!! NSFW LINK !!!\\nPlease enter the url manually")') konachan.com - | NSFW + a(href='https://github.com/moebooru/moebooru', target='_blank', rel='nofollow') moebooru li a(href='javascript:alert("!!! NSFW LINK !!!\\nPlease enter the url manually")') rule34.xxx | NSFW + li + a(href='javascript:alert("!!! NSFW LINK !!!\\nPlease enter the url manually")') gelbooru.com + | NSFW li a(href='https://icons8.com/icons/set/star', target='_blank', rel='nofollow') Icons8 @@ -52,10 +57,11 @@ html input#name(type='text', placeholder=':name', style='display: inline-block; width: 80px; height: 1.4em; line-height: 1.4em; margin: 0 4px; vertical-align: middle;') code ?theme= select#theme(style='display: inline-block; height: 1.6em; line-height: 1.6em; font-size: 14px; margin: 0 4px; padding: 0 4px; vertical-align: middle;') - option(value='konachan') konachan + option(value='moebooru') moebooru option(value='rule34') rule34 - button#get(style='margin: 10px 0') Get - img#result(style='display: block; width: 315px; height: 100px') + option(value='gelbooru') gelbooru + button#get(style='margin: 10px 0;') Get + img#result(style='display: block;') script. var btn = document.getElementById('get'), @@ -65,7 +71,7 @@ html var name = document.getElementById('name'), themeEl = document.getElementById('theme') var text = name.value ? name.value.trim() : '' - var theme = themeEl.value || 'konachan' + var theme = themeEl.value || 'moebooru' if(!text) { alert('Please input counter name.') return @@ -74,7 +80,7 @@ html img.src = 'https://count.getloli.com/get/@' + text + '?theme=' + theme }) - iframe(src="https://chat.getloli.com/room/@kawaii-counter?title=%E5%8F%AF%E7%88%B1%E7%9A%84%E8%AE%A1%E6%95%B0%E5%99%A8%E7%9A%84%E7%95%99%E8%A8%80%E6%9D%BF", scrolling="no", frameborder="0", height="70%", width="26%", style="position: fixed;top: 2%;right: 5%;") + iframe(src="https://chat.getloli.com/room/@Moe-counter?title=%E5%8F%AF%E7%88%B1%E7%9A%84%E8%AE%A1%E6%95%B0%E5%99%A8%E7%9A%84%E7%95%99%E8%A8%80%E6%9D%BF", scrolling="no", frameborder="0", height="70%", width="26%", style="position: fixed;top: 2%;right: 5%;") p.copy - a(href='https://repl.it/@journeyad/kawaii-counter') source code \ No newline at end of file + a(href='https://repl.it/@journeyad/Moe-counter') source code \ No newline at end of file