Skip to content

Commit 7513de7

Browse files
committed
💄 add more visual distinction for reproduction sucess/failure
1 parent 45679dc commit 7513de7

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

‎security/site/main.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ function changeVersion() {
117117

118118
// bring this line back after fixing errors
119119
cveButtons.forEach(b => b.click());
120+
document.querySelectorAll('.cve').forEach(e => e.classList.remove('hide'));
120121
};
121122

122123
const versionParts = version.split('.');
@@ -129,6 +130,7 @@ function changeVersion() {
129130
else {
130131
error(`failed to load jQuery ${loadVersion}.`);
131132
}
133+
document.querySelectorAll('.cve').forEach(e => e.classList.add('hide'));
132134
};
133135

134136
s.src = `vendor/jquery-${loadVersion}.js`;
@@ -140,6 +142,7 @@ function changeVersion() {
140142
cve[1].triggerCount = 0;
141143
}
142144

145+
document.querySelectorAll('.cve__footer').forEach(e => e.classList.remove('cve__footer--error'));
143146
document.querySelectorAll('.cve__footer-status').forEach(e => e.textContent= '');
144147
document.querySelectorAll('.cve__footer-note').forEach(e => e.textContent= '');
145148
errors.innerHTML = '';
@@ -164,6 +167,7 @@ function updateCVE(cve) {
164167
let { triggerCount } = cve[1];
165168

166169
if(triggered){
170+
$relevantCVEFooter.addClass('cve__footer--error');
167171
triggerCount = Number.isInteger(triggerCount) ? triggerCount += 1 : 1;
168172
$footerStatus.text(`CVE triggered ${triggerCount} time${triggerCount > 1 ? 's' : ''}`);
169173
cve[1].triggerCount = triggerCount;

‎security/site/styles.css‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
--grey: #a6b7c8;
99
--header: #6f70ff;
1010
--mono: IBM Plex Mono, Consolas, monospace;
11-
--red: #ff6f70;
11+
--purp: #884a9c;
1212
--text: #ececec;
1313
}
1414

@@ -87,6 +87,7 @@ input[type="checkbox"] {
8787
color: var(--bg);
8888
font-size: 1.8rem;
8989
font-weight: bold;
90+
height: 2.7rem;
9091
padding: 1rem;
9192
text-align: center;
9293
&::selection {
@@ -105,10 +106,15 @@ input[type="checkbox"] {
105106

106107
.cve__footer {
107108
background-color: var(--blue-med);
109+
min-height: 2.7rem;
108110
padding: 1rem;
109111
text-align: center;
110112
}
111113

114+
.cve__footer--error {
115+
background-color: var(--purp);
116+
}
117+
112118
.cve__footer-status {
113119
display: inline-block;
114120
font-size: 1.8rem;
@@ -130,12 +136,15 @@ input[type="checkbox"] {
130136
}
131137

132138
#errors {
133-
background-color: var(--red);
134-
color: var(--bg);
139+
background-color: var(--purp);
135140

136141
p {
137-
border-bottom: solid .1rem var(--bg);
142+
border-bottom: solid .1rem var(--text);
138143
margin: 0;
139144
padding: 1rem;
140145
}
141146
}
147+
148+
.hide {
149+
display: none;
150+
}

0 commit comments

Comments
 (0)