slight refactor

This commit is contained in:
Daniel Bulant 2021-11-25 18:07:14 +01:00
parent 8206cf1b5d
commit a8216e80ac
4 changed files with 42 additions and 33 deletions

View file

@ -4,7 +4,7 @@
"license": "AGPL-3.0-or-later",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"dev": "rollup -w -c",
"start": "sirv public --no-clear"
},
"devDependencies": {

View file

@ -12,6 +12,8 @@ const production = !process.env.ROLLUP_WATCH;
// List of folders from images/png to convert to webp and save into public/images
const imageFolders = ["angels", "backgrounds", "button", "death", "levels"];
console.log(production ? "PROD MODE" : "DEV MODE");
function serve() {
let server;
@ -21,7 +23,9 @@ function serve() {
return {
writeBundle() {
console.log("wb");
if (server) return;
console.log("Starting server");
server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev', '--host', '0.0.0.0'], {
stdio: ['ignore', 'inherit', 'inherit'],
shell: true

View file

@ -6,9 +6,10 @@
import { gameActive, menuActive } from "../stores/gameActive";
import { toRoman } from "../utils";
import Keypress from "../stores/keypress.svelte";
import Success from "./dialog/success.svelte";
export var current;
export var page;
// export var page;
/** @type {typeof dialog[number]}*/
var d;
@ -200,7 +201,7 @@
{/if}
</div>
{#if success}
<h2>SUCCESS</h2>
<Success />
{/if}
</div>
{/if}
@ -250,36 +251,6 @@
text-align: center;
letter-spacing: 2px;
}
h2 {
position: relative;
width: 400px;
color: white;
font-size: 70px;
letter-spacing: 12px;
text-align: center;
margin: 15px auto;
text-shadow: 0 0 6px white;
animation: shadowAppear .4s ease-out;
}
h2::before, h2::after {
position: absolute;
content: "";
background: white;
box-shadow: 0 0 15px white;
border-radius: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
h2::before {
animation: successLeft .4s, appear .2s;
animation-timing-function: ease-out;
animation-delay: .2s, 0;
}
h2::after {
animation: successRight .4s, appear .2s;
animation-timing-function: ease-out;
animation-delay: .2s, 0;
}
@keyframes shadowAppear {
0% {
text-shadow: 0 0 20px white;

View file

@ -0,0 +1,34 @@
<h2>SUCCESS</h2>
<style>
h2 {
position: relative;
width: 400px;
color: white;
font-size: 70px;
letter-spacing: 12px;
text-align: center;
margin: 15px auto;
text-shadow: 0 0 6px white;
animation: shadowAppear .4s ease-out;
}
h2::before, h2::after {
position: absolute;
content: "";
background: white;
box-shadow: 0 0 15px white;
border-radius: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
h2::before {
animation: successLeft .4s, appear .2s;
animation-timing-function: ease-out;
animation-delay: .2s, 0;
}
h2::after {
animation: successRight .4s, appear .2s;
animation-timing-function: ease-out;
animation-delay: .2s, 0;
}
</style>