MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / animation

Function animation

code/styling/public/app.js:23325–23394  ·  view source on GitHub ↗

* Animation * * @param {string} input * @return {string}

(input)

Source from the content-addressed store, hash-verified

23323 * @return {string}
23324 */
23325 function animation (input) {
23326 var length = input.length
23327 var index = input.indexOf(':', 9) + 1
23328 var declare = input.substring(0, index).trim()
23329 var out = input.substring(index, length-1).trim()
23330
23331 switch (input.charCodeAt(9)*keyed) {
23332 case 0: {
23333 break
23334 }
23335 // animation-*, -
23336 case DASH: {
23337 // animation-name, n
23338 if (input.charCodeAt(10) !== 110) {
23339 break
23340 }
23341 }
23342 // animation/animation-name
23343 default: {
23344 // split in case of multiple animations
23345 var list = out.split((out = '', animationptn))
23346
23347 for (var i = 0, index = 0, length = list.length; i < length; index = 0, ++i) {
23348 var value = list[i]
23349 var items = value.split(propertiesptn)
23350
23351 while (value = items[index]) {
23352 var peak = value.charCodeAt(0)
23353
23354 if (keyed === 1 && (
23355 // letters
23356 (peak > AT && peak < 90) || (peak > 96 && peak < 123) || peak === UNDERSCORE ||
23357 // dash but not in sequence i.e --
23358 (peak === DASH && value.charCodeAt(1) !== DASH)
23359 )) {
23360 // not a number/function
23361 switch (isNaN(parseFloat(value)) + (value.indexOf('(') !== -1)) {
23362 case 1: {
23363 switch (value) {
23364 // not a valid reserved keyword
23365 case 'infinite': case 'alternate': case 'backwards': case 'running':
23366 case 'normal': case 'forwards': case 'both': case 'none': case 'linear':
23367 case 'ease': case 'ease-in': case 'ease-out': case 'ease-in-out':
23368 case 'paused': case 'reverse': case 'alternate-reverse': case 'inherit':
23369 case 'initial': case 'unset': case 'step-start': case 'step-end': {
23370 break
23371 }
23372 default: {
23373 value += key
23374 }
23375 }
23376 }
23377 }
23378 }
23379
23380 items[index++] = value
23381 }
23382

Callers 1

propertyFunction · 0.85

Calls 1

vendorFunction · 0.85

Tested by

no test coverage detected