Browse Source

Update

master
Adrian Heine 4 years ago
parent
commit
c61cbabca7
  1. 2
      src/data.js
  2. 1
      src/display.js
  3. 3
      src/index.js
  4. 2
      style.css

2
src/data.js

@ -67,7 +67,7 @@ export const items = [
},
{
icon: 'UnskilledLabour2.svg',
linkable: ['Gefährdete Gesundheit'],
linkable: ['Gefährdete Gesundheit', 'Überarbeitet', 'Arm'],
img: 'hans.png',
name: 'Hans',
desc: '12, Kinderarbeiter',

1
src/display.js

@ -19,6 +19,7 @@ export class Display {
target.addEventListener('dragstart', e => {
let target = findA(e.target)
if (!target || !target.draggable) return
e.dataTransfer.clearData()
e.dataTransfer.setData('application/prs.x', target.dataset['id'])
e.dataTransfer.effectAllowed = 'link'
})

3
src/index.js

@ -24,6 +24,9 @@ class Actions {
state.show = null
}
link(from, to) {
if (from == to) return false
const ok = state.items[from].linkable.filter(i => state.items[to].linkable.includes(i)).length > 0
if (!ok) return false
state.links.push({id: state.links.length, from, to})
return true
}

2
style.css

@ -62,7 +62,7 @@ body {
text-align: center;
position: absolute;
transform-origin: 0 0;
font-size: 1.2em;
font-size: 1.4em;
padding: 0 70px;
box-sizing: border-box;
}

Loading…
Cancel
Save