Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crux redesign #2731

Merged
merged 4 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 133 additions & 85 deletions www/assets/css/pagestyle2.css
Original file line number Diff line number Diff line change
Expand Up @@ -5599,8 +5599,8 @@ table.details td.reqMime {
flex-wrap: wrap;
justify-content: space-between;
width: 100%;
margin: 1rem 0 3rem 0;
padding: 0 0 3rem;
margin: 1rem 0 1rem 0;
padding: 0;
gap: 3rem;
text-align: center;
}
Expand Down Expand Up @@ -5704,110 +5704,159 @@ table.details td.reqMime {
}

.cruxbars {
margin: 0;
z-index: 1;
padding: inherit;
text-align: left;
display: flex;
justify-content: flex-start;
gap: 2rem;
flex-flow: row wrap;
justify-content: space-between;
}

.cruxlabel .legend {
font-size: smaller;
font-weight: normal;
.cruxbars div.crux_metric {
flex: 1 0 30%;
margin: 0;
}

.cruxlabel .fvarrow {
color: #1a1a1a;
@media (max-width: 80em) {
.cruxbars div.crux_metric {
flex: 1 0 40%;
}
}

/* these are for crux embeds */

.cruxembed .cruxbars {
display: grid;
grid-template-columns: 1fr;
gap: 1.5rem;
.crux_subhed {
display: flex;
justify-content: space-between;
padding-bottom: .5em;
margin-bottom: 1.5em;
border-bottom: 1px solid #eee;
gap: 2em;
}

@media (min-width: 30em) {
.cruxembed .cruxbars {
grid-template-columns: 1fr 1fr;
}
.crux_subhed p {
font-size: .9em;
margin: 0;
line-height: 1.4;
color: #444;
}

@media (min-width: 60em) {
.cruxembed .cruxbars {
grid-template-columns: repeat(8, 1fr);
.crux_subhed p.crux_subhed_cite {
font-size: .9em;
color: #8B8B8B;
font-style: normal;
}
@media (max-width: 50em) {
.cruxbars div.crux_metric {
flex: 1 0 100%;
}

.cruxembed .cruxbars svg {
grid-column: span 2;
.crux_subhed {
display: block;
}

.cruxembed .cruxbars svg:last-child:nth-child(4n - 1) {
grid-column-end: -3;
}

.cruxembed .cruxbars svg:nth-last-child(2):nth-child(4n + 1) {
grid-column-end: 5;
.crux_subhed p {
margin: .5em 0;
}
}
h4.crux_metric_title {
font-size: .9em;
font-weight: 900;
color: #686868;
white-space: nowrap;
margin: 0;
}

.summary-container .crux h3 {
font-size: 1.2rem;
.crux_metric_value {
border: 0 solid #fff;
display:block;
padding: 0 0 0;
margin: 0;
font-size: 2.2em;
font-weight: 900;
border-top-width: 0;
color: #2a3c64;
margin: 2em 0 0;
-webkit-text-stroke: 0.04em currentColor;
line-height: 1;
}

.summary-container .crux h3 em {
display: block;
font-size: 0.7em;
margin: 0.4em 0;
line-height: 1.5;
.crux_metric_value-good {
color: #6ca71a;
}

.cruxembed .crux h3 {
margin-top: 2rem;
.crux_metric_value-fair {
color: #d48e08;
}

.crux_legends {
display: inline-flex;
gap: 0.5rem;
border: 1px solid #eee;
padding: 0.7em 1.5em 0;
border-radius: 1rem;
margin: 1em 0;
.crux_metric_value-poor {
color: #d02424;
}

.crux_legends strong {
background: none;
border: 0px solid #fff;
font-weight: 700;
color: #686868;
font-size: 0.9em;
min-height: 2em;
.crux_metric_value em {
font-size: .5em;
font-weight: 200;
text-transform: capitalize;
font-style: normal;
}

.summary-container .crux_legends {
.crux_metric_desc {
font-size: .75em;
margin: 0 0 .8em;
color: #666;
}
.crux_bars {
display: flex;
position: relative;
}
.crux_bars:before,
.crux_bars:after {
content: "";
width: 0;
height: 0;
border-top: 10px solid #fff;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
margin-top: -4px;
position: absolute;
left: calc(75% - 5px);
}
.crux_bars:after {
border-top: 8px solid #2a3b64;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
left: calc(75% - 3px);
margin-top: -5px;
}
.crux_bars li {
flex: 0 0 0;
color: #fff;
padding: .2em 0em;
box-sizing: border-box;
font-size: .8em;
overflow: hidden;
text-indent: 1em;
}
.crux_bars li.crux_bars-hidelabel {
text-indent: -999px;
}
.crux_bars-good {
background:#6ca71a;
}
.crux_bars-fair {
background: #d48e08;
}
.crux_bars-poor {
background: #d02424;
}
.crux details.metrics_shown {
position: relative;
top: auto;
right: auto;
left: auto;
display: inline-block;
padding: 0.3em 1em;
margin: 0;
margin: .5em 0 0;
}

.cruxembed .crux .legend {
font-size: smaller;
font-weight: normal;
margin: 0 0 1em;
display: block;
text-align: right;
.crux details.metrics_shown span.units {
color: inherit;
}

.cruxembed .crux .fvarrow {
color: #1072ba;
.crux_diff {
font-size: .9em;
font-style: normal;
margin: .5em 0 0;
color: #666;
}

.cruxembed .crux .rvarrow {
color: #5dbbe8;
.crux_diff span.units {
font-weight: 500;
padding-left: 0;
}
.crux details.metrics_shown {
margin: 2em 0 0;
}

/* end vitals page styles */
Expand Down Expand Up @@ -6575,8 +6624,7 @@ table#tableResults td.ok {
color: #d48e08;
}

table.pretty td.poor,
table#tableResults td.poor {
table.pretty td.poor, table#tableResults td {
color: #d02424;
}

Expand Down
10 changes: 4 additions & 6 deletions www/details.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,12 @@ function createForm($formName, $btnText, $id, $owner, $secret)
]);
}

if (isset($testRunResults)) {
if (isset($testRunResults) && !$cached) {
echo '<div class="cruxembed">';
require_once(INCLUDES_PATH . '/include/CrUX.php');
if ($cached) {
InsertCruxHTML(null, $testRunResults);
} else {
InsertCruxHTML($testRunResults, null);
}

InsertCruxHTML($testRunResults, null);

echo '</div>';
}
?>
Expand Down
Loading