animate/webGl/my-threejs-test/node_modules/csso/cjs/replace/atrule/keyframes.cjs

26 lines
818 B
JavaScript
Raw Normal View History

2024-06-24 09:24:00 +00:00
'use strict';
function compressKeyframes(node) {
node.block.children.forEach((rule) => {
rule.prelude.children.forEach((simpleselector) => {
simpleselector.children.forEach((data, item) => {
if (data.type === 'Percentage' && data.value === '100') {
item.data = {
type: 'TypeSelector',
loc: data.loc,
name: 'to'
};
} else if (data.type === 'TypeSelector' && data.name === 'from') {
item.data = {
type: 'Percentage',
loc: data.loc,
value: '0'
};
}
});
});
});
}
module.exports = compressKeyframes;