Skip to content

Commit

Permalink
dragging cards
Browse files Browse the repository at this point in the history
SQUASHED: AUTO-COMMIT-demos-stefan-untitled-board-game-ubg-card.js,AUTO-COMMIT-demos-stefan-untitled-board-game-ubg-cards-exporter.js,AUTO-COMMIT-src-client-clipboard.js,AUTO-COMMIT-src-components-tools-lively-container.js,AUTO-COMMIT-src-components-tools-lively-container-navbar.html,AUTO-COMMIT-src-components-tools-lively-container-navbar.js,AUTO-COMMIT-src-components-widgets-ubg-card.html,AUTO-COMMIT-src-components-widgets-ubg-card.js,AUTO-COMMIT-src-components-widgets-ubg-cards-editor.html,AUTO-COMMIT-src-components-widgets-ubg-cards-editor.js,AUTO-COMMIT-src-components-widgets-ubg-cards-entry.html,AUTO-COMMIT-src-components-widgets-ubg-cards-entry.js,AUTO-COMMIT-src-components-widgets-ubg-cards.html,AUTO-COMMIT-src-components-widgets-ubg-cards.js,
  • Loading branch information
onsetsu committed Apr 9, 2024
1 parent aeda6a2 commit 92b4bb6
Show file tree
Hide file tree
Showing 13 changed files with 510 additions and 3,562 deletions.
15 changes: 15 additions & 0 deletions demos/stefan/untitled-board-game/ubg-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ export default class Card {
this.versions.last.name = name;
}

getIdentity() {
return this.identity;
}

setIdentity(identity) {
if (identity === undefined) {
delete this.identity;
} else {
this.identity = identity;
}
}

getType() {
return this.versions.last.type;
}
Expand Down Expand Up @@ -183,4 +195,7 @@ export default class Card {
return this.versions.length;
}

toString() {
return `Card ${this.getName() || this.getId()}`
}
}
9 changes: 4 additions & 5 deletions demos/stefan/untitled-board-game/ubg-cards-exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ export default class CardExporter {
}

/*MD ## Layout & Rendering MD*/
static async execute(cards, ubgCards) {
const cardsToPrint = cards.slice(0, 14)

static async execute(cardsToPrint, ubgCards, skipCardBack) {
this.printWithSavedWorld(async () => {
const body = document.body
body.innerHTML = ''
// body.style = ""

await this.buildCards(undefined, cardsToPrint, false, ubgCards)
await this.buildCards(undefined, cardsToPrint, skipCardBack, ubgCards)
})
}

Expand All @@ -70,7 +68,8 @@ box-shadow: inset 0px 0px 0px 2px black;
static createCardPreview(card, ubgCards) {
const cardPreview = document.createElement('ubg-card')
cardPreview.setCard(card)
cardPreview.src = ubgCards.src
cardPreview.setCards(ubgCards.cards)
cardPreview.setSrc(ubgCards.src)
return cardPreview
}

Expand Down
2 changes: 2 additions & 0 deletions src/client/clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

/* global that */


import {pt} from 'src/client/graphics.js';
import Halo from "src/components/halo/lively-halo.js";
import { uuid } from 'utils';
import persistence from "src/client/persistence.js"

import {default as HaloService} from "src/components/halo/lively-halo.js"


export default class Clipboard {

static load() {
Expand Down
1 change: 1 addition & 0 deletions src/components/tools/lively-container-navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,7 @@ export default class LivelyContainerNavbar extends Morph {
eaMethodInfo.class = classInfo.name // for later use
var name = eaMethodInfo.name
var methodItem = this.createDetailsItem(name)
debugger
if (eaMethodInfo.static) {
methodItem.insertBefore(<span class="mod">static</span>, methodItem.querySelector("a"))
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/tools/lively-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ export default class Container extends Morph {
if (render) {
return this.appendHtml('<lively-bibtex src="'+ url +'"></lively-bibtex>', renderTimeStamp);
}
} else if (format == "json" && files.name(url).startsWith('all-cards')) {
} else if (format == "json" && files.name(url).includes('all-cards')) {
this.sourceContent = content;
if (render) {
return this.appendHtml('<ubg-cards id="editor" src="'+ url +'"></ubg-cards>', renderTimeStamp);
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/ubg-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
background-position: center center;
}
#outer {
box-shadow: inset 0px 0px 0px 2px #0f0;
/* box-shadow: inset 0px 0px 0px 2px #0f0; */
width: 100%;
height: 100%;
/* background-color: transparent;
Expand Down
Loading

0 comments on commit 92b4bb6

Please sign in to comment.