Mercurial > hg > batmud > materials
changeset 45:6a9d1b8e3065
No longer show number of attempts, only whether combination is unstable or not.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 23 Aug 2021 17:27:54 +0300 |
parents | 281777e9a3a5 |
children | 2e2a05bb4b76 |
files | info.php |
diffstat | 1 files changed, 7 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/info.php Mon Aug 23 17:25:50 2021 +0300 +++ b/info.php Mon Aug 23 17:27:54 2021 +0300 @@ -125,16 +125,16 @@ $researchValue += $value; $slist = []; + $unstable = count($tmp) > 1; foreach ($tmp as $a => $b) { $slist[] = stGetMatLink($a, - $b." successful alloys (".$mat1." + ".$mat2." = ".$a.")". - (count($tmp) > 1 ? " [UNSTABLE]" : "") + $mat1." + ".$mat2." = ".$a. + ($unstable ? " [UNSTABLE]" : "") ); - // , " <sup>".$b."</sup>"); } echo - "<td class=\"".stGetReliabilityClass($value)."\">". + "<td class=\"".($unstable ? "unstable" : "")."\">". join(" <span class=\"alternate\">/</span> ", $slist)."</td>"; } else @@ -178,15 +178,6 @@ // Generate CSS and information snippets into temporary arrays $extraCSS = []; $extraInfo = []; -foreach ($matReliability as $chk) -{ - $tmps = "hits".$chk[0]."to".$chk[1]; - $extraCSS[] = " td.".$tmps.", .".$tmps." { ".$chk[3]." }"; - if (isset($chk[4])) - $extraCSS[] = " td.".$tmps." a { ".$chk[4]." }"; - - $extraInfo[] = "<span class=\"hits".$chk[0]."to".$chk[1]."\"><b>".$chk[2]."</b></span>"; -} // @@ -197,8 +188,9 @@ <style type=\"text/css\"> span.alternate { color: red; font-weight: bold; } ".implode("\n", $extraCSS)." - td.nohits, .nohits { background: black; } + td.nohits, .nohits { background: rgba(0,0,0,0.7); } td.impossible { background: black; color: #f00; text-align: center; } + td.unstable { background: rgba(255,0,0,0.3); } </style> "); @@ -216,7 +208,7 @@ " <li><b><a href=\"instructions.php\">Read this</a> for instructions on how you can collect and submit your own alloy research data.</b></li>\n". " <li>Only 2-material alloys are supported by this browser.</li>\n". " <li>There may be errors, and lots of combinations are not researched yet.</li>\n". - " <li>The cell colour reflects how \"reliable\" the information is: ".implode(", ", $extraInfo).".</li>\n"; + ""; if (isset($contributors) && count($contributors) > 0) {