Create index.html
This commit is contained in:
parent
db84fa1506
commit
1c482aaf86
1 changed files with 41 additions and 0 deletions
41
index.html
Normal file
41
index.html
Normal 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>
|
Loading…
Reference in a new issue