Asyouknow, I amElithecomputerguyandintoday's clientsandgoingtobeshowingyouhowtocreate a basicalertanimationusingCSS.
Sowhenever I'm teachingyoufolksmanytimes, I amtakingyoufromthe I o T.
Perspectiveagain, theInternetofthingsperspective.
Theideabeingisthatyou'regoingtobebuildingandcreatingnumerousdifferentdevicesinyourenvironmentandthosedevicesthey'regoingtobesendinginformationbackto a mainserver.
Itmayputthatinformationinto a databaseandmayusethatinformationtosendoutanSMSmessageforanalertsomethinglikethat, oritmayusetheinformationthat's beenpresentedtoitinordertodynamicallycreateanHTMLWebpage.
AndthenyourusersmayhavethatHTMLWebpageopenassometypeofmonitoringsystemtotellthemifthereis a problemintheirenvironment.
Butiftheydon't attracttheattentionoftheenduserortheydon't presenttheinformationin a waythattheenduserunderstands, itcanbebothtechnicallycorrectandabsolutelyworthless.
Oh, theexactsametime, right?
Soimagineifyouhave a lotoftemperaturesensorsinyourenvironment.
Andsoyouwanttomakesurethatiftheserverroomgoesabove a surgeinTampacure, youwanttomakesureyourusersarealerted s sothattheywilltakesomeaction.
Theymayturnontheairconditioner.
Theymayopenthedoor.
Theymaysimplycallthe V a C techniciantotrytosolvetheproblem.
Well, let's imaginethatyouhave a monitor, andinthatmanmonitoryouhave a Webbrowserthat's openandinthatWebbrowser, basicallyhave a dynamicallywritingHTMLdocumentthatshowsyouinformationfromthedifferenttemperaturesensorswithinyourenvironment.
Everytimetheylookatthescreen, allthetemperaturesent, thesensorvaluesarenormal, youknow, at a certainpoint, peoplejuststartassumingthatallthetemperaturesarefine.
I lookatthescreen, andwhen I lookatthescreen, thetemperaturesarefine.
If I'm sittinghereand I'm in a Cabinetconversationand a cupofcoffeewithoneofmycoworkersandthatthecoloroverherechanges, probablyjustnotgonnanoticethatthere's a goodchancepeoplearegonnanoticethat.
Sooneofthethingsthatyoucoulddoisyoucancreate a basicanimation.
Technically, technically, you'redoingyourjobisgonnabe a horribleuserexperience, right?
Onethingsyouknowyou'rethinkingaboutisheain't goingtheseextrastepstosayOK, whenthetemperaturegoesabove a certainlevelorwhenthesensorhits a surgeonlevel, I'm goingtodosomethingthatthentrytoattracttheendusersbydoingsomethingvisual.
Sowe'regonnabeusingtodayis a cameout, andCSSwe'regoingtocreatesomevery, verybasicanimationsthatcanreallymakeyour i o T applicationsreallybecome a hellof a lotmoreusefulwithliterallyjust a fewlinesofcode.
SothewarningwarningWillRobinsonfortodayisifyou're a humanwitheyeballs, youarenotgoingtolookwhat?
So I feel I feel I'm doingmymylegalobligationbygivingthatyouthismorningagain.
Itisveryimportant.
Understandthatwhen I dothesedemonstrationsand I dotheseclassesmanytimes, I giveyouveryuglydemonstrationsbecause I'm tryingtogetthepointacross, please, tonotsimplycopyandpastewhat I'm showing.
Youdo a littlebitofmodificationsothatyou'reinusersDon't hateyouwiththat.
Let's gowith a computerandagainputyoureyeballs.
Justtakeyoureyeballsout, putthemin a closetforthedemonstrationandletmeshowyouhowallthisworks.
Sohereweare, backinmydemonstrationmachineagain, I'm using a Macbookpro.
Andso, inordertowritethiscode, I usedtextatitforthistypeofscripting.
Having a longbarlikethis, youcouldput a lotofdifferentinformationinthatbar.
Soagain, let's sayyouhad a lotofdifferentsensors.
Let's say I had, like, 10 sensorsEatoneofthesebarscouldbeonesensorandthenbasicallyyoucanhavetheanimationbehindwhateversensorisbeingtriggeredandthenitcantellyou.
Sothisisthetemperature.
Thisisthehumidity.
Thisisthewaterlevel.
Thisis a motiontotheright.
Youcanactuallyhave a lotofinformationinthisbarisshowingyouthat.
Let's sayyou'redealingwith a smallscreenoryoudon't needthatmuchinformation.
BasicallythesamethingwiththeDiv.
Only I'vemadeit a lotsmallerthansomethinglike 40 pixelsby 40 pixels.
Thenextthingthat I didis I created a dipagainusingtheexactsamealertbox.
So I'm reusingthealertbox.
Butinsidethealertbox.
I did a P tagwith a classofalerttext.
Sothat's that's goingtobetaking a CSSformattingfromtheclassalerttext.
Andthen I putthe 95 degreessoandthen I closedthedip.
Sowiththat, basically, it's thatsamethesameDevdas I hadbefore.
Butinside I putsomealerttax.
Thenwe'regoingtogodownhere.
We'regonnabreakagain.
We'regonnagoDef, We'regoingto a class.
So I createdclassfortheDIVcalledAlertSquare.
So I simplymodifiedwhatthatdipshouldlooklikeagain.
I thinkit's 40 pixelsby 40 pixelstomakethatsquare.
I thencenteredinthescreen.
I didthemargins.
Itwillbecentered.
It'llbered.
It'llbeanimatedinthescreen.
I reusedthealerttext.
Sothen p classequalsalertTextreusethat.
Butnow I'm simplypointingout 95.
Insteadoftheadditionalwords, I closedthe P.
I closedthedivandthenwedo a break.
Thenfinallywegodownheretopee.
Sofor a pee I createdin a classofalertmessagesoBasically, all I havetodoiscallthisclassofalertmessageon, thenthatisthengoingtoanimatehelpthecomputerscreaming.
Umandit's justgoingtodothatanimation.
We'regonnaclosethebody.
Andthen, ofcourse, we'regonnaclose.
Youcameout.
SosincehaveyouseenthedemonstrationandtheHTML, wethengoovertoseeSS, andhopefullytheCSSwillmake a littlebitmoresensebecause, basically, withCSS, we'regonnabedealingwith a coupleofthings.
Here s O.
Thefirstthingthatwe'regoingtobedealingwithis a classlikewe'vebeendealingwithclassesbefore, Sothisis a classofalertbox, andthenbasically, withtheclassofalertbox, wehaveananimationthattheyweregoingtocallalert.
Soifyouhave a basicanimationlikeideashowedyou, that's a way I'm sittingherehaving a cupofcoffeewithoneofmypeersandallof a suddenoutofthecornerofmyeye, I startseeingthisflashingthingthatthatattractsmyattention.
Insteadofbeingoutinthefieldusers, Itwasjust a certainIt's justthatcertainpoint, likeonedayyouwalkinandlike a userisdealingdoingwhat a userdoes, andyou'rejustkindoflike, Youknowwhat?
I'm done.
I goteachthenextgenerationonhowtodealwiththiscrap.
Butifyouwanttowatchopinionvideos, orifyouwanttobeabletocomment, youdoneedtobecome a member.
Membershipis $5 a monthor $60 a yearandgivesyouaccesstothoseopinionvideosandtheabilitytocomment.
Ifyoudon't wanttobecome a member, youjustwanttogive a onetimedonation.
Thereisalso a donatebuttonwhereyoucandothat.
Pleaseunderstand.
Inordertoprovidetheeducationthat I am, itdoescostmoneyservers, costmoney, equipment, costs, money, travelcosts, money.
Allofthesethingscost a reasonableamountofmoneyandthefactofthematteris, isYouTube's advertisingprogramnolongersupportscreatorsthewaythatitusedto.
Soifyouwanttotheseclassestocontinuetostickaroundandyoufindthemtobevaluable, pleasethinkabouteitherbecoming a monthlymemberordonating a fewdollarsforthisproject.