diff --git a/src/Lib/Presenters/DisplayHtml.css b/src/Lib/Presenters/DisplayHtml.css index 3eb2982..aa96a26 100644 --- a/src/Lib/Presenters/DisplayHtml.css +++ b/src/Lib/Presenters/DisplayHtml.css @@ -1,11 +1,11 @@ -.performance *{ +#performance-tool *{ box-sizing: border-box; margin: 0; padding: 0; font-family: Times; } -.performance{ +#performance-tool{ display: block; position: fixed; border: solid #ccc 1px; @@ -25,7 +25,7 @@ body{ margin-bottom: 350px; } - .performance { + #performance-tool { bottom: 0px; left: 0; right: 0; @@ -34,68 +34,83 @@ } } -.performance .overflow{ +#performance-tool .overflow{ overflow: auto; height: 77%; border-top: solid #bababa 1px; } -.performance .table-title{ +#performance-tool .table-title{ width: 100%; background-color: #fff; } -.performance .table-title td{ +#performance-tool .table-title td{ text-align: center; padding: 8px; font-size: 28px; } -.performance .table-point .t-l{ +#performance-tool .table-point .t-l{ text-align: left; } -.performance .table-point .new-line-message{ +#performance-tool .table-point .new-line-message{ color: #333; text-align: left; padding-left: 14px; } -.performance .table-title td span{ +#performance-tool .table-title td span{ font-size: 12px; } -.performance .table-point { +#performance-tool .table-point { width: 100%; } -.performance .table-point th{ +#performance-tool .table-point th{ background-color: #e2e2e2; } -.performance .table-point tr:nth-child(odd) { +#performance-tool .table-point tr:nth-child(odd) { background-color: #f2f2f2; } -.performance .table-point tr:hover{ +#performance-tool .table-point tr:hover{ background-color: #e2e2e2; } -.performance .table-point td{ +#performance-tool .table-point td{ padding: 4px; text-align: right; } -.performance .table-more-info{ +#performance-tool .table-more-info{ border-top: solid #ccc 2px; color: #555; padding: 14px 10px; text-align: center; } -.performance code { +#performance-tool code { background-color: #2b542c; margin: 20px; padding: 20px; display: block; background:#F8F8FF; border:black dashed 1px; +} + +#performance-btn-close{ + position: absolute; + right: 0; + top: 0; + margin: 0px; + padding: 10px; + color: #ccc; + text-decoration: none; + border-radius: 100%; +} + +#performance-btn-close:hover{ + color: #e09a0f; } \ No newline at end of file diff --git a/src/Lib/Presenters/DisplayScript.js b/src/Lib/Presenters/DisplayScript.js new file mode 100644 index 0000000..60c6350 --- /dev/null +++ b/src/Lib/Presenters/DisplayScript.js @@ -0,0 +1,37 @@ +// Set web store +if (typeof(Storage) !== "undefined") +{ + if( ! localStorage.performanceToolDisplay) + localStorage.performanceToolDisplay = 'show'; + + if(localStorage.performanceToolDisplay == 'hide') + performanceDisplayToggle(false); +} + + +function performanceDisplayToggle(show) +{ + x = document.getElementById('hiddenContent'); + y = document.getElementById('performance-tool'); + z = document.getElementById('performance-btn-close'); + status = null; + if( x.style.display == 'none' || show == true) + { + x.style.display = 'block'; + y.style.height = 300; + y.style.maxWidth = 500; + z.innerHTML = '▼'; + status = 'show'; + } + else + { + x.style.display = 'none'; + y.style.height = 40; + y.style.maxWidth = 36; + z.innerHTML = '▲'; + status = 'hide'; + } + + if(typeof(Storage) !== "undefined" && show == null) + localStorage.performanceToolDisplay = status; +} \ No newline at end of file diff --git a/src/Lib/Presenters/WebPresenter.php b/src/Lib/Presenters/WebPresenter.php index a02f10c..f3ea13d 100644 --- a/src/Lib/Presenters/WebPresenter.php +++ b/src/Lib/Presenters/WebPresenter.php @@ -43,73 +43,81 @@ private function displayForWebAsHtml() include_once 'DisplayHtml.css'; echo ''; - echo '
' . $this->formatter->memoryToHuman($calculateTotalHolder->totalMemory) . ' Max memory ' . ini_get("memory_limit") . ' |
- ' . $this->formatter->timeToHuman($calculateTotalHolder->totalTime) . ' Max time ' . $textExecutionTime . ' on PHP ' . phpversion() . ' |
-
Label | -% | -Memory | -% | -Time | -
---|---|---|---|---|
' . $point->getLabel() . ' | ' - . '' . $this->calculate->calculatePercentage($point->getDifferenceMemory(), $calculateTotalHolder->totalMemory) . ' | ' - . '' . $this->formatter->memoryToHuman($point->getDifferenceMemory()) . ' | ' - . '' . $this->calculate->calculatePercentage($point->getDifferenceTime(), $calculateTotalHolder->totalTime) . ' | ' - . '' . $this->formatter->timeToHuman($point->getDifferenceTime()) . ' | ' - . '
Performance::point()
Final you can view the results with the results command:Performance::results()
Performance::point()
Final you can view the results with the results command:Performance::results()