-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathNT.html
More file actions
134 lines (114 loc) · 7.58 KB
/
Copy pathNT.html
File metadata and controls
134 lines (114 loc) · 7.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>New Tab</title>
<script src="quotes.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
:root { --bg: #0d0d0d; --fg: #eaeaea; --acc: #1a1a1a; --hvr: #2a2a2a; }
body { margin: 0; font-family: 'Inter', sans-serif; background: var(--bg); color: var(--fg); display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100vh; text-align: center; overflow: hidden; }
h1.clock { font-size: 3rem; margin: 0 0 10px; font-weight: 600; letter-spacing: 1px; animation: fade 1s ease; }
.search-container { display: flex; align-items: center; background: #111; padding: 12px 18px; border-radius: 2rem; box-shadow: 0 6px 30px rgba(0,0,0,0.7); animation: pop 0.6s ease; width: 550px; max-width: 90%; }
.search-container input { flex: 1; background: 0 0; border: 0; outline: 0; color: #fff; font-size: 1rem; padding: 5px; }
.search-container select { background: var(--acc); border: 0; color: #fff; border-radius: .5rem; padding: 6px 10px; margin-left: 10px; cursor: pointer; transition: .2s; }
.search-container select:hover { background: var(--hvr); }
.icons { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 20px; margin-top: 30px; width: 400px; max-width: 90%; }
.shortcut-item { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--fg); width: 80px; }
.icon { width: 65px; height: 65px; background: var(--acc); border-radius: 1rem; display: flex; justify-content: center; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.5); transition: .25s; margin-bottom: 8px; cursor: pointer; }
.shortcut-item:hover .icon { transform: translateY(-4px) scale(1.1); background: var(--hvr); }
.shortcut-label { font-size: .85rem; font-weight: 500; color: rgba(255,255,255,0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; transition: .2s; }
.shortcut-item:hover .shortcut-label { color: #fff; }
.icon img { width: 28px; height: 28px; filter: brightness(0) invert(1); }
.extras { margin-top: 25px; color: #aaa; }
.loading-overlay { position: fixed; inset: 0; background: rgba(13,13,13,0.8); display: none; align-items: center; justify-content: center; z-index: 9; backdrop-filter: blur(4px); }
.loading-overlay.show { display: flex; }
.spinner { width: 60px; height: 60px; border: 4px solid #333; border-top-color: #eaeaea; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes fade { from{opacity:0;transform:translateY(-10px)} to{opacity:1;transform:translateY(0)} }
@keyframes pop { 0%{transform:scale(.8);opacity:0} 100%{transform:scale(1);opacity:1} }
@keyframes spin { to{transform:rotate(360deg)} }
</style>
</head>
<body>
<div class="loading-overlay" id="loader"><div class="spinner"></div></div>
<h1 class="clock">00:00:00</h1>
<form id="searchForm" class="search-container">
<input type="text" id="searchInput" placeholder="Search..." autocomplete="off">
<select id="engineSelect">
<option value="https://search.brave.com/search?q=" selected>Brave Search</option>
<option value="https://duckduckgo.com/?q=">DuckDuckGo</option>
<option value="https://www.google.com/search?q=">Google</option>
<option value="https://www.bing.com/search?q=">Bing</option>
</select>
</form>
<div class="icons" id="iconGrid">
<div class="shortcut-item"><a href="https://youtube.com" class="icon"><img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/youtube.svg"></a><span>YouTube</span></div>
<div class="shortcut-item"><a href="https://github.com" class="icon"><img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/github.svg"></a><span>GitHub</span></div>
<div class="shortcut-item"><a href="https://mail.google.com" class="icon"><img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/gmail.svg"></a><span>Gmail</span></div>
<div class="shortcut-item"><a href="https://twitter.com" class="icon"><img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/x.svg"></a><span>Twitter</span></div>
<div class="shortcut-item"><a href="https://nextjs.org" class="icon"><img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/nextdotjs.svg"></a><span>Next.js</span></div>
<div class="shortcut-item"><a href="https://vercel.com" class="icon"><img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/vercel.svg"></a><span>Vercel</span></div>
<div class="shortcut-item"><a href="https://openai.com" class="icon"><img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/openai.svg"></a><span>OpenAI</span></div>
<div class="shortcut-item"><a href="https://discord.com" class="icon"><img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/discord.svg"></a><span>Discord</span></div>
<div class="shortcut-item"><a href="https://spotify.com" class="icon"><img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/spotify.svg"></a><span>Spotify</span></div>
<div class="shortcut-item">
<div class="icon" id="addNewShortcut"><span style="font-size:2rem;color:#fff;">+</span></div>
<span class="shortcut-label">Add New</span>
</div>
</div>
<div class="extras"><span id="quote">Loading...</span></div>
<script>
const $ = s => document.querySelector(s);
const nav = url => {
$('#loader').classList.add('show');
requestAnimationFrame(() => window.parent?.postMessage({ type: 'navigate', url }, '*'));
};
// Clock
setInterval(() => $('.clock').textContent = new Date().toLocaleTimeString(), 1000);
// Search
$('#searchForm').onsubmit = e => {
e.preventDefault();
const q = $('#searchInput').value.trim();
if(q) nav($('#engineSelect').value + encodeURIComponent(q));
};
// Handle clicks for both <a> tags and the Add New button
$('#iconGrid').onclick = e => {
const link = e.target.closest('a');
const addBtn = e.target.closest('#addNewShortcut');
if (link) {
e.preventDefault();
nav(link.href);
} else if (addBtn) {
const name = prompt("Name:");
if (!name) return;
let url = prompt("URL:");
if (!url) return;
if (!url.startsWith('http')) url = 'https://' + url;
const shortcuts = JSON.parse(localStorage.getItem('shortcuts') || '[]');
shortcuts.push({ name, url });
localStorage.setItem('shortcuts', JSON.stringify(shortcuts));
renderCustom();
}
};
// Render Custom Shortcuts
function renderCustom() {
document.querySelectorAll('.custom').forEach(e => e.remove());
const shortcuts = JSON.parse(localStorage.getItem('shortcuts') || '[]');
const addContainer = $('#addNewShortcut').parentElement;
shortcuts.forEach(s => {
const div = document.createElement('div');
div.className = 'shortcut-item custom';
div.innerHTML = `<a href="${s.url}" class="icon"><i class="fa-solid fa-link" style="font-size:24px;color:#fff"></i></a><span class="shortcut-label">${s.name}</span>`;
$('#iconGrid').insertBefore(div, addContainer);
});
}
// Quotes from external file
if (window.QUOTES && window.QUOTES.length > 0) {
$('#quote').textContent = window.QUOTES[Math.floor(Math.random() * window.QUOTES.length)];
} else {
$('#quote').textContent = "“The best error message is the one that never shows up.”";
}
renderCustom();
</script>
</body>
</html>