diff --git a/resources/icons/list.svg b/resources/icons/list.svg new file mode 100644 index 0000000..8ef19ee --- /dev/null +++ b/resources/icons/list.svg @@ -0,0 +1,13 @@ + +Created with Fabric.js 1.7.22 + + + + + + + + + + + \ No newline at end of file diff --git a/resources/index.html b/resources/index.html index ad5dcb7..38a7519 100644 --- a/resources/index.html +++ b/resources/index.html @@ -25,10 +25,12 @@
+
+
diff --git a/resources/js/index.js b/resources/js/index.js index 1b3d2f9..fd4a1a5 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -153,6 +153,29 @@ async function handleFavoriteInput() { } } +async function handleFavoriteList() { + const ipArr = await getFavIps() + const ipList = document.querySelector('#ipList') + + if (ipList.style.display === 'none') { + ipList.innerHTML = '' + + const list = ipList.appendChild( + document.createElement('ul') + ) + + for (const ip of ipArr) { + const elm = document.createElement('li') + elm.innerHTML = ip + list.appendChild(elm) + } + + ipList.style.display = 'block' + } else { + ipList.style.display = 'none' + } +} + async function setFavorite() { const ip = document.querySelector('#ip').value const ipArr = await getFavIps() diff --git a/resources/style/index.css b/resources/style/index.css index 31ed9a8..a92cb4d 100644 --- a/resources/style/index.css +++ b/resources/style/index.css @@ -11,6 +11,35 @@ body { filter: brightness(0.6); } +#ipList { + position: absolute; + z-index: 99; + padding: 10px; + transform: translate(150px, 370px); + background-color: #fff; + border-radius: 5px; + border: 1px solid #ccc; + width: 200px; +} + +#ipList ul { + list-style-type: none; + padding: 0; + margin: 0; + width: 100%; + height: 100%; + overflow: auto; +} + +#ipList li { + padding: 4px; + border-bottom: 1px solid #ccc; +} + +#ipList li:last-child { + border-bottom: none; +} + #controlBar { display: flex; flex-direction: row;