MCPcopy
hub / github.com/jlmakes/scrollreveal / SequenceModel

Function SequenceModel

src/instance/functions/sequence.js:82–106  ·  view source on GitHub ↗
(seq, prop, store)

Source from the content-addressed store, hash-verified

80}
81
82function SequenceModel(seq, prop, store) {
83 this.head = []
84 this.body = []
85 this.foot = []
86
87 each(seq.members, (id, index) => {
88 const element = store.elements[id]
89 if (element && element[prop]) {
90 this.body.push(index)
91 }
92 })
93
94 if (this.body.length) {
95 each(seq.members, (id, index) => {
96 const element = store.elements[id]
97 if (element && !element[prop]) {
98 if (index < this.body[0]) {
99 this.head.push(index)
100 } else {
101 this.foot.push(index)
102 }
103 }
104 })
105 }
106}
107
108function cue(seq, i, direction, pristine) {
109 const blocked = ['head', null, 'foot'][1 + direction]

Callers

nothing calls this directly

Calls 1

eachFunction · 0.85

Tested by

no test coverage detected