-
Notifications
You must be signed in to change notification settings - Fork 2
/
history.html
94 lines (92 loc) · 1.96 KB
/
history.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
<!DOCTYPE html>
<html>
<head>
<title id="t">Galaxy history</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap" rel="stylesheet">
<link rel='icon' href='https://lb123658.github.io/galaxy/favicon.png' type='image/png'/>
<link href="https://fonts.googleapis.com/css2?family=Material+Icons" rel="stylesheet">
<style>
body {
background: #2F3137;
}
* {
font-family: 'Montserrat', sans-serif;
color: white;
user-select: none;
-webkit-user-select: none;
}
::selection {
background: #5765f2;
}
:focus {
outline-width: 0px;
}
.history {
min-height: 30px;
margin-bottom: 10px;
width: 100%;
border-radius: 8px;
font-size: 16px;
text-align: left;
cursor: pointer;
border: none;
background: #3b4351;
color: white;
}
.history:hover {
opacity: 0.8;
}
.small {
color: grey;
font-size: 15px;
}
#top {
background: #2F3137;
position: -webkit-sticky;
position: sticky;
top: 0px;
padding: 10px;
z-index: 2;
}
#clear {
float:right;
background: #5765f2;
border: none;
border-radius: 8px;
padding: 5px;
cursor: pointer;
opacity: 0.7;
transition: transform 0.5s;
}
#clear:hover {
opacity: 1;
transform: scale(1.2);
}
a {
color: grey;
text-decoration: none;
font-size: 15px;
}
</style>
<body>
<div id="top">
<h2>Galaxy History</h2>
<button id="clear" onclick="clearHistory()">Clear history</button>
<p class="small">Your search history is only stored in your browser and is not available to anyone else.</p>
</div>
<div id="links"></div>
<script>
var links = document.getElementById("links");
var searchHistory = localStorage.getItem("search_history");
links.innerHTML = searchHistory.split("null")[1];
function clearHistory() {
const d = new Date();
var clearedButton = "null<button class='history'>Search history cleared... <span style='float:right;'>" + d.toLocaleTimeString() + "</span></button>";
localStorage.setItem("search_history",clearedButton);
location.reload();
}
</script>
<script src="menu.js"></script>
</body>
</html>