Compare commits

..

No commits in common. "cbe3a3331184318e4e10ebec7111df9b6d98e641" and "1c1d183dbe672f6d559bc8494ec95bf48646997c" have entirely different histories.

6 changed files with 6 additions and 37 deletions

View File

@ -1,11 +1,8 @@
[package] [package]
name = "mixsy" name = "bitsy-merge"
description = "combine Bitsy games" version = "0.71.0"
version = "0.72.0"
authors = ["Max Bradbury <max@tinybird.info>"] authors = ["Max Bradbury <max@tinybird.info>"]
edition = "2018" edition = "2018"
license = "MIT"
repository = "https://tinybird.dev/max/mixsy"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -1,6 +1,5 @@
#!/usr/bin/env bash #!/bin/sh
cargo build
pug index.pug pug index.pug
set -ex set -ex
wasm-pack build --target web wasm-pack build --target web

View File

@ -8,24 +8,12 @@ async function run() {
const output = document.getElementById('c'); const output = document.getElementById('c');
const merge_button = document.getElementById('merge'); const merge_button = document.getElementById('merge');
function handleResult(inputElement, message) {
console.log(message);
let messageBox = inputElement.nextSibling;
messageBox.innerText = message;
messageBox.style.display = "block"
setTimeout(() => {messageBox.style.display = "none"}, 4000);
}
main.addEventListener('change', () => { main.addEventListener('change', () => {
if (main.value) { console.debug(load_main(main.value));
handleResult(main, load_main(main.value));
}
}); });
additional.addEventListener('change', () => { additional.addEventListener('change', () => {
if (additional.value) { console.debug(load_additional(additional.value));
handleResult(additional, load_additional(additional.value));
}
}); });
function mix() { function mix() {

View File

@ -3,8 +3,6 @@ html(lang="en-gb")
head head
meta(content="text/html;charset=utf-8" http-equiv="Content-Type") meta(content="text/html;charset=utf-8" http-equiv="Content-Type")
title mixsy title mixsy
//- no favicon!! taken from: https://k1ss.org/blog/20191004a
<link href=data:, rel=icon>
style style
include style.css include style.css
body body
@ -15,11 +13,9 @@ html(lang="en-gb")
#main.square.left #main.square.left
h2 main h2 main
textarea#a(placeholder="Paste your main game data here...") textarea#a(placeholder="Paste your main game data here...")
p.result
#additional.square.left #additional.square.left
h2 additional h2 additional
textarea#b(placeholder="Paste additional game data here...") textarea#b(placeholder="Paste additional game data here...")
p.result
.row.middle .row.middle
img.centre(src="merge.png" alt="") img.centre(src="merge.png" alt="")
button#merge.centre mix! button#merge.centre mix!

View File

@ -41,11 +41,6 @@ pub fn load_additional(game_data: String) -> String {
#[wasm_bindgen] #[wasm_bindgen]
pub fn merge() -> String { pub fn merge() -> String {
let state = STATE.lock().unwrap(); let state = STATE.lock().unwrap();
if state.main.is_none() || state.additional.is_none() {
return "".to_string();
}
let mut main = state.main.clone().unwrap(); let mut main = state.main.clone().unwrap();
let additional = state.additional.clone().unwrap(); let additional = state.additional.clone().unwrap();
main.merge(additional); main.merge(additional);

View File

@ -72,12 +72,6 @@ textarea {
float: left; float: left;
} }
.result {
position: relative;
background: var(--bg);
color: var(--inverse);
}
.row { .row {
width: 100%; width: 100%;
height: calc(82vmin / 3); height: calc(82vmin / 3);
@ -87,4 +81,4 @@ textarea {
width: 50vmin; width: 50vmin;
height: 100%; height: 100%;
padding: 0.5em; padding: 0.5em;
} }