Other usage ideas
+Address geocoding
Below is an example of how to combine city geocoding with the AUTOCOMPLETE
library. In
fact, there are many ideas for using it ;)
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d2f65e..8711f72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2021-01-26 (v1.0.30) +### Added +- grouping the results + ## 2021-01-23 (v1.0.29) ### Changed - expanding demo examples diff --git a/README.md b/README.md index 257590e..ed9c144 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,11 @@ See the demo - [example](https://tomik23.github.io/autocomplete/) - Accessible, with full support for ARIA attributes and keyboard interactions. - Customize your own CSS. - Support for asynchronous data fetching. -- Move between the records using the arrows ↓ ↑, and confirm by Enter +- Move between the records using the arrows ↓ ↑, and confirm by Enter or mouse +- Grouping of record results +- Showing 'no results' - No dependencies +- Very light library, packed gzip **only ~3KB** ## Initialization @@ -134,6 +137,7 @@ JavaScript | insertToInput | Boolean | `false` | | Adding an element selected with arrows to the input field | | howManyCharacters | Number | `2` | | The number of characters entered should start searching | | delay | Number | `500` | | Time in milliseconds that the component should wait after last keystroke before calling search function 1000 = 1s | +| classGroup | String | | | Enter a class name, this class will be added to the group name elements | ~~instruction~~ | ~~String~~ | ~~`When autocomplete results ...`~~ | | ~~aria-describedby [attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute) A full text below~~ | **instructions** - has been removed from the library, [see how to add to html](https://tomik23.github.io/autocomplete/) @@ -163,6 +167,10 @@ const options = { // should start searching howManyCharacters: 2, + // enter the name of the class by + // which you will name the 'group by' element + classGroup: 'group-by', + // Function for user input. It can be a synchronous function or a promise // you can fetch data with jquery, axios, fetch, etc. onSearch: (input) => { diff --git a/docs/characters.json b/docs/characters.json index b5b5b72..f0d7b90 100644 --- a/docs/characters.json +++ b/docs/characters.json @@ -1 +1 @@ -[{"char_id":1,"name":"Walter White","birthday":"09-07-1958","occupation":["High School Chemistry Teacher","Meth King Pin"],"img":"https://images.amcnetworks.com/amc.com/wp-content/uploads/2015/04/cast_bb_700x1000_walter-white-lg.jpg","status":"Presumed dead","nickname":"Heisenberg","appearance":[1,2,3,4,5],"portrayed":"Bryan Cranston","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":2,"name":"Jesse Pinkman","birthday":"09-24-1984","occupation":["Meth Dealer"],"img":"https://upload.wikimedia.org/wikipedia/en/thumb/f/f2/Jesse_Pinkman2.jpg/220px-Jesse_Pinkman2.jpg","status":"Alive","nickname":"Cap n' Cook","appearance":[1,2,3,4,5],"portrayed":"Aaron Paul","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":3,"name":"Skyler White","birthday":"08-11-1970","occupation":["House wife","Book Keeper","Car Wash Manager","Taxi Dispatcher"],"img":"https://s-i.huffpost.com/gen/1317262/images/o-ANNA-GUNN-facebook.jpg","status":"Alive","nickname":"Sky","appearance":[1,2,3,4,5],"portrayed":"Anna Gunn","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":4,"name":"Walter White Jr.","birthday":"07-08-1993","occupation":["Teenager"],"img":"https://media1.popsugar-assets.com/files/thumbor/WeLUSvbAMS_GL4iELYAUzu7Bpv0/fit-in/1024x1024/filters:format_auto-!!-:strip_icc-!!-/2018/01/12/910/n/1922283/fb758e62b5daf3c9_TCDBRBA_EC011/i/RJ-Mitte-Walter-White-Jr.jpg","status":"Alive","nickname":"Flynn","appearance":[1,2,3,4,5],"portrayed":"RJ Mitte","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":5,"name":"Henry Schrader","birthday":"Unknown","occupation":["DEA Agent"],"img":"https://upload.wikimedia.org/wikipedia/en/thumb/c/c1/Hank_Schrader2.jpg/220px-Hank_Schrader2.jpg","status":"Deceased","nickname":"Hank","appearance":[1,2,3,4,5],"portrayed":"Dean Norris","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":6,"name":"Marie Schrader","birthday":"Unknown","occupation":["Housewife","Clepto"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/1/10/Season_2_-_Marie.jpg/revision/latest?cb=20120617211645","status":"Alive","nickname":"Marie","appearance":[1,2,3,4,5],"portrayed":"Betsy Brandt","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":7,"name":"Mike Ehrmantraut","birthday":"Unknown","occupation":["Hitman","Private Investigator","Ex-Cop"],"img":"https://images.amcnetworks.com/amc.com/wp-content/uploads/2015/04/cast_bb_700x1000_mike-ehrmantraut-lg.jpg","status":"Deceased","nickname":"Mike","appearance":[2,3,4,5],"portrayed":"Jonathan Banks","category":"Breaking Bad, Better Call Saul","better_call_saul_appearance":[1,2,3,4]},{"char_id":8,"name":"Saul Goodman","birthday":"Unknown","occupation":["Lawyer"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/1/16/Saul_Goodman.jpg/revision/latest?cb=20120704065846","status":"Alive","nickname":"Jimmy McGill","appearance":[2,3,4,5],"portrayed":"Bob Odenkirk","category":"Breaking Bad, Better Call Saul","better_call_saul_appearance":[1,2,3,4]},{"char_id":9,"name":"Gustavo Fring","birthday":"Unknown","occupation":["Los-Pollos co-Founder","Philanthropist","Cartel Leader"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/1/1f/BCS_S4_Gustavo_Fring.jpg/revision/latest?cb=20180824195925","status":"Deceased","nickname":"Gus","appearance":[2,3,4],"portrayed":"Giancarlo Esposito","category":"Breaking Bad, Better Call Saul","better_call_saul_appearance":[3,4]},{"char_id":10,"name":"Hector Salamanca","birthday":"Unknown","occupation":["Former Senior Cartel Leader"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/b/b4/Hector_BCS.jpg/revision/latest?cb=20170810091606","status":"Deceased","nickname":"Don Hector","appearance":[1,2,3,4],"portrayed":"Mark Margolis","category":"Breaking Bad, Better Call Saul","better_call_saul_appearance":[2,3,4]},{"char_id":11,"name":"Domingo Molina","birthday":"Unknown","occupation":["Meth Distributor"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/e/e7/Krazy8.png/revision/latest?cb=20130208041554","status":"Deceased","nickname":"Krazy-8","appearance":[1],"portrayed":"Maximino Arciniega","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":12,"name":"Tuco Salamanca","birthday":"Unknown","occupation":["Meth Distributor"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/a/a7/Tuco_BCS.jpg/revision/latest?cb=20170810082445","status":"Deceased","nickname":"Tuco","appearance":[1,2],"portrayed":"Raymond Cruz","category":"Breaking Bad, Better Call Saul","better_call_saul_appearance":[1,2]},{"char_id":13,"name":"Marco & Leonel Salamanca","birthday":"Unknown","occupation":["Cartel Hitman"],"img":"https://images.amcnetworks.com/amc.com/wp-content/uploads/2015/04/cast_bb_700x1000_the-cousins-lg.jpg","status":"Deceased","nickname":"The Cousins","appearance":[3],"portrayed":"Luis & Daniel Moncada","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":14,"name":"Lydia Rodarte-Quayle","birthday":"Unknown","occupation":["Executive at Madrigal"],"img":"https://media1.popsugar-assets.com/files/thumbor/wERDST0TUb-iHCSb2r5ZpsvaZLo/fit-in/1024x1024/filters:format_auto-!!-:strip_icc-!!-/2013/07/17/675/n/1922283/fae2f583f04bb80f_Laura-Fraser-is-back-as-Lydia-Rodarte-Quayle_gallery_primary/i/Laura-Fraser-Lydia-Rodarte-Quayle.jpg","status":"Alive","nickname":"Lydia","appearance":[5],"portrayed":"Laura Fraser","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":15,"name":"Todd Alquist","birthday":"Unknown","occupation":["Lab Assistant","Enforcer","Meth Cook"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/9/95/Todd_brba5b.png/revision/latest?cb=20130717134303","status":"Deceased","nickname":"Ricky Hitler","appearance":[5],"portrayed":"Jesse Plemons","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":16,"name":"Jane Margolis","birthday":"Unknown","occupation":["Tattoo Artist","Landlord"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/b/b4/Jane.jpg/revision/latest?cb=20090621233653","status":"Deceased","nickname":"Apology Girl","appearance":[2],"portrayed":"Krysten Ritter","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":17,"name":"Skinny Pete","birthday":"Unknown","occupation":["Low-level meth distributer"],"img":"https://vignette.wikia.nocookie.net/breaking-bad-tv/images/c/ce/Sp.png/revision/latest?cb=20121016143623","status":"Alive","nickname":"Skinny","appearance":[1,2,3,4,5],"portrayed":"Charles Baker","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":18,"name":"Brandon Mayhew","birthday":"Unknown","occupation":["Low-level meth distributer"],"img":"https://images.amcnetworks.com/amc.com/wp-content/uploads/2015/04/cast_bb_700x1000_badger-lg.jpg","status":"Alive","nickname":"Badger","appearance":[1,2,3,4,5],"portrayed":"Matt L. Jones","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":19,"name":"Huell Babineaux","birthday":"Unknown","occupation":["Bodyguard"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/c/c1/4x11_-_Huell.png/revision/latest?cb=20130913100459&path-prefix=es","status":"Alive","nickname":"Huell","appearance":[4,5],"portrayed":"Lavell Crawford","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":20,"name":"Steven Gomez","birthday":"Unknown","occupation":["DEA Agent"],"img":"https://images.amcnetworks.com/amc.com/wp-content/uploads/2015/04/cast_bb_700x1000_steven-gomez-lg.jpg","status":"Deceased","nickname":"Gomie","appearance":[1,2,3,4,5],"portrayed":"Steven Michael Quezada","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":21,"name":"Theodore Beneke","birthday":"Unknown","occupation":["Former President Beneke Fabricators"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/b/bd/Cast_bb_700x1000_todd-beneke-lg.jpg/revision/latest?cb=20170723165057","status":"Alive","nickname":"Ted","appearance":[2,3,4,5],"portrayed":"Christopher Cousins","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":22,"name":"Gale Boetticher","birthday":"Unknown","occupation":["Chemist","Meth manufacturer"],"img":"https://images.amcnetworks.com/amc.com/wp-content/uploads/2015/04/cast_bb_700x1000_gale-boetticher-lg.jpg","status":"Deceased","nickname":"GB","appearance":[3],"portrayed":"David Costabile","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":23,"name":"Andrea Cantillo","birthday":"Unknown","occupation":["Unknown"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/5/51/Andrea_-_To%27hajilee.png/revision/latest?cb=20131025094457","status":"Deceased","nickname":"Andrea","appearance":[3,4,5],"portrayed":"Emily Rios","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":24,"name":"Brock Cantillo","birthday":"Unknown","occupation":["Kid"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/9/97/Brock.png/revision/latest?cb=20170725193144","status":"Alive","nickname":"Brock","appearance":[3,4,5],"portrayed":"Ian Posada","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":25,"name":"Carmen Molina","birthday":"Unknown","occupation":["High School Principal"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/d/de/Carmen.JPG/revision/latest?cb=20100410125233","status":"Alive","nickname":"Carmen","appearance":[1,2,3,5],"portrayed":"Carmen Serano","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":26,"name":"Gretchen Schwartz","birthday":"Unknown","occupation":["Co-owner Gray Matter"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/5/5e/Gretchen_Schwartz.png/revision/latest?cb=20131005103735&path-prefix=es","status":"Alive","nickname":"Gretchen","appearance":[1,2,5],"portrayed":"Jessica Hecht","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":27,"name":"Elliot Schwartz","birthday":"Unknown","occupation":["Co-Founder Gray Matter"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/8/8a/Elliott_Schwartz.png/revision/latest?cb=20131005103743&path-prefix=es","status":"Alive","nickname":"Elliot","appearance":[1,5],"portrayed":"Adam Godley","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":28,"name":"Gonzo","birthday":"Unknown","occupation":["Tuco's Bodyguard"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/d/d6/Gonzo.JPG/revision/latest?cb=20100415212944","status":"Deceased","nickname":"Gonzo","appearance":[1,2],"portrayed":"Jesus, Payan, Jr.","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":29,"name":"Christian Ortgea","birthday":"Unknown","occupation":["Low-level meth distributor"],"img":"https://res.cloudinary.com/dwvrok1le/image/upload/v1540314304/c8acek3pimb0hb4efrvf.jpg","status":"Deceased","nickname":"Combo","appearance":[1,2,3],"portrayed":"Rodney Rush","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":30,"name":"Mrs. Pinkman","birthday":"Unknown","occupation":["unknown"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/a/a2/Tess_Harper.jpg/revision/latest?cb=20120923235754","status":"Alive","nickname":"Jesse's mom","appearance":[1,2,3],"portrayed":"Tess Harper","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":31,"name":"Adam Pinkman","birthday":"Unknown","occupation":["unknown"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/c/c9/AdamPinkman.png/revision/latest?cb=20141117180836&path-prefix=es","status":"Alive","nickname":"Jesse's dad","appearance":[1,2,3],"portrayed":"Michael Bofshever","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":32,"name":"Jake Pinkman","birthday":"Unknown","occupation":["Kid","Jesse's little brother"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/a/a4/Jake.jpg/revision/latest?cb=20121214201656&path-prefix=de","status":"Alive","nickname":"Jake","appearance":[1],"portrayed":"Ben Petry","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":33,"name":"No-Doze","birthday":"Unknown","occupation":["Juarez Cartel Lieutenant"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/c/ca/No_Doze_2.png/revision/latest?cb=20131014073210","status":"Deceased","nickname":"No-Doze","appearance":[1,2],"portrayed":"Cesar Garcia","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":34,"name":"Emilio Koyama","birthday":"Unknown","occupation":["Low-level meth distributor"],"img":"https://vignette.wikia.nocookie.net/trbreakingbad/images/9/9c/Emilio.jpeg/revision/latest?cb=20161029192022","status":"Deceased","nickname":"Emilio","appearance":[1],"portrayed":"John Koyama","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":35,"name":"Dr. Delcavoli","birthday":"Unknown","occupation":["Physician"],"img":"https://res.cloudinary.com/dwvrok1le/image/upload/v1540314509/lj5qlbe6xvmmpxnspz6y.jpg","status":"Alive","nickname":"Dr. Delcavoli","appearance":[1,2],"portrayed":"David House","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":36,"name":"Wendy S.","birthday":"Unknown","occupation":["Prostitute"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/c/cc/Wendy.jpg/revision/latest?cb=20170721162715","status":"Alive","nickname":"Wendy","appearance":[1,2,3],"portrayed":"Julie Minesci","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":37,"name":"Bogdan Wolynetz","birthday":"Unknown","occupation":["Former owner of A1A Car Wash"],"img":"https://i.pinimg.com/originals/d5/c0/34/d5c0345ae70fbdbaa33b7537d685da54.jpg","status":"Alive","nickname":"Bogdan","appearance":[1,3,4],"portrayed":"Marius Stan","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":38,"name":"Ken","birthday":"Unknown","occupation":["Stock Broker"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/8/8c/Ken.png/revision/latest?cb=20170721163649","status":"Alive","nickname":"Ken Wins","appearance":[1],"portrayed":"Kyle Bornheimer","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":39,"name":"Holly White","birthday":"Unknown","occupation":["Infant"],"img":"https://pmctvline2.files.wordpress.com/2013/09/breaking-bad-elanor-anne-wenrich-325.jpg?w=325&h=240","status":"Alive","nickname":"Holly","appearance":[2,3,4,5],"portrayed":"Unknown","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":40,"name":"George Merkert","birthday":"Unknown","occupation":["Former Head of Albuquerque DEA"],"img":"https://m.media-amazon.com/images/M/MV5BMTkwMTkxNjUzM15BMl5BanBnXkFtZTgwMTg5MTczMTE@._V1_UY317_CR175,0,214,317_AL_.jpg","status":"Alive","nickname":"ASAC Merkert","appearance":[2,3,4,5],"portrayed":"Michael Shamus Wiles","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":41,"name":"Donald Margolis","birthday":"Unknown","occupation":["Air-Traffic Controller","Landlord"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/1/12/Donald_Margolis.png/revision/latest?cb=20120802212034","status":"Unknown","nickname":"Jane's dad","appearance":[2,3],"portrayed":"John de Lancie","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":42,"name":"Clovis","birthday":"Unknown","occupation":["Mechanic"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/0/0f/Clovis.JPG/revision/latest?cb=20100415221013","status":"Alive","nickname":"Clovis","appearance":[2,3],"portrayed":"Tom Kiesche","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":43,"name":"SAC Ramey","birthday":"Unknown","occupation":["DEA agent"],"img":"https://res.cloudinary.com/dwvrok1le/image/upload/v1539360786/o7thsjdorobfbetqaefj.jpg","status":"Alive","nickname":"SAC Ramey","appearance":[2,4,5],"portrayed":"Todd Terry","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":44,"name":"Victor","birthday":"Unknown","occupation":["Henchman of Gustavo Fring"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/4/48/Victor2.png/revision/latest?cb=20131009225027","status":"Deceased","nickname":"Victor","appearance":[2,3,4],"portrayed":"Jeremiah Bitsui","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":45,"name":"Tomás Cantillo","birthday":"Unknown","occupation":["Kid","Gang member for a rival dealer in ABQ"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/e/ec/Tomas.png/revision/latest?cb=20130131043014","status":"Deceased","nickname":"Andrea's brother","appearance":[2,3],"portrayed":"Angelo Martinez","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":46,"name":"Francesca Liddy","birthday":"Unknown","occupation":["Department of Motor Vehicles","Secretary for Saul Goodman Associates"],"img":"https://res.cloudinary.com/dwvrok1le/image/upload/v1539362182/o9mstjonfn6dsdi3uij6.jpg","status":"Alive","nickname":"Honey Tits","appearance":[2,3,4,5],"portrayed":"Tina Parker","category":"Breaking Bad, Better Call Saul","better_call_saul_appearance":[3,4]},{"char_id":47,"name":"Cynthia","birthday":"Unknown","occupation":["Los Pollos Hermanos Manager"],"img":"https://res.cloudinary.com/dwvrok1le/image/upload/v1539362375/z63youp272k5mbqbuqj9.jpg","status":"Alive","nickname":"Cynthia","appearance":[2,3,4],"portrayed":"Ashley Kajiki","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":48,"name":"Tortuga","birthday":"Unknown","occupation":["Juarez Cartel member","DEA informant"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/5/58/BBWA_Tortuga.jpg/revision/latest?cb=20131101172007","status":"Deceased","nickname":"Tortuga","appearance":[2,3],"portrayed":"Danny Trejo","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":49,"name":"Tim Roberts","birthday":"Unknown","occupation":["Detective for the APD"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/8/8d/2x02_-_Tim_Roberts.jpg/revision/latest?cb=20110927053954","status":"Alive","nickname":"Detective Roberts","appearance":[2,4],"portrayed":"Nigel Gibbs","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":50,"name":"Juan Bolsa","birthday":"Unknown","occupation":["Mexican drug cartel boss"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/3/38/Bolsa.png/revision/latest?cb=20180825204033","status":"Deceased","nickname":"Don Juan","appearance":[3,4],"portrayed":"Javier Grajeda","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":51,"name":"Group Leader","birthday":"Unknown","occupation":["Drug & Alcohol Rehabilitation Counselor"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/8/81/Group_Leader_Brown_Shirt_-_Kafkaesque.png/revision/latest?cb=20131025095333","status":"Alive","nickname":"Counselor","appearance":[3,4],"portrayed":"Jere Burns","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":52,"name":"Kaylee Ehrmantraut","birthday":"Unknown","occupation":["Kid"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/c/cc/Kaylee.png/revision/latest?cb=20170810082843","status":"Alive","nickname":"Mike's Granddaughter","appearance":[3,5],"portrayed":"Kaija Rose Bales","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":53,"name":"Pamela","birthday":"Unknown","occupation":["Attorney"],"img":"https://res.cloudinary.com/dwvrok1le/image/upload/v1539373707/bbb6muek0tcmbc3g2sog.jpg","status":"Alive","nickname":"Skyler's attorney","appearance":[3],"portrayed":"Julie Dretzin","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":54,"name":"Duane Chow","birthday":"Unknown","occupation":["Owner of Golden Moth Chemical"],"img":"https://res.cloudinary.com/dwvrok1le/image/upload/v1539373871/ssk1t4hvo9tmhvdt5hcn.jpg","status":"Deceased","nickname":"Chow","appearance":[3,5],"portrayed":"James Ning","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":55,"name":"Stacey Ehrmantraut","birthday":"Unknown","occupation":["Unknown"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/b/b3/StaceyEhrmantraut.png/revision/latest?cb=20150310150049","status":"Alive","nickname":"Mike's daugter-in-law","appearance":[3],"portrayed":"Kerry Condon","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":56,"name":"Officer Saxton","birthday":"Unknown","occupation":["APD Officer"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/f/f3/Officer_Saxton_-_I.F.T..png/revision/latest?cb=20131025090606","status":"Alive","nickname":"Saxton","appearance":[3],"portrayed":"Stoney Westmoreland","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":57,"name":"Jack Welker","birthday":"Unknown","occupation":["Criminal Gang Leader"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/c/ce/Jack5x13.png/revision/latest?cb=20130912225922","status":"Deceased","nickname":"Uncle Jack","appearance":[5],"portrayed":"Michael Bowen","category":"Breaking Bad","better_call_saul_appearance":[]},{"char_id":112,"name":"Kimberly Wexler","birthday":"Unknown","occupation":["Lawyer"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/f/f7/BCS_S4_Kim_Wexler.jpg/revision/latest?cb=20180824195845","status":"?","nickname":"Kim","appearance":[],"portrayed":"Rhea Seehorn","category":"Better Call Saul","better_call_saul_appearance":[1,2,3,4]},{"char_id":113,"name":"Howard Hamlin","birthday":"Unknown","occupation":["Lawyer"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/5/57/BCS_S4_Howard_Hamlin.jpg/revision/latest?cb=20180824195855","status":"?","nickname":"Howard","appearance":[],"portrayed":"Patrick Fabian","category":"Better Call Saul","better_call_saul_appearance":[1,2,3,4]},{"char_id":114,"name":"Charles McGill","birthday":"Unknown","occupation":["Lawyer"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/3/3e/BCS_S3_ChuckMcGill.jpg/revision/latest?cb=20170327185308","status":"?","nickname":"Chuck","appearance":[],"portrayed":"Michael McKean","category":"Better Call Saul","better_call_saul_appearance":[1,2,3,4]},{"char_id":115,"name":"Ignacio Varga","birthday":"Unknown","occupation":["Crimal Gang Lieutenant"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/b/b1/BCS_S4_Nacho_Varga.jpg/revision/latest?cb=20180824195910","status":"?","nickname":"Nacho","appearance":[],"portrayed":"Michael Mano","category":"Better Call Saul","better_call_saul_appearance":[1,2,3,4]},{"char_id":116,"name":"Eduardo Salamanca","birthday":"Unknown","occupation":["Cartel Member"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/8/85/LaloProfileBCS.png/revision/latest?cb=20180925050152","status":"?","nickname":"Lalo","appearance":[],"portrayed":"Tony Dalton","category":"Better Call Saul","better_call_saul_appearance":[4]},{"char_id":117,"name":"Stacey Ehrmantraut","birthday":"Unknownn","occupation":["Mother"],"img":"https://vignette.wikia.nocookie.net/breakingbad/images/b/b3/StaceyEhrmantraut.png/revision/latest?cb=20150310150049","status":"?","nickname":"Stacey","appearance":[],"portrayed":"Kerry Condon","category":"Better Call Saul","better_call_saul_appearance":[1,2,3,4]}] \ No newline at end of file +[{"char_id":1,"name":"Walter White","birthday":"09-07-1958","img":"https://images.amcnetworks.com/amc.com/wp-content/uploads/2015/04/cast_bb_700x1000_walter-white-lg.jpg","status":"Presumed dead"},{"char_id":2,"name":"Jesse Pinkman","birthday":"09-24-1984","img":"https://vignette.wikia.nocookie.net/breakingbad/images/9/95/JesseS5.jpg/revision/latest?cb=20120620012441","status":"Alive"},{"char_id":3,"name":"Skyler White","birthday":"08-11-1970","img":"https://s-i.huffpost.com/gen/1317262/images/o-ANNA-GUNN-facebook.jpg","status":"Alive"},{"char_id":4,"name":"Walter White Jr.","birthday":"07-08-1993","img":"https://media1.popsugar-assets.com/files/thumbor/WeLUSvbAMS_GL4iELYAUzu7Bpv0/fit-in/1024x1024/filters:format_auto-!!-:strip_icc-!!-/2018/01/12/910/n/1922283/fb758e62b5daf3c9_TCDBRBA_EC011/i/RJ-Mitte-Walter-White-Jr.jpg","status":"Alive"},{"char_id":5,"name":"Henry Schrader","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/b/b7/HankS5.jpg/revision/latest/scale-to-width-down/700?cb=20120620014136","status":"Deceased"},{"char_id":6,"name":"Marie Schrader","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/1/10/Season_2_-_Marie.jpg/revision/latest?cb=20120617211645","status":"Alive"},{"char_id":7,"name":"Mike Ehrmantraut","birthday":"Unknown","img":"https://images.amcnetworks.com/amc.com/wp-content/uploads/2015/04/cast_bb_700x1000_mike-ehrmantraut-lg.jpg","status":"Deceased"},{"char_id":8,"name":"Saul Goodman","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/1/16/Saul_Goodman.jpg/revision/latest?cb=20120704065846","status":"Alive"},{"char_id":9,"name":"Gustavo Fring","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/1/1f/BCS_S4_Gustavo_Fring.jpg/revision/latest?cb=20180824195925","status":"Deceased"},{"char_id":10,"name":"Hector Salamanca","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/b/b4/Hector_BCS.jpg/revision/latest?cb=20170810091606","status":"Deceased"},{"char_id":11,"name":"Domingo Molina","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/e/e7/Krazy8.png/revision/latest?cb=20130208041554","status":"Deceased"},{"char_id":12,"name":"Tuco Salamanca","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/a/a7/Tuco_BCS.jpg/revision/latest?cb=20170810082445","status":"Deceased"},{"char_id":13,"name":"Marco & Leonel Salamanca","birthday":"Unknown","img":"https://images.amcnetworks.com/amc.com/wp-content/uploads/2015/04/cast_bb_700x1000_the-cousins-lg.jpg","status":"Deceased"},{"char_id":14,"name":"Lydia Rodarte-Quayle","birthday":"Unknown","img":"https://media1.popsugar-assets.com/files/thumbor/wERDST0TUb-iHCSb2r5ZpsvaZLo/fit-in/1024x1024/filters:format_auto-!!-:strip_icc-!!-/2013/07/17/675/n/1922283/fae2f583f04bb80f_Laura-Fraser-is-back-as-Lydia-Rodarte-Quayle_gallery_primary/i/Laura-Fraser-Lydia-Rodarte-Quayle.jpg","status":"Alive"},{"char_id":15,"name":"Todd Alquist","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/9/95/Todd_brba5b.png/revision/latest?cb=20130717134303","status":"Deceased"},{"char_id":16,"name":"Jane Margolis","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/b/b4/Jane.jpg/revision/latest?cb=20090621233653","status":"Deceased"},{"char_id":17,"name":"Skinny Pete","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breaking-bad-tv/images/c/ce/Sp.png/revision/latest?cb=20121016143623","status":"Alive"},{"char_id":18,"name":"Brandon Mayhew","birthday":"Unknown","img":"https://images.amcnetworks.com/amc.com/wp-content/uploads/2015/04/cast_bb_700x1000_badger-lg.jpg","status":"Alive"},{"char_id":19,"name":"Huell Babineaux","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/c/c1/4x11_-_Huell.png/revision/latest?cb=20130913100459&path-prefix=es","status":"Alive"},{"char_id":20,"name":"Steven Gomez","birthday":"Unknown","img":"https://images.amcnetworks.com/amc.com/wp-content/uploads/2015/04/cast_bb_700x1000_steven-gomez-lg.jpg","status":"Deceased"},{"char_id":21,"name":"Theodore Beneke","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/b/bd/Cast_bb_700x1000_todd-beneke-lg.jpg/revision/latest?cb=20170723165057","status":"Alive"},{"char_id":22,"name":"Gale Boetticher","birthday":"Unknown","img":"https://images.amcnetworks.com/amc.com/wp-content/uploads/2015/04/cast_bb_700x1000_gale-boetticher-lg.jpg","status":"Deceased"},{"char_id":23,"name":"Andrea Cantillo","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/5/51/Andrea_-_To%27hajilee.png/revision/latest?cb=20131025094457","status":"Deceased"},{"char_id":24,"name":"Brock Cantillo","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/9/97/Brock.png/revision/latest?cb=20170725193144","status":"Alive"},{"char_id":25,"name":"Carmen Molina","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/d/de/Carmen.JPG/revision/latest?cb=20100410125233","status":"Alive"},{"char_id":26,"name":"Gretchen Schwartz","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/5/5e/Gretchen_Schwartz.png/revision/latest?cb=20131005103735&path-prefix=es","status":"Alive"},{"char_id":27,"name":"Elliot Schwartz","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/8/8a/Elliott_Schwartz.png/revision/latest?cb=20131005103743&path-prefix=es","status":"Alive"},{"char_id":28,"name":"Gonzo","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/d/d6/Gonzo.JPG/revision/latest?cb=20100415212944","status":"Deceased"},{"char_id":29,"name":"Christian Ortgea","birthday":"Unknown","img":"https://res.cloudinary.com/dwvrok1le/image/upload/v1540314304/c8acek3pimb0hb4efrvf.jpg","status":"Deceased"},{"char_id":30,"name":"Mrs. Pinkman","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/a/a2/Tess_Harper.jpg/revision/latest?cb=20120923235754","status":"Alive"},{"char_id":31,"name":"Adam Pinkman","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/c/c9/AdamPinkman.png/revision/latest?cb=20141117180836&path-prefix=es","status":"Alive"},{"char_id":32,"name":"Jake Pinkman","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/a/a4/Jake.jpg/revision/latest?cb=20121214201656&path-prefix=de","status":"Alive"},{"char_id":33,"name":"No-Doze","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/c/ca/No_Doze_2.png/revision/latest?cb=20131014073210","status":"Deceased"},{"char_id":34,"name":"Emilio Koyama","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/trbreakingbad/images/9/9c/Emilio.jpeg/revision/latest?cb=20161029192022","status":"Deceased"},{"char_id":35,"name":"Dr. Delcavoli","birthday":"Unknown","img":"https://res.cloudinary.com/dwvrok1le/image/upload/v1540314509/lj5qlbe6xvmmpxnspz6y.jpg","status":"Alive"},{"char_id":36,"name":"Wendy S.","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/c/cc/Wendy.jpg/revision/latest?cb=20170721162715","status":"Alive"},{"char_id":37,"name":"Bogdan Wolynetz","birthday":"Unknown","img":"https://i.pinimg.com/originals/d5/c0/34/d5c0345ae70fbdbaa33b7537d685da54.jpg","status":"Alive"},{"char_id":38,"name":"Ken","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/8/8c/Ken.png/revision/latest?cb=20170721163649","status":"Alive"},{"char_id":39,"name":"Holly White","birthday":"Unknown","img":"https://static.wikia.nocookie.net/breakingbad/images/7/78/Holly.JPG/revision/latest/scale-to-width-down/683?cb=20100413115129","status":"Alive"},{"char_id":40,"name":"George Merkert","birthday":"Unknown","img":"https://m.media-amazon.com/images/M/MV5BMTkwMTkxNjUzM15BMl5BanBnXkFtZTgwMTg5MTczMTE@._V1_UY317_CR175,0,214,317_AL_.jpg","status":"Alive"},{"char_id":41,"name":"Donald Margolis","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/1/12/Donald_Margolis.png/revision/latest?cb=20120802212034","status":"Unknown"},{"char_id":42,"name":"Clovis","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/0/0f/Clovis.JPG/revision/latest?cb=20100415221013","status":"Alive"},{"char_id":43,"name":"SAC Ramey","birthday":"Unknown","img":"https://res.cloudinary.com/dwvrok1le/image/upload/v1539360786/o7thsjdorobfbetqaefj.jpg","status":"Alive"},{"char_id":44,"name":"Victor","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/4/48/Victor2.png/revision/latest?cb=20131009225027","status":"Deceased"},{"char_id":45,"name":"Tomás Cantillo","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/e/ec/Tomas.png/revision/latest?cb=20130131043014","status":"Deceased"},{"char_id":46,"name":"Francesca Liddy","birthday":"Unknown","img":"https://res.cloudinary.com/dwvrok1le/image/upload/v1539362182/o9mstjonfn6dsdi3uij6.jpg","status":"Alive"},{"char_id":47,"name":"Cynthia","birthday":"Unknown","img":"https://res.cloudinary.com/dwvrok1le/image/upload/v1539362375/z63youp272k5mbqbuqj9.jpg","status":"Alive"},{"char_id":48,"name":"Tortuga","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/5/58/BBWA_Tortuga.jpg/revision/latest?cb=20131101172007","status":"Deceased"},{"char_id":49,"name":"Tim Roberts","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/8/8d/2x02_-_Tim_Roberts.jpg/revision/latest?cb=20110927053954","status":"Alive"},{"char_id":50,"name":"Juan Bolsa","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/3/38/Bolsa.png/revision/latest?cb=20180825204033","status":"Deceased"},{"char_id":51,"name":"Group Leader","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/8/81/Group_Leader_Brown_Shirt_-_Kafkaesque.png/revision/latest?cb=20131025095333","status":"Alive"},{"char_id":52,"name":"Kaylee Ehrmantraut","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/c/cc/Kaylee.png/revision/latest?cb=20170810082843","status":"Alive"},{"char_id":53,"name":"Pamela","birthday":"Unknown","img":"https://res.cloudinary.com/dwvrok1le/image/upload/v1539373707/bbb6muek0tcmbc3g2sog.jpg","status":"Alive"},{"char_id":54,"name":"Duane Chow","birthday":"Unknown","img":"https://res.cloudinary.com/dwvrok1le/image/upload/v1539373871/ssk1t4hvo9tmhvdt5hcn.jpg","status":"Deceased"},{"char_id":55,"name":"Stacey Ehrmantraut","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/b/b3/StaceyEhrmantraut.png/revision/latest?cb=20150310150049","status":"Alive"},{"char_id":56,"name":"Officer Saxton","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/f/f3/Officer_Saxton_-_I.F.T..png/revision/latest?cb=20131025090606","status":"Alive"},{"char_id":57,"name":"Jack Welker","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/c/ce/Jack5x13.png/revision/latest?cb=20130912225922","status":"Deceased"},{"char_id":112,"name":"Kimberly Wexler","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/f/f7/BCS_S4_Kim_Wexler.jpg/revision/latest?cb=20180824195845","status":"Alive"},{"char_id":113,"name":"Howard Hamlin","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/5/57/BCS_S4_Howard_Hamlin.jpg/revision/latest?cb=20180824195855","status":"Alive"},{"char_id":114,"name":"Charles McGill","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/3/3e/BCS_S3_ChuckMcGill.jpg/revision/latest?cb=20170327185308","status":"Deceased"},{"char_id":115,"name":"Ignacio Varga","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/b/b1/BCS_S4_Nacho_Varga.jpg/revision/latest?cb=20180824195910","status":"Alive"},{"char_id":116,"name":"Eduardo Salamanca","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/8/85/LaloProfileBCS.png/revision/latest?cb=20180925050152","status":"Alive"},{"char_id":117,"name":"Stacey Ehrmantraut","birthday":"Unknown","img":"https://vignette.wikia.nocookie.net/breakingbad/images/b/b3/StaceyEhrmantraut.png/revision/latest?cb=20150310150049","status":"Alive"}] \ No newline at end of file diff --git a/docs/css/main.css b/docs/css/main.css index f3a9f70..5ebcbd2 100644 --- a/docs/css/main.css +++ b/docs/css/main.css @@ -1 +1 @@ -@import url(https://fonts.googleapis.com/css?family=Lato&display=swap);*,:after,:before{box-sizing:border-box;padding:0;margin:0}html{scroll-behavior:smooth;height:100%}body,html{margin:0;padding:0}body{position:relative;font-family:Lato, sans-serif;background:#fbfbfb;padding:0;line-height:1.4;font-size:18px;overflow-x:hidden;min-height:100%}h1{position:relative;letter-spacing:1px;margin-bottom:30px;padding-left:50px}h1.search:before{width:30px;height:30px;filter:invert(25%)}a{text-decoration:none;color:#414141;padding:7px 0}.active a{border-right:3px solid #ff0000;margin-right:-30px;font-weight:bold}label{display:block;font-size:12px;text-transform:uppercase;font-weight:bold}aside{position:fixed;top:0;width:100%;height:100%;left:0;max-width:320px;padding:50px 30px;background:#ececec;transition:left 200ms ease}aside ul{list-style:none}aside ul a{display:block}.shields{margin:-10px 0 20px}.based{position:fixed;bottom:70px;text-align:center}.based small{text-transform:uppercase;font-weight:600;letter-spacing:1px}.flex{display:flex}.search-elements{margin-right:20px;margin-left:340px;padding-bottom:150px;transition:transform 100ms ease}.github-corner{position:fixed;top:0;right:0}.toggle-menu{position:fixed;width:30px;height:30px;bottom:20px;left:30px;border:0;cursor:pointer}.toggle-menu:before{position:absolute;content:"";top:0;left:0;width:100%;height:100%;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z'/%3E%3C/svg%3E%0A")}.close aside{left:-320px}.close .search-elements{margin-left:0;margin-right:0}section,article,.section{padding:50px 0 0;margin-top:-50px;margin:auto;max-width:850px}h2{margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid rgba(128,128,128,0.4)}h3{margin-bottom:10px;font-weight:400}@media (max-width: 950px){aside{display:none}.search-elements{margin-left:20px}.close aside{display:block;left:0}.close .search-elements{margin-left:20px;margin-right:20px;transform:translateX(320px)}}.highlight{margin-top:20px;font-size:18px;line-height:130%}.highlight h4{text-transform:uppercase;margin-bottom:10px}pre{display:flex;margin:0;padding:0;position:relative}pre::before{position:absolute;content:"1\A 2\A 3\A 4\A 5\A 6\A 7\A 8\A 9\A 10\A 11\A 12\A 13\A 14\A 15\A 16\A 17\A 18\A 19\A 20\A 21\A 22\A 23\A 24\A 25\A 26\A 27\A 28\A 29\A 30\A 31\A 32\A 33\A 34\A 35\A 36\A 37\A 38\A 39\A 40\A 41\A 42\A 43\A 44\A 45\A 46\A 47\A 48\A 49\A 50\A 51\A 52\A 53\A 54\A 55\A 56\A 57\A 58\A 59\A 60\A 61\A 62\A 63\A 64\A 65\A 66\A 67\A 68\A 69\A 70\A 71\A 72\A 73\A 74\A 75\A 76\A 77\A 78\A 79\A 80\A 81\A 82\A 83\A 84\A 85\A 86\A 87\A 88\A 89\A 90\A 91\A 92\A 93\A 94\A 95\A 96\A 97\A 98\A 99\A 100\A 101\A 102\A 103\A 104\A 105\A 106\A 107\A 108\A 109\A 110\A 111\A 112\A 113\A 114\A 115\A 116\A 117\A 118\A 119\A 120\A 121\A 122\A 123\A 124\A 125\A 126\A 127\A 128\A 129\A 130\A 131\A 132\A 133\A 134\A 135\A 136\A 137\A 138\A 139\A 140\A 141\A 142\A 143\A 144\A 145\A 146\A 147\A 148\A 149\A 150\A 151\A 152\A 153\A 154\A 155\A 156\A 157\A 158\A 159\A 160\A 161\A 162\A 163\A 164\A 165\A 166\A 167\A 168\A 169\A 170\A 171\A 172\A 173\A 174\A 175\A 176\A 177\A 178\A 179\A 180\A 181\A 182\A 183\A 184\A 185\A 186\A 187\A 188\A 189\A 190\A 191\A 192\A 193\A 194\A 195\A 196\A 197\A 198\A 199\A 200\A";left:0;top:20px;bottom:25px;width:45px;padding-right:15px;overflow:hidden;text-align:right;color:#666;white-space:pre;letter-spacing:-1px;background-color:#282c34}pre::after{position:absolute;content:attr(rel);top:0;right:0;z-index:0;color:#fff;font-size:50%;text-transform:uppercase;font-weight:700;padding:0 15px;background:#000;border-radius:0 0 0 5px;line-height:200%}code{padding:3px 20px 3px 25px}body::-webkit-scrollbar,.highlight code::-webkit-scrollbar{background-color:#eeeeee;width:20px}body::-webkit-scrollbar-track,.highlight code::-webkit-scrollbar-track{background-color:#fff}body::-webkit-scrollbar-track:hover,.highlight code::-webkit-scrollbar-track:hover{background-color:#f4f4f4}body::-webkit-scrollbar-thumb,.highlight code::-webkit-scrollbar-thumb{background-color:#dcdce6;border-radius:16px;border:2px solid #fff}body::-webkit-scrollbar-thumb:hover,.highlight code::-webkit-scrollbar-thumb:hover{background-color:#a0a0a5}body::-webkit-scrollbar-button,.highlight code::-webkit-scrollbar-button{display:none}.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@media (max-width: 500px){.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}.github-corner:hover .octo-arm{animation:none}}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}.iframe{margin-top:20px;width:100%;height:400px;border:1px solid #a3a3a3}.info-section code,.info-section a{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}.info-section a{border-bottom:1px solid #c7254e}.top{position:relative;padding-top:40px;font-size:0.8em;padding-left:10px;text-transform:uppercase}.top::before{position:absolute;content:"\2191";margin-top:-2px;left:0}.active-data{max-width:350px;border:1px solid #ff9999;width:100%;display:flex;background:#f5f5f5;flex-direction:column;padding:10px;border-radius:5px;text-align:center;box-shadow:0 0 20px rgba(255,164,164,0.2)}.active-data .image{overflow:hidden}.active-data img{display:block;max-width:100%;height:auto;transition:all 300ms ease-in-out;border:1px solid #fff;border-radius:5px}.active-data img:hover{transform:scale(1.2);filter:brightness(150%)} +@import url(https://fonts.googleapis.com/css?family=Lato&display=swap);*,:after,:before{box-sizing:border-box;padding:0;margin:0}html{scroll-behavior:smooth;height:100%}body,html{margin:0;padding:0}body{position:relative;font-family:Lato, sans-serif;background:#fbfbfb;padding:0;line-height:1.4;font-size:18px;overflow-x:hidden;min-height:100%}h1{position:relative;letter-spacing:1px;margin-bottom:30px;padding-left:50px}h1.search:before{width:30px;height:30px;filter:invert(25%)}a{text-decoration:none;color:#414141;padding:7px 0}.active a{border-right:3px solid #ff0000;margin-right:-30px;font-weight:bold}label{display:block;font-size:12px;text-transform:uppercase;font-weight:bold}aside{position:fixed;top:0;width:100%;height:100%;left:0;max-width:320px;padding:50px 30px;background:#ececec;transition:left 200ms ease}aside ul{list-style:none}aside ul a{display:block}.shields{margin:-10px 0 20px}.based{position:fixed;bottom:70px;text-align:center}.based small{text-transform:uppercase;font-weight:600;letter-spacing:1px}.flex{display:flex}.search-elements{margin-right:20px;margin-left:340px;padding-bottom:150px;transition:transform 100ms ease}.github-corner{position:fixed;top:0;right:0}.toggle-menu{position:fixed;width:30px;height:30px;bottom:20px;left:30px;border:0;cursor:pointer}.toggle-menu:before{position:absolute;content:"";top:0;left:0;width:100%;height:100%;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z'/%3E%3C/svg%3E%0A")}.close aside{left:-320px}.close .search-elements{margin-left:0;margin-right:0}section,article,.section{padding:50px 0 0;margin-top:-50px;margin:auto;max-width:850px}h2{margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid rgba(128,128,128,0.4)}h3{margin-bottom:10px;font-weight:400}@media (max-width: 950px){aside{display:none}.search-elements{margin-left:20px}.close aside{display:block;left:0}.close .search-elements{margin-left:20px;margin-right:20px;transform:translateX(320px)}}.highlight{margin-top:20px;font-size:18px;line-height:130%}.highlight h4{text-transform:uppercase;margin-bottom:10px}pre{display:flex;margin:0;padding:0;position:relative}pre::before{position:absolute;content:"1\A 2\A 3\A 4\A 5\A 6\A 7\A 8\A 9\A 10\A 11\A 12\A 13\A 14\A 15\A 16\A 17\A 18\A 19\A 20\A 21\A 22\A 23\A 24\A 25\A 26\A 27\A 28\A 29\A 30\A 31\A 32\A 33\A 34\A 35\A 36\A 37\A 38\A 39\A 40\A 41\A 42\A 43\A 44\A 45\A 46\A 47\A 48\A 49\A 50\A 51\A 52\A 53\A 54\A 55\A 56\A 57\A 58\A 59\A 60\A 61\A 62\A 63\A 64\A 65\A 66\A 67\A 68\A 69\A 70\A 71\A 72\A 73\A 74\A 75\A 76\A 77\A 78\A 79\A 80\A 81\A 82\A 83\A 84\A 85\A 86\A 87\A 88\A 89\A 90\A 91\A 92\A 93\A 94\A 95\A 96\A 97\A 98\A 99\A 100\A 101\A 102\A 103\A 104\A 105\A 106\A 107\A 108\A 109\A 110\A 111\A 112\A 113\A 114\A 115\A 116\A 117\A 118\A 119\A 120\A 121\A 122\A 123\A 124\A 125\A 126\A 127\A 128\A 129\A 130\A 131\A 132\A 133\A 134\A 135\A 136\A 137\A 138\A 139\A 140\A 141\A 142\A 143\A 144\A 145\A 146\A 147\A 148\A 149\A 150\A 151\A 152\A 153\A 154\A 155\A 156\A 157\A 158\A 159\A 160\A 161\A 162\A 163\A 164\A 165\A 166\A 167\A 168\A 169\A 170\A 171\A 172\A 173\A 174\A 175\A 176\A 177\A 178\A 179\A 180\A 181\A 182\A 183\A 184\A 185\A 186\A 187\A 188\A 189\A 190\A 191\A 192\A 193\A 194\A 195\A 196\A 197\A 198\A 199\A 200\A";left:0;top:20px;bottom:25px;width:45px;padding-right:15px;overflow:hidden;text-align:right;color:#666;white-space:pre;letter-spacing:-1px;background-color:#282c34}pre::after{position:absolute;content:attr(rel);top:0;right:0;z-index:0;color:#fff;font-size:50%;text-transform:uppercase;font-weight:700;padding:0 15px;background:#000;border-radius:0 0 0 5px;line-height:200%}code{padding:3px 20px 3px 25px}body::-webkit-scrollbar,.highlight code::-webkit-scrollbar{background-color:#eeeeee;width:20px}body::-webkit-scrollbar-track,.highlight code::-webkit-scrollbar-track{background-color:#fff}body::-webkit-scrollbar-track:hover,.highlight code::-webkit-scrollbar-track:hover{background-color:#f4f4f4}body::-webkit-scrollbar-thumb,.highlight code::-webkit-scrollbar-thumb{background-color:#dcdce6;border-radius:16px;border:2px solid #fff}body::-webkit-scrollbar-thumb:hover,.highlight code::-webkit-scrollbar-thumb:hover{background-color:#a0a0a5}body::-webkit-scrollbar-button,.highlight code::-webkit-scrollbar-button{display:none}.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@media (max-width: 500px){.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}.github-corner:hover .octo-arm{animation:none}}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}.iframe{margin-top:20px;width:100%;height:400px;border:1px solid #a3a3a3}.info-section code,.info-section a{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}.info-section a{border-bottom:1px solid #c7254e}.info-section p+p{margin-top:20px}.top{position:relative;padding-top:40px;font-size:0.8em;padding-left:10px;text-transform:uppercase}.top::before{position:absolute;content:"\2191";margin-top:-2px;left:0}.active-data{max-width:350px;border:1px solid #ff9999;width:100%;display:flex;background:#f5f5f5;flex-direction:column;padding:10px;border-radius:5px;text-align:center;box-shadow:0 0 20px rgba(255,164,164,0.2)}.active-data .image{overflow:hidden}.active-data img{display:block;max-width:100%;height:auto;transition:all 300ms ease-in-out;border:1px solid #fff;border-radius:5px}.active-data img:hover{transform:scale(1.2);filter:brightness(150%)}.group-by{padding:8px 12px;background:#000;font-size:0.85em;border-top:1px solid #c5d8ff;border-bottom:1px solid #c5d8ff;color:#fff;letter-spacing:1px;cursor:none} diff --git a/docs/index.html b/docs/index.html index a3e9d67..996b7d2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -31,7 +31,9 @@
"loupe"
icons and the
button with which we
can clear the "x"
field, as well as the possibility of an animation waiting for the
- results before our
- REST API
returns us. See complex-example.
+ results before our REST API
returns us.
+
+ See complex-example.
Adding no-result is a bit more complicated so it shows up in the examples. First, add the
- noResults
method, then in the onResults
method we check whether maches
- returns zero results, if so, it is enough to make a comparison of return matches === 0 ? input:
- matches
- Now just type some non-existent text and no-results
will be displayed.
+
Adding no result is a bit more complicated, so it is included in the examples. First, add the
+ noResults
method, then in the onResults
method we check whether
+ maches
returns zero results, if so, it is enough to make a comparison of return matches === 0 ? input:
+ matches
.
+
Now you just need to type in non-existent text, and no results
will be displayed, only "no
+ results" information.
Instead of the REST API, you can use a static +
Instead of the REST API, you can use a static files
const api='./characters.json'
Due to the fact that we
- download the entire json file locally, we should add sorting and filtering the results. We can add
+ download the entire json file locally, we should add sorting and filtering the results.
+
We can add
sorting and filtering in two ways. In the onSearch
or onResults
method.
You want to download all the data, nothing easier. You can do it in the onSubmit
method by clicking the mouse on the element, or by pressing enter when the element is selected, but also
- in the onSelectedItem
method. That is, selecting an element, either with the mouse or
- by jumping on the elements with the arrows. Open the console and see what happens during these
+ in the onSelectedItem
method.
That is, selecting an element, either with the mouse or + by jumping on the elements with the arrows.
+Open the console and see what happens during these events.
- new Autocomplete('search-complex', {
+ new Autocomplete('static-file-data', {
clearButton: true,
selectFirst: true,
howManyCharacters: 1,
@@ -481,15 +501,10 @@ javascript
const { name, nickname, birthday, img, portrayed } = matches;
const template = `
- <h2>
- <a href="https://www.imdb.com/find?q=${encodeURI(portrayed)}" target="_blank">
- ${portrayed}
- </a>
- </h2>
<p>name - ${name}</p>
- <p>nickname - ${nickname}</p>
<p>birthday - ${birthday}</p>
<div class="image"><img src="${img}"></div>`;
+
const info = document.querySelector('.info-d');
info.classList.add('active-data');
info.innerHTML = template;
@@ -504,10 +519,149 @@ javascript
+
+
+
+
+ Data grouping
+ First, we declare the class of group members classGroup: 'group-by'
+
+ Then we sort by our group, in our case it will be status ['Alive', 'Deceased', 'Presumed
+ dead', 'Unknown']
,
+ then we
+ sort by
+ name
.
+ Of course, it is not always needed, because we should get such soroting from our
+ api 'REST API'
+
+
+ The next thing is the onResults
method which returns the third element of the group class
+ name which
+ will prevent moving between result records with the arrow and with the mouse.
+ This class should be added to the group items.
+
+
+
+
+
+
+ html
+
+
+ javascript
+
+ new Autocomplete('group', {
+ clearButton: true,
+ howManyCharacters: 1,
+
+ // enter the name of the class by
+ // which you will name the group element
+ classGroup: 'group-by',
+
+ onSearch: (input) => {
+ const api = './characters.json';
+ return new Promise((resolve) => {
+ fetch(api)
+ .then((response) => response.json())
+ .then((data) => {
+
+ // First, we sort by our group, in our case
+ // it will be the status, then we sort by name.
+ // Of course, it is not always necessary because
+ // such soroting may be obtained from REST API
+ const result = data
+ .sort((a, b) => a.status.localeCompare(b.status) || a.name.localeCompare(b.name))
+ .filter(element => {
+ return element.name.match(new RegExp(input, 'gi'))
+ })
+ resolve(result);
+ })
+ .catch((error) => {
+ console.error(error);
+ });
+ });
+ },
+ onResults: (matches, input, className) => {
+ return matches === 0 ? input : matches
+ .map((el, index, array) => {
+
+ // we create an element of the group
+ let group = el.status !== array[index - 1]?.status
+ ? `<li class="${className}">GROUP: ${el.status}</div>`
+ : '';
+
+ return `
+ ${group}
+ <li class="loupe">
+ <p>${el.name.replace(new RegExp(input, 'gi'), (str) => `<b>${str}</b>`)}</p>
+ </li>`;
+ }).join('');
+ },
+ onSubmit: (matches, input) => {
+ console.log(`You selected ${input}`);
+ },
+ onSelectedItem: (index, matches) => {
+ console.log('onSelectedItem:', index, matches);
+ },
+ noResults: (input, resultRender) => resultRender(`<li>No results found: "${input}"</li>`),
+});
+
+
+
+
+
+
+
+
+
+ Local data
+ Not only json
or rest api
file, but also data can be downloaded locally.
+ Also in this case, you need to sort and filter the data.
+
+
+
+
+
+
+ html
+
+
+ javascript
+
+ new Autocomplete('local', {
+ howManyCharacters: 1,
+
+ onSearch: (input) => {
+
+ // local data
+ const data = [
+ { "name": "Walter White" },
+ { "name": "Jesse Pinkman" },
+ { "name": "Skyler White" },
+ { "name": "Walter White Jr." }
+ ];
+ return data.sort((a, b) => a.name.localeCompare(b.name))
+ .filter(element => {
+ return element.name.match(new RegExp(input, 'gi'))
+ })
+ },
+ onResults: (matches) => {
+ return matches
+ .map((el) => {
+ return `
+ <li>${el.name}</li>`;
+ }).join('');
+ },
+});
+
+
+
+
+
-
+
- Other usage ideas
+ Address geocoding
Below is an example of how to combine city geocoding with the AUTOCOMPLETE
library. In
fact, there are many ideas for using it ;)
@@ -520,314 +674,7 @@ Other usage ideas
-
+