Skip to content

Commit 093f51a

Browse files
author
fabianmoronzirfas
committed
feat(hide serach hints): adds toggle search hints
and some style refinement
1 parent 9b18be2 commit 093f51a

File tree

8 files changed

+92
-34
lines changed

8 files changed

+92
-34
lines changed

_includes/search-bar.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
<div id="flex-search">
2-
<input class="searchfield flex-search-item" id="lunr-search" placeholder="Search" /> <button id="lunr-clear" class="flex-search-item">Clear</button>
2+
<input class="searchfield flex-search-item" id="lunr-search" placeholder="Search" /> <button id="lunr-clear" class="flex-search-item">Clear</button>
3+
</div>
4+
<div class="flex-search-advanced-hints">
5+
<div id="advanced-search-hint">
6+
<label for="advanced-search-toggle">Advanced search:</label>
7+
<input type="checkbox" name="toggle" id="advanced-search-toggle" checked>
8+
<div id="advanced-search-text" >
9+
<p>
10+
<em>If your terms don't match, try to use some special search terms.<br>
11+
You can use wildcards: like <code>lerp*</code> or <code>co*lor*</code>. <br>
12+
Or try using boosts: <code>fill^10 color</code>. This means the weight of fill is 10 times higher then color<br>
13+
Read more about the search engine <a href="https://lunrjs.com/guides/searching.html">here</a>
14+
</em>
15+
</p>
16+
</div>
17+
</div>
318
</div>
419
<div id="flex-search-results">
520
</div>

_layouts/entry.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
}
99
</style>
1010
<div id="distance">
11-
12-
{%- include search-bar.html -%}
11+
{%- include search-bar.html -%}
1312
</div>
1413
{% include entry-card.html entry=page ispage=true %}
1514
{{content}}

_sass/_reference-index.scss renamed to _sass/_reference.scss

Lines changed: 55 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ h1#new-cat-index {
2525

2626
.sub-category {
2727
column-width: 250px;
28+
column-rule: 1px dotted #9636FC;
29+
// column-gap: 1em;
2830
/* border-bottom: 1px dotted #9636FC; */
2931
}
3032

@@ -34,6 +36,9 @@ h1#new-cat-index {
3436
/* border-bottom: 1px dotted #9636FC; */
3537
}
3638

39+
.heading-sub-category{
40+
padding-bottom: 1em;
41+
}
3742
.heading-category {
3843
border-top: 1px dotted #9636FC;
3944
}
@@ -64,33 +69,45 @@ h1#new-cat-index {
6469
/* .entry-heading{
6570
margin-top: 0;
6671
} */
67-
72+
.ref-entry{
73+
padding-bottom: 1em;
74+
height:7.5em;
75+
padding-left: 0.2em;
76+
}
6877
.summary,
6978
.ref-entry {
7079
break-inside: avoid;
7180
}
7281

7382
.summary {
74-
min-height: 6em;
75-
margin-top: 0.5em;
83+
// min-height: 4.5em;
84+
// height: 4.5em;
85+
margin-top: 0.2em;
86+
font-size: 1.1em;
87+
margin-bottom:0;
88+
line-height: 1.25em;
89+
code{
90+
padding: 0;
91+
vertical-align: bottom;
92+
font-size: 0.9em;
93+
}
7694
}
7795

7896
#flex-search {
7997
display: flex;
80-
}
81-
82-
#flex-search>* {
98+
* {
8399
margin-right: 0.5em;
84-
}
85-
86-
#flex-search>button {
100+
}
101+
button {
87102
margin-right: 0 !important;
88103
background-color: white;
89104
background: white;
90105
background-image: none;
91106
border: 1px solid #9636FC;
92107
}
93108

109+
}
110+
94111
.flex-search-item,
95112
.flex-search-item::placeholder {
96113
font-family: 'Times New Roman', Times, serif;
@@ -115,15 +132,42 @@ button.flex-search-item:active {
115132
background: black !important;
116133
}
117134

118-
#flex-search-results>.search-result-container>.ref-entry {
135+
#flex-search-results> .search-result-container > .ref-entry {
119136
padding-top: 0.5em;
120137
border-top: 1px dotted #9636FC;
121138
}
122139

123-
#flex-search-results>.search-result-container>.ref-entry>p.summary {
140+
#flex-search-results>.search-result-container>.ref-entry > p.summary {
124141
min-height: 0;
125142
}
126143

127144
.search-result-container {
128145
padding-top: 1em;
146+
}
147+
148+
#advanced-search-hint{
149+
input{
150+
display:none;
151+
}
152+
label{
153+
font-style: italic;
154+
border-bottom: 1px solid #9636FC;
155+
// text-decoration: underline;
156+
&:hover{
157+
background-image: url("/assets/images/stripe_c40ccfac0db9e43c48e95a530d787366.png");
158+
}
159+
}
160+
}
161+
#advanced-search-hint input[type="checkbox"]:checked + div {
162+
opacity: 0;
163+
max-height: 0;
164+
border: none;
165+
}
166+
167+
#advanced-search-text{
168+
max-height: 99em;
169+
height: auto;
170+
opacity: 1;
171+
overflow: hidden;
172+
transition: opacity .5s linear, max-height .5s linear;
129173
}

assets/css/styles.sass

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ a.textgrow
355355
font-size: 30px
356356
border-bottom: 1px solid $textColor
357357

358-
@import 'reference-index'
358+
@import 'reference'
359359

360360
// ------------------------
361361
// old basil css. Overwrite new settings

assets/js/reference.bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)