Sowetackledesignwaytacklebuildingapplicationsfrombothlikethedesignanddevelopment, SocheckouttheTobydotcomandthatbringsmetowhywe'reheretodayandwhat I do s I said I'm chasing.
I'm partofthe 14 thatdevelops a bunchofopensourcetextforTobyThatincludescanjustAndreastealsgas.
That's eversowe'regonnauseCandy s today.
Thiokindofgiveusthetoolstobuildourapplication.
AndCandaceis a clientsideJavaScriptframework.
Ithasitsrootsgoingback 10 yearsago, and a friendwerecalledJavascriptin D.
C.
Soit's beenaround a longtime, butitmakesitreallyeasyfromtobuildissimplewebwidgetsallthewayuptoscalingtolargerapplications.
Andthisishowwebuildabsent.
ButToby, um, sohasthreemainprinciples.
Andmakesurethatmyscreenthisislarge, asitcouldbe.
Okay, umsobasically, butthecoreconceptofkanji s isyoubuildcomponentsandthecomponentsis a A tag, a customelementtax.
SowhenyouputthattaganywhereineachtoMelthatthattankgetsupgradedinto a customelementorinto a component, it's renderedwith a view, soyou'llseebetweenthetickmarks.
Thisiswhatwecall I canstashyouwho's seen, likehandlebarsormustachebefore?
Yeah, OK, soit's a veryit's a similarsyntaxwherewhereveryouhavedoubledoublecurlybraceslikethis, thatmeansthatthatvalueisgonnabereplacedwithsomethingdynamic.
Sowe'vegotthedoublecurliesandcounts.
Um, andCanStashalsohas a bindingsyntaxforlisteningtoevents.
Thisishowwescaleuptoyouentirewebapplicationsthatarebuiltfromtheseprinciplesthatyouhavecustomelementsthatarecomponentsthathave a viewthatarerenderedwith a viewmodelforallofthepropertiesinactions.
That's it.
Anyanyquestions, commentsbeforewemoveon?
Yeah.
Youknow, I woulddobestinthis.
I loveyou.
Yeah.
So, um, viewandreactandangularandkanji s andnumberlikethat, there's Yeah, there's soandsowhenTobystarted 10 yearsago, therewasnovieworangularoremperororreact.
It's dotcomandonthelefthandside, uh, that's candy S e a N J s stuckon, um, Andthenonthelefthandside, you'llsee a, uh, a guideslinkandthenundertherecipessection, uh, there's a tindercarousel.
Yeah, thatthatmaybeifyou'reablethio a newerversionthat's likefrom, orFirefoxandgofromthere.
Um, areyoujustdidn't call?
Itsoundsgood.
Umokay, sobasically, howtonightitisgonnaworkiswe'regonnagothroughallofthesestepsofbuildingthatappthat I don't moveit a littlebitearlier.
Sowe'll, uh, we'llseteveryoneup, andthenwe'llgothroughthestepsof, like, showing a currentandnextprofileimage, addingthe I thinkitwas a heart I can't remember.
Whatisthelightbutton?
Yeah, thelikebuttonwilladdthe, um, the X notebuttonandmakethoseworkwillmakethelike, slidingandtrackingmasseventswork.
We'llhavetheoverlaysweregonnadothoseallininsteps, So I'm gonnatalkabouttheproblemthatwewant.
So, um, untilrecently, thebestwaytoloadscriptswaswith a scripttaggedandthatputsomethingonthewindowandyoustartusingit, whichisn't greatformaintainabilityormodularityorwhathaveyouesoincandy?
Sothisiskindoflikesettingupwhatthatpropertyisgonnabelike s.
Sowehave a Thisdefaultgetterisbasicallywhatevertheinitialvalueisfortheproperty, Um, there's a coupleotherwillkindofgetinto a fewotherthingsthatwecanputinthistypedefinitionofflikegettersandcentersandthatsortofthing.
Soinourviewmodel, wecandefine a anactionor a methodlikethis.
Andthisisjustkindofstandardsintaxforfordefining a methodsowecanhavedosomething, itcantakearguments.
So, likeinthisexample, we'repassingdancefromtheviewintotheviewmodel, andthenwhenthatbuttoniscollected, willmakethealertonthelastthingshiftshiftiswhatyou'relookingfor.
ThioPopoffthezeroindex.
Uh, somethinginterest.
Um, that's it.
Goandtake a coupleminutes.
Anyquestionsbeforewebreakforher?
Oh, now, Okay, cool.
Soyouwanttomakethis?
Youwannamakethis, likebutton, actually, like, whofeelslikethey'vecometo a solution?
No.
Takeanotherminute.
Gothrough a solutiontogether.
What?
Allright.
Whowantstogetmestartedwith a solution?
Whatshould I dofirst?
Okay, let's see.
Whatdowewanttocallit?
Um, like, justlikewe'llgowithlightsprofile.
Okay.
Uh, sowe'vegotourourmethodinsidehere.
Whatdowewantto d'oh, Huh?
Yeah.
Waytodoboth.
Sowell.
D'oh!
ConsulLog, er, thinkallcapsliked, andthentheystartprofilesthatshift, sowehaven't quitegoneover?
No.
Oh, thatwasexciting.
We'reWe'rehavingscreenthatshe's allright.
Therewego.
That's okay.
Uh, letmeswitchbacktonotshowingmyface, Sweets.
Well, then, let's nothavethisbe a 1,000,000 timessmaller.
That's right, guys.
Uh, that's foursweet.
Okay.
Allright.
I thinkwe'rebackontrack.
Getthisright.
OK, Uh, OK, so, um, onethingwehaven't like 100% talkedabout, butnowit's asgood A Bythetimeit's everso.
Lastthingisthatsowecansewinourinourviewmodel, wecanhave, like, a leftpropertyorhowfarwehavemovedpropertyandthenrenderthatintheintheviewwiththedoubleCurly's.
Sojustlike a normalHTMLattributes, um, andtheninsidetherewillhavethedoubleCurly's fortheviewmodelproperty.
Andwewanttolistentopointherdownasourstartcomplainyourmovesfor a CZ, theuserismoving, andthere's a coupleof h maleattributesthatyou'llneedtoaddtotheimagetomakesurethatyoudon't getthedefaultdragonbehavior.
Um, it's gonnabereallyawkward, becauseatthispointthere's no, like, cleaneruporwhatevertheeventisfor, likelettinggo.