Skip to content

Instantly share code, notes, and snippets.

@bnolan
Created February 27, 2020 00:21
Show Gist options
  • Save bnolan/7daf85be779fa1e521e15a95471c823e to your computer and use it in GitHub Desktop.
Save bnolan/7daf85be779fa1e521e15a95471c823e to your computer and use it in GitHub Desktop.
hasBudgetFor (feature) {
let count = this.features.filter(f => f.type === feature.type).length
if (isLowPerformance()) {
if (feature.type === 'particles') {
return count < 4
} else if (feature.type === 'polytext') {
return count < 6
} else if (feature.type === 'image') {
return count < 100
} else if (feature.type === 'sign') {
return count < 100
} else if (feature.type === 'richtext') {
return count < 10
} else if (feature.type === 'video') {
return count < 0
} else if (feature.type === 'audio') {
// temporary
return count < 0
} else if (feature.type === 'button') {
return count < 3
} else if (feature.type === 'button') {
return count < 3
} else if (feature.type === 'vox-model') {
return count < 80
} else if (feature.type === 'nft-image') {
return count < 100
} else {
return true
}
} else {
if (feature.type === 'particles') {
return count < 4
} else if (feature.type === 'polytext') {
return count < 40
} else if (feature.type === 'vox-model') {
return count < 128
} else {
return true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment