Skip to content

UI/wsdot #348

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

Merged
merged 2 commits into from
May 21, 2024
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
3 changes: 3 additions & 0 deletions .cspell/custom-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ fontnik
Geoportal
geouri
GNIS
Haettenschweiler
inconsolata
JURDSG
JURFIPSDSG
JURNM
latlng
lato
lcov
mlat
mlon
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<body class="calcite-mode-auto">
<calcite-loader></calcite-loader>
<calcite-shell>
<h2 slot="header">%VITE_TITLE%</h2>
<h2 slot="header" id="header-title">%VITE_TITLE%</h2>
<calcite-shell-panel slot="panel-start">
<calcite-panel>
<calcite-block heading="SRMP" collapsible open>
Expand Down
107 changes: 57 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"clean": "git clean -dfx --exclude \"node_modules/**\" --exclude \".mailmap\"",
"dev": "vite",
"lint": "eslint . --fix",
"prettier": "prettier .",
"prettier": "prettier . --write",
"publish": "npm run build && node tools/publish.mjs",
"test": "vitest run",
"test:watch": "vitest",
Expand All @@ -38,7 +38,7 @@
"eslint-plugin-sonarjs": "^1.0.3",
"gh-pages": "^6.1.1",
"jsdom": "^24.0.0",
"lefthook": "^1.6.12",
"lefthook": "1.6.11",
"optionator": "^0.9.4",
"prettier": "^3.2.5",
"tsx": "^4.10.5",
Expand Down Expand Up @@ -71,6 +71,7 @@
"dependencies": {
"@esri/calcite-components": "^2.8.2",
"@types/geojson": "^7946.0.14",
"@wsdot/web-styles": "github:WSDOT-GIS/wsdot-web-styles",
"dms-conversion": "^3.1.3"
}
}
9 changes: 8 additions & 1 deletion src/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
:root {
font-family: "Lato", Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
}

#wsdot-logo {
fill: var(--wsdot-logo-green);
margin-right: 1rem;
}

html,
body,
Expand Down Expand Up @@ -29,4 +36,4 @@ calcite-loader {

calcite-rating {
margin-top: 0.25rem;
}
}
25 changes: 25 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@ import { createElcErrorAlert } from "./createElcErrorAlert";
import { emitErrorEvent } from "./errorEvent";
import type MapView from "@arcgis/core/views/MapView";
import "@esri/calcite-components";
import "@fontsource/inconsolata";
import "@fontsource/lato";

import("@wsdot/web-styles/css/wsdot-colors.css");

async function addWsdotLogo() {
const { default: svg } = await import(
"@wsdot/web-styles/images/wsdot-logo/wsdot-logo-black.svg?raw"
);
const dp = new DOMParser();
const wsdotLogo = dp.parseFromString(svg, "image/svg+xml").documentElement;

wsdotLogo.id = "wsdot-logo";

/* __PURE__ */ console.debug("wsdot logo", wsdotLogo);
const headingSelector = "h2";
const headingElement = document.body.querySelector(headingSelector);
if (!headingElement) {
throw new Error("Heading element not found");
}
headingElement.prepend(wsdotLogo);
return wsdotLogo;
}

void addWsdotLogo();

window.addEventListener("elc-error", (event) => {
/* __PURE__ */ console.group("elc-error event listener");
Expand Down
Loading