X Video Share Generator

body {
font-family: ‘Helvetica’, Arial, sans-serif;
background-color: #f5f8fa;
margin: 0;
padding: 40px 20px;
color: #333;
}
.container {
background-color: #fff;
border-radius: 10px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
padding: 40px;
max-width: 1200px; /* Wider for desktop */
margin: 0 auto;
}
h1 {
color: #1DA1F2;
text-align: center;
font-size: 32px;
margin-bottom: 15px;
}
p {
text-align: center;
font-size: 18px;
color: #657786;
margin-bottom: 30px;
max-width: 800px;
margin-left: auto;
margin-right: auto;
}
.input-group {
display: flex;
justify-content: center;
align-items: center;
gap: 15px;
max-width: 900px;
margin: 0 auto;
}
input {
flex: 1;
padding: 14px;
border: 1px solid #ccd6dd;
border-radius: 5px;
font-size: 16px;
box-sizing: border-box;
min-width: 0; /* Prevents flex shrinkage issues */
}
button {
padding: 14px 30px;
background-color: #1DA1F2;
color: white;
border: none;
border-radius: 25px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #0d8ddb;
}
#result {
margin-top: 30px;
padding: 20px;
background-color: #f5f8fa;
border-radius: 5px;
text-align: center;
font-size: 16px;
color: #14171a;
max-width: 800px;
margin-left: auto;
margin-right: auto;
}
#result a {
color: #1DA1F2;
text-decoration: none;
}
#result a:hover {
text-decoration: underline;
}
@media (max-width: 900px) {
.input-group {
flex-direction: column;
gap: 10px;
}
input, button {
width: 100%;
max-width: 500px;
}
h1 {
font-size: 28px;
}
p {
font-size: 16px;
}
}
@media (max-width: 600px) {
.container {
padding: 20px;
}
h1 {
font-size: 24px;
}
#result {
font-size: 14px;
}
}

X Video Share Generator

Convert a Twitter/X video URL to share it without retweeting, with credit to the original poster. Perfect for a cleaner post on your timeline.

function editUrl() {
const urlInput = document.getElementById(‘videoUrl’).value;
const resultDiv = document.getElementById(‘result’);

if (!urlInput || (!urlInput.includes(‘twitter.com’) && !urlInput.includes(‘x.com’))) {
resultDiv.innerHTML = “Please enter a valid Twitter/X video URL.”;
return;
}

const statusMatch = urlInput.match(/status/d+/);
if (!statusMatch) {
resultDiv.innerHTML = “Invalid URL format. Ensure it contains a status ID.”;
return;
}

const baseUrl = urlInput.substring(0, urlInput.indexOf(‘status/’) + statusMatch[0].length);
const newUrl = baseUrl + “/video/1”;

resultDiv.innerHTML = `Shareable URL: ${newUrl}

Copy this URL and paste it into a new X post to share the video!`;
}