cnchar/public/index.js

118 lines
3.1 KiB
JavaScript
Raw Normal View History

2020-12-13 17:52:29 +08:00
// import cnchar from '../src/main/index';
import cnchar from '../src/main/ts/index';
2020-11-23 18:10:14 +08:00
import '../src/plugin/order';
import '../src/plugin/trad';
import '../src/plugin/poly';
import '../src/plugin/draw';
import '../src/plugin/idiom';
import '../src/plugin/xhy';
import '../src/plugin/radical';
2020-05-29 21:21:13 +08:00
2020-06-03 18:11:37 +08:00
// import spell from '../src/main/spell-dict-jian.json';
2020-12-13 17:52:29 +08:00
// window.keys = Object.keys(spell);
import cncharDraw from '../src/plugin/draw';
2020-04-13 16:46:50 +08:00
2020-07-07 19:08:30 +08:00
// import cnchar from '../npm/cnchar';
// import '../npm/order';
// import '../npm/trad';
// import '../npm/poly';
// import '../npm/draw';
// import '../npm/idiom';
// import '../npm/xhy';
2020-10-17 14:52:09 +08:00
// import '../npm/radical';
2020-11-23 18:10:14 +08:00
// import cnchar from '../npm/cnchar/cnchar.min.js';
// import '../npm/order/cnchar.order.min.js';
// import '../npm/trad/cnchar.trad.min.js';
// import '../npm/poly/cnchar.poly.min.js';
// import '../npm/draw/cnchar.draw.min.js';
// import '../npm/idiom/cnchar.idiom.min.js';
// import '../npm/xhy/cnchar.xhy.min.js';
// import '../npm/radical/cnchar.radical.min.js';
2020-10-17 14:52:09 +08:00
console.log(cnchar);
// import './plugin/draw'
// console.log('1',cnchar)
console.log(cnchar.stroke('一个', 'order'));
console.log(cnchar.stroke('長城', 'count', 'order', 'name'));
2020-12-13 17:52:29 +08:00
console.log(cnchar.orderToWord(['横', '撇', '捺']));
console.log(cnchar.orderToWord(['横', '撇', '捺'], 'start'));
2020-10-17 14:52:09 +08:00
console.log(cnchar.spellToWord('lv2'));
console.log(cnchar.spellInfo('lǘ'));
console.log(cnchar.strokeToWord(1));
console.log('美好的地方'.spell('tone'));
2020-04-13 16:46:50 +08:00
2020-04-08 08:13:55 +08:00
2020-12-13 17:52:29 +08:00
cncharDraw('你好', {
type: cncharDraw.TYPE.NORMAL,
el: '#drawArea',
style: {
radicalColor: '#44f',
backgroundColor: '#ccc'
},
animation: {
animateComplete () {
console.log('animateComplete');
},
loopAnimate: true,
autoAnimate: false, // false 时点击出发animate 只能触发一次
// stepByStep: false
},
test: {
onTestStatus (d) {
console.log(d);
}
}
});
cnchar.draw('中国', {
el: '#drawArea',
type: cnchar.draw.TYPE.NORMAL,
style: {
radicalColor: '#44f',
backgroundColor: '#eee',
length: 100,
2020-07-07 19:08:30 +08:00
2020-12-13 17:52:29 +08:00
},
});
cnchar.draw('你好', {
type: cnchar.draw.TYPE.STROKE,
style: {
radicalColor: '#44f',
backgroundColor: '#eee',
length: 60,
},
});
cnchar.draw('中国', {
type: cnchar.draw.TYPE.TEST,
style: {
radicalColor: '#44f',
backgroundColor: '#eee',
length: 100,
2020-11-08 15:36:36 +08:00
2020-12-13 17:52:29 +08:00
},
});
2020-07-07 19:08:30 +08:00
2020-12-13 17:52:29 +08:00
cnchar.draw('你好', {
type: cnchar.draw.TYPE.ANIMATION,
style: {
radicalColor: '#44f',
backgroundColor: '#eee',
length: 120,
2020-07-07 19:08:30 +08:00
2020-12-13 17:52:29 +08:00
},
});
2020-04-08 08:13:55 +08:00
2020-04-06 01:51:13 +08:00
export default cnchar;
// var cnchar = require('./main/index')
// var order = require('./plugin/order')
// var trad = require('./plugin/trad')
// var poly = require('./plugin/poly')
// cnchar.use(order,trad,poly)
// console.log(cnchar.stroke("一个",'order'))
// console.log(cnchar.stroke('長城','count','order','name'))
// module.exports = cnchar
// import b from './b'
// // var b = require('./b')
// console.log(b);