commit 9e38aad292b1f335c54be5cb24ece60258a1a8a1 Author: Korbs Date: Thu Aug 29 17:14:50 2024 -0400 Init diff --git a/backgrounds/19906181/background.jpg b/backgrounds/19906181/background.jpg new file mode 100644 index 0000000..e01fbb0 Binary files /dev/null and b/backgrounds/19906181/background.jpg differ diff --git a/backgrounds/19906181/credit.txt b/backgrounds/19906181/credit.txt new file mode 100644 index 0000000..72f7dbe --- /dev/null +++ b/backgrounds/19906181/credit.txt @@ -0,0 +1,2 @@ +Swiss Alps in Winter. Shot by Susanne Jutzeler. +https://www.pexels.com/photo/swiss-alps-in-winter-19906181/ \ No newline at end of file diff --git a/backgrounds/27588471/background.jpg b/backgrounds/27588471/background.jpg new file mode 100644 index 0000000..1fdc14b Binary files /dev/null and b/backgrounds/27588471/background.jpg differ diff --git a/backgrounds/27588471/credit.txt b/backgrounds/27588471/credit.txt new file mode 100644 index 0000000..3666c43 --- /dev/null +++ b/backgrounds/27588471/credit.txt @@ -0,0 +1,2 @@ +Dresden, SN, Deutschland. Shot by Wolfgang Weiser. +https://www.pexels.com/photo/elbsandsteingebirge-27588471/ \ No newline at end of file diff --git a/backgrounds/27960528/background.jpg b/backgrounds/27960528/background.jpg new file mode 100644 index 0000000..baeb9cd Binary files /dev/null and b/backgrounds/27960528/background.jpg differ diff --git a/backgrounds/27960528/credit.txt b/backgrounds/27960528/credit.txt new file mode 100644 index 0000000..2205ef3 --- /dev/null +++ b/backgrounds/27960528/credit.txt @@ -0,0 +1,2 @@ +Maderia, Portugal. Shot by Artem Stoliar. +https://www.pexels.com/photo/sea-landscape-beach-water-27960528/ \ No newline at end of file diff --git a/functions/clock.js b/functions/clock.js new file mode 100644 index 0000000..b0c8b13 --- /dev/null +++ b/functions/clock.js @@ -0,0 +1,8 @@ +InputTime() +function InputTime() { + let currentTime = new Date(); + let options = { timeStyle: 'short', hour12: true }; + let timeString = currentTime.toLocaleTimeString('en-US', options); + document.querySelector('#main-clock').innerHTML = `${timeString}` +} +setInterval(InputTime, 1000); \ No newline at end of file diff --git a/functions/init.js b/functions/init.js new file mode 100644 index 0000000..f649779 --- /dev/null +++ b/functions/init.js @@ -0,0 +1,19 @@ +// Init +/// Toggles +if (localStorage.getItem('enable-search') === null) { + localStorage.setItem('enable-search', true) +} +if (localStorage.getItem('enable-top-sites') === null) { + localStorage.setItem('enable-top-sites', true) +} +if (localStorage.getItem('enable-clock') === null) { + localStorage.setItem('enable-clock', true) +} +if (localStorage.getItem('enable-wallpaper-credits') === null) { + localStorage.setItem('enable-wallpaper-credits', true) +} + +/// Search Engine +if (localStorage.getItem('search-engine') === null) { + localStorage.setItem('search-engine', "https://duckduckgo.com/?t=h_&q=") +} \ No newline at end of file diff --git a/functions/toggles.js b/functions/toggles.js new file mode 100644 index 0000000..de2b95b --- /dev/null +++ b/functions/toggles.js @@ -0,0 +1,51 @@ +// Open Settings +function ShowSettings() { + var SettingsPopup = document.querySelector('.toolbar-popups > #settings-popup') + if (SettingsPopup.style.display === "block") { + SettingsPopup.style.display = "none"; + } else { + SettingsPopup.style.display = "block"; + } +} + +// Search +function ToggleOnSearch() { localStorage.setItem('enable-search', "true"); location.href = '/' } +function ToggleOffSearch() { localStorage.setItem('enable-search', "false"); location.href = '/' } + +if (localStorage.getItem('enable-search') === "true") { + document.getElementById('search-btn-toggle').setAttribute('onclick', 'ToggleOffSearch()') + document.querySelector('.search').style.display = 'block' + document.querySelector('#search-toggle-disabled').style.display = 'none' +} else { + document.getElementById('search-btn-toggle').setAttribute('onclick', 'ToggleOnSearch()') + document.querySelector('.search').style.display = 'none' + document.querySelector('#search-toggle-enabled').style.display = 'none' +} + +// Clock +function ToggleOnClock() { localStorage.setItem('enable-clock', "true"); location.href = '/' } +function ToggleOffClock() { localStorage.setItem('enable-clock', "false"); location.href = '/' } + +if (localStorage.getItem('enable-clock') === "true") { + document.getElementById('main-clock-btn-toggle').setAttribute('onclick', 'ToggleOffClock()') + document.getElementById('main-clock').style.display = 'block' + document.getElementById('main-clock-toggle-disabled').style.display = 'none' +} else { + document.getElementById('main-clock-btn-toggle').setAttribute('onclick', 'ToggleOnClock()') + document.getElementById('main-clock').style.display = 'none' + document.getElementById('main-clock-toggle-enabled').style.display = 'none' +} + +// Wallpaper Credits +function ToggleOnWallpapercredits() { localStorage.setItem('enable-wallpaper-credits', "true"); location.href = '/' } +function ToggleOffWallpapercredits() { localStorage.setItem('enable-wallpaper-credits', "false"); location.href = '/' } + +if (localStorage.getItem('enable-wallpaper-credits') === "true") { + document.getElementById('wallpaper-credit-btn-toggle').setAttribute('onclick', 'ToggleOffWallpapercredits()') + document.getElementById('wallpaper-credit').style.display = 'block' + document.getElementById('wallpaper-credit-toggle-disabled').style.display = 'none' +} else { + document.getElementById('wallpaper-credit-btn-toggle').setAttribute('onclick', 'ToggleOnWallpapercredits()') + document.getElementById('wallpaper-credit').style.display = 'none' + document.getElementById('wallpaper-credit-toggle-enabled').style.display = 'none' +} \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..2071e5c --- /dev/null +++ b/index.html @@ -0,0 +1,295 @@ + + + + New Tab + + + +
+ +

+ Photo by Wolfgang Weiser on Pexels +

+
+
+ + +
+
+
+

Wallpaper

+ +

Search

+ +

Interface

+ + + +
+
+
+
+

Wallpapers

+ +
+
+ +
+
+ +
+ +
+ + + + + + + + + + + \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..c844ddf --- /dev/null +++ b/manifest.json @@ -0,0 +1,23 @@ +{ + "manifest_version": 2, + "name": "Spirit", + "version": "1.0", + "description": "A new tab extension.", + "developer": { + "name": "SudoVanilla", + "url": "https://ark.sudovanilla.org/korbs/Spirit" + }, + "chrome_url_overrides" : { + "newtab": "index.html" + }, + "applications": { + "gecko": { + "id": "spiri@sudovanilla.org", + "strict_min_version": "57.0" + } + }, + "incognito": "spanning", + "permissions": [ + "storage" + ] +} \ No newline at end of file