forked from solstice/sols.dev
dingus
This commit is contained in:
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 176 KiB |
@@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content"Solstice is a programming language focused on ease of use.">
|
||||
<link rel="stylesheet" href="index.css?v=1">
|
||||
<title>Solstice</title>
|
||||
</head>
|
||||
@@ -10,11 +11,12 @@
|
||||
<div class="main">
|
||||
<div class="box" id="main">
|
||||
<div class="hero-content">
|
||||
<img src="https://sols.dev/solstice.svg" width="200" height="200"></img>
|
||||
<img src="https://sols.dev/solstice.svg" width="200" height="200" alt="Solstice logo"></img>
|
||||
<h1>Solstice</h1>
|
||||
<p class="big">A programming language focused on ease of use.</p>
|
||||
<button onclick="window.location.href = 'https://chsp.au/max/solstice'">View Code</button>
|
||||
<button onclick="window.location.href = '#installing'">Install</button>
|
||||
<button onclick="window.location.href = '/playground'">Try Online</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box">
|
||||
|
||||
4
node_modules/.cache/wrangler/pages.json
generated
vendored
Normal file
4
node_modules/.cache/wrangler/pages.json
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"account_id": "74bee0e1b8240f33b5876649abbfb3c3",
|
||||
"project_name": "solstice"
|
||||
}
|
||||
6
node_modules/.cache/wrangler/wrangler-account.json
generated
vendored
Normal file
6
node_modules/.cache/wrangler/wrangler-account.json
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"account": {
|
||||
"id": "74bee0e1b8240f33b5876649abbfb3c3",
|
||||
"name": "Chookspace"
|
||||
}
|
||||
}
|
||||
1
node_modules/.mf/cf.json
generated
vendored
Normal file
1
node_modules/.mf/cf.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"httpProtocol":"HTTP/1.1","clientAcceptEncoding":"gzip, deflate, br","requestPriority":"","edgeRequestKeepAliveStatus":1,"requestHeaderNames":{},"clientTcpRtt":15,"colo":"SYD","asn":1221,"asOrganization":"Telstra Limited","country":"AU","isEUCountry":false,"city":"Sydney","continent":"OC","region":"New South Wales","regionCode":"NSW","timezone":"Australia/Sydney","longitude":"151.20732","latitude":"-33.86785","postalCode":"1001","tlsVersion":"TLSv1.3","tlsCipher":"AEAD-AES256-GCM-SHA384","tlsClientRandom":"VnosRll56NurYMmPAR45l8rG4I2Nklvmcb+fGaOXVTI=","tlsClientCiphersSha1":"kXrN3VEKDdzz2cPKTQaKzpxVTxQ=","tlsClientExtensionsSha1":"1eY97BUYYO8vDaTfHQywB1pcNdM=","tlsClientExtensionsSha1Le":"u4wtEMFQBY18l3BzHAvORm+KGRw=","tlsExportedAuthenticator":{"clientHandshake":"1dfbe7451ef201532a216471f87886dfd3d290b649ac6787f187e7a296c886e53a496bd6b59c693b87f2d5b78c90e5b4","serverHandshake":"f7b332d2f13f55a5ccd91cff8554173516c5141b77e217c37b7a2b1ee552da7c6a7abbb66b27c722d1adbfd96266d778","clientFinished":"01042563ecd01453b385f6679691fe23b1ba391e1d3faa8accca1c80dad3e39e69f8ceb924a9640b7b527f1c2dbddab9","serverFinished":"38937607097ad8fc3847b2cf632b60444be3233468e24bceaaf05ea263c7ea5bb3e8c62fedc65ad96ce62ffd3db9937e"},"tlsClientHelloLength":"1603","tlsClientAuth":{"certPresented":"0","certVerified":"NONE","certRevoked":"0","certIssuerDN":"","certSubjectDN":"","certIssuerDNRFC2253":"","certSubjectDNRFC2253":"","certIssuerDNLegacy":"","certSubjectDNLegacy":"","certSerial":"","certIssuerSerial":"","certSKI":"","certIssuerSKI":"","certFingerprintSHA1":"","certFingerprintSHA256":"","certNotBefore":"","certNotAfter":""},"verifiedBotCategory":"","botManagement":{"corporateProxy":false,"verifiedBot":false,"jsDetection":{"passed":false},"staticResource":false,"detectionIds":{},"score":99}}
|
||||
87
playground/index.html
Normal file
87
playground/index.html
Normal file
@@ -0,0 +1,87 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Solstice Playground</title>
|
||||
<link rel="stylesheet" href="https://sols.dev/index.css">
|
||||
<style>
|
||||
textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="box">
|
||||
<h1>Solstice Playground</h1>
|
||||
|
||||
<textarea class="code" id="editor" spellcheck="false" placeholder="Enter Solstice code here..." rows="20">
|
||||
puts "Hello from Solstice via WebAssembly!"
|
||||
puts "Let's do some math:"
|
||||
puts 10 + 20 + 12
|
||||
</textarea>
|
||||
|
||||
<div id="controls">
|
||||
<button id="runBtn" style="font-size: 20px;">Loading WASM...</button>
|
||||
</div>
|
||||
|
||||
<h3>Output:</h3>
|
||||
<pre class="code" id="output">Output will appear here. Click "Run Code" to run!</pre>
|
||||
|
||||
<script type="module">
|
||||
import createSolsticeModule from './playground.js';
|
||||
|
||||
let solsticeModule = null;
|
||||
const outputDiv = document.getElementById('output');
|
||||
const runBtn = document.getElementById('runBtn');
|
||||
const editor = document.getElementById('editor');
|
||||
|
||||
// Initialize the Emscripten module
|
||||
createSolsticeModule({
|
||||
// Redirect stdout to our output div
|
||||
print: (text) => {
|
||||
outputDiv.textContent += text + "\n";
|
||||
console.log(text);
|
||||
},
|
||||
// Redirect stderr to our output div (and console)
|
||||
printErr: (text) => {
|
||||
outputDiv.textContent += "[stderr] " + text + "\n";
|
||||
console.error(text);
|
||||
}
|
||||
}).then((instance) => {
|
||||
solsticeModule = instance;
|
||||
runBtn.textContent = "Run Code";
|
||||
runBtn.disabled = false;
|
||||
console.log("Solstice WASM module loaded successfully");
|
||||
}).catch(err => {
|
||||
console.error("Failed to load WASM module:", err);
|
||||
outputDiv.innerHTML = '<span class="error">Error loading WASM module. See console for details.</span>';
|
||||
runBtn.textContent = "Load Failed";
|
||||
});
|
||||
|
||||
runBtn.addEventListener('click', () => {
|
||||
if (!solsticeModule) return;
|
||||
|
||||
outputDiv.textContent = ""; // Clear previous output
|
||||
const code = editor.value;
|
||||
|
||||
try {
|
||||
// Call the C++ function 'run_source' exported via EMSCRIPTEN_KEEPALIVE
|
||||
// int run_source(char* code)
|
||||
solsticeModule.ccall(
|
||||
'run_source', // function name
|
||||
'number', // return type
|
||||
['string'], // argument types
|
||||
[code] // arguments
|
||||
);
|
||||
} catch (e) {
|
||||
outputDiv.innerHTML += `\n<span class="error">[Runtime Error] ${e}</span>`;
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
5169
playground/playground.js
Normal file
5169
playground/playground.js
Normal file
File diff suppressed because it is too large
Load Diff
BIN
playground/playground.wasm
Executable file
BIN
playground/playground.wasm
Executable file
Binary file not shown.
Reference in New Issue
Block a user