Create index.html

This commit is contained in:
ThatLinuxFan 2024-01-22 18:15:57 -06:00 committed by GitHub
parent db84fa1506
commit 1c482aaf86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

41
index.html Normal file
View file

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SPL Generator</title>
</head>
<body>
<h2>SPL Generator</h2>
<form id="splForm">
<label for="name">Your Name or Organization:</label>
<textarea id="name" rows="2" cols="30"></textarea>
<button type="button" onclick="generateSPL()">Generate SPL</button>
</form>
<script>
function generateSPL() {
// Get the name from the textarea
const name = document.getElementById('name').value;
// Fetch the latest SPL template
fetch('https://raw.githubusercontent.com/NodeMixaholic/samuel-public-license/main/LICENSE')
.then(response => response.text())
.then(template => {
// Replace placeholders with actual values
const fullNumericYear = new Date().getFullYear();
const splText = template.replace('FULL-NUMERIC-YEAR', fullNumericYear).replace('YOUR-REAL-NAME-OR-ORG', name);
// Set the body content to the generated SPL text
document.body.innerHTML = `<pre>${splText}</pre>`;
})
.catch(error => console.error('Error fetching SPL template:', error));
}
</script>
</body>
</html>