From 409e647646fb1782a4e9ea9ce3ddb48c69b794bd Mon Sep 17 00:00:00 2001 From: Leo <95978312+yaefdb@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:35:06 +0800 Subject: [PATCH] update --- consumerWebsite/public/css/api.css | 25 +++++- consumerWebsite/public/js/learnmore.js | 74 +++++++++++----- consumerWebsite/views/api.ejs | 114 ++++++++++++++++--------- consumerWebsite/views/contact.ejs | 1 + consumerWebsite/views/learnmore.ejs | 2 +- consumerWebsite/views/profile.ejs | 5 +- consumerWebsite/views/top.ejs | 3 - 7 files changed, 152 insertions(+), 72 deletions(-) diff --git a/consumerWebsite/public/css/api.css b/consumerWebsite/public/css/api.css index d3d44b1..f5d527e 100644 --- a/consumerWebsite/public/css/api.css +++ b/consumerWebsite/public/css/api.css @@ -523,4 +523,27 @@ body.one-content-column-version .content thead { .cf:before, .cf:after { content: ""; display: block; } .cf:after { clear: both; } -.ie6 .cf { zoom: 1 } \ No newline at end of file +.ie6 .cf { zoom: 1 } + + + +.generate-key-button { + float: right; /* Align the button to the right */ + margin-right: 85%; + margin-top: -40px; /* Adjust the margin-top value based on your layout */ + /* Add any additional styling you want for the button */ +} + +#content-get-api .generate-key-button { + background-color: #4caf50; /* Green background color */ + color: white; /* White text color */ + padding: 5px 11px; /* Padding for the button */ + border: none; /* Remove button border */ + border-radius: 5px; /* Add border-radius for rounded corners */ + cursor: pointer; /* Add pointer cursor on hover */ + font-size: 14px; /* Font size */ +} + +#content-get-api .generate-key-button:hover { + background-color: #45a049; /* Darker green on hover */ +} \ No newline at end of file diff --git a/consumerWebsite/public/js/learnmore.js b/consumerWebsite/public/js/learnmore.js index c965824..2e4a440 100644 --- a/consumerWebsite/public/js/learnmore.js +++ b/consumerWebsite/public/js/learnmore.js @@ -1,28 +1,60 @@ document.addEventListener("DOMContentLoaded", function () { function updateAdditionalInfo(region) { const infoContainer = document.getElementById("additional-info"); - // Replace the following with actual data retrieval based on the region - const aqi = "15"; - const temperature = "25°C"; - const humidity = "60%"; +// Replace the following with actual data retrieval based on the region +const aqi = "15"; +const temperature = "25°C"; +const humidity = "60%"; +const pm25 = "10"; +const pm10 = "20"; +const so2 = "5"; +const o3 = "35"; +const co = "0.5"; +const no2 = "15"; + +infoContainer.innerHTML = ` +
+

Additional Information - ${region}

+ +
+ Air Quality Index: + ${aqi} +
+
+ Temperature: + ${temperature} +
+
+ Humidity: + ${humidity} +
+
+ PM2.5: + ${pm25} +
+
+ PM10: + ${pm10} +
+
+ SO2: + ${so2} +
+
+ O3: + ${o3} +
+
+ CO: + ${co} +
+
+ NO2: + ${no2} +
+
+`; - infoContainer.innerHTML = ` -
-

Additional Information - ${region}

-
- Air Quality Index: - ${aqi} -
-
- Temperature: - ${temperature} -
-
- Humidity: - ${humidity} -
-
- `; // Remove the 'active' class from all info-box elements const infoBoxes = document.querySelectorAll('.info-box'); diff --git a/consumerWebsite/views/api.ejs b/consumerWebsite/views/api.ejs index aa5ade5..fd19cb7 100644 --- a/consumerWebsite/views/api.ejs +++ b/consumerWebsite/views/api.ejs @@ -5,8 +5,8 @@ https://github.com/ticlekiwi/API-Documentation-HTML-Template !--> - <%- include('top') %> - +<%- include('top') %> +
@@ -39,8 +39,8 @@ -
- - - - - - - - - - - - - - - - - -

Errors

@@ -360,6 +358,38 @@

+
+
+

API Keys

+ +

+ You can generate API Keys here: +

+ + + + + + + + + + + + + + + + + + + +
NamePublic KeyPrivate KeyKey TypeCreated
API KeyGR234-We34greR-234-fEGType2024-01-22
+
+
+ + + diff --git a/consumerWebsite/views/contact.ejs b/consumerWebsite/views/contact.ejs index f93c0f2..edc98f5 100644 --- a/consumerWebsite/views/contact.ejs +++ b/consumerWebsite/views/contact.ejs @@ -1,4 +1,5 @@ <%- include('top') %> +
diff --git a/consumerWebsite/views/learnmore.ejs b/consumerWebsite/views/learnmore.ejs index 9be0da4..f5e89e8 100644 --- a/consumerWebsite/views/learnmore.ejs +++ b/consumerWebsite/views/learnmore.ejs @@ -1,4 +1,5 @@ <%- include('top') %> +

@@ -38,5 +39,4 @@

- <%- include('bot') %> diff --git a/consumerWebsite/views/profile.ejs b/consumerWebsite/views/profile.ejs index c779825..4163961 100644 --- a/consumerWebsite/views/profile.ejs +++ b/consumerWebsite/views/profile.ejs @@ -1,8 +1,5 @@ <%- include('top') %> - +
diff --git a/consumerWebsite/views/top.ejs b/consumerWebsite/views/top.ejs index 59cc921..74ab3e8 100644 --- a/consumerWebsite/views/top.ejs +++ b/consumerWebsite/views/top.ejs @@ -21,9 +21,6 @@ - - -