Compare commits

..

No commits in common. "c87e44e609dd38d4fcda2d56ebe08bb2d847b457" and "89a8897b7aecd1cc591090f58b26f66110215bb2" have entirely different histories.

24 changed files with 48 additions and 21918 deletions

1
.gitignore vendored
View File

@ -8,6 +8,7 @@ pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local

47
README.md Normal file
View File

@ -0,0 +1,47 @@
# Svelte + Vite
This template should help get you started developing with Svelte in Vite.
## Recommended IDE Setup
[VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode).
## Need an official Svelte framework?
Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also powered by Vite. Deploy anywhere with its serverless-first approach and adapt to various platforms, with out of the box support for TypeScript, SCSS, and Less, and easily-added support for mdsvex, GraphQL, PostCSS, Tailwind CSS, and more.
## Technical considerations
**Why use this over SvelteKit?**
- It brings its own routing solution which might not be preferable for some users.
- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.
This template contains as little as possible to get started with Vite + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.
Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate.
**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?**
Setting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding `svelte` and `vite/client` type information.
**Why include `.vscode/extensions.json`?**
Other templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to install the recommended extension upon opening the project.
**Why enable `checkJs` in the JS template?**
It is likely that most cases of changing variable types in runtime are likely to be accidental, rather than deliberate. This provides advanced typechecking out of the box. Should you like to take advantage of the dynamically-typed nature of JavaScript, it is trivial to change the configuration.
**Why is HMR not preserving my local component state?**
HMR state preservation comes with a number of gotchas! It has been disabled by default in both `svelte-hmr` and `@sveltejs/vite-plugin-svelte` due to its often surprising behavior. You can read the details [here](https://github.com/rixo/svelte-hmr#svelte-hmr).
If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR.
```js
// store.js
// An extremely simple external store
import { writable } from 'svelte/store'
export default writable(0)
```

BIN
dist/assets/doom1.wad vendored

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because one or more lines are too long

1
dist/css/.gitignore vendored
View File

@ -1 +0,0 @@
style.css

2
dist/css/98.css vendored

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

45
dist/default.cfg vendored
View File

@ -1,45 +0,0 @@
use_libsamplerate 0
force_software_renderer 0
startup_delay 2000
show_diskicon 1
crispy_soundfix 1
grabmouse 0
fullscreen 0
sfx_volume 8
music_volume 8
show_messages 1
key_right 25
key_left 24
key_up 17
key_down 31
key_strafeleft 30
key_straferight 32
key_fire 57
key_use 18
key_strafe 46
key_speed 42
key_strafe_alt 46
key_speed_alt 42
key_fullscreen 33
use_mouse 1
use_joystick 0
screenblocks 10
detaillevel 0
snd_channels 8
snd_musicdevice 3
snd_sfxdevice 3
snd_sbport 0
snd_sbirq 0
snd_sbdma 0
snd_mport 0
usegamma 0
chatmacro0 "No"
chatmacro1 "I'm ready to kick butt!"
chatmacro2 "I'm OK."
chatmacro3 "I'm not looking too good!"
chatmacro4 "Help!"
chatmacro5 "You suck!"
chatmacro6 "Next time, scumbag..."
chatmacro7 "Come here!"
chatmacro8 "I'll take care of it."
chatmacro9 "Yes"

BIN
dist/doom1.wad vendored

Binary file not shown.

110
dist/index.html vendored
View File

@ -1,110 +0,0 @@
<head>
<link rel="stylesheet" href="/css/98.css">
<link rel="stylesheet" href="/css/style.css">
</head>
<div class="bg-gray-800">
<div class="container m-auto">
<div class="window h-full">
<div class="title-bar">
<div class="title-bar-text">Doom 95</div>
<div class="title-bar-controls">
<button aria-label="Minimize" />
<button aria-label="Maximize" />
<button aria-label="Close" />
</div>
</div>
<div class="window-body w-full h-full m-0">
<div id="container" class="noselect m-0">
<canvas class="frame w-full h-full" id="canvas" oncontextmenu="event.preventDefault()" tabindex="-1" />
</div>
<script>
var commonArgs = [
"-iwad",
"doom1.wad",
"-window",
"-nogui",
"-nomusic",
"-config",
"default.cfg",
"-servername",
"doomflare",
];
var Module = {
onRuntimeInitialized: () => {
console.log("TEST");
callMain(commonArgs);
},
noInitialRun: true,
preRun: () => {
Module.FS.createPreloadedFile(
"",
"doom1.wad",
"doom1.wad",
true,
true
);
Module.FS.createPreloadedFile(
"",
"default.cfg",
"default.cfg",
true,
true
);
},
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.addEventListener(
"webglcontextlost",
function (e) {
alert("WebGL context lost. You will need to reload the page.");
e.preventDefault();
},
false
);
return canvas;
})(),
print: function (text) {
console.log(text);
},
setStatus: function (text) {
console.log(text);
},
totalDependencies: 0,
monitorRunDependencies: function (left) {
this.totalDependencies = Math.max(this.totalDependencies, left);
Module.setStatus(
left
? "Preparing... (" +
(this.totalDependencies - left) +
"/" +
this.totalDependencies +
")"
: "All downloads complete."
);
},
};
window.onerror = function (event) {
Module.setStatus("Exception thrown, see JavaScript console");
Module.setStatus = function (text) {
if (text) Module.printErr("[post-exception status] " + text);
};
};
</script>
<script type="text/javascript" src="websockets-doom.js"></script>
</div>
<div class="status-bar">
<p class="status-bar-field">CPU Usage: 666%</p>
</div>
</div>
</div>
</div>

File diff suppressed because one or more lines are too long

8908
dist/websockets-doom.js vendored

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because one or more lines are too long

1331
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
{
"devDependencies": {
"tailwindcss": "^3.2.4"
},
"scripts": {
"build": "npx tailwindcss -i ./src/style.css -o ./dist/css/style.css --watch"
}
}

View File

@ -1,3 +0,0 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@ -1,8 +0,0 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["dist/*.{html,js,htm}"],
theme: {
extend: {},
},
plugins: [],
}