diff options
| author | Kevin J Hoerr <kjhoerr@protonmail.com> | 2020-02-22 17:36:13 -0500 |
|---|---|---|
| committer | Kevin J Hoerr <kjhoerr@protonmail.com> | 2020-02-22 17:36:13 -0500 |
| commit | 5fa41a15f8f41c7f04d05a487ddb01930639f393 (patch) | |
| tree | 0bb71b2d5c65cb2737713ebf651c7ace499b221d | |
| parent | cbcbeb40afa10272003657eb06376a7e8663856c (diff) | |
| download | ao-coverage-5fa41a15f8f41c7f04d05a487ddb01930639f393.tar.gz ao-coverage-5fa41a15f8f41c7f04d05a487ddb01930639f393.tar.bz2 ao-coverage-5fa41a15f8f41c7f04d05a487ddb01930639f393.zip | |
#2 Add CSS, favicon for landing page
| -rw-r--r-- | public/static/favicon.ico | bin | 0 -> 14225 bytes | |||
| -rw-r--r-- | public/static/index.css | 59 | ||||
| -rw-r--r-- | public/templates/index.html.template | 23 | ||||
| -rw-r--r-- | src/routes.ts | 9 |
4 files changed, 89 insertions, 2 deletions
diff --git a/public/static/favicon.ico b/public/static/favicon.ico Binary files differnew file mode 100644 index 0000000..24bebc8 --- /dev/null +++ b/public/static/favicon.ico diff --git a/public/static/index.css b/public/static/index.css new file mode 100644 index 0000000..df05342 --- /dev/null +++ b/public/static/index.css @@ -0,0 +1,59 @@ +body { + margin: 0; +} + +div#top-half { + background-color: #c6e3a4; + padding: 8px; +} +div#bottom-half { + padding: 12px; +} + +div#container { + margin: 0 auto; + width: 600px; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; +} + +div#logo { + width: 256px; + height: 256px; + margin: 0 auto; + pointer-events: none; + user-select: none; +} + +div#content { + padding-bottom: 8px; +} + +div#container h1 { + text-align: center; + font-weight: 500; + margin: 12px 0 0; +} + +div#content p { + text-align: justify; + padding: 0 10px; +} + +.code-container { + text-align: center; + margin: 24px 0; +} +.code { + background-color: #e8ebf4; + color: #000; + font-family: 'Courier New', Courier, monospace; + font-size: inherit; + padding: 6px 14px; + border: 0px solid #e8ebf4; + border-radius: 4px; + left: auto; + right: auto; +} +.code.shell:before { + content: "$ "; +}
\ No newline at end of file diff --git a/public/templates/index.html.template b/public/templates/index.html.template index 0dfbee7..53095b3 100644 --- a/public/templates/index.html.template +++ b/public/templates/index.html.template @@ -6,11 +6,30 @@ <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta http-equiv="x-ua-compatible" content="ie=edge" /> <title>AO Coverage: Simple code coverage tracking</title> + <link rel="stylesheet" type="text/css" href="/static/index.css" /> </head> <body> - <div id="content"> - <span class="code">bash <(curl -s {{TARGET_URL}}/bash)</span> + <div id="top-half"> + <div id="container"> + <div id="logo"><img src="/favicon.ico" alt="logo" /></div> + <h1 id="tagline">Simple Code Coverage Tracking</h1> + </div> + </div> + <div id="bottom-half"> + <div id="container"> + <div id="content"> + <p>AO Coverage is a simple code coverage tracking tool that stores your reports for public visibility and + provides a coverage badge for your projects. That’s all there is to it.</p> + <p>If you have a coverage token, uploading a report is as easy as adding this line to your CI pipeline:</p> + <div class="code-container"> + <span class="shell code">bash <(curl -s {{TARGET_URL}}/bash)</span> + </div> + <p>Visit <a href="https://git.submelon.dev/kjhoerr/ao-coverage/wiki/Home" target="_blank">the AO Coverage + documentation</a> to learn more about uploading reports and discover more information about how AO Coverage + works.</p> + </div> + </div> </div> </body> diff --git a/src/routes.ts b/src/routes.ts index 92d3542..cacbf15 100644 --- a/src/routes.ts +++ b/src/routes.ts @@ -67,6 +67,15 @@ export default (metadata: Metadata): Router => { }) ); + // serve static files + // favicon should be served directly on root + router.get("/favicon.ico", (_, res) => { + res.sendFile(path.join(__dirname, "..", "public", "static", "favicon.ico")); + }); + router.use( + "/static", express.static(path.join(__dirname, "..", "public", "static")) + ); + // Upload HTML file router.post("/v1/:org/:repo/:branch/:commit.html", (req, res) => { const { org, repo, branch, commit } = req.params; |
