From 9b8efab96b1778482e0868f3f5d9d4e7459d6a42 Mon Sep 17 00:00:00 2001 From: MerryHao Date: Sun, 19 Mar 2023 23:13:31 +0800 Subject: [PATCH 001/107] feat: add tweets page --- app.js | 9 ++++- controllers/tweet-controller.js | 6 +++ public/stylesheets/style.css | 64 ++++++++++++++++++++++++++++++ routes/index.js | 5 +++ views/layouts/main.hbs | 23 +++++++++++ views/partials/leftbar.hbs | 42 ++++++++++++++++++++ views/partials/rightbar.hbs | 41 ++++++++++++++++++++ views/tweets.hbs | 69 +++++++++++++++++++++++++++++++++ 8 files changed, 257 insertions(+), 2 deletions(-) create mode 100644 controllers/tweet-controller.js create mode 100644 public/stylesheets/style.css create mode 100644 routes/index.js create mode 100644 views/layouts/main.hbs create mode 100644 views/partials/leftbar.hbs create mode 100644 views/partials/rightbar.hbs create mode 100644 views/tweets.hbs diff --git a/app.js b/app.js index 80ee0bbf8..c1f9f6a7b 100644 --- a/app.js +++ b/app.js @@ -1,12 +1,17 @@ const express = require('express') const helpers = require('./_helpers'); - +const handlebars = require('express-handlebars') +const routes = require('./routes') const app = express() const port = 3000 // use helpers.getUser(req) to replace req.user // use helpers.ensureAuthenticated(req) to replace req.isAuthenticated() - +app.engine('hbs', handlebars({ extname: '.hbs', helpers })) +app.set('view engine', 'hbs') +app.use(express.static('public')) +app.use(express.urlencoded({ extended: true })) +app.use(routes) app.get('/', (req, res) => res.send('Hello World!')) app.listen(port, () => console.log(`Example app listening on port ${port}!`)) diff --git a/controllers/tweet-controller.js b/controllers/tweet-controller.js new file mode 100644 index 000000000..feed469d7 --- /dev/null +++ b/controllers/tweet-controller.js @@ -0,0 +1,6 @@ +const tweetController = { + getTweets: (req, res, next) => { + res.render('tweets') + } +} +module.exports = tweetController \ No newline at end of file diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css new file mode 100644 index 000000000..70ba8e25f --- /dev/null +++ b/public/stylesheets/style.css @@ -0,0 +1,64 @@ +a { + text-decoration: none; + color: black; +} +a:hover { + color: gray; +} +.avatar-img { + border-radius: 50% +} + +.left-bar-tweetbtn ,.follow-btn{ + width: 125px; + height: 40px; + padding: 8px 16px; + background: #FF6600; + border: 0px; + border-radius: 50px; + + font-size: 16px; + font-size: 400; + color: #fff; + text-decoration: none; + + align-items: center; + + right: 10%; + bottom: 10%; +} + +.tweetbtn { + width: 70px; + height: 40px; + padding: 8px 16px; + background: #FF6600; + border: 0px; + border-radius: 50px; + + font-size: 16px; + font-size: 400; + color: #fff; + text-decoration: none; + + align-items: center; + + right: 10%; + bottom: 10%; +} + +.modal-input-tweets { + width: 70%; + height: 80px; + /* border: transparent; */ + border-style: none; + outline: none; +} + +.fl { + float: left; +} + +.position-absolute { + position: absolute; +} \ No newline at end of file diff --git a/routes/index.js b/routes/index.js new file mode 100644 index 000000000..ddc14caf4 --- /dev/null +++ b/routes/index.js @@ -0,0 +1,5 @@ +const express = require('express') +const router = express.Router() +const tweetController = require('../controllers/tweet-controller') +router.get('/tweets', tweetController.getTweets) +module.exports = router \ No newline at end of file diff --git a/views/layouts/main.hbs b/views/layouts/main.hbs new file mode 100644 index 000000000..c71eee4d6 --- /dev/null +++ b/views/layouts/main.hbs @@ -0,0 +1,23 @@ + + + + + + + + Twitter + + + + + {{{body}}} + + + + + \ No newline at end of file diff --git a/views/partials/leftbar.hbs b/views/partials/leftbar.hbs new file mode 100644 index 000000000..6e6d668e1 --- /dev/null +++ b/views/partials/leftbar.hbs @@ -0,0 +1,42 @@ +
+
+
+
+ AC icon + + + + + +
+ +
+ +
+ + +
+
+
diff --git a/views/partials/rightbar.hbs b/views/partials/rightbar.hbs new file mode 100644 index 000000000..b61ce4fdc --- /dev/null +++ b/views/partials/rightbar.hbs @@ -0,0 +1,41 @@ +
+
+

推薦跟隨

+
+ {{!-- {{#each users}} --}} +
+ + +
+
Apple
+
@apple
+
+ +
+

+ {{!-- {{#if this.isFollowed }} --}} + {{!-- +

+ +
--}} + {{!-- {{else}} --}} +
+ +
+ {{!-- {{/if}} --}} +

+
+
+ {{!-- {{/each}} --}} +
+ +
diff --git a/views/tweets.hbs b/views/tweets.hbs new file mode 100644 index 000000000..7f77b8464 --- /dev/null +++ b/views/tweets.hbs @@ -0,0 +1,69 @@ +
+
+ {{> leftbar}} +
+
+

首頁

+
+ +
+ +
+ {{!-- {{#if this.image}} --}} + {{!-- --}} + {{!-- {{else}} --}} + + {{!-- {{/if}} --}} +
+
+ +
+ +
+
+
+ +
+
+
+ {{!-- {{#each tweets}} --}} +
+ + {{!-- {{#if this.image}} --}} + {{!-- --}} + {{!-- {{else}} --}} + + {{!-- {{/if}} --}} + Apple + + @apple‧3小時 +

merjc idblid ngijsnli gririr leirhielr gli g grgiur hghbgn ign

+
+
+ + {{this.replyCount}} +
+ {{!-- {{#if isLiked}} --}} + {{!--
+ +
--}} + {{!-- {{else}} --}} +
+ + {{this.likeCount}} +
+ {{!-- {{/if}} --}} +
+
+
+ {{!-- {{/each}} --}} +
+
+
+ {{> rightbar}} +
+ +
+ From 0e0b5d99848d537290ba8d27b02efa17331ba48c Mon Sep 17 00:00:00 2001 From: MerryHao Date: Mon, 20 Mar 2023 19:22:44 +0800 Subject: [PATCH 002/107] feat: adjust tweets width --- views/tweets.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/tweets.hbs b/views/tweets.hbs index 7f77b8464..38c2dd0f2 100644 --- a/views/tweets.hbs +++ b/views/tweets.hbs @@ -1,7 +1,7 @@
{{> leftbar}} -
+

首頁

From 5ba42f1fd72664de57c51983e8fec6140474f56b Mon Sep 17 00:00:00 2001 From: MerryHao Date: Mon, 20 Mar 2023 22:46:17 +0800 Subject: [PATCH 003/107] feat: add icons --- public/images/AC-icon@2x.png | Bin 0 -> 2243 bytes public/images/addphoto-outlined@2x.png | Bin 0 -> 1181 bytes public/images/back@2x.png | Bin 0 -> 254 bytes public/images/bell-filled@2x.png | Bin 0 -> 610 bytes public/images/bell-outlined@2x.png | Bin 0 -> 717 bytes public/images/chat-filled@2x.png | Bin 0 -> 598 bytes public/images/chat-outlined@2x.png | Bin 0 -> 777 bytes public/images/close-outlined@2x.png | Bin 0 -> 446 bytes public/images/home-filled@2x.png | Bin 0 -> 929 bytes public/images/home-outlined@2x.png | Bin 0 -> 1308 bytes public/images/like-filled@2x.png | Bin 0 -> 614 bytes public/images/like-outlined@2x.png | Bin 0 -> 1639 bytes public/images/logout@2x.png | Bin 0 -> 592 bytes public/images/message-filled@2x.png | Bin 0 -> 431 bytes public/images/message-outlined@2x.png | Bin 0 -> 436 bytes public/images/post-filled@2x.png | Bin 0 -> 640 bytes public/images/reply-outlined@2x.png | Bin 0 -> 1488 bytes public/images/setting-filled@2x.png | Bin 0 -> 1094 bytes public/images/setting-outlined@2x.png | Bin 0 -> 884 bytes public/images/user-filled@2x.png | Bin 0 -> 466 bytes public/images/user-outlined@2x.png | Bin 0 -> 1052 bytes public/stylesheets/style.css | 4 + views/layouts/main.hbs | 8 +- views/partials/leftbar.hbs | 22 ++-- views/tweets.hbs | 150 +++++++++++++++---------- 25 files changed, 110 insertions(+), 74 deletions(-) create mode 100644 public/images/AC-icon@2x.png create mode 100644 public/images/addphoto-outlined@2x.png create mode 100644 public/images/back@2x.png create mode 100644 public/images/bell-filled@2x.png create mode 100644 public/images/bell-outlined@2x.png create mode 100644 public/images/chat-filled@2x.png create mode 100644 public/images/chat-outlined@2x.png create mode 100644 public/images/close-outlined@2x.png create mode 100644 public/images/home-filled@2x.png create mode 100644 public/images/home-outlined@2x.png create mode 100644 public/images/like-filled@2x.png create mode 100644 public/images/like-outlined@2x.png create mode 100644 public/images/logout@2x.png create mode 100644 public/images/message-filled@2x.png create mode 100644 public/images/message-outlined@2x.png create mode 100644 public/images/post-filled@2x.png create mode 100644 public/images/reply-outlined@2x.png create mode 100644 public/images/setting-filled@2x.png create mode 100644 public/images/setting-outlined@2x.png create mode 100644 public/images/user-filled@2x.png create mode 100644 public/images/user-outlined@2x.png diff --git a/public/images/AC-icon@2x.png b/public/images/AC-icon@2x.png new file mode 100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j7vJ1^cw*m8@O&0KgwH8yAOBZjLRFy#b zJadT6!WzB_2;gcnDF|Tvz=Og`j6s4VxGyCf!hSzzIK<_J^@QpKm~h792)aZ_ar}n!NR^3~;0+27%F$8AxN(&o+bksTr54Jox zf&fshM2V$vwv@m<(FA-1aocVE5wkow7aC6#zJyN1oX@4;F8t_B`fPnB)*3mf8Y?4# z8oq#ZB7Fdd&;$%|<;s=!lYTIikEME-$Y zg|PEg1dbXzY0U|oz;0rOQgPf0dB9X-4cF$$5_k(4H=EnSMcHnufQBGy<~(5<9Zxkz zV`ik)5@?tg&Mz4>gJALqU#YsrE4urrv0A!Oq03!m35ab_v?w~5JSvRa8cmPY0_UT~ zg}iAPfwAY#++f5YuUHu87Tvd{$4qyBVdYgAfq|)@71*T`&qC)`*9kjVeUsOGL>)xtDl-qZAA6)<2+ks2ZHhXP4-^yS_kJY_|=A88a_r+fO3+y z3pTC!=!_OXa$EIG$odm42s$iV*%XaH8f>|G+_YJ&Puv;UwZqYN6ms(&N3w>}WQ4i4 zviW)2TDhZ;3w8Ts*?DJQ>}NvNxw#H1enNK-r;N)$|FVGXiw!lrK(W1m9YLg>LfET5 zw_*Eo*AqI?Ur_90SXwa}*iK5kOUF8D=Rmgy!C|ZcIcRtvt|*dNPoT9z`5LzY4mxg{ zNVi?y3!LZr(Ch|gL2SWSwC9kKyXZcx$g zk}2#4?6xP5;5>GBLn8#{=v*Rgg>T#hamyiEfD6<5U~9BZ8yn-y-~X-PtKe40n@3sJ zS_Lmp002ovPDHLkV1h&fD^36a literal 0 HcmV?d00001 diff --git a/public/images/addphoto-outlined@2x.png b/public/images/addphoto-outlined@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..fad0ac2968eca92ccf67084c55714a79db1d4612 GIT binary patch literal 1181 zcmV;O1Y-M%P)I z87d_e6jy4Slr}!TFNs^nc7F8EQY$qd$@2MpcHVpU?!D&=(TEWj8$mIW%iSxuuKQ33 zS-`7JB58JRIXEhOB$Mgo&CMSbiiubhV8NwqE}~f&@{x)Vv{bFGl}QsV1x(Y-?(e7G zK$s#aASIQ@#ts*3+jdA1Wd&e$Q%d)%&rKK>WEuUIVWcY6>Q9?HCnoaKLb#@37*8Pd z^T4ZYAriCR*wdn<09(FZPp@CPS7qXJ`gs zeJoDTZQLaxQX%(fHk;WiR}O8R@aKnvLZfjx8}&PIpLrbKg10aWv;Hwr3P`Vw!Lep) z6|z|~d+Ac@uXi1k$)IzNuoV@N6Z`h>x0wILf4eP9C`LzwmrMYGAdxZsBBk*C-gtuLP3Zby7sbg+y0I zbzK@7jFnw)67m`;qC5kz_>Poa*F|JmLRdX^p^oKY@jC_Bs?h3n<*nf2$9q;u5sft< zu(u<-e7T)vWvAVmT&sP@z}KBz?2HM4KIMHPWfwX)I4DzWBrH-ySphC{`y{BAt3PCuZUho{8;?tm6tr6nWS-l&Eba zZ?k)A!t`&|j9pG@a|S7Hz&1WP|5&ln00000NkvXXu0mjf1FRoi literal 0 HcmV?d00001 diff --git a/public/images/back@2x.png b/public/images/back@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0b9a4f1bddf9ae1c53f9e4645475cf50d7e713ae GIT binary patch literal 254 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC&H|6fVg?2=RS;(M3{v?36l5$8 za(7}_cTVOdki(Mh=*pdZ-WsgT=JWlY5rf?(=@xy54_g=!xu~^Oh;uO?|(SYe9|3 zDffjSB2s&Q_$)T_(8*3+|F^94`}J;3g*fkqNAdTio=lzZuXW^6hm20&iGxt;SMuSM p)V=yAi`G?*&U#I{8 literal 0 HcmV?d00001 diff --git a/public/images/bell-filled@2x.png b/public/images/bell-filled@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..a2c8149a27afe5804401e9ee5202a1d2b2ad0fd3 GIT binary patch literal 610 zcmV-o0-gPdP)Q$v7c1E2^h^^04GE!>!cP?_98T;74s4*)20}cObnFI4 zCYEVJ_e^nQC=CdXOc*);4S2-qJec^}kO#aq@I*g2?bp`8BmE$FBBuKbS!#p_6p-{} z`he5;JTQmQoc>6Qce-)Q5&BEN)ltX^fn)%#a9|0&7HvAC0YfW3S5bpW({4LtUT2|e z?Va{nd&_XxXuH)xxx?Wi7VOXF0&JU0RY6G7K?MzTL1t607*qoM6N<$g3gHw`2YX_ literal 0 HcmV?d00001 diff --git a/public/images/bell-outlined@2x.png b/public/images/bell-outlined@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..d980cb0f0fb6cf7a7bb8406224bd86f2145e493c GIT binary patch literal 717 zcmV;;0y6!HP)mH+B$oU>|ccI*2nY z^o+lme+Gi^;9^(65(4JUx|YH_9emWa9j*e$ zV{Lsx=z>(V)Ne@ls8)%|>IXd|or-oEmGQqxm!dv23cNb=DjD&aA7p@BDTBBa81{m}2m>?@S3fox4!w|dwBfMr zIzM_@iNP*QzDQ>$G{Ccq+=(_ z!CwA&BRe+7Hb7>wL1ENpfE?%%X-Q&$JOg$}%U#F3&a@eDBFY=2WiQGK0nEt*KM?_q zX%4XlnbegC_#N0D$VGXB^gM`py55bQQ8>(j6sBQ`kzQz!DfAlC!4F)Dx&I=73mj+l z8rVz$E88T23f0zJV#MB_ngV`% zdVv{YF#LBDf3Gof4659zF=ktT=JX)drPvG498notpX%IO00000NkvXXu0mjf1>8BC literal 0 HcmV?d00001 diff --git a/public/images/chat-filled@2x.png b/public/images/chat-filled@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..2441d8f875d61643f12ce2079be43e5a33367805 GIT binary patch literal 598 zcmV-c0;&CpP)yY&7glSlIS0td>ceVfRd;CBjMW?f+RD&vx=jY5K$O*t;l}p` zqA0|euu|zOcg;I8GlAsBcQqvwW5{lPt1*dDwySnKrO79&!DfFbE#Y5$2Dg!R!fHA?lGmiOfH&x^}@Xsv!=J93b;?} z8~W69;gIL>74cjKj8Sa|&KPjgKQx>4_fBtvJ2#~NY5k*o0fdsh0rPRnk&_|=Yr0G5 zoX8ha8@>QS>iW~_K46?P@0O7xhVk2Wz*j;Gy7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1xc2RBR6T-<1&Ik?e6rMS^VB{*uM<=W9smFU literal 0 HcmV?d00001 diff --git a/public/images/home-filled@2x.png b/public/images/home-filled@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..5881918e4f9ec0f00d6a4b39c94424f3a67ebd60 GIT binary patch literal 929 zcmV;S177@zP)3bnTA+bGgCX)a^$%Krb%{PDE=QkMOg;IbC5d=ZW_m|$!&%X+;uYa9`V+2fq zN@cCCl-LDOL9a;)0sCQiaR`oZD!fv8Q&lQP!BEWzan=DR!Wn{xX$Vo+3d3^=mW(AF z1qUej0QiC*p%ff?USZ#+16IN*@osL4G{W290GkdN2`9nr_UuO?6bUYYV=$rjJkLAg zbbu{hO%|JJ5sha(Vsd6RcxfWLNmo(%OdS!FPB;c=V&w=}25Pvfqfyr7`&379oVB z1I9-V>5*OGQ6wWFyc+gn2fez67F0v=-@pz@_nDjPEQVool@9tH@3&Cu;!HxI*JN}6GrZoZv_)s_lbGX+;X*uI*E|S0ilZVwon`>}3Q|G76HCM?J)jCx z7k9tG7VHOGniUec!c8m@p&kE8o_H$e@UeYjQiY~jA)(#6;ZyDp816HvX2x58Ef$M1 zj^hYNZ3A21S=9Pbt97xMc47wfNIW*cfO~R^8Ch1?JqH?0t3;P%Ss|enZfJ>4$+AL1E8L_?bWD`BlOj0DNl2J7d5KA| zgg=EP=2;=Z5{@^SdV=Ei?l|u}OZe^W?IBEeolATn*vJcD38w^25~#s+#M9r})a_x} z?>XD;-{Hc-@)w*!DtZDud~gd5%4hnI?A29M`(E@vPkUo-^dOP)T@2k7+AG zdZ4YE+RIE_+gsP(T{jM=d{Wh|cRZeNXXo3o3oyeBGfV}|=972x^X;Gbv)^j9yD%j% zs2Hu*3s;C>8Ha9W%4f{}Fc|#uph8qeKoNNMksFLzJtX2o1(=us2F}AUSY`~mnW-UT zVvPnuu;uK1LcqFZ*(;M0xiJCGxpQ(-U&0_i;-Ajd*>LUl?V#`b{*eA6k^n&;gI>(~ znUqLr0;<3<3m(9DpZ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1q$ zCtcLN2Zvo6J}WY4B?8*F<)gh z!wXZ*$m>R_BKR=XpWl)d8nvCnd9K-m;Q#;t07*qoM6N<$f-6`J A?EnA( literal 0 HcmV?d00001 diff --git a/public/images/like-outlined@2x.png b/public/images/like-outlined@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..784928115b64aa4c19ae435e043da93c5b4f8142 GIT binary patch literal 1639 zcmV-t2AKJYP)?2G$RUR_B)}MBj4{R-(FKEm z$QO&r%gf26VZ@TA*>3EW*6I)oYX3Gy20hOL8z%`1g^dUIP`&+7-i&oWqVROFNRWx`F1~e>4G7 z_>nZoh@d6y@2qWr3tR~+$Tm3RyPqdoW!WM^rhg5*hy>^C?|LI$qyJxrHr))EW1Pk_ey^$`%5DX>UowNL%tpSbbtj@g2t!|-WP~f7eHjwlb{ki7+)Hbr% zk!)5*RHmEB;lw6e=ujC97y?|NPOQ&F_QCzD8Qn#qQd+AT3}zTGYyBj4;t9#Nl4ad_ zKBYsJKssDCo78bRqSjlF=Q+XtB+j_6Wv&XH@|*b8az-Lt@tooOok^*u%V0pZ@J zA}r9#jXzZw4eBt^JteE)7-8~nLIH>Oa7VxxytO_%xPXfv?o?p#AACY^C48sA;S1~I zCC1P8Dh|T-MFc0mED(q!I51&{B@0OvBP{M*;Lbo89O+^!CCq?ZD<@@>KWgadXc=Ml zudJSwFh(J-tANKn`v8isuTpp1ueE1Tqw z`X zH+~gXy;S@naqFgiei1L&=dO|6UjVT-e-S#ovif3$$az^4me)8RWB>e_P zh}=qP5y_UUW%#^NDXmw*1AN^8$gOOh*iYx(4zYrO7AZQ95=)Ka%J%9kc!aNyEjwWTn?1LmyzwrHc|Gk{$&SB({?_L3V?VNN+W%`u(mk|K0((Yup>{y zCQAsMmsXGlZbEed-3WLDxgOlvRc*zgkR=2%X)6@w4Z2s0C>Z$vB7r+7^O@~cXkhOEkMb=?ka7sYl#7bqD*B~0jDgdsN~S*^v<9(vIY^HR7g%7#g{BNj%4 z`PE;Fva3bC&(^xX@-tit1}fVxl=n1(U}S^|^JuCDnkv`4VMiuRcS&B3XvaqIw3qe@ z+IxTb_4J`JVKjyPw-a<5VEeQCt?chV|MU-x5F;I7D=atYDBatg-;C8UnQ*AO(f7%K lTu?p&d9g9Z7-Njc;{#Wrx&{ky94!C<002ovPDHLkV1h&~1i1hJ literal 0 HcmV?d00001 diff --git a/public/images/logout@2x.png b/public/images/logout@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..f38b23a0b76d6e57a171ae717b0afaa707010f69 GIT binary patch literal 592 zcmV-W0oSNYKzMCZNxe#)K!wD285JD`%aJzvT$ra#vSH6^A zPXN*fJ>n?ZT|kXEc`pr}Ct|1>r2x+x-I_Wt1Uy2`v{Wyog!$nZo!NA|pLanJ)c&iM zLAeJ8gONO%D9(mq_!fX=I7KJg=sZzafUU3z==H`^T&5rRynEhw3YxG9a2#0Rhl>xM zHFB*hf^i8+_h_Ukf=vL1<@>BnM+BRIFx;(C#4KwsD}pr&RUv{sjGBtD;v6s$(SnMg zxb8S|1^dug8Yxxw9}%FcD=Pa34&r*{poo>~U4=_X*5Z7MG6Swmz&@^v0BRtwt|**N zV`+G@el{W9L+h-aHaBf@)%UE3Lb}cq>;g=jCs+lTI!{z~4wR+ezr4X-(>iM}<2=Eb zjh-!k+sZjlSW^$^I8U$%z^2(OJvU-q=Lu`h0bTx2SAx3KU?F(|o(~5}a=xT)HCTpn zU1JWuz%=#&^x?f9a9!W+blNYb9cs4wfjAB@ygAo~DKg*v06`7iDB2Fwdi52`@hA5K e4Gj$qynF* z!Y~ko7ZiX3Dgg;dzyUY_30Ob^4sg&)zyWno9F%mLhf>mTX_8*(+&8ns0D<1_CH(~i zK@d1uSiV~+?Ugd{QYsbtmCQk@QmPZtQ`bad3$PbFq#X$4;4gGYdB0fG8mN&jFQs+& zgQa269qIC*4m=~RMO^8coXC*IddT6qE9dIQsMH%wjx$W#4OM6>fLcp2Bzo+C3PQN2Y z(%ozIaZNqC0b9~tGWZ`uq8bP}*GUFqUeJ_i&)=JikY*aK5QfFz8%-z!vG}NYi9bgS za3cn|5d++a0d8h#pg_8O-5WI-xFKDx)PWcHpZ12<#Z;*68QD(hsI&nuCE8h0KoEra Z@dn@XbvpdBozegR002ovPDHLkV1oE!s-FM= literal 0 HcmV?d00001 diff --git a/public/images/message-outlined@2x.png b/public/images/message-outlined@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..7b3f718734352d2b2813dc7a9f5028a6c68113c7 GIT binary patch literal 436 zcmV;l0ZaagP);W zf-n$9Kb@o_I6_Bp16Sw}^r z&rEZ(bM9OQ?Cdld#r$bHr@mZCa;_w~y_53ByB&>uXbexW6TA%?`O$EKZMqlC24&DY zZBaPBVDJ)O5oPD+~v+-gY# z8H0FDnkChe3IgGpp_y7OxgcW@mor#KQb9u5xuC5@Rq5xRTg|0+s_Q{1RZvP5lu`wy zR6!{u_;B89JBfJq9AsdJjSSP>@s1u+Q6eqw9S|@M>a01)_^RA5-dJRp|6q19_-S>c_ zBrmV;7X_|dxomEbCPHc|^@~K9pf^y8@0edg+n*I2&0{#{1fFTDEus1wMAcNcZ9)Mt1AUN?yF<-Jx{eZf6sQy8Xo?$KuPPpCy!tmabAs}mQ;hDwtHlcGYnQiuP zg8KyD1)Hgn;BS11)BWQ!!bZ3n&f|qZ1PHi$Tp%L)ywCB?VaTO()VlA30NjSK*f4pY zjVDA7Az|a00^RXWNB}~&_k%a1vFP%Cj)dSiZ#Si6$dG8#D%wvNG9&~Kc)IZg5<^ek zWJ;!vp1e5{L*OuR&x+5}X}w83B0*I3NiK02p5voRT-OkqHm~o{9&e|FKm>_91P&oW aMEn7z>ujs`>%XV~00001uy!EP)NsIynF%TloJ(F zFFMT5k?qcg!c#t5#amP zt(@b~6bZ~iA4maMnM}R1XBbro8KDqfHjM1Q7wI`fd`v)7{G)vl?F0c-1&A|3`(!fH zD2Fit0}*B=^A6z>finXULy||patdMNpjfb=PxM7tDtd95UgwWkh8Tc^Mro(80ezrn z!izubOo6bEdCqel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LbZ*aUu@FbCAo2xNRjOaXrxsElrSK|v~Tiw1r9$c$Z31j-n5?Wsb> z7ih}DR7q)1Gey*K0iMRn0+Y(S*zEAeF{J=oV3|inDj3apM?_sHFl*jeS)c{~M(<+^ z(AEd2<1uc60%oVsIyX0$5hc}QZu%p|6bSZhY*2#{4NOdxy9wFFjQ)OBTMObb zy|*+|2dK#Cdhr_;jy;gaOd<2z2F;vIf?qA#UIfKbsgU7%yRGXIg)BPB-Q5c2bG9$3 zj8rQjxyBCQ9pl_qx$Iift;9U2G;$w$lg)Ci_0xZ~xYN zk5jc4Xs0*A)+3Py1gO=vt``WltYD!PQr85jg^Wy|qwoYX-g?Ypxhs)3-u$jasscgr zu^>0FPTH;AH2yla5FA9fcGSExe0{G)k^U zt|6kMuJYBMQjW)ypi2vQn_6PX5HEVr?H>kC;NaiIOB{4BvBWd+4{w^>Iom0TX8-^I M07*qoM6N<$g7J>tkN^Mx literal 0 HcmV?d00001 diff --git a/public/images/setting-outlined@2x.png b/public/images/setting-outlined@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..82f6c3904e35b68af50e13ee5982fb9b29ad044d GIT binary patch literal 884 zcmV-)1B?8LP)04If{aRAhYJ z{$~WeB@%imbTFMfvFpsE#|Ah@JMcBeyHhC(Zxmf29v|OgCM;7}kTHXy``wN%BXs6? z4Lxe4CF2EK(_#h+#HGJOTzvzXSHZt&BYZ?W{wib7m=2Bef<&-L=*~!()N9f>pM9t% zuD1(Kj%nr$Q}hYpkZ~NBNOzeI4NKy$WsU=93*sgoLg;gk3@ ztIdKl)a~LLaV}jTT%07v}I!#GBnyO=Q7g>QxNnaUN;U?&U2fx7%I zVm>t}ruA^xNNZfNi8RI@5C=1nb1!f;P@}Kuz!ly(_zlnkb&ELcCvv_C+*pp*lZ_6s zi&uAuGlgRqXE9-}QRdoqZJrf#1R$l+wZfqXb0-+Kz%Y&0ioOyDrcnoXkSjrflr;>- zg{($j$apH$3R#Ysg^b>aWjCYsC#hNq>Lr&xGbDI6riK}1o*R?eknT)reEM!Fs+l`> zJ8jzQJ>IaLj_qGkVViP2i}8(Lr~&+gZom33{W9pZbx{qHhC!WB34*5yRZrSH|6<_sn<3)%2bW z{1ej({U;_K`^iEhHMBlR3$L@m$v?B6>O=RwkzaTRAG$C2@9+=(Z0tw?)|B!90000< KMNUMnLSTX!oQF67 literal 0 HcmV?d00001 diff --git a/public/images/user-filled@2x.png b/public/images/user-filled@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..c6d03dece67d03f13e683ef7c15554bed60f9840 GIT binary patch literal 466 zcmV;@0WJQCP)K~#7F&6vSa z!!QstKn7(a9*KA9Vx)EP+;vc zjN>503I#aZP?1}NxrYuG0*MWD*hnM{bPz3vfew{KLW`@A2r?(pLx&Cmi4HpS5{VD! z@D2e6^3$?~!d=0+C+MFW zTy}%IK-W(sf(p?lb67r2)lh7honv7Wn$v7_J_#K{x5+*Y;(tV|Anh~e}0SLmf%vIc2c0~h8E$aH$?LJdC zDwXO2l6en~>Ew2MsE*%rar%W$#5oP~*prdO+}T-Q5}`HE70%g?zY*hTq9ZkGz61iG z(+CtoBZ&loHpRJHo{Xest(#J4~gyb%)S<7OtBW_-L_lO*`$iiWNqK7ngJ?PVrn7}I%FY&-hl8$mh4ihASznHJ<`q2htfD@J3YM4+jnOqVHijJ5k-s<|nN63hai|>15W8+QS zo-VoU>QxGbCvbWBZP%7>lXy1EnDik;VheBl0{lgkO4SDHoe%bK8n0VK%H^qJ@A&8> zki-n!0kFlOOs=@1-5dM$2-z`YLk+FA2zP|*>n`=dULKM=ouOs_j-b8BB;Fq`n6?j8 zxFd8rMrU;N(KYV$#(h<@P2)K>j{=>tRbiTA=Z`D+*eD2HKu3f!1JdjC|p57=IVkxwfW9#7)^sKLF!+WZZI W(Vom+pJes`0000 - - {{{body}}} +
+ {{{body}}} +
+
diff --git a/views/partials/leftbar.hbs b/views/partials/leftbar.hbs index 6e6d668e1..dac61ed1f 100644 --- a/views/partials/leftbar.hbs +++ b/views/partials/leftbar.hbs @@ -1,26 +1,26 @@
-
- AC icon -
- +
+
+ AC icon +
+ -
- + -
- +
+ setting 設定 @@ -32,7 +32,7 @@
- + setting 登出 diff --git a/views/tweets.hbs b/views/tweets.hbs index 38c2dd0f2..55fa2f250 100644 --- a/views/tweets.hbs +++ b/views/tweets.hbs @@ -1,69 +1,101 @@ -
-
- {{> leftbar}} -
-
-

首頁

+
+ {{> leftbar}} +
+
+

首頁

+
+ +
+ +
+ {{!-- {{#if this.image}} --}} + {{!-- --}} + {{!-- {{else}} --}} + + {{!-- {{/if}} --}} +
+
+ +
+
+ +
- -
- -
- {{!-- {{#if this.image}} --}} - {{!-- --}} - {{!-- {{else}} --}} - - {{!-- {{/if}} --}} -
-
- -
- + -
-
- {{!-- {{#each tweets}} --}} -
- - {{!-- {{#if this.image}} --}} - {{!-- --}} - {{!-- {{else}} --}} - - {{!-- {{/if}} --}} - Apple - - @apple‧3小時 -

merjc idblid ngijsnli gririr leirhielr gli g grgiur hghbgn ign

-
-
- - {{this.replyCount}} -
- {{!-- {{#if isLiked}} --}} - {{!--
- -
--}} - {{!-- {{else}} --}} -
- - {{this.likeCount}} -
- {{!-- {{/if}} --}} +
+
+
+ {{!-- {{#each tweets}} --}} +
+ + {{!-- {{#if this.image}} --}} + {{!-- --}} + {{!-- {{else}} --}} + + {{!-- {{/if}} --}} + Apple + + @apple‧3小時 +

merjc idblid ngijsnli gririr leirhielr gli g grgiur hghbgn ign

+
+
+ + {{this.replyCount}} +
+ {{!-- {{#if isLiked}} --}} + {{!--
+ +
--}} + {{!-- {{else}} --}} +
+ + {{this.likeCount}} +
+ {{!-- {{/if}} --}} +
+
+
+ {{!-- 回覆彈跳視窗 --}} + + {{!-- {{/each}} --}}
- {{> rightbar}}
- -
- + {{> rightbar}} +
\ No newline at end of file From caa7d5a853f8d98281c9d41da7bd5c7df18a153f Mon Sep 17 00:00:00 2001 From: robert1074004 Date: Tue, 21 Mar 2023 12:42:25 +0800 Subject: [PATCH 004/107] feat: add login page --- controllers/user-controller.js | 7 +++++++ package.json | 4 ++-- public/stylesheets/style.css | 4 ++++ routes/index.js | 2 ++ views/layouts/main.hbs | 3 +++ views/login.hbs | 31 +++++++++++++++++++++++++++++++ 6 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 controllers/user-controller.js create mode 100644 views/login.hbs diff --git a/controllers/user-controller.js b/controllers/user-controller.js new file mode 100644 index 000000000..026b1f636 --- /dev/null +++ b/controllers/user-controller.js @@ -0,0 +1,7 @@ +const userController = { + login_page: (req, res) => { + res.render('login') + } +} + +module.exports = userController \ No newline at end of file diff --git a/package.json b/package.json index e85b8c07c..a595f6148 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "", "main": "index.js", "scripts": { - "start": "NODE_ENV=development node app.js", - "dev": "NODE_ENV=development nodemon app.js", + "start": "set \"NODE_ENV=development\" && node app.js", + "dev": "set \"NODE_ENV=development\" && nodemon app.js", "test": "mocha test --exit --recursive --timeout 5000" }, "author": "", diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index d89a30e7f..c582a42b4 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -1,3 +1,7 @@ +html, body { + font-family: 'Noto Sans TC', sans-serif; + font-weight: 400; +} a { text-decoration: none; color: black; diff --git a/routes/index.js b/routes/index.js index ddc14caf4..7f85875d1 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,5 +1,7 @@ const express = require('express') const router = express.Router() +const userController = require('../controllers/user-controller') const tweetController = require('../controllers/tweet-controller') +router.get('/login', userController.login_page) router.get('/tweets', tweetController.getTweets) module.exports = router \ No newline at end of file diff --git a/views/layouts/main.hbs b/views/layouts/main.hbs index 1ef9d8fc4..237aaf481 100644 --- a/views/layouts/main.hbs +++ b/views/layouts/main.hbs @@ -8,6 +8,9 @@ Twitter + + +
diff --git a/views/login.hbs b/views/login.hbs new file mode 100644 index 000000000..570aa22db --- /dev/null +++ b/views/login.hbs @@ -0,0 +1,31 @@ +
+
+ +
+

+ 登入Alphitter

+
+
+ + + +
+
+ + +
+ +
+
+ 註冊 + + 後台登入 +
+
\ No newline at end of file From 45843435918b4a8643467dfb8d52202831098637 Mon Sep 17 00:00:00 2001 From: MerryHao Date: Tue, 21 Mar 2023 20:15:20 +0800 Subject: [PATCH 005/107] feat: fix reply and like icon style --- views/tweets.hbs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/views/tweets.hbs b/views/tweets.hbs index 55fa2f250..75264e465 100644 --- a/views/tweets.hbs +++ b/views/tweets.hbs @@ -58,8 +58,8 @@

merjc idblid ngijsnli gririr leirhielr gli g grgiur hghbgn ign

- - {{this.replyCount}} + + 78{{this.replyCount}}
{{!-- {{#if isLiked}} --}} {{!--
@@ -67,8 +67,8 @@
--}} {{!-- {{else}} --}}
- - {{this.likeCount}} + + 87{{this.likeCount}}
{{!-- {{/if}} --}}
From 75ceb062a5bf0ae4bd954f8e75e99bfcc1a7edb3 Mon Sep 17 00:00:00 2001 From: MerryHao Date: Wed, 22 Mar 2023 00:44:19 +0800 Subject: [PATCH 006/107] feat: adjust card and modal ui --- public/stylesheets/style.css | 18 +++ views/layouts/main.hbs | 5 +- views/partials/following-avatar.hbs | 7 + views/partials/user-avatar.hbs | 6 + views/tweets.hbs | 190 ++++++++++++++++------------ 5 files changed, 143 insertions(+), 83 deletions(-) create mode 100644 views/partials/following-avatar.hbs create mode 100644 views/partials/user-avatar.hbs diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index d89a30e7f..62bf39978 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -65,4 +65,22 @@ a:hover { .position-absolute { position: absolute; +} + +textarea { + resize: none; +} + +.reply-modal-hr-line { + height: 120px; + border-left: 2px solid gray; + position: relative; + top: 5px; + left: 23px; + margin-bottom: 10px; +} + +.tweet-flow-text { + width: 82%; + margin: 2% 0 0 2%; } \ No newline at end of file diff --git a/views/layouts/main.hbs b/views/layouts/main.hbs index 1ef9d8fc4..0eea64593 100644 --- a/views/layouts/main.hbs +++ b/views/layouts/main.hbs @@ -10,10 +10,7 @@ integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> -
- {{{body}}} -
-
+ {{{body}}} diff --git a/views/partials/following-avatar.hbs b/views/partials/following-avatar.hbs new file mode 100644 index 000000000..16a0bdbe8 --- /dev/null +++ b/views/partials/following-avatar.hbs @@ -0,0 +1,7 @@ +{{!-- {{#if this.image}} --}} + {{!-- --}} + {{!-- {{else}} --}} + + + {{!-- {{/if}} --}} \ No newline at end of file diff --git a/views/partials/user-avatar.hbs b/views/partials/user-avatar.hbs new file mode 100644 index 000000000..bcedb1e9c --- /dev/null +++ b/views/partials/user-avatar.hbs @@ -0,0 +1,6 @@ +{{!-- {{#if this.image}} --}} +{{!-- --}} +{{!-- {{else}} --}} + +{{!-- {{/if}} --}} \ No newline at end of file diff --git a/views/tweets.hbs b/views/tweets.hbs index 75264e465..afa84d811 100644 --- a/views/tweets.hbs +++ b/views/tweets.hbs @@ -1,101 +1,133 @@ -
- {{> leftbar}} -
-
-

首頁

-
+
+
+ {{> leftbar}} +
+
+

首頁

+
-
+
-
- {{!-- {{#if this.image}} --}} - {{!-- --}} - {{!-- {{else}} --}} - - {{!-- {{/if}} --}} -
-
- -
-
- -
-
- -
-
-
- {{!-- {{#each tweets}} --}} -
- - {{!-- {{#if this.image}} --}} - {{!-- --}} - {{!-- {{else}} --}} - - {{!-- {{/if}} --}} - Apple - - @apple‧3小時 -

merjc idblid ngijsnli gririr leirhielr gli g grgiur hghbgn ign

-
-
- - 78{{this.replyCount}} -
- {{!-- {{#if isLiked}} --}} - {{!--
- -
--}} - {{!-- {{else}} --}} -
- - 87{{this.likeCount}} -
- {{!-- {{/if}} --}} +
+ {{> user-avatar}} +
+
+ +
+
+
-
- {{!-- 回覆彈跳視窗 --}} - +
+
+ {{!-- {{#each tweets}} --}} +
+
+
+ {{> following-avatar}} +
+
+
+ Apple + @apple‧3小時 +
+

merjc idblid ngijsnli gririr leirhielr gli g grgiur hghbgn ign merjc idblid + ngijsnli gririr leirhielr gli g grgiur + hghbgn ign merjc idblid ngijsnli gririr leirhielr + gli g grgiur hghbgn ign

+
+
+
+
+ + 78{{this.replyCount}} +
+ {{!-- {{#if isLiked}} --}} + {{!--
+ +
--}} + {{!-- {{else}} --}} +
+ + 87{{this.likeCount}} +
+ {{!-- {{/if}} --}} +
+
+
+ {{!-- 回覆彈跳視窗 --}} + + {{!-- {{/each}} --}}
- {{!-- {{/each}} --}}
+ {{> rightbar}}
- {{> rightbar}}
\ No newline at end of file From d0318643e997b49df50bcafb5e2b829d50e26299 Mon Sep 17 00:00:00 2001 From: robert1074004 Date: Wed, 22 Mar 2023 10:18:44 +0800 Subject: [PATCH 007/107] feat: modify login page and add cross-env --- package-lock.json | 118 +++++++++++++++++++++++++++++++++++++++++ package.json | 5 +- routes/index.js | 2 +- views/layouts/main.hbs | 3 -- views/login.hbs | 60 +++++++++++---------- 5 files changed, 155 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0307072c0..c0abecffb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "body-parser": "^1.18.3", "chai": "^4.2.0", "connect-flash": "^0.1.1", + "cross-env": "^7.0.3", "express": "^4.16.4", "express-handlebars": "^3.0.0", "express-session": "^1.15.6", @@ -450,6 +451,50 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -2136,6 +2181,14 @@ "node": ">=0.10.0" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -2594,6 +2647,25 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -3534,6 +3606,34 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "requires": { + "cross-spawn": "^7.0.1" + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -4815,6 +4915,11 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, "path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -5145,6 +5250,19 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, "side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", diff --git a/package.json b/package.json index a595f6148..194f21433 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "", "main": "index.js", "scripts": { - "start": "set \"NODE_ENV=development\" && node app.js", - "dev": "set \"NODE_ENV=development\" && nodemon app.js", + "start": "cross-env NODE_ENV=development node app.js", + "dev": "cross-env NODE_ENV=development nodemon app.js", "test": "mocha test --exit --recursive --timeout 5000" }, "author": "", @@ -15,6 +15,7 @@ "body-parser": "^1.18.3", "chai": "^4.2.0", "connect-flash": "^0.1.1", + "cross-env": "^7.0.3", "express": "^4.16.4", "express-handlebars": "^3.0.0", "express-session": "^1.15.6", diff --git a/routes/index.js b/routes/index.js index 7f85875d1..9f96ebc5c 100644 --- a/routes/index.js +++ b/routes/index.js @@ -2,6 +2,6 @@ const express = require('express') const router = express.Router() const userController = require('../controllers/user-controller') const tweetController = require('../controllers/tweet-controller') -router.get('/login', userController.login_page) +router.get('/signin', userController.login_page) router.get('/tweets', tweetController.getTweets) module.exports = router \ No newline at end of file diff --git a/views/layouts/main.hbs b/views/layouts/main.hbs index 237aaf481..6c71924c3 100644 --- a/views/layouts/main.hbs +++ b/views/layouts/main.hbs @@ -13,10 +13,7 @@ -
{{{body}}} -
-
diff --git a/views/login.hbs b/views/login.hbs index 570aa22db..e5767e817 100644 --- a/views/login.hbs +++ b/views/login.hbs @@ -1,31 +1,37 @@ -
-
- -
-

- 登入Alphitter

-
-
- - - +
+
+
+
-
- - +

+ 登入Alphitter

+ +
+ + +
+
+ + +
+ + +
+ 註冊 + + 後台登入
- - -
- 註冊 - - 後台登入
\ No newline at end of file From 2d8040d2376081c603d0124e38bda18f1be9eaea Mon Sep 17 00:00:00 2001 From: MerryHao Date: Wed, 22 Mar 2023 19:01:26 +0800 Subject: [PATCH 008/107] feat: add modal alert msg, add user name in reply modal, adjust ui --- public/stylesheets/style.css | 11 +++++++++- views/partials/rightbar.hbs | 4 ++-- views/tweets.hbs | 39 ++++++++++++++++++++++-------------- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index 82c8826cf..a67d95982 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -75,7 +75,7 @@ textarea { resize: none; } -.reply-modal-hr-line { +.reply-modal-vr-line { height: 120px; border-left: 2px solid gray; position: relative; @@ -87,4 +87,13 @@ textarea { .tweet-flow-text { width: 82%; margin: 2% 0 0 2%; +} + +.user-tweet-alertMsg, +.user-reply-alertMsg { + position: relative; + top: 10px; + right: 5px; + font-size: small; + color: red; } \ No newline at end of file diff --git a/views/partials/rightbar.hbs b/views/partials/rightbar.hbs index b61ce4fdc..f58eb89a0 100644 --- a/views/partials/rightbar.hbs +++ b/views/partials/rightbar.hbs @@ -1,6 +1,6 @@
-

推薦跟隨

+

推薦跟隨


{{!-- {{#each users}} --}}
@@ -16,7 +16,7 @@
-
Apple
+ Apple
@apple
diff --git a/views/tweets.hbs b/views/tweets.hbs index afa84d811..567d75616 100644 --- a/views/tweets.hbs +++ b/views/tweets.hbs @@ -3,12 +3,12 @@ {{> leftbar}}
-

首頁

+

首頁

- +
- -
+ +
{{> user-avatar}}
@@ -37,14 +37,16 @@
-
-
+
+
+ {{!--
--}} {{!-- {{#each tweets}} --}}
@@ -53,12 +55,12 @@
- Apple + Apple @apple‧3小時

merjc idblid ngijsnli gririr leirhielr gli g grgiur hghbgn ign merjc idblid ngijsnli gririr leirhielr gli g grgiur - hghbgn ign merjc idblid ngijsnli gririr leirhielr + hghbgn ign merjc idblid ngijsnli gririr leirhielr gli g grgiur hghbgn ign

@@ -96,20 +98,25 @@
{{> following-avatar}} -
+
- {{!-- --}} + {{!-- --}}
-

merjc idblid ngijsnli gririr leirhielr gli g grgiur hghbgn ign merjc idblid ngijsnli gririr leirhielr gli g grgiur + Apple + @apple‧3小時 +

+
+

merjc idblid ngijsnli gririr leirhielr gli g grgiur hghbgn ign merjc idblid ngijsnli gririr + leirhielr gli g grgiur hghbgn ign merjc idblid ngijsnli gririr leirhielr gli g grgiur hghbgn ign

回覆給@mitsubishi
- +
- +
- + {{> user-avatar}}
@@ -88,7 +88,7 @@
{{!-- 回覆彈跳視窗 --}}