Skip to content

Commit

Permalink
Merge pull request #208 from usnistgov/fix/ODD1001-Metadata-viewer
Browse files Browse the repository at this point in the history
Changed the colors in the JSON viewer
  • Loading branch information
RayPlante authored Sep 30, 2021
2 parents 3bdbfc5 + 79fdc22 commit 424c0d4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
4 changes: 2 additions & 2 deletions angular/src/app/landing/metadata/metadata.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<!-- JSON viewer with a thin grey border -->
<div class="json-viewer-box" id="json-viewer">
<!-- Header bar with JSON tree navigate buttons (left) and JSON export button (right)-->
<div class="json-viewer-header nist-blue-background">
<div class="json-viewer-header">
<!-- JSON export button (right alignment) -->
<div >
<a [href]='getDownloadURL()'>
<span class="json-export-btn" (click)="onjson()"><i class="faa faa-file-code-o" style="margin-right: 5px;"></i>Export</span></a>
<span class="json-export-btn nist-blue-background" (click)="onjson()"><i class="faa faa-file-code-o" style="margin-right: 10px;"></i>Export</span></a>
</div>

<!-- JSON tree navigate buttons (left alignment) -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.json-viewer-box {
/* margin-top: 1em; */
border: 1px solid rgb(151, 151, 151, .2);
border: 1px solid rgba(151, 151, 151, .2);
}

.more-info {
Expand All @@ -9,11 +8,11 @@

.json-viewer-header {
height: 1.8em;
background-color: rgb(216, 228, 240);
}

.json-level {
display:inline;
color: white;
}

.item-list {
Expand All @@ -22,21 +21,20 @@
margin-left: -30px;
height: 1.5em;
width: auto;
/* font-weight: bold; */
}

.item-list li{
display:inline;
padding:1px 10px 2px 10px;
border-radius: 3px;
margin-right:8px;
background-color: #4CAF50;
font-weight:400;
font-size: 14px;
}

.item-list li:hover {
background-color:#98d655;
background-color:#0b67a8;
color: #fff;
cursor: pointer;
}

Expand All @@ -55,11 +53,31 @@
border-radius: 3px;
margin: 3px 8px;
color: white;
background-color: #4CAF50;
font-weight:400;
font-size: 14px;
}

.json-export-btn:hover {
background-color:#98d655;
background-color:#5daae0;
}

// JSON viewer styling
$type-colors: (
string: #ff0000,
number: #00443d,
boolean: #551d4c,
date: #014966,

array: rgb(0, 0, 0),
object: rgb(0, 0, 0),
function: rgb(0, 0, 0),

'null': #fff,
undefined: #fff,
);

@each $type, $color in $type-colors {
::ng-deep .segment-type-#{$type} > .segment-main > .segment-value {
color: $color !important;
}
}
2 changes: 1 addition & 1 deletion angular/src/app/landing/metadata/metadata.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { GoogleAnalyticsService } from '../../shared/ga-service/google-analytics
@Component({
selector: 'metadata-detail',
templateUrl: './metadata.component.html',
styleUrls: ['./metadata.component.css']
styleUrls: ['./metadata.component.scss']
})
export class MetadataComponent implements OnChanges {
nerdmRecord: any = {};
Expand Down

0 comments on commit 424c0d4

Please sign in to comment.