From 64bd9053a25297f7a442ca831c7da5b44bd33f84 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 12 Jun 2024 17:54:40 +1000 Subject: Update LVGL to v9.1.0 --- lib/lvgl/docs/_static/css/custom.css | 22 ++++++++++++- lib/lvgl/docs/_static/img/js_calculator.gif | Bin 0 -> 531246 bytes lib/lvgl/docs/_static/img/js_code.png | Bin 0 -> 319158 bytes lib/lvgl/docs/_static/img/js_on_device.jpg | Bin 0 -> 193128 bytes lib/lvgl/docs/_static/img/js_widgets_demo.gif | Bin 0 -> 1309189 bytes lib/lvgl/docs/_static/js/custom.js | 43 ++++++++++++++++++++++++-- lib/lvgl/docs/_static/js/include_html.js | 29 +++++++++++++++++ 7 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 lib/lvgl/docs/_static/img/js_calculator.gif create mode 100644 lib/lvgl/docs/_static/img/js_code.png create mode 100644 lib/lvgl/docs/_static/img/js_on_device.jpg create mode 100644 lib/lvgl/docs/_static/img/js_widgets_demo.gif create mode 100644 lib/lvgl/docs/_static/js/include_html.js (limited to 'lib/lvgl/docs/_static') diff --git a/lib/lvgl/docs/_static/css/custom.css b/lib/lvgl/docs/_static/css/custom.css index 93a95be1..3ba92996 100644 --- a/lib/lvgl/docs/_static/css/custom.css +++ b/lib/lvgl/docs/_static/css/custom.css @@ -130,4 +130,24 @@ dl.cpp.unexpanded dd { } .expanded .lv-api-expansion-button::before { content: "\f0d7 \00a0"; -} \ No newline at end of file +} + +.wy-nav-content{ + padding: 1.618em 3.236em; + height: 100%; + max-width: 1920px; + margin: auto +} + +div.body { + min-width: 360px; + max-width: 1920px; +} + +.cpp-expr { + font-family: SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace; + color: #e74c3c; + padding: 2px 5px; + border: 1px solid #e1e4e5; + font-size: 75%; +} diff --git a/lib/lvgl/docs/_static/img/js_calculator.gif b/lib/lvgl/docs/_static/img/js_calculator.gif new file mode 100644 index 00000000..09a40e39 Binary files /dev/null and b/lib/lvgl/docs/_static/img/js_calculator.gif differ diff --git a/lib/lvgl/docs/_static/img/js_code.png b/lib/lvgl/docs/_static/img/js_code.png new file mode 100644 index 00000000..298a63f7 Binary files /dev/null and b/lib/lvgl/docs/_static/img/js_code.png differ diff --git a/lib/lvgl/docs/_static/img/js_on_device.jpg b/lib/lvgl/docs/_static/img/js_on_device.jpg new file mode 100644 index 00000000..6c98c915 Binary files /dev/null and b/lib/lvgl/docs/_static/img/js_on_device.jpg differ diff --git a/lib/lvgl/docs/_static/img/js_widgets_demo.gif b/lib/lvgl/docs/_static/img/js_widgets_demo.gif new file mode 100644 index 00000000..20583243 Binary files /dev/null and b/lib/lvgl/docs/_static/img/js_widgets_demo.gif differ 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); + }); +}) diff --git a/lib/lvgl/docs/_static/js/include_html.js b/lib/lvgl/docs/_static/js/include_html.js new file mode 100644 index 00000000..ad8b0717 --- /dev/null +++ b/lib/lvgl/docs/_static/js/include_html.js @@ -0,0 +1,29 @@ + +/*https://www.w3schools.com/howto/howto_html_include.asp*/ +function includeHTML() { + var z, i, elmnt, file, xhttp; + /*loop through a collection of all HTML elements:*/ + z = document.getElementsByTagName("*"); + for (i = 0; i < z.length; i++) { + elmnt = z[i]; + /*search for elements with a certain attribute:*/ + file = elmnt.getAttribute("include-html"); + if (file) { + /*make an HTTP request using the attribute value as the file name:*/ + xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function() { + if (this.readyState == 4) { + if (this.status == 200) {elmnt.innerHTML = this.responseText;} + if (this.status == 404) {elmnt.innerHTML = "Page not found.";} + /*remove the attribute, and call this function once more:*/ + elmnt.removeAttribute("w3-include-html"); + includeHTML(); + } + } + xhttp.open("GET", file, true); + xhttp.send(); + /*exit the function:*/ + return; + } + } +}; \ No newline at end of file -- cgit v1.2.3