first commit

This commit is contained in:
pacnpal
2025-02-15 22:23:33 -05:00
commit 8bbe9fe0ab
2 changed files with 142 additions and 0 deletions

96
index.html Normal file
View File

@@ -0,0 +1,96 @@
<!DOCTYPE html>
<html>
<head>
<title>Steam URL Converter</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
max-width: 800px;
margin: 20px auto;
padding: 0 20px;
background: #f5f5f5;
}
.container {
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
input[type="text"] {
width: 100%;
padding: 8px;
margin: 10px 0;
border: 1px solid #ddd;
border-radius: 4px;
}
button {
background: #1a9fff;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background: #0089ff;
}
#result {
margin-top: 20px;
word-break: break-all;
}
.result-box {
background: #f8f9fa;
padding: 10px;
border-radius: 4px;
border: 1px solid #ddd;
margin-top: 10px;
}
</style>
</head>
<body>
<div class="container">
<h1>Steam URL Converter</h1>
<p>Convert Steam URLs to shareable links that work on Discord and other platforms.</p>
<input type="text" id="steamUrl" placeholder="Enter steam:// URL (e.g., steam://joinlobby/1131190/109775241747665514)" />
<button onclick="convertUrl()">Convert</button>
<div id="result"></div>
</div>
<script>
// Check if we have a steam URL in the parameters
const urlParams = new URLSearchParams(window.location.search);
const steamUrl = urlParams.get('url');
if (steamUrl) {
// Redirect to the Steam URL
window.location.href = decodeURIComponent(steamUrl);
}
function convertUrl() {
const steamUrl = document.getElementById('steamUrl').value;
if (!steamUrl.startsWith('steam://')) {
alert('Please enter a valid steam:// URL');
return;
}
const shareableUrl = window.location.origin + window.location.pathname + '?url=' + encodeURIComponent(steamUrl);
const resultDiv = document.getElementById('result');
resultDiv.innerHTML = `
<h3>Your Shareable Link:</h3>
<div class="result-box">
<a href="${shareableUrl}">${shareableUrl}</a>
</div>
<p>Copy this link and share it on Discord or other platforms.</p>
`;
}
// If URL was in the input field on page load, convert it automatically
const initialUrl = urlParams.get('input');
if (initialUrl) {
document.getElementById('steamUrl').value = decodeURIComponent(initialUrl);
convertUrl();
}
</script>
</body>
</html>