-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
100 lines (90 loc) · 2.17 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
<!DOCTYPE html>
<html>
<head>
<title>CS2 Inspect Link Generator</title>
<style>
body {
background-color: #f5f5f5;
font-family: Arial, sans-serif;
font-size: 16px;
line-height: 1.5;
margin: 0;
padding: 0;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
h1 {
font-size: 2.5rem;
margin-bottom: 2rem;
text-align: center;
}
input[type="text"] {
padding: 10px;
border-radius: 5px;
border: none;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
margin-bottom: 1rem;
width: 100%;
max-width: 400px;
}
button {
background-color: #008CBA;
color: #fff;
padding: 10px 20px;
border-radius: 5px;
border: none;
cursor: pointer;
transition: background-color 0.2s ease;
}
button:hover {
background-color: #005b79;
}
p {
margin-top: 1rem;
font-size: 1.2rem;
text-align: center;
word-wrap: break-word;
max-width: 80%;
line-height: 1.5;
}
#output
{
cursor: pointer;
}
</style>
</head>
<body>
<div class="container">
<h1>CS2 Inspect Link Generator</h1>
<h5>Once generated, click in the command to copy to the clipboard!</h5>
<input type="text" id="input" placeholder="Enter a steam:// url with the item to inspect">
<button onclick="extractString()">Extract inspect link</button>
<p id="output" onclick="copyClipboard()"></p>
</div>
<script>
function extractString() {
const input = document.getElementById("input").value;
const regex = /.+(csgo_.+)(?=\%).+(S[A-Z0-9]+)/;
const match = input.match(regex)
const output = document.getElementById("output");
if (match) {
output.innerHTML = `${match[1]} ${match[2]}`;
navigator.clipboard.writeText(output.innerHTML)
} else {
output.innerHTML = "No match found / wrong link";
}
}
function copyClipboard() {
const output = document.getElementById("output").innerHTML
if( !output.contains('match') ) {
navigator.clipboard.writeText(document.getElementById("output").innerHTML)
}
}
</script>
</body>
</html>