UNPKG

@digital-nature-ltd/carbon-lite

Version:

A simple tool to reduce the carbon usage of your website by blanking out the screen after a period of inactivity

1 lines 18.8 kB
{"version":3,"file":"CarbonLite.mjs","sources":["../src/CarbonLite.ts"],"sourcesContent":["import { CarbonLiteMessage } from './elements/CarbonLiteMessage'\r\nimport { CarbonLiteElement } from './elements/CarbonLiteElement'\r\nimport { CarbonLiteConfig } from './config/CarbonLiteConfig';\r\n\r\nexport default class CarbonLite {\r\n initialised: boolean = false;\r\n ignoreInteractions: boolean = false;\r\n\r\n // objects\r\n carbonLite: CarbonLiteElement = new CarbonLiteElement();\r\n carbonLiteMessage: CarbonLiteMessage = new CarbonLiteMessage();\r\n carbonLiteTimer: ReturnType<typeof setTimeout>|undefined = undefined;\r\n carbonLiteMessageTimer: ReturnType<typeof setTimeout>|undefined = undefined;\r\n\r\n // configurable\r\n config: CarbonLiteConfig = {\r\n message: 'CarbonLite is reducing the carbon usage of this site, one (dark) pixel at a time',\r\n timeout: 60000,\r\n backgroundColour: '#000',\r\n messageTimeout: 3000,\r\n messageColour: '#254137',\r\n messageColourHover: '#7DF799',\r\n messageBorderColour: '#7DF799',\r\n messageDropShadowColour: '#254137',\r\n debug: false\r\n };\r\n\r\n configure(configuration: object){\r\n this.config = {...this.config, ...configuration}\r\n }\r\n\r\n debug(message: string) {\r\n if (this.config.debug) {\r\n console.log(`CarbonLite: ${message}`)\r\n }\r\n }\r\n\r\n init(configuration: CarbonLiteConfig|null = null) {\r\n this.debug('initialising')\r\n if (this.initialised) {\r\n return\r\n }\r\n\r\n if (configuration) {\r\n this.configure(configuration)\r\n }\r\n\r\n if (this.config.message) {\r\n this.carbonLite.configure(this.config.message);\r\n }\r\n\r\n // add styles\r\n const style = document.createElement('style')\r\n style.innerHTML = this.generateStyles()\r\n document.head.appendChild(style)\r\n\r\n this.addEventListeners()\r\n this.restartTimer()\r\n this.initialised = true\r\n }\r\n\r\n generateStyles() {\r\n return `\r\n carbon-lite {\r\n position: fixed;\r\n bottom: 0;\r\n right: 0;\r\n top: 0;\r\n left: 0;\r\n color: ${this.config.messageColour};\r\n z-index: 2147483646;\r\n background: ${this.config.backgroundColour};\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n \r\n div {\r\n max-width: 80%;\r\n line-height: 1.5rem;\r\n }\r\n }\r\n \r\n carbon-lite-message {\r\n position: fixed;\r\n bottom: 100px;\r\n right: 100px;\r\n color: ${this.config.messageColour};\r\n text-align: center;\r\n z-index: 2147483647;\r\n opacity: 0.8;\r\n transition: opacity ${this.config.messageTimeout}ms ease-in;\r\n \r\n a {\r\n color: ${this.config.messageColour};\r\n background: ${this.config.backgroundColour};\r\n padding: 20px;\r\n display: block;\r\n text-decoration: none;\r\n border-radius: 20px;\r\n border: 3px solid ${this.config.backgroundColour};\r\n \r\n &:hover {\r\n color: ${this.config.messageColourHover};\r\n text-decoration: underline;\r\n border-color: ${this.config.messageBorderColour};\r\n filter: drop-shadow(0 0 0.75rem ${this.config.messageDropShadowColour});\r\n }\r\n \r\n svg {\r\n height: 100px;\r\n display: block;\r\n margin: 0 auto 20px auto;\r\n } \r\n }\r\n \r\n &.fading {\r\n opacity: 0;\r\n \r\n a {\r\n border-color: ${this.config.messageBorderColour};\r\n filter: drop-shadow(0 0 0.75rem ${this.config.messageDropShadowColour});\r\n }\r\n }\r\n \r\n &:hover {\r\n transition: opacity 0ms linear;\r\n }\r\n }\r\n `;\r\n }\r\n\r\n getIframes() {\r\n let iframes = document.getElementsByTagName(`iframe`);\r\n let iframesArray = [];\r\n for (let i = 0; i < iframes.length; i++) {\r\n iframesArray.push(iframes[i]);\r\n }\r\n return iframesArray;\r\n }\r\n\r\n addGlobalEventListener(eventType: string) {\r\n this.debug(`Adding listeners for event type ${eventType}`)\r\n let CarbonLite = this;\r\n\r\n let iframes = this.getIframes()\r\n\r\n iframes.forEach(iframe => {\r\n iframe.addEventListener(eventType, () => {\r\n CarbonLite.userInteracted()\r\n })\r\n })\r\n\r\n document.addEventListener(eventType, () => {\r\n CarbonLite.userInteracted()\r\n })\r\n }\r\n\r\n addEventListeners() {\r\n this.debug('adding event listeners')\r\n\r\n this.addGlobalEventListener('mousemove')\r\n this.addGlobalEventListener('click')\r\n this.addGlobalEventListener('scroll')\r\n this.addGlobalEventListener('keypress')\r\n this.addGlobalEventListener('resize')\r\n this.addVideoEventListeners()\r\n\r\n let CarbonLite = this;\r\n\r\n this.debug('adding message event listeners')\r\n\r\n CarbonLite.carbonLiteMessage.addEventListener(`mouseenter`, (event) => {\r\n CarbonLite.carbonLiteMessage.classList.remove('fading')\r\n if (CarbonLite.carbonLiteMessageTimer) {\r\n this.debug('clearing message fade out timer due to mouseenter')\r\n clearTimeout(CarbonLite.carbonLiteMessageTimer)\r\n }\r\n })\r\n\r\n CarbonLite.carbonLiteMessage.addEventListener(`mouseleave`, (event) => {\r\n CarbonLite.fadeOutMessage()\r\n })\r\n\r\n document.addEventListener('carbon-lite-suspend', function(event: CustomEvent) {\r\n CarbonLite.suspend()\r\n });\r\n\r\n document.addEventListener('carbon-lite-resume', function(event: CustomEvent) {\r\n CarbonLite.resume()\r\n });\r\n\r\n document.addEventListener('carbon-lite-open', (event: CustomEvent) => {\r\n if (event.detail?.interactionDelay) {\r\n this.debug(`ignoring interactions for ${event.detail.interactionDelay} ms`)\r\n CarbonLite.ignoreInteractions = true;\r\n let originalMessage = this.config.message;\r\n\r\n if (event.detail.tempMessage) {\r\n this.debug(`Adding a temporary message ${event.detail.tempMessage}`)\r\n this.carbonLite.configure(event.detail.tempMessage);\r\n }\r\n\r\n setTimeout(() => {\r\n this.debug('allowing interactions')\r\n CarbonLite.ignoreInteractions = false;\r\n if (originalMessage) {\r\n this.carbonLite.configure(originalMessage);\r\n }\r\n }, event.detail.interactionDelay)\r\n }\r\n\r\n CarbonLite.open()\r\n });\r\n }\r\n\r\n addVideoEventListeners() {\r\n this.debug('adding video event listeners')\r\n let CarbonLite = this;\r\n\r\n let videos = document.getElementsByTagName(`video`);\r\n\r\n for (let i = 0; i < videos.length; i++) {\r\n let videoEl = videos[i]\r\n\r\n videoEl.addEventListener(`playing`, () => {\r\n CarbonLite.debug('video playing')\r\n CarbonLite.suspend()\r\n })\r\n videoEl.addEventListener(`ended`, () => {\r\n CarbonLite.debug('video ended')\r\n CarbonLite.resume()\r\n })\r\n videoEl.addEventListener(`pause`, () => {\r\n CarbonLite.debug('video paused')\r\n CarbonLite.resume()\r\n })\r\n }\r\n }\r\n\r\n restartTimer() {\r\n clearTimeout(this.carbonLiteTimer)\r\n this.carbonLiteTimer = setTimeout(() => { this.open() }, this.config.timeout)\r\n }\r\n\r\n userInteracted() {\r\n if (this.ignoreInteractions) {\r\n this.debug('ignoring interactions')\r\n return\r\n }\r\n\r\n if (this.backgroundIsVisible()) {\r\n this.debug('user interacted - hiding')\r\n this.hideBackground()\r\n } else {\r\n this.debug('user interacted - restarting timer')\r\n this.restartTimer()\r\n }\r\n }\r\n\r\n suspend() {\r\n this.debug('suspending timer')\r\n\r\n if (this.backgroundIsVisible()) {\r\n document.body.removeChild(this.carbonLite)\r\n }\r\n if (this.messageIsVisible()) {\r\n document.body.removeChild(this.carbonLiteMessage)\r\n }\r\n clearTimeout(this.carbonLiteTimer)\r\n clearTimeout(this.carbonLiteMessageTimer)\r\n }\r\n\r\n backgroundIsVisible() {\r\n return this.carbonLite.parentNode === document.body\r\n }\r\n\r\n messageIsVisible() {\r\n return this.carbonLiteMessage.parentNode === document.body\r\n }\r\n\r\n resume() {\r\n this.debug('resuming timer')\r\n this.restartTimer()\r\n }\r\n\r\n hideBackground() {\r\n if (!this.carbonLite || !this.carbonLite.parentNode) {\r\n return;\r\n }\r\n\r\n document.body.removeChild(this.carbonLite)\r\n this.fadeOutMessage()\r\n }\r\n\r\n hideMessage() {\r\n let CarbonLite = this;\r\n\r\n if (!CarbonLite.carbonLiteMessage || !CarbonLite.carbonLiteMessage.parentNode) {\r\n return;\r\n }\r\n this.debug('hiding message')\r\n\r\n document.body.removeChild(CarbonLite.carbonLiteMessage)\r\n this.debug('clearing message fade out timer due to message being hidden')\r\n clearTimeout(CarbonLite.carbonLiteMessageTimer)\r\n CarbonLite.carbonLiteMessage.classList.remove('fading')\r\n\r\n this.debug('restarting timer after message has been hidden')\r\n CarbonLite.restartTimer()\r\n }\r\n\r\n fadeOutMessage() {\r\n this.debug('setting timer to fade out message')\r\n\r\n this.carbonLiteMessage.classList.add('fading')\r\n this.carbonLiteMessageTimer = setTimeout(() => { this.hideMessage() }, this.config.messageTimeout)\r\n }\r\n\r\n open() {\r\n this.debug('opening')\r\n let CarbonLite = this;\r\n\r\n if (CarbonLite.carbonLiteMessageTimer) {\r\n this.debug('clearing message fade out timer')\r\n clearTimeout(CarbonLite.carbonLiteMessageTimer)\r\n }\r\n\r\n document.body.appendChild(CarbonLite.carbonLite)\r\n document.body.appendChild(CarbonLite.carbonLiteMessage)\r\n }\r\n}\r\n"],"names":[],"mappings":";;;AAIc,MAAO,UAAU,CAAA;AAA/B,IAAA,WAAA,GAAA;QACI,IAAA,CAAA,WAAW,GAAY,KAAK;QAC5B,IAAA,CAAA,kBAAkB,GAAY,KAAK;;AAGnC,QAAA,IAAA,CAAA,UAAU,GAAsB,IAAI,iBAAiB,EAAE;AACvD,QAAA,IAAA,CAAA,iBAAiB,GAAsB,IAAI,iBAAiB,EAAE;QAC9D,IAAA,CAAA,eAAe,GAA4C,SAAS;QACpE,IAAA,CAAA,sBAAsB,GAA4C,SAAS;;AAG3E,QAAA,IAAA,CAAA,MAAM,GAAqB;AACvB,YAAA,OAAO,EAAE,kFAAkF;AAC3F,YAAA,OAAO,EAAE,KAAK;AACd,YAAA,gBAAgB,EAAE,MAAM;AACxB,YAAA,cAAc,EAAE,IAAI;AACpB,YAAA,aAAa,EAAE,SAAS;AACxB,YAAA,kBAAkB,EAAE,SAAS;AAC7B,YAAA,mBAAmB,EAAE,SAAS;AAC9B,YAAA,uBAAuB,EAAE,SAAS;AAClC,YAAA,KAAK,EAAE;SACV;IAiTL;AA/SI,IAAA,SAAS,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