diff --git a/etc/dsnet-report-js.png b/etc/dsnet-report-js.png new file mode 100644 index 0000000..a9b55be Binary files /dev/null and b/etc/dsnet-report-js.png differ diff --git a/report_rendering/README.md b/report_rendering/README.md index f560046..1cbdcea 100644 --- a/report_rendering/README.md +++ b/report_rendering/README.md @@ -5,15 +5,29 @@ into an existing website or web application. Most are contributions from other users. If you have a useful addition, please do a PR. - -* `dsnetreport.php`: A php file to render a report. -* `dsnetreport.html`: A hugo shortcode for rendering a report. See https://github.com/naggie/dsnet/issues/4#issuecomment-632928158 for background. Courtesy of [@Write](https://github.com/Write) - Most look something like this: ## Hugo shortcode template + +* `hugo/dsnetreport.html`: A hugo shortcode for rendering a report. + ![dsnet report table](https://raw.githubusercontent.com/naggie/dsnet/master/etc/report.png) # PHP template +See https://github.com/naggie/dsnet/issues/4#issuecomment-632928158 for background. Courtesy of [@Write](https://github.com/Write) + +* `php/dsnetreport.php`: A php file to render a report. + ![dsnet report table](https://user-images.githubusercontent.com/541722/82712747-0cf42180-9c89-11ea-92fa-0974a34c5c79.jpg) ![dsnet report table](https://user-images.githubusercontent.com/541722/82712745-0a91c780-9c89-11ea-91a8-828e0be38951.jpg) + +# Clientside JavaScript + +Courtesy of [@frillip](https://github.com/frillip/) + +* `js/dsnetreport.html`: Basic HTML with a `div` to place the table in. +* `js/dsnetreport.js`: Fetches `dsnetreport.json` and renders table. +* `js/dsnetreport.css`: CSS to render the table as per screenshot. + +![dsnet report table](https://raw.githubusercontent.com/naggie/dsnet/master/etc/dsnet-report-js.png) + diff --git a/report_rendering/dsnetreport.html b/report_rendering/hugo/dsnetreport.html similarity index 100% rename from report_rendering/dsnetreport.html rename to report_rendering/hugo/dsnetreport.html diff --git a/report_rendering/js/dsnetreport.css b/report_rendering/js/dsnetreport.css new file mode 100644 index 0000000..b7253ab --- /dev/null +++ b/report_rendering/js/dsnetreport.css @@ -0,0 +1,72 @@ +:root { + --bg: #030303; + --bg-highlight: #202020; + --text: #aaaaaa; + --text-muted: #666666; + --text-faint: #444444; + --heading: #cccccc; +} + +body { + font-family: Arial, Helvetica, sans-serif; + background: var(--bg); + color: var(--text); + font-size: 20px; +} + +table { + width: 100%; + border-collapse: collapse; + margin: 80px 0; + user-select: text +} + +table th, +table td { + text-align: left; + padding: 10px 5px; + padding: .6em +} + +table th { + border-bottom: 1px solid var(--heading); + color: var(--heading) +} + +table tr.dormant { + opacity: .3 +} + +table tr:nth-child(even) { + background: var(--bg-highlight) +} + +table td.indicator-green::before, +table td.indicator-amber::before, +table td.indicator-red::before, +table td.indicator-null::before { + display: inline-block; + content: ""; + margin-right: .4em; + width: .5em; + height: .5em; + border: .05em solid transparent +} + +table td.indicator-green::before { + background: #0f0; + box-shadow: 0 0 .5em rgba(100, 255, 100, .5) +} + +table td.indicator-amber::before { + background: orange +} + +table td.indicator-red::before { + background: red +} + +table td.indicator-null::before { + background: #000; + border: .05em solid var(--text-faint) +} diff --git a/report_rendering/js/dsnetreport.html b/report_rendering/js/dsnetreport.html new file mode 100644 index 0000000..f38d0cb --- /dev/null +++ b/report_rendering/js/dsnetreport.html @@ -0,0 +1,17 @@ + + + +
+ + +