-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
57 lines (51 loc) · 1.61 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Whereami?</title>
<style>
body.dark {
background-color: #333;
color: #fff;
}
.content {
text-align: center;
margin-top: 20%;
}
button {
padding: 10px 20px;
background-color: #007bff;
color: #fff;
border: none;
cursor: pointer;
}
</style>
</head>
<body class="dark">
<div class="content">
<h1>Whereami?</h1>
<p>whereami - an alternative command of whoami. (Shows your current directory)</p>
<button id="installBtn">Install</button>
</div>
<script>
var installBtn = document.getElementById('installBtn');
installBtn.addEventListener('click', function() {
if (installBtn.textContent === 'Copied!') {
installBtn.style.backgroundColor = '#007bff';
installBtn.textContent = 'Install';
} else {
var commandToCopy = 'scoop install https://gist.githubusercontent.com/KailUser/df48b4ef06041ff7740bbcabc25e0adf/raw/b320cc3a32f55d5ce4bcc04bb5885c8122dfa3bc/whereami.json';
var tempInput = document.createElement('input');
tempInput.value = commandToCopy;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand('copy');
document.body.removeChild(tempInput);
installBtn.textContent = 'Copied!';
installBtn.style.backgroundColor = 'green';
}
});
</script>
</body>
</html>