Andnowtogetstartedwiththisvideo, I havevisualstudiocodeopento a completelyblankfolder, andontheright, I havethefinishedversionofourproductloadedupsowecanseewhatwe'retryingtodo.
Andif I comeoverhereandrefreshthepage, youcanseethatournavigationandtheelementsinsideofitsmoothlyanimatedinaswellasourcontentorpagealsosmoothlyanimatesin.
Soit's really a niceeasytransitionfromthecompletelywhitepagetoeallofourcontentinsteadofjustbeinginstantandhasthesenice, smoothanimationswhichwe'regoingtobuildusingCSS.
Andifwesaythatyouseethatwegetthismostlytransparentwhiteboxthatappearsovereachoneofourelements, whichisexactlywhatwewantNowthevery, verylastthingwehavetodoistoaddjust a littlebitofpaddingaround.
Soabout 1/3 of a secondandnowifwesaythatyouseeitanimatesin, wecouldsaythatagain.
Youcanseeitslowlydropsin.
Wecanalsousewhat's calledeasingeffects.
Sothisisthetiming.
Andwecansay, forexample, wewantthistobeeasyin.
Now, ifwesaveit, yousee, it'llbe a littlesloweratthebeginningandit'llspeeduptheendwherewecoulddoeaseoutandwe'llbe a littlebitstilloverattheendforourexample.
I'm justgonnausetheseinbecause I thinkitgivesit a reallynicelook.
Also, ifyourememberfromthepreviousexamplewhere I showedyoutheendproduct, younoticedthatartlabelshereforourlinksactuallystartedtheiranimationassoonasthisanimationended.
Wewanttodothisonourallyelements, sowewanttocreateananimationwhichisgoingtobeknavelinkloadandlikeintheotherexample, asyousaw, I dideverythinginsideofoneanimationproperty.
So, forexample, areknaveallyfirstchildthistlesgoingtobewhatthisleftsideoneisgoingtodo?
Thiswayweactuallyhave.
It's thatwecanoverridejustthenameofouranimationtoehave a completelydifferentanimationwithouthavingtooverridealloftheotherproperties.
Sothenextthingweneedisgoingtobeourduration.
Soinsteadofhere, we'regonnaputanimationdurationandagain, we'regonnamake a variableforthisbecausewewantourcontentinsideofourpagetoanimateafterourheadersectionisdone.
Solet's justsay I havelinkloadtimeandwe'regonnasetthisto 500 millisecondsjustsoit'lltake a littlebitlongerandnowwecanputthisinsideofhere.
Soit's goingtogiveit a reallycoolkindofloadingtransition.
Sothefirstthingwe'regoingtosayiswewantouranimationandofcourse, thisanimationisgoingtohave a nameandwe'rejustgonnacallthisarticleloadandthenwe'realsogoingtogiveit a duration 300 milliseconds, andwe'lljustsaythatthisoneisgoingtobeeasyinaswell.
Andthen, lastly, wewanttocalculatehowlongit's goingtotakeforthistoload, andthisisgoingtotaketheknaveloadlinktimeplustheknavelinkloadtimesowecanjustcreate a articleloaddelay, andwecansetthattothecalculationofthisknaveloadtime.