diff --git a/mods/scroll-to-top/arrow.svg b/mods/scroll-to-top/arrow.svg new file mode 100644 index 0000000..4662f60 --- /dev/null +++ b/mods/scroll-to-top/arrow.svg @@ -0,0 +1 @@ + diff --git a/mods/scroll-to-top/mod.js b/mods/scroll-to-top/mod.js index 11c9316..66c82f4 100644 --- a/mods/scroll-to-top/mod.js +++ b/mods/scroll-to-top/mod.js @@ -7,7 +7,9 @@ 'use strict'; -const { createElement } = require('../../pkg/helpers.js'); +const { createElement } = require('../../pkg/helpers.js'), + path = require('path'), + fs = require('fs-extra'); module.exports = { id: '0a958f5a-17c5-48b5-8713-16190cae1959', @@ -49,8 +51,14 @@ module.exports = { const $container = document.createElement('div'); const $help = document.querySelector('.notion-help-button'); const $scroll = createElement( - '
' // 🠙; + '' ); + + (async () => { + $scroll.innerHTML = await fs.readFile( + path.resolve(`${__dirname}/arrow.svg`) // 🠙; + ) + })(); $container.className = 'bottom-right-buttons'; $help.after($container); diff --git a/mods/scroll-to-top/styles.css b/mods/scroll-to-top/styles.css index 044e7f8..ab76d19 100644 --- a/mods/scroll-to-top/styles.css +++ b/mods/scroll-to-top/styles.css @@ -53,3 +53,8 @@ transition-property: opacity, transform, visibility; transition-delay: 0, 0, 700ms; } + +.notion-scroll-button > svg { + width: 18px; + height: 18px; +}