From 54f0397817ec0cce5dcadea87f5ee8f3062602fb Mon Sep 17 00:00:00 2001 From: otoneko1102 Date: Sun, 15 Sep 2024 22:27:04 +0900 Subject: [PATCH] =?UTF-8?q?Footer=E3=82=92=E8=BF=BD=E5=8A=A0=E3=83=BB?= =?UTF-8?q?=E3=82=B3=E3=83=94=E3=83=BC=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=AE?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=83=BB=E8=BB=BD=E5=BE=AE=E3=81=AA=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 1 + index.html | 1 + main/blackjack/index.html | 1 + main/exchange/index.html | 1 + main/fake/index.html | 1 + main/ping/index.html | 1 + main/replace/index.html | 1 + main/tategaki/index.html | 1 + script.js | 56 ++++++++++++++++++++++++++++++++++++++- style.css | 23 +++++++++++++++- 10 files changed, 85 insertions(+), 2 deletions(-) diff --git a/404.html b/404.html index 4dd244f..88a528d 100644 --- a/404.html +++ b/404.html @@ -11,6 +11,7 @@

サイトマップ

+ \ No newline at end of file diff --git a/index.html b/index.html index 4dd244f..88a528d 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,7 @@

サイトマップ

+ \ No newline at end of file diff --git a/main/blackjack/index.html b/main/blackjack/index.html index 46130b4..90a0464 100644 --- a/main/blackjack/index.html +++ b/main/blackjack/index.html @@ -13,6 +13,7 @@

サイトマップ

+ \ No newline at end of file diff --git a/main/exchange/index.html b/main/exchange/index.html index 46130b4..90a0464 100644 --- a/main/exchange/index.html +++ b/main/exchange/index.html @@ -13,6 +13,7 @@

サイトマップ

+ \ No newline at end of file diff --git a/main/fake/index.html b/main/fake/index.html index 46130b4..90a0464 100644 --- a/main/fake/index.html +++ b/main/fake/index.html @@ -13,6 +13,7 @@

サイトマップ

+ \ No newline at end of file diff --git a/main/ping/index.html b/main/ping/index.html index 0b5daf4..80e6701 100644 --- a/main/ping/index.html +++ b/main/ping/index.html @@ -28,6 +28,7 @@

サイトステータス

サイトマップ

+ diff --git a/main/replace/index.html b/main/replace/index.html index 46130b4..90a0464 100644 --- a/main/replace/index.html +++ b/main/replace/index.html @@ -13,6 +13,7 @@

サイトマップ

+ \ No newline at end of file diff --git a/main/tategaki/index.html b/main/tategaki/index.html index 46130b4..90a0464 100644 --- a/main/tategaki/index.html +++ b/main/tategaki/index.html @@ -13,6 +13,7 @@

サイトマップ

+ \ No newline at end of file diff --git a/script.js b/script.js index f1bf272..b969eb6 100644 --- a/script.js +++ b/script.js @@ -21,7 +21,7 @@ document.addEventListener('DOMContentLoaded', () => { const now = `/${window.location.href.split('/').slice(3).join('/')}`; console.log(now); if ( - now === path || + now.includes(path) || ( now === '/' && path === '/index.html' @@ -44,3 +44,57 @@ document.addEventListener('DOMContentLoaded', () => { console.error('Error loading pages.txt:', error); }); }); + +const footer = document.querySelector('footer'); + +if (footer) { + const links = [ + { + url: 'https://dsc.gg/otolab', + textContent: 'Discord' + }, + { + url: 'https://otoneko.jp/', + textContent: 'Dev Homepage' + } + ]; + for (const link of links) { + const element = document.createElement('a'); + element.href = link.url; + element.textContent = link.textContent; + element.target = '_blank'; + footer.appendChild(element); + } + + const copyButton = document.createElement('button'); + const linkIcon = '🔗'; + const checkIcon = '✅'; + + copyButton.textContent = linkIcon; + copyButton.title = 'Copy'; + copyButton.style.position = 'absolute'; + copyButton.style.right = '10px'; + copyButton.style.bottom = '10px'; + copyButton.style.border = 'none'; + copyButton.style.background = 'transparent'; + copyButton.style.cursor = 'pointer'; + copyButton.style.marginLeft = '10px'; + copyButton.style.fontSize = '24px'; + + copyButton.addEventListener('click', () => { + const url = window.location.href; + navigator.clipboard.writeText(url).then(() => { + copyButton.textContent = checkIcon; + copyButton.title = 'Success!' + + setTimeout(() => { + copyButton.textContent = linkIcon; + copyButton.title = 'Copy' + }, 3000); + }).catch(err => { + console.error(err); + }); + }); + + footer.appendChild(copyButton); +} diff --git a/style.css b/style.css index 955d209..6bdf55f 100644 --- a/style.css +++ b/style.css @@ -8,6 +8,7 @@ body { font-family: 'Kiwi Maru', sans-serif; font-weight: bold; padding: 40px; + padding-bottom: 50px; box-sizing: border-box; margin: 0; } @@ -69,9 +70,29 @@ li:hover { a { text-decoration: none; - color: #333; + color: #004777; } a:hover { color: #007acc; } + +footer { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + height: 50px; + background-color: gainsboro; + text-align: left; + line-height: 50px; +} + +footer a { + margin: 20px; +} + +footer a::after { + content: ' >'; + font-size: 12px; +}