mirror of
https://github.com/pacnpal/steadirect.git
synced 2025-12-20 04:01:09 -05:00
first commit
This commit is contained in:
46
README.md
Normal file
46
README.md
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
# Steam URL Converter
|
||||||
|
|
||||||
|
A simple, standalone web app that converts Steam URLs to shareable HTTPS links. Perfect for sharing Steam lobby links on platforms like Discord where steam:// URLs are not clickable.
|
||||||
|
|
||||||
|
## Deployment
|
||||||
|
|
||||||
|
The app is completely self-contained in a single `index.html` file. You can host it anywhere:
|
||||||
|
|
||||||
|
- GitHub Pages
|
||||||
|
- Netlify
|
||||||
|
- Vercel
|
||||||
|
- Any web hosting service that can serve static files
|
||||||
|
|
||||||
|
## How it Works
|
||||||
|
|
||||||
|
1. When hosted (e.g., at `https://yourdomain.com/`), the app will generate links like:
|
||||||
|
```
|
||||||
|
https://yourdomain.com/?url=steam%3A%2F%2Fjoinlobby%2F1131190%2F109775241747665514
|
||||||
|
```
|
||||||
|
|
||||||
|
2. When someone clicks the generated link, the app automatically redirects them to the original Steam URL:
|
||||||
|
```
|
||||||
|
steam://joinlobby/1131190/109775241747665514
|
||||||
|
```
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
Original Steam URL:
|
||||||
|
```
|
||||||
|
steam://joinlobby/1131190/109775241747665514
|
||||||
|
```
|
||||||
|
|
||||||
|
Generated shareable link (if hosted on example.com):
|
||||||
|
```
|
||||||
|
https://example.com/?url=steam%3A%2F%2Fjoinlobby%2F1131190%2F109775241747665514
|
||||||
|
```
|
||||||
|
|
||||||
|
The app will work the same way regardless of where it's hosted - it automatically uses whatever domain it's running on to generate the correct links.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- No external dependencies
|
||||||
|
- Single file deployment
|
||||||
|
- Works on any hosting platform
|
||||||
|
- Automatic URL parameter handling
|
||||||
|
- Client-side only (no server required)
|
||||||
96
index.html
Normal file
96
index.html
Normal 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>
|
||||||
Reference in New Issue
Block a user