Update changes
This commit is contained in:
parent
5ba0d053f2
commit
49a1892678
6 changed files with 123 additions and 29 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1 @@
|
|||
web-ext-artifacts/spirit-1.0.zip
|
||||
web-ext-artifacts
|
31
functions/search.js
Normal file
31
functions/search.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
// Set Default
|
||||
if (localStorage.getItem('search-engine-provider') === null) {SetDuckDuckGo()}
|
||||
|
||||
// Apply
|
||||
document.querySelector('.search input').setAttribute('placeholder', 'Search ' + localStorage.getItem('search-engine-provider') + '...')
|
||||
document.querySelector('#settings-search').value = localStorage.getItem('search-engine-provider')
|
||||
|
||||
// Set Search Engine
|
||||
function SetDuckDuckGo() {
|
||||
localStorage.setItem('search-engine-provider', "DuckDuckGo")
|
||||
localStorage.setItem('search-engine', "https://duckduckgo.com/?t=h_&q=")
|
||||
document.querySelector('.search input').setAttribute('placeholder', 'Search ' + localStorage.getItem('search-engine-provider') + '...')
|
||||
}
|
||||
|
||||
function Set4get() {
|
||||
localStorage.setItem('search-engine-provider', "4get")
|
||||
localStorage.setItem('search-engine', "https://4get.sudovanilla.org/web?s=")
|
||||
document.querySelector('.search input').setAttribute('placeholder', 'Search ' + localStorage.getItem('search-engine-provider') + '...')
|
||||
}
|
||||
|
||||
function SetAraa() {
|
||||
localStorage.setItem('search-engine-provider', "Araa")
|
||||
localStorage.setItem('search-engine', "https://araa.sudovanilla.org/search?q=")
|
||||
document.querySelector('.search input').setAttribute('placeholder', 'Search ' + localStorage.getItem('search-engine-provider') + '...')
|
||||
}
|
||||
|
||||
function SetBrave() {
|
||||
localStorage.setItem('search-engine-provider', "Brave")
|
||||
localStorage.setItem('search-engine', "https://search.brave.com/search?q=")
|
||||
document.querySelector('.search input').setAttribute('placeholder', 'Search ' + localStorage.getItem('search-engine-provider') + '...')
|
||||
}
|
|
@ -8,6 +8,16 @@ function ShowSettings() {
|
|||
}
|
||||
}
|
||||
|
||||
// Open Wallpapers
|
||||
function ShowWallpapers() {
|
||||
ShowSettings()
|
||||
var SettingsPopup = document.querySelector('.wallpaper-selector')
|
||||
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 = '/' }
|
||||
|
|
48
functions/wallpaper.js
Normal file
48
functions/wallpaper.js
Normal file
|
@ -0,0 +1,48 @@
|
|||
// Set Default
|
||||
if (localStorage.getItem('wallpaper') === null) {Wallpaper27588471()}
|
||||
|
||||
// Apply
|
||||
function ApplyWallpaper() {
|
||||
document.querySelector('.tab-background img').setAttribute('src', localStorage.getItem('wallpaper'))
|
||||
document.querySelector('#wallpaper-credit-link').innerHTML = localStorage.getItem('wallpaper-credit-author')
|
||||
document.querySelector('#wallpaper-credit-link').setAttribute('href', localStorage.getItem('wallpaper-credit-link'))
|
||||
}
|
||||
|
||||
// Deselect All
|
||||
function WallpaperDeselectAll() {
|
||||
document.querySelector('#wallpaper-selection-19906181').style.borderColor = 'transparent'
|
||||
document.querySelector('#wallpaper-selection-27588471').style.borderColor = 'transparent'
|
||||
document.querySelector('#wallpaper-selection-27960528').style.borderColor = 'transparent'
|
||||
}
|
||||
|
||||
// Change Wallpaper
|
||||
function Wallpaper19906181() {
|
||||
localStorage.setItem('wallpaper', './backgrounds/19906181/background.jpg')
|
||||
localStorage.setItem('wallpaper-selection', 'wallpaper-selection-19906181')
|
||||
|
||||
localStorage.setItem('wallpaper-credit-author', 'Susanne Jutzeler')
|
||||
localStorage.setItem('wallpaper-credit-link', 'https://www.pexels.com/photo/swiss-alps-in-winter-19906181/')
|
||||
ApplyWallpaper()
|
||||
WallpaperDeselectAll()
|
||||
document.querySelector('#wallpaper-selection-19906181').style.borderColor = 'white'
|
||||
}
|
||||
function Wallpaper27588471() {
|
||||
localStorage.setItem('wallpaper', './backgrounds/27588471/background.jpg')
|
||||
localStorage.setItem('wallpaper-selection', 'wallpaper-selection-27588471')
|
||||
|
||||
localStorage.setItem('wallpaper-credit-author', 'Wolfgang Weiser')
|
||||
localStorage.setItem('wallpaper-credit-link', 'https://www.pexels.com/photo/elbsandsteingebirge-27588471/')
|
||||
ApplyWallpaper()
|
||||
WallpaperDeselectAll()
|
||||
document.querySelector('#wallpaper-selection-27588471').style.borderColor = 'white'
|
||||
}
|
||||
function Wallpaper27960528() {
|
||||
localStorage.setItem('wallpaper', './backgrounds/27960528/background.jpg')
|
||||
localStorage.setItem('wallpaper-selection', 'wallpaper-selection-27960528')
|
||||
|
||||
localStorage.setItem('wallpaper-credit-author', 'Artem Stoliar')
|
||||
localStorage.setItem('wallpaper-credit-link', 'https://www.pexels.com/photo/sea-landscape-beach-water-27960528/')
|
||||
ApplyWallpaper()
|
||||
WallpaperDeselectAll()
|
||||
document.querySelector('#wallpaper-selection-27960528').style.borderColor = 'white'
|
||||
}
|
57
index.html
57
index.html
|
@ -4,11 +4,11 @@
|
|||
<title>New Tab</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body onload="ApplyWallpaper()">
|
||||
<div class="tab-background">
|
||||
<img src="./backgrounds/27588471/background.jpg" />
|
||||
<img/>
|
||||
<p id="wallpaper-credit">
|
||||
Photo by <a href="https://www.pexels.com/photo/elbsandsteingebirge-27588471/">Wolfgang Weiser</a> on Pexels
|
||||
Photo by <a id="wallpaper-credit-link" href="https://www.pexels.com/photo/elbsandsteingebirge-27588471/">Wolfgang Weiser</a> on Pexels
|
||||
</p>
|
||||
</div>
|
||||
<div class="toolbar">
|
||||
|
@ -22,19 +22,17 @@
|
|||
<div class="toolbar-popups">
|
||||
<div id="settings-popup">
|
||||
<p>Wallpaper</p>
|
||||
<button disabled style="opacity: 0.5;" class="wide-selector"><?xml version="1.0" encoding="UTF-8"?><svg width="24px" height="24px" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="#FFFFFF"><path d="M21 3.6V20.4C21 20.7314 20.7314 21 20.4 21H3.6C3.26863 21 3 20.7314 3 20.4V3.6C3 3.26863 3.26863 3 3.6 3H20.4C20.7314 3 21 3.26863 21 3.6Z" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M3 16L10 13L21 18" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M16 10C14.8954 10 14 9.10457 14 8C14 6.89543 14.8954 6 16 6C17.1046 6 18 6.89543 18 8C18 9.10457 17.1046 10 16 10Z" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg> <span>Select a New Wallpaper</span></button>
|
||||
<button onclick="ShowWallpapers()" style="opacity: 0.5;" class="wide-selector"><?xml version="1.0" encoding="UTF-8"?><svg width="24px" height="24px" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="#FFFFFF"><path d="M21 3.6V20.4C21 20.7314 20.7314 21 20.4 21H3.6C3.26863 21 3 20.7314 3 20.4V3.6C3 3.26863 3.26863 3 3.6 3H20.4C20.7314 3 21 3.26863 21 3.6Z" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M3 16L10 13L21 18" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M16 10C14.8954 10 14 9.10457 14 8C14 6.89543 14.8954 6 16 6C17.1046 6 18 6.89543 18 8C18 9.10457 17.1046 10 16 10Z" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg> <span>Select a New Wallpaper</span></button>
|
||||
<p>Search</p>
|
||||
<select disabled style="opacity: 0.5;">
|
||||
<option>DuckDuckGo</option>
|
||||
<option>Brave</option>
|
||||
<option>4get</option>
|
||||
<option>Whoogle</option>
|
||||
<option>Leta</option>
|
||||
<option>Araa</option>
|
||||
<option>Bing</option>
|
||||
<option>Yandex</option>
|
||||
<option>Google</option>
|
||||
<select id="settings-search" style="opacity: 0.5;">
|
||||
<option id="search-option-DuckDuckGo" onclick="SetDuckDuckGo()">DuckDuckGo</option>
|
||||
<option id="search-option-4get" onclick="Set4get()">4get</option>
|
||||
<option id="search-option-Araa" onclick="SetAraa()">Araa</option>
|
||||
<option id="search-option-Brave" onclick="SetBrave()">Brave</option>
|
||||
</select>
|
||||
<!-- <div class="search-custom">
|
||||
<p id="search-custom-4get">Change Instance</p>
|
||||
</div> -->
|
||||
<p>Interface</p>
|
||||
<button id="search-btn-toggle" class="toggles">
|
||||
<span>Search</span>
|
||||
|
@ -52,36 +50,41 @@
|
|||
<span id="wallpaper-credit-toggle-disabled"><?xml version="1.0" encoding="UTF-8"?><svg width="24px" height="24px" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="#FFFFFF"><path d="M7 13C7.55228 13 8 12.5523 8 12C8 11.4477 7.55228 11 7 11C6.44772 11 6 11.4477 6 12C6 12.5523 6.44772 13 7 13Z" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17 17H7C4.23858 17 2 14.7614 2 12C2 9.23858 4.23858 7 7 7H17C19.7614 7 22 9.23858 22 12C22 14.7614 19.7614 17 17 17Z" stroke="#FFFFFF" stroke-width="1.5"></path></svg></span>
|
||||
</button>
|
||||
</div>
|
||||
<!-- <div id="4get-instance-popup">
|
||||
<p>4get Instance</p>
|
||||
<input placeholder="https://4get..."/>
|
||||
<button>Save</button>
|
||||
</div>
|
||||
<div id="araa-instance-popup">
|
||||
<p>Araa Instance</p>
|
||||
<input placeholder="https://araa..."/>
|
||||
<button>Save</button>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="wallpaper-selector">
|
||||
<div class="wallpaper-selector-header">
|
||||
<p>Wallpapers</p>
|
||||
<button>
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg width="24px" height="24px" stroke-width="1.5"
|
||||
viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="#FFFFFF">
|
||||
<path
|
||||
d="M6.75827 17.2426L12.0009 12M17.2435 6.75736L12.0009 12M12.0009 12L6.75827 6.75736M12.0009 12L17.2435 17.2426"
|
||||
stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</svg>
|
||||
</button>
|
||||
<button onclick="ShowWallpapers()"><svg width="24px" height="24px" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="#FFFFFF"><path d="M6.75827 17.2426L12.0009 12M17.2435 6.75736L12.0009 12M12.0009 12L6.75827 6.75736M12.0009 12L17.2435 17.2426" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></button>
|
||||
</div>
|
||||
<div class="wallpapers-all">
|
||||
<!-- <img src="https://ipx.sudovanilla.org/https://images.pexels.com/photos/2026454/pexels-photo-2026454.jpeg" />
|
||||
<img src="https://ipx.sudovanilla.org/https://images.pexels.com/photos/1530212/pexels-photo-1530212.jpeg" />
|
||||
<img src="https://ipx.sudovanilla.org/https://images.pexels.com/photos/1624497/pexels-photo-1624497.jpeg" /> -->
|
||||
<img onclick="Wallpaper19906181()" id="wallpaper-selection-19906181" src="./backgrounds/19906181/background.jpg"/>
|
||||
<img onclick="Wallpaper27588471()" id="wallpaper-selection-27588471" src="./backgrounds/27588471/background.jpg"/>
|
||||
<img onclick="Wallpaper27960528()" id="wallpaper-selection-27960528" src="./backgrounds/27960528/background.jpg"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="center-area">
|
||||
<div class="search">
|
||||
<input autofocus onkeypress="if(event.keyCode == 13) {Search()}" placeholder="Search DuckDuckGo" />
|
||||
<input autofocus onkeypress="if(event.keyCode == 13) {Search()}" />
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- Functions -->
|
||||
<script src="./functions/init.js"></script>
|
||||
<script src="./functions/clock.js"></script>
|
||||
<script src="./functions/search.js"></script>
|
||||
<script src="./functions/toggles.js"></script>
|
||||
<script src="./functions/wallpaper.js"></script>
|
||||
|
||||
<script>
|
||||
function Search() {
|
||||
|
@ -250,6 +253,8 @@ function Search() {
|
|||
width: 200px;
|
||||
height: 132px;
|
||||
object-fit: cover;
|
||||
border-radius: 6px;
|
||||
border: 2px transparent solid;
|
||||
}
|
||||
|
||||
.toggles {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Spirit",
|
||||
"version": "1.0",
|
||||
"version": "1.2",
|
||||
"description": "A new tab extension.",
|
||||
"developer": {
|
||||
"name": "SudoVanilla",
|
||||
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"applications": {
|
||||
"gecko": {
|
||||
"id": "spiri@sudovanilla.org",
|
||||
"id": "spirit@sudovanilla.org",
|
||||
"strict_min_version": "58.0"
|
||||
}
|
||||
},
|
||||
|
|
Reference in a new issue