-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
117 lines (106 loc) · 3.29 KB
/
index.html
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
<link rel='stylesheet' type='text/css' href='/style.css'/>
<script src='uv/uv.bundle.js'></script>
<script src='uv/uv.config.js'></script>
<link rel='icon' type='image/x-icon' href='---icon---'>
<div class='title'>
<h1 id='title1'>Hi</h1>
</div>
<form class='searchbox' id='searchbox'>
<input class='search' id='search' placeholder='Search the web freely' type='text'/>
</form>
<style>
body{
background: ---bg---;
background-repeat: no-repeat;
background-size: cover;
}
.bg{
top: 0%;
left: 0%;
position: absolute;
width:100%;
height:100%;
}
.searchbox{
width:47%;
height:7%;
position: absolute;
left:26.5%;
top:50%;
}
.search{
text-align: center;
background: transparent;
border-radius: 18px;
border-radius: 18px;
width:100%;
height:100%;
}
.title{
font-family: 'Roboto', Arial, Helvetica, sans-serif;
position: absolute;
width: 100%;
height: 100px;
top:17%;
float: center;
align: center;
text-align: center;
}
::placeholder {
margin: auto;
color: inherit;
font-size: 1.2em;
}
</style>
<script>
document.title="Hi";
searchbox.style.color="#ffffff";
search.style.backgroundColor="#787878";
search.style.color="#ffffff";
search.style.border="10px solid #000000";
title1.style.color="#435ccc";
search.placeholder="";
var credits=document.createElement('div');
credits.style.position='absolute';
credits.style.left='0px';
credits.style.zIndex='999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999';
credits.style.bottom='0px';
credits.style.fontSize='15px';
credits.style.width='100%';
credits.style.height='20px';
credits.style.textAlign='center';
document.body.appendChild(credits);
var link=document.createElement('a');
link.href='https://github.com/dragon731012/FreedomForge';
link.style.textDecoration='none';
link.style.color='#435ccc';
credits.appendChild(link);
var text=document.createElement('h2');
text.innerText='Created with FreedomForge';
text.style.position='absolute';
text.style.left='50%';
text.style.transform='translateX(-50%)';
text.style.bottom='-15px';
link.appendChild(text);
var fontsize1=2560/screen.width*18;
var fontsize2=2560/screen.width*7.5;
title1.style.fontSize = fontsize1+'px';
search.style.fontSize = fontsize2+'px';
const form = document.querySelector('form');
const input = document.querySelector('input');
form.addEventListener('submit', async event => {
event.preventDefault();
window.navigator.serviceWorker.register('./sw.js', {
scope: __uv$config.prefix
}).then(() => {
let url = input.value.trim();
if (!isUrl(url)) url = 'https://www.google.com/search?q=' + url;
else if (!(url.startsWith('https://') || url.startsWith('http://'))) url = 'http://' + url;
window.location.href = __uv$config.prefix + __uv$config.encodeUrl(url);
});
});
function isUrl(val = '') {
if (/^http(s?):\/\//.test(val) || val.includes('.') && val.substr(0, 1) !== ' ') return true;
return false;
};
</script>