>
</head>

<body>
<canvas id='canvas' width='950' height='520'>
    Canvas not supported
</canvas>

<script>
    'use strict';

    let canvas = document.getElementById('canvas'),
        context = canvas.getContext('2d'),
        image = new Image(),
        gradient = context.createLinearGradient(0,0,canvas.width,canvas.height),
        text = 'Canvas',

        //在图片加载之后创建一个'模式'
        pattern;

    //Function……

    /**
     * 画背景
     */
    let drawBackground=()=> 