-
Notifications
You must be signed in to change notification settings - Fork 0
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
Styled header/subtitles and "sensors" #27
Conversation
I love the styling on the metrics (top three screenshots). I'm sending the images to the client for feedback on text. For the sensors illustration, I like option 1 but think the line brightness and weight (as perceived on my laptop) clash a bit with the rest of the graphic outside. Can you reduce the opacity or otherwise de-emphasize the lines? |
@ajrobbins Sounds good! I'll keep working on option 1 per your suggestions and post a screenshot of it here for more feedback. |
@ajrobbins Is this any better? |
Taking a look at this! |
It looks like the Is there some good way to have it hidden initially and then to unhide it when writing data to the document here?: https://github.com/azavea/pwd-river-dispatches/blob/develop/usgs-details.html#L211 |
// Sensor lacks metrics, so giving its div.container a name of "sensor" | ||
// in order to apply some specific styles. | ||
var container = document.getElementsByClassName('container'); | ||
container[0].setAttribute('name', 'sensor'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it works well! I was able to load and unload the different spokes and this shows up only when the sensor spoke's selected.
I wonder if it'd make sense to give the container
div above a unique string like sensor-data-container
for its id
attribute so that we could use something like
var container = documentGetElementById('sensor-data-container');
container.setAttribute('name', 'sensor');
to get the single element and then not have to use the array index here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense! I'm not super sure how to go about doing that (my javascript skills are that I can mostly read it, haha) so the revisions to the commit I put up won't include that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! I tested this out and it works as is.
usgs-details.html
Outdated
@@ -239,14 +292,21 @@ | |||
xhr.send(); | |||
} | |||
|
|||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are few extra lines of whitespace here, plus one on 309. We usually try to avoid committing extra whitespace, so it may be worth dropping the extra lines in a fixup commit.
Primary, backup, and fallback value's displaying correctly with the new styles! |
@kellyi I hopefully got rid of all of the areas with unnecessary whitespace. To hide the white line unless sensor data has loaded, I'm checking whether or the div has any content yet using |
Victoria likes the design and language on the metric displays! Called them "legible and simple". Now I'm just checking with her on the sensor illustration. |
Accidentally hit the "close and comment" button instead of "comment", apologies. |
Victoria says the illustration is "spot-on". Nice job, @alexelash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. Nice job with this!
Overview
This PR addresses the need to style metrics, headers/subtitles, and the "sensors" page suggested in issue #24.
To do make these changes, I also added an
assets/
folder that containsLeague Gothic Condensed
(an open source typeface that resembles the one used elsewhere in the application) and two illustration options for the Sensors page.Screenshots
Turbidity with reading from the Schuylkill
Turbidity with reading from the Delaware
Turbidity with no sensor reading
Sensor (option 1)
Sensor (option 2)
Notes
if(!metric)
statement withinwindow.onload
in order to give the page's.container
a class name of "sensor". Please let me know if this was a bad way to do this!@font-face
declaration.Testing
server
.usgs
from thePRIMARY_SENSOR_URL
constant, then refresh the app. visit the spokes and verify that you see the values, headers, and subscripts from the Delaware River..usgs
from theBACKUP_SENSOR_URL
const, refresh the app, then visit the spokes again. Verify that you see the fallback values and text.background-image: url("assets/Sensor_Illustration_opt2.png");
tobackground-image: url("assets/Sensor_Illustration_opt1.png");
`