⌂Individuals & households
Sustrax Vita
Give your community a practical way to explore emissions from home energy and travel.
Try the personal calculator →View Vita embed code HTML + CSS + JavaScript
<style>
#sustrax_vita_iframe {
box-sizing: content-box; /* border sits outside the height, so the frame never runs short */
border: 10px solid #f0f0f0;
border-radius: 25px;
width: calc(100% - 20px); /* frame plus border fills the container exactly */
display: block;
height: 700px; /* starting height; the script sets the real height */
}
</style>
<iframe id="sustrax_vita_iframe" title="Sustrax Vita personal carbon calculator" src="https://iframe.app.sustrax.com/dashboard"></iframe>
<script>
(() => {
const APP_ORIGIN = "https://iframe.app.sustrax.com";
const iframe = document.getElementById("sustrax_vita_iframe");
window.addEventListener("message", (event) => {
if (event.origin !== APP_ORIGIN || event.source !== iframe.contentWindow) return;
const data = event.data;
if (!data || data.type !== "sustrax:resize" || typeof data.height !== "number") return;
/* Extra room on the taller results view so its drop-down menus are never cut off. */
const headroom = data.height > 900 ? 400 : 80;
iframe.style.height = Math.max(560, Math.min(Math.ceil(data.height) + headroom, 8000)) + "px";
iframe.setAttribute("scrolling", "no");
});
})();
</script>