summaryrefslogtreecommitdiff
path: root/lib/lvgl/docs/_static/js/custom.js
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-06-12 17:54:40 +1000
committerjacqueline <me@jacqueline.id.au>2024-06-12 17:54:40 +1000
commit64bd9053a25297f7a442ca831c7da5b44bd33f84 (patch)
treea90c6cad25a12028302ab1a5334510fba0229bae /lib/lvgl/docs/_static/js/custom.js
parent611176ed667c4ed7ee9f609e958f9404f4aee91d (diff)
downloadtangara-fw-64bd9053a25297f7a442ca831c7da5b44bd33f84.tar.gz
Update LVGL to v9.1.0
Diffstat (limited to 'lib/lvgl/docs/_static/js/custom.js')
-rw-r--r--lib/lvgl/docs/_static/js/custom.js43
1 files changed, 41 insertions, 2 deletions
diff --git a/lib/lvgl/docs/_static/js/custom.js b/lib/lvgl/docs/_static/js/custom.js
index d16e00b0..fa1327d6 100644
--- a/lib/lvgl/docs/_static/js/custom.js
+++ b/lib/lvgl/docs/_static/js/custom.js
@@ -12,7 +12,46 @@ document.addEventListener('DOMContentLoaded', (event) => {
cppListing.classList.toggle("unexpanded");
cppListing.classList.toggle("expanded");
});
-
+
dt.insertBefore(button, dt.firstChild);
});
-}) \ No newline at end of file
+
+ fetch('https://lvgl.io/home-banner.txt') // Replace with your URL
+ .then(response => {
+ // Check if the request was successful
+ if (!response.ok) {
+ throw new Error(`HTTP error! Status: ${response.status}`);
+ }
+ // Read the response as text
+ return response.text();
+ })
+ .then(data => {
+
+ const section = document.querySelector('.wy-nav-content-wrap');
+
+ //Add a div
+ const newDiv = document.createElement('div');
+ newDiv.style="background-image: linear-gradient(45deg, black, #5e5e5e); color: white; border-bottom: 4px solid #e10010; padding-inline:3em"
+ section.insertBefore(newDiv, section.firstChild);
+
+
+ //Add a p to the div
+ const newP = document.createElement('p');
+ newP.style="padding-block:12px; margin-block:0px;align-content: center;align-items: center;"
+ newP.innerHTML = data
+ newDiv.insertBefore(newP, newDiv.firstChild);
+
+ const children = newDiv.querySelectorAll('*');
+
+ // Iterate over each child
+ children.forEach(child => {
+ // Check if the child has an id
+ if (child.id) {
+ // Prepend 'docs-' to the id
+ child.id = 'docs-' + child.id;
+ }
+ })
+ }) .catch(error => {
+ console.error('Fetch error: ' + error.message);
+ });
+})