33title: 'Components'
44permalink: '/components/'
55---
6+ <!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/instantsearch.js/1/instantsearch.min.css"> -->
7+ <!-- <style>
8+ .ais-hits {
9+ mid-width: 100%;
10+ }
11+ .ais-hits--item {
12+ display: inline;
13+ }
14+ </style> -->
615< h1 > Components</ h1 >
716{% assign componentCount = site.data.components.size %}
817< p > The full library of the completed components.< br > < strong > Total Components so far:</ strong > < span class ="text-danger "> {{componentCount}}</ span > </ p >
9- < p > </ p >
18+
19+ < link rel ="stylesheet " href ="../css/font-awesome.min.css ">
20+ < img src ="{{site.baseurl}}/imgs/algolia-powered-by.svg " alt ="powered by algolia ">
21+ < div class ="input-group ">
22+ < span class ="input-group-addon "> < i class ="fa fa-search " aria-hidden ="true "> </ i > </ span >
23+ < input type ="text " class ="form-control " placeholder ="search for component " id ="search-input ">
24+ </ div >
1025< br >
26+ < div id ="hits ">
1127{% assign rows = site.data.components.size | divided_by: 6.0 | ceil %}
1228{% for i in (1..rows) %}
1329 {% assign offset = forloop.index0 | times: 6 %}
@@ -24,8 +40,53 @@ <h1>Components</h1>
2440 {% endfor %}
2541 </ div >
2642{% endfor %}
43+ </ div >
2744< br > < br >
2845< p > Todo:</ p >
2946< p > To follow items on the todo list please look at the project list on github...</ p >
3047< a href ="https://github.com/shadowcodex/codex-ui/projects/ " class ="btn btn-lg btn-primary "> View Github Projects</ a >
31- < br > < br >
48+ < br > < br >
49+ < script src ="https://cdn.jsdelivr.net/algoliasearch/3/algoliasearchLite.min.js "> </ script >
50+ {% raw %}
51+ < script type ="text/html " id ="hit-template ">
52+ < div class = "col-6 col-sm-4 col-md-3 col-lg-3 col-xl-2" >
53+ < a href = "/codex-ui/{{permalink}}" class = "card border-dark mb-3" style = "text-decoration:none;" >
54+ < img src = "/codex-ui/{{image}}" alt = "{{title}}" class = "card-img-top" >
55+ < div class = "card-footer bg-dark text-white" >
56+ { { title} }
57+ </ div >
58+ </ a >
59+ </ div >
60+ </ script >
61+ {% endraw %}
62+ < script >
63+ var client = algoliasearch ( "JALYH7QHOY" , "1a318d659306a2e6a21d83ffd6fff9e2" ) ;
64+ var index = client . initIndex ( 'bootstrap_components' ) ;
65+
66+ document . getElementById ( "search-input" ) . addEventListener ( "keyup" , function ( event ) {
67+ index . search ( document . getElementById ( "search-input" ) . value , function ( err , content ) {
68+ document . getElementById ( "hits" ) . innerHTML = '' ;
69+ var hits = document . getElementById ( "hits" ) ;
70+ hits . innerHTML = '' ;
71+ var ultiText = '' ;
72+ for ( var i = 0 ; i < content . hits . length ; i ++ ) {
73+ var text = ''
74+ if ( i == 0 ) {
75+ text += '<div class="row">' ;
76+ } else if ( i % 6 == 0 ) {
77+ text += '</div><div class="row">' ;
78+ }
79+ var data = content . hits [ i ] ;
80+ text += '<div class="col-6 col-sm-4 col-md-3 col-lg-3 col-xl-2">' ;
81+ text += '<a href="/codex-ui/' + data . permalink + '" class="card border-dark mb-3" style="text-decoration:none;">' ;
82+ text += '<img src="/codex-ui/' + data . image + '" alt="' + data . title + '" class="card-img-top">' ;
83+ text += '<div class="card-footer bg-dark text-white">' + data . title + '</div></a></div>' ;
84+
85+ ultiText += text ;
86+ }
87+ ultiText += '</div>' ;
88+ hits . innerHTML = ultiText ;
89+ } ) ;
90+ } )
91+
92+ </ script >
0 commit comments