Browse Source

Update

master
Adrian Heine 8 months ago
parent
commit
c61cbabca7
4 changed files with 6 additions and 2 deletions
  1. +1
    -1
      src/data.js
  2. +1
    -0
      src/display.js
  3. +3
    -0
      src/index.js
  4. +1
    -1
      style.css

+ 1
- 1
src/data.js View File

@@ -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
- 0
src/display.js View File

@@ -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
- 0
src/index.js View File

@@ -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
}


+ 1
- 1
style.css View File

@@ -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