Skip to content

Commit

Permalink
v0.1.3
Browse files Browse the repository at this point in the history
- Add search
  • Loading branch information
kristuff authored Aug 3, 2021
2 parents 0480dc7 + 71d5301 commit 64a1591
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 62 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@
```

![preview_dark](/screenshots/after_dark.png)



## Features
- Responsive design
- Breadcrumb navigation
- Search/Filter results
- Light/Dark theme based on user prefered color scheme

## Requirements
Expand Down
166 changes: 122 additions & 44 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* |__/
*
* This file is part of kristuff/apache-fancy-index.
* Version 0.1.2 - Copyright (c) 2021 Kristuff <[email protected]>
* Version 0.1.3 - Copyright (c) 2021 Kristuff <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -22,6 +22,7 @@
--color-table-bg: whitesmoke;
--color-table-bg--head: #161720;
--color-table-bg--even: #e3e2e2;
--color-table-border :rgba(0,0,0,0.05);
--color-table-text: #222222;
--color-table-header-text: #dadada;
--color-link-text: #115293;
Expand All @@ -34,9 +35,9 @@
--color-highlight: #ffffff;
--color-text: #bbb;
--color-text-light: #8a8a8a;
--color-text-xlight: #404253;
--color-text-xlight: #5e5f6c;
--color-table-bg: #282e37;
--color-table-bg--head:#282e37;
--color-table-bg--head:#171b20;
--color-table-bg--even: rgba(255,255,255,0.03);
--color-table-border :rgba(255,255,255,0.1);
--color-table-text: #bbbbbb;
Expand All @@ -51,6 +52,17 @@
}
}

*,
*::after,
*::before {
box-sizing: border-box;
}

html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
}

body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
Expand All @@ -60,6 +72,20 @@ body {

}

img {
border-style: none;
}


button,
input,
optgroup,
select,
textarea {
font-family: inherit;
line-height: 1.15;
margin: 0;
}

a {
text-decoration: none;
Expand All @@ -75,40 +101,6 @@ a:hover {
}


/* Adjust padding according to footer height (~50px) */
section#section-content {
padding-bottom: 50px;
}

/* Fixed footer */
footer#section-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 15px 0 10px 0;
color: var(--color-text-xlight);
background-color: var(--color-bg);
font-size: 0.75rem;
}
footer#section-footer p {
margin: 0;
margin-top: 6px;
}

footer#section-footer a,
footer#section-footer a:visited {
color: var(--color-text-xlight) ;
text-decoration: underline;
}
footer#section-footer a:hover {
color: var(--color-text) ;
}

footer#section-footer .row {
border-top: 1px solid var(--color-text-xlight);
}

.row {
box-sizing:border-box;
margin:0 auto;
Expand All @@ -120,6 +112,10 @@ h1 {

}

/* ------------------- */
/* -- SECTION TITLE -- */
/* ------------------- */

section#section-title {
margin: 12px 0;
min-height: 60px;
Expand All @@ -133,8 +129,7 @@ section#section-title h1 {
section#section-title div#breadcrumb {
color: var(--color-text-xlight);
font-size: 0.77rem;
display: flex;
flex-wrap: wrap;
display: block;
}
section#section-title div#breadcrumb .separator {
margin: 0 6px;
Expand All @@ -148,13 +143,30 @@ section#section-title div#breadcrumb a.active:visited {
color: var(--color-text-xlight);
}

@media only screen and (min-width:768px) {
.row{
width:96%;
}


input#filter {
border:1px solid var(--color-table-border) ;
background-color: var(--color-table-bg--even);
outline: 0;
display: block;
width: 100%;
margin:10px 0 6px 0;
color:var(--color-text);
padding: 5px;
}

input#filter:focus,
input#filter:focus-visible {
border-color:var(--color-link-text);
box-shadow: inset 0 1px 1px rgba(var(--color-link-text), 0.075), 0 0 8px rgba(var(--color-link-text), 0.6);
}


/* --------------------- */
/* -- SECTION CONTENT -- */
/* --------------------- */

/** table index */
table#indexlist {
width: 100%;
Expand Down Expand Up @@ -214,12 +226,78 @@ table#indexlist tr[class*="dir"] td.indexcolname a {
font-weight: 600;
}

/**
table#indexlist tr {
background: var(--color-table-bg--even);
border-bottom: 1px solid var(--color-table-border);
}
*/

/** tableIndex: alternative row style */
table#indexlist tr[class^="even"] {
table#indexlist tr:not(.indexhead):nth-child(even) {
background: var(--color-table-bg--even);
}

/* Adjust padding according to footer height (~50px) */
section#section-content {
padding-bottom: 50px;
}

/* -------------------- */
/* -- SECTION FOOTER -- */
/* -------------------- */


/* Fixed footer */
footer#section-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 15px 0 10px 0;
color: var(--color-text-xlight);
background-color: var(--color-bg);
font-size: 0.75rem;
}
footer#section-footer p {
margin: 0;
margin-top: 6px;
}

footer#section-footer a,
footer#section-footer a:visited {
color: var(--color-text-xlight) ;
text-decoration: underline;
}
footer#section-footer a:hover {
color: var(--color-text) ;
}

footer#section-footer .row {
border-top: 1px solid var(--color-text-xlight);
}




@media only screen and (min-width:768px) {
.row{
width:96%;
}


section#section-title div#breadcrumb {
display: inline-block;
max-width: calc(100% - 250px);
}
input#filter {
float: right;
width: 200px;
margin:0;
margin-top: -10px;
padding: 6px;
}
}


@media (max-width: 700px) {
Expand Down
24 changes: 11 additions & 13 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* |__/
*
* This file is part of kristuff/apache-fancy-index.
* Version 0.1.2 - Copyright (c) 2021 Kristuff <[email protected]>
* Version 0.1.3 - Copyright (c) 2021 Kristuff <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down Expand Up @@ -67,31 +67,28 @@



var LightTableFilter = (function(Arr) {
var tableFilter = (function(Arr) {

var _input;

function _onInputEvent(e) {
_input = e.target;
var tables = document.getElementsByClassName(_input.getAttribute('data-table'));
Arr.forEach.call(tables, function(table) {
Arr.forEach.call(table.tBodies, function(tbody) {
Arr.forEach.call(tbody.rows, _filter);
});
});
var tableBody = document.querySelector('table#indexlist tBody');
Arr.forEach.call(tableBody.rows, _filter);
}

function _filter(row) {
var text = row.textContent.toLowerCase(), val = _input.value.toLowerCase();
row.style.display = text.indexOf(val) === -1 ? 'none' : 'table-row';
if (row.classList.contains('indexbreakrow') || row.classList.contains('indexhead')) return;
row.style.display = text.indexOf(val) === -1 ? 'none' : 'table-row';
}

return {
init: function() {
var inputs = document.getElementsByClassName('light-table-filter');
Arr.forEach.call(inputs, function(input) {
input.oninput = _onInputEvent;
});
var input = document.querySelector('input#filter');
if (input) {
input.oninput = _onInputEvent;
}
}
};
})(Array.prototype);
Expand All @@ -100,6 +97,7 @@
// Go
documentReady(function(){
setTitle();
tableFilter.init();
});

})(document);
Expand Down
2 changes: 1 addition & 1 deletion conf/fancy-index-tests.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# |__/
#
# This file is part of kristuff/apache-fancy-index.
# Version 0.1.2 - Copyright (c) 2021 Kristuff <[email protected]>
# Version 0.1.3 - Copyright (c) 2021 Kristuff <[email protected]>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion conf/fancy-index.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# |__/
#
# This file is part of kristuff/apache-fancy-index.
# Version 0.1.2 - Copyright (c) 2021 Kristuff <[email protected]>
# Version 0.1.3 - Copyright (c) 2021 Kristuff <[email protected]>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion create_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# |__/
#
# This file is part of kristuff/apache-fancy-index.
# Version 0.1.2
# Version 0.1.3
# Copyright (c) 2021 Kristuff <[email protected]>
#
# For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion deb/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: apache-fancy-index
Version: 0.1.2
Version: 0.1.3
Maintainer: kristuff <[email protected]>
Architecture: all
Depends: apache2
Expand Down
Binary file added screenshots/after_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion template/FOOTER.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</section>
<footer id="section-footer">
<div class="row">
<p>kristuff/apache-fancy-index | © 2021 Christophe Buliard | <a target="_blank" href="https://github.com/kristuff/apache-fancy-index" rel="no-referer">Source code</a> </p>
<p>Apache Fancy Index v0.1.3 | © 2021 Christophe Buliard | <a target="_blank" href="https://github.com/kristuff/apache-fancy-index" rel="no-referer">Source code</a> </p>
</div>
</footer>
<script src="/fancy-index/js/script.js"></script>
Expand Down
1 change: 1 addition & 0 deletions template/HEADER.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<div class="row">
<h1 id="title"></h1>
<div id="breadcrumb"></div>
<input id="filter" type="text" placeholder="Search..." >
</div>
</section>
<section id="section-content">
Expand Down

0 comments on commit 64a1591

Please sign in to comment.