Skip to content

Commit

Permalink
feat: 更换名称
Browse files Browse the repository at this point in the history
  • Loading branch information
Gitjinfeiyang committed Aug 28, 2020
1 parent 1536dcb commit 8c619e9
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 30 deletions.
4 changes: 2 additions & 2 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const path = require('path')
export default {
input: path.resolve(__dirname, '../lib/index'),
output: {
file: path.resolve(__dirname, '../dist/easyFlow.min.js'),
file: path.resolve(__dirname, '../dist/easy-canvas.min.js'),
format: 'umd',
name: 'easyFlow'
name: 'easyCanvas'
},
plugins: [
terser()
Expand Down
1 change: 1 addition & 0 deletions dist/easy-canvas.min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions example/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<body style="background:#fff;">
<canvas id="canvas" style="width:100%; height:100%; position:fixed;"></canvas>

<script src="../dist/easyFlow.min.js"></script>
<script src="../dist/easy-canvas.min.js"></script>
<script src="./draw.js"></script>
<script>
window.onload = function () {
Expand All @@ -43,7 +43,7 @@
}
}, children)
}
easyFlow.component('card', (opt, children, h) => Card(h, children))
easyCanvas.component('card', (opt, children, h) => Card(h, children))

function Title(h, level, title) {
return h('view', {
Expand All @@ -62,7 +62,7 @@
}, title)])
}
[1, 2, 3, 4, 5, 6].forEach(level => {
easyFlow.component(`h${level}`, (opt, children, h) => Title(h, level, children))
easyCanvas.component(`h${level}`, (opt, children, h) => Title(h, level, children))
})
function main() {
const canvas = document.querySelector('#canvas')
Expand All @@ -74,9 +74,9 @@
canvas.width = w * dpr
canvas.height = h * dpr
ctx.scale(dpr, dpr)
layer = easyFlow.createLayer(ctx, { dpr, width: w, height: h })
layer = easyCanvas.createLayer(ctx, { dpr, width: w, height: h })

const node = easyFlow.createElement((h) => {
const node = easyCanvas.createElement((h) => {
return h('scroll-view', { styles: { backgroundColor: '#fff', height: window.innerHeight } },
[
drawListItem(h),
Expand Down
6 changes: 3 additions & 3 deletions example/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<body style="background:#fff;">
<canvas id="canvas" style="width:100%; height:100%;position:fixed;"></canvas>

<script src="../dist/easyFlow.min.js"></script>
<script src="../dist/easy-canvas.min.js"></script>
<script src="./draw.js"></script>
<script>
window.onload = function () {
Expand All @@ -39,9 +39,9 @@
canvas.width = w * dpr
canvas.height = h * dpr
ctx.scale(dpr, dpr)
layer = easyFlow.createLayer(ctx, { dpr, width: w, height: h })
layer = easyCanvas.createLayer(ctx, { dpr, width: w, height: h })

const node = easyFlow.createElement((h) => {
const node = easyCanvas.createElement((h) => {
return h('view', { styles: {} },
[
h('view', {
Expand Down
10 changes: 5 additions & 5 deletions example/image.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<body style="background:#fff;">
<canvas id="canvas" style="width:100%; height:100%; position:fixed;"></canvas>

<script src="../dist/easyFlow.min.js"></script>
<script src="../dist/easy-canvas.min.js"></script>
<script src="./draw.js"></script>
<script>
window.onload = function () {
Expand All @@ -45,7 +45,7 @@
}
}, children)
}
easyFlow.component('card', (opt, children, h) => Card(h, children))
easyCanvas.component('card', (opt, children, h) => Card(h, children))

function Title(h, level, title) {
return h('view', {
Expand All @@ -64,7 +64,7 @@
}, title)])
}
[1, 2, 3, 4, 5, 6].forEach(level => {
easyFlow.component(`h${level}`, (opt, children, h) => Title(h, level, children))
easyCanvas.component(`h${level}`, (opt, children, h) => Title(h, level, children))
})

function main() {
Expand All @@ -77,9 +77,9 @@
canvas.width = w * dpr
canvas.height = h * dpr
ctx.scale(dpr, dpr)
layer = easyFlow.createLayer(ctx, { dpr, width: w, height: h })
layer = easyCanvas.createLayer(ctx, { dpr, width: w, height: h })

const node = easyFlow.createElement((h) => {
const node = easyCanvas.createElement((h) => {
return h('scroll-view', { styles: { backgroundColor: '#f1f1f1', height: window.innerHeight } },
[
h('card', {}, [
Expand Down
10 changes: 5 additions & 5 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<body style="background:#fff;">
<canvas id="canvas" style="width:100%; height:100%; position:fixed;"></canvas>

<script src="../dist/easyFlow.min.js"></script>
<script src="../dist/easy-canvas.min.js"></script>
<script src="./draw.js"></script>
<script>
window.onload = function () {
Expand All @@ -29,7 +29,7 @@
main()
}

const host = 'https://gitjinfeiyang.github.io/easyFlow/example/'
const host = 'https://gitjinfeiyang.github.io/easy-canvas/example/'
const examples = [
{ title: 'Basic', desc: '基本布局', url: 'basic.html' },
{ title: 'Event 事件', desc: '事件监听', url: 'event.html' },
Expand All @@ -48,10 +48,10 @@
canvas.width = w * dpr
canvas.height = h * dpr
ctx.scale(dpr, dpr)
layer = easyFlow.createLayer(ctx, { dpr, width: w, height: h })
layer = easyCanvas.createLayer(ctx, { dpr, width: w, height: h })

const background = 'https://tse1-mm.cn.bing.net/th/id/OIP.Dkj8fnK1SsPHIBmAN9XnUAHaNK?pid=Api&rs=1'
const node = easyFlow.createElement((h) => {
const node = easyCanvas.createElement((h) => {
const list = examples.map(item => {
return h('view', {
data: item,
Expand All @@ -74,7 +74,7 @@
[
h('view', { styles: { height: 300 } }, [
h('image', { styles: { width: '100%', height: '100%', position: 'absolute' }, attrs: { src: background, mode: 'aspectFill' }, }),
h('view', { styles: { backgroundColor: 'rgba(255,255,255,0.5)', fontSize: 30, padding: 10, position: 'absolute', bottom: 0, left: 0, width: '100%', textAlign: 'center' } }, [h('text', { styles: {} }, 'easyFlow')])
h('view', { styles: { backgroundColor: 'rgba(255,255,255,0.5)', fontSize: 30, padding: 10, position: 'absolute', bottom: 0, left: 0, width: '100%', textAlign: 'center' } }, [h('text', { styles: {} }, 'easyCanvas')])
]),
...list
]
Expand Down
8 changes: 4 additions & 4 deletions example/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<body style="background:#fff;">
<canvas id="canvas" style="width:100%; height:100%; position:fixed;"></canvas>

<script src="../dist/easyFlow.min.js"></script>
<script src="../dist/easy-canvas.min.js"></script>
<script src="./draw.js"></script>
<script>
window.onload = function () {
Expand All @@ -39,9 +39,9 @@
canvas.width = w * dpr
canvas.height = h * dpr
ctx.scale(dpr, dpr)
layer = easyFlow.createLayer(ctx, { dpr, width: w, height: h })
layer = easyCanvas.createLayer(ctx, { dpr, width: w, height: h })

const node = easyFlow.createElement((h) => {
const node = easyCanvas.createElement((h) => {
return h('view', { styles: { backgroundColor: '#fff' } }, [
// this.drawBox(h),
this.drawSimple(h),
Expand All @@ -57,7 +57,7 @@
}

// 注册全局组件
easyFlow.component('button', (opt, children, h) => this.drawButton(h, children))
easyCanvas.component('button', (opt, children, h) => this.drawButton(h, children))
canvas.ontouchstart = ontouchstart
canvas.ontouchmove = ontouchmove
canvas.ontouchend = ontouchend
Expand Down
2 changes: 1 addition & 1 deletion example/test1.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<body style="background:#fff;">
<canvas id="canvas" style="width:100%; height:100%; position:fixed;"></canvas>

<script src="../dist/easyFlow.min.js"></script>
<script src="../dist/easy-canvas.min.js"></script>
<script src="./draw.js"></script>
<script>
window.onload = function () {
Expand Down
2 changes: 1 addition & 1 deletion example/weapp/easyFlow.min.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.easyFlow = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.easyCanvas = factory());
}(this, (function () { 'use strict';

const DISPLAY = {
Expand Down
2 changes: 1 addition & 1 deletion example/weapp/pages/index/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//index.js
//获取应用实例
import ef from '../../easyFlow.min'
import ef from '../../easy-canvas.min'
const app = getApp()

Page({
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "easyflow",
"version": "1.0.0",
"name": "easy-canvas",
"version": "0.0.1",
"description": "A canvas lib helps us easy to layout with canvas.",
"main": "./lib/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "rollup -c ./build/rollup.config.js",
"copy": "cp ./dist/easyFlow.min.js ./example/weapp && cp ./example/draw.js ./example/weapp"
"copy": "cp ./dist/easy-canvas.min.js ./example/weapp && cp ./example/draw.js ./example/weapp"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 8c619e9

Please sign in to comment.