This commit is contained in:
jscraft 2024-08-04 02:05:36 +00:00
parent 6e886f6934
commit 537ba6c81a
4 changed files with 88 additions and 154 deletions

58
.replit
View file

@ -1,58 +0,0 @@
hidden=[".config"]
[nix]
channel = "stable-21_11"
[languages.html]
pattern = "**/*.html"
[languages.html.languageServer]
start = ["vscode-html-language-server", "--stdio"]
[languages.html.languageServer.initializationOptions]
provideFormatter = true
[languages.html.languageServer.configuration.html]
customData = [ ]
autoCreateQuotes = true
autoClosingTags = true
mirrorCursorOnMatchingTag = false
[languages.html.languageServer.configuration.html.completion]
attributeDefaultValue = "doublequotes"
[languages.html.languageServer.configuration.html.format]
enable = true
wrapLineLength = 120
unformatted = "wbr"
contentUnformatted = "pre,code,textarea"
indentInnerHtml = false
preserveNewLines = true
indentHandlebars = false
endWithNewline = false
extraLiners = "head, body, /html"
wrapAttributes = "auto"
templating = false
unformattedContentDelimiter = ""
[languages.html.languageServer.configuration.html.suggest]
html5 = true
[languages.html.languageServer.configuration.html.validate]
scripts = true
styles = true
[languages.html.languageServer.configuration.html.hover]
documentation = true
references = true
[languages.html.languageServer.configuration.html.trace]
server = "off"
[languages.javascript]
pattern = "**/{*.js,*.jsx,*.ts,*.tsx,*.mjs,*.cjs}"
[languages.javascript.languageServer]
start = ["typescript-language-server", "--stdio"]
[languages.css]
pattern = "**/{*.less,*.scss,*.css}"
[languages.css.languageServer]
start = "vscode-css-language-server --stdio"

View file

@ -1,7 +0,0 @@
const container = document.getElementById('container');
if (container.textContent.includes('SM64-JS | Made by Chase Wicklund on replit! (@jscraft)')) {
console.log('');
} else {
console.log('Do not steal code. Here is the original repl. https://replit.com/@jscraft/sm64');
}

View file

@ -1,85 +1,90 @@
<title>Click to Start!</title>
<script src="anti-steal.js"></script>
<center><h1>Click to Start!</h1>
<h3>SM64-JS | Made by Chase Wicklund on replit! (@jscraft)</h3></center>
<script>
document.addEventListener('click', () => {
<!--
<html lang="en-us"><head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Super Mario 64</title>
document.write( '<html lang=\"en-us\"><head>\n' );
document.write( ' <meta charset=\"utf-8\">\n' );
document.write( ' <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n' );
document.write( ' <title>Super Mario 64</title>\n' );
document.write( ' <style>\n' );
document.write( ' body, html{\n' );
document.write( ' margin: 0;\n' );
document.write( ' padding: 0;\n' );
document.write( ' width: 100vw;\n' );
document.write( ' min-height: 100vh;\n' );
document.write( ' font-family: Arial, Helvetica, sans-serif;\n' );
document.write( ' color: white;\n' );
document.write( ' image-rendering: pixelated;\n' );
document.write( ' scrollbar-width: none;\n' );
document.write( ' }\n' );
document.write( ' ::-webkit-scrollbar {\n' );
document.write( ' display: none;\n' );
document.write( ' }\n' );
document.write( ' #container {\n' );
document.write( ' width: 100vw;\n' );
document.write( ' height: 100vh;\n' );
document.write( ' display: flex;\n' );
document.write( ' align-items: center;\n' );
document.write( ' justify-content: center;\n' );
document.write( ' }\n' );
document.write( ' canvas {\n' );
document.write( ' width: 100vw;\n' );
document.write( ' height: 100vh;\n' );
document.write( ' }\n' );
document.write( ' </style>\n' );
document.write( ' </head>\n' );
document.write( ' <body>\n' );
document.write( ' <div id=\"container\">\n' );
document.write( ' <canvas class=\"emscripten\" id=\"canvas\" width=\"1920\" height=\"1080\" style=\"cursor: default;\"></canvas>\n' );
document.write( ' </div>\n' );
document.write( ' <script type=\"text/javascript\">\n' );
document.write( ' var Module = {\n' );
document.write( ' preRun: [],\n' );
document.write( ' postRun: [],\n' );
document.write( ' print: (function() {\n' );
document.write( ' return function(text) {\n' );
document.write( ' if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(\' \');\n' );
document.write( ' console.log(text);\n' );
document.write( ' };\n' );
document.write( ' })(),\n' );
document.write( ' printErr: function(text) {\n' );
document.write( ' if (arguments.length > 1)\n' );
document.write( ' text = Array.prototype.slice.call(arguments).join(\' \');\n' );
document.write( ' console.error(text);\n' );
document.write( ' },\n' );
document.write( ' canvas: (function() {\n' );
document.write( ' var canvas = document.getElementById(\'canvas\');\n' );
document.write( ' canvas.width = window.innerWidth; // Todo: how to do this from c++\n' );
document.write( ' canvas.height = window.innerHeight;\n' );
document.write( ' canvas.addEventListener(\"webglcontextlost\", function(e) {\n' );
document.write( ' alert(\'WebGL context lost. You will need to reload the page.\');\n' );
document.write( ' e.preventDefault();\n' );
document.write( ' }, false);\n' );
document.write( ' return canvas;\n' );
document.write( ' })(),\n' );
document.write( ' setStatus: function(text) {\n' );
document.write( ' }\n' );
document.write( ' };\n' );
document.write( ' </script>\n' );
document.write( ' <script async=\"\" type=\"text/javascript\" src=\"sm64.js\"></script>\n' );
document.write( ' <script>\n' );
document.write( ' </script>\n' );
document.write( ' \n' );
document.write( '\n' );
document.write( '\n' );
document.write( '\n' );
document.write( '\n' );
document.write( '</body></html>' );
<style>
body, html {
margin: 0;
padding: 0;
width: 100vw;
min-height: 100vh;
font-family: Arial, Helvetica, sans-serif;
background: black;
color: white;
image-rendering: pixelated;
scrollbar-width: none;
}
::-webkit-scrollbar {
display: none;
}
//-->
})
</script>
#container {
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
canvas {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<div id="container">
<canvas class="emscripten" id="canvas" width="1920" height="1080" style="cursor: default;"></canvas>
</div>
<script type="text/javascript">
var Module = {
preRun: [],
postRun: [],
print: (function() {
return function(text) {
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
console.log(text);
};
})(),
printErr: function(text) {
if (arguments.length > 1)
text = Array.prototype.slice.call(arguments).join(' ');
console.error(text);
},
canvas: (function() {
var canvas = document.getElementById('canvas');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
canvas.addEventListener("webglcontextlost", function(e) {
alert('WebGL context lost. You will need to reload the page.');
e.preventDefault();
}, false);
return canvas;
})(),
setStatus: function(text) {
}
};
</script>
<script>
document.addEventListener("click", function() {
const game = document.createElement("script");
game.setAttribute("async", "");
game.setAttribute("src", "sm64.js");
document.body.appendChild(game);
document.removeEventListener("click", this);
});
</script>
</body>
</html>

View file

@ -1,6 +0,0 @@
{ pkgs }: {
deps = [
pkgs.nodePackages.vscode-langservers-extracted
pkgs.nodePackages.typescript-language-server
];
}