mirror of
https://forge.murkfall.net/bluesaxman/librePECS.git
synced 2026-03-13 02:04:20 -06:00
broke out library to its own js file and implimented modules
This commit is contained in:
@@ -2,8 +2,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>librePECS</title>
|
<title>librePECS</title>
|
||||||
<link href="main.css" rel="stylesheet" />
|
<link href="main.css" rel="stylesheet" />
|
||||||
<script src="pecslib.js"></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body></body>
|
<body></body>
|
||||||
<script src="main.js"></script>
|
<script type="module" src="main.js"></script>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
13
library.js
Normal file
13
library.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { pec } from './pecslib.js';
|
||||||
|
|
||||||
|
// Populate Library
|
||||||
|
var library = [];
|
||||||
|
library.push(new pec("No","images/cards_conversation_no.svg"));
|
||||||
|
library.push(new pec("Up",""));
|
||||||
|
library.push(new pec("More",""));
|
||||||
|
library.push(new pec("Drink","images/cards_food_thirsty.svg"));
|
||||||
|
library.push(new pec("Food","images/cards_food_hungry.svg"));
|
||||||
|
library.push(new pec("Toy",""));
|
||||||
|
// add more here
|
||||||
|
|
||||||
|
export { library as library };
|
||||||
11
main.js
11
main.js
@@ -1,3 +1,5 @@
|
|||||||
|
import { pecBoard, pec } from './pecslib.js';
|
||||||
|
|
||||||
// gui object classes?
|
// gui object classes?
|
||||||
// Why am I doing this?
|
// Why am I doing this?
|
||||||
class auxillery_dialog {
|
class auxillery_dialog {
|
||||||
@@ -132,7 +134,6 @@ function repopBoards (current=0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
boardTab.innerText = name;
|
boardTab.innerText = name;
|
||||||
console.log(boardTab);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,12 +205,8 @@ repopBoards(0);
|
|||||||
repopGrid(app.currentBoard);
|
repopGrid(app.currentBoard);
|
||||||
|
|
||||||
// Populate Library
|
// Populate Library
|
||||||
app.library = [];
|
import { library as library } from './library.js';
|
||||||
app.library.push(new pec("No","images/cards_conversation_no.svg"));
|
app.library = library;
|
||||||
app.library.push(new pec("Up",""));
|
|
||||||
app.library.push(new pec("More",""));
|
|
||||||
app.library.push(new pec("Drink","images/cards_food_thirsty.svg"));
|
|
||||||
app.library.push(new pec("Food","images/cards_food_hungry.svg"));
|
|
||||||
// add more here
|
// add more here
|
||||||
app.library.forEach((p,i)=>{
|
app.library.forEach((p,i)=>{
|
||||||
var newPec = document.createElement("span");
|
var newPec = document.createElement("span");
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class pec {
|
export class pec {
|
||||||
// this is the object for the pecs themselves, this will be used both
|
// this is the object for the pecs themselves, this will be used both
|
||||||
// to populate the library, and to occupy pecSlot objects
|
// to populate the library, and to occupy pecSlot objects
|
||||||
constructor (word,image) {
|
constructor (word,image) {
|
||||||
@@ -35,7 +35,7 @@ class pecSlot {
|
|||||||
// Do I actually need this?
|
// Do I actually need this?
|
||||||
}
|
}
|
||||||
|
|
||||||
class pecBoard {
|
export class pecBoard {
|
||||||
constructor (pecs=[]) {
|
constructor (pecs=[]) {
|
||||||
var initPecs = [
|
var initPecs = [
|
||||||
null,null,null,null,
|
null,null,null,null,
|
||||||
|
|||||||
Reference in New Issue
Block a user