成人无码视频,亚洲精品久久久久av无码,午夜精品久久久久久毛片,亚洲 中文字幕 日韩 无码

資訊專欄INFORMATION COLUMN

簡介 jCanvas:當(dāng) jQuery遇上HTML5 Canvas

QiuyueZhong / 1013人閱讀

摘要:上面的代碼片段表示,存儲對象到一個名為的變量中。這也是一個可選的參數(shù),如果不設(shè)置,則默認(rèn)為搖擺動畫完成之后的回調(diào)函數(shù),也是可選的。

HTML5 可以直接在你的網(wǎng)頁中使用 元素及其相關(guān)的 JavaScript API繪制的圖形。

在這篇文章中,我將向你介紹 jCanvas,一個基于 jQuery的免費(fèi)且開源的 HTML5的Canvas API。

如果你使用 jQuery 進(jìn)行開發(fā),jCanvas能夠使用 jQuery更簡單,更快速的完成一些非常炫酷的 canvas畫布及交互效果。

什么是 jCanvas ?

jCanvas 官網(wǎng)是這樣解釋的:

“jCanvas is a JavaScript library, written using jQuery and for jQuery, that wraps around the HTML5 canvas API, adding new features and capabilities, many of which are customizable. Capabilities include layers, events, drag-and-drop, animation, and much more.

The result is a flexible API wrapped up in a sugary, jQuery-esque syntax that brings power and ease to the HTML5 canvas. ”

jCanvas 能讓你做的一切事情,你都可以用原生的Canvas API來實(shí)現(xiàn),甚至可以做更多的事情。如果你愿意的話,你也可以將原生的Canvas API方法和 jCanvas一起使用。draw()方法就可以這樣使用。此外,你還可以非常輕松的用自己的方法結(jié)合 extend()函數(shù)來擴(kuò)展jCanvas的功能。

添加jCanvas 到你的項(xiàng)目中

將jCanavs添加在你的項(xiàng)目中,從官方網(wǎng)站或GitHub的頁面上下載腳本,然后將腳本文件放在你的項(xiàng)目文件夾中。正如前面說的,jCanvas需要依賴 jQuery才能正常工作,所以還要確保引入了 jQuery文件。

項(xiàng)目的腳本文件將是這個樣子:



最后,引入你自己的JavaScript 代碼文件。現(xiàn)在,讓我們開始jCanvas之旅吧。

設(shè)置 HTML文檔

我們通過為 HTMl5文檔添加一個標(biāo)簽,來開始我們的示例。


 

This is fallback content for users of assistive technologies or of browsers that don"t have full support for the Canvas API.

以下是關(guān)于上面的代碼片段的幾點(diǎn)說明。

默認(rèn)情況下,的尺寸300px x 150px,你可以在width 和 height 屬性里修改默認(rèn)的大小。

id屬性不是必須添加的,但是確是 JavaScript訪問該元素的最簡單的方法。

元素中的內(nèi)容只是位圖,這使得它無法被使用輔助技術(shù)的用戶訪問。另外,對不支持 Canvas API的瀏覽器,將不能夠訪問其內(nèi)容或者任何方式的交互。因此,該技術(shù)旨在讓更容易被支持。

如果你想使用原生的Canvas API,你的 JavaScript 代碼將會這樣的:

var canvas = document.getElementById("myCanvas"),
context = canvas.getContext("2d");

上述代碼中的context變量存儲了Canvas對象的一個2D上下文屬性。正是這種特性,使得你可以訪問 HTML5的 Canvas API提供的所有其他屬性和方法。

如果你想了解的更多,你可以戳這里HTML5 Canvas 簡介。

jCanvas的方法和屬性已經(jīng)包含了2D上下文的引用,因此你可以直接的跳到繪制圖片。

用jCanvas繪制一些圖形

大多數(shù)的 jCanvas方法,接受鍵值對的形式,因此你可以根據(jù)你的需要,或你喜歡的順序去使用它們。

讓我們從繪制一個矩形開始吧。

矩形

下面是你怎樣用 jCanvas對象的 drawRect() 方法繪制出一個矩形的方法。

// Store the canvas object into a variable
var $myCanvas = $("#myCanvas");

// rectangle shape 
$myCanvas.drawRect({
      fillStyle: "steelblue",
      strokeStyle: "blue",
      strokeWidth: 4,
      x: 150, y: 100,
      fromCenter: false,
      width: 200,
     height: 100
});

上面的代碼片段表示,存儲 Canvas對象到一個名為$myCanvas的變量中。里面的drawRect()方法的屬性都是比較簡單的,但是我們在這里簡單的闡述一下:

fillStyle 設(shè)置矩形的背景色;

strokeStyle 設(shè)置它的邊框顏色;

strokeWidth 設(shè)置矩形的邊框?qū)挾?

x 和 y設(shè)置對應(yīng)矩形的坐標(biāo)的水平和垂直的畫布內(nèi)測的位置。頂點(diǎn)的0值的分別為 x和y,也就是說,(0,0),對應(yīng)于畫布的左上角。x坐標(biāo)向右增大,y坐標(biāo)朝向畫布的底部增加。默認(rèn)情況下,jCanvas會以矩形的中心點(diǎn)作為x和y坐標(biāo)的值;

要想改變這一點(diǎn),以便x和y對應(yīng)矩形的左上角,可以將fromCenter屬性的值設(shè)置為 false;

最后,通過寬度和高度屬性設(shè)置矩形的尺寸。

下面是矩形的示例代碼:

HTML:

jCanvas example: Rectangle

This is fallback content for users of assistive technologies or of browsers that don"t have full support for the Canvas API.

CSS:

body {
  text-align: center;
}

canvas {
  margin: auto;
  display: block;
}

JS:

// Store the canvas object into a variable
var $myCanvas = $("#myCanvas");

// rectangle shape 
$myCanvas.drawRect({
  fillStyle: "steelblue",
  strokeStyle: "blue",
  strokeWidth: 4,
  x: 190,
  y: 50,
  fromCenter: false,
  width: 200,
  height: 100
});

Result:

jCanvas example: Rectangle

圓弧和圓

弧是一個圓的邊緣部分。對于jCanvas來說,畫一個圓弧僅僅是在 drawArc() 方法里設(shè)置幾個所需的屬性:

$myCanvas.drawArc({
  strokeStyle: "steelblue",
  strokeStyle: "blue",
  strokeWidth: 4,
  x: 300, y: 100,
  radius: 50,
  // start and end angles in degrees
  start: 0, end: 200
});

繪制弧形,需要設(shè)置半徑屬性的值,以及開始的角度和結(jié)束的角度。如果你希望弧形是逆時針方向的話,需要添加一個ccw屬性,并將其屬性值設(shè)置為true。

下面是上述代碼塊演示:

HTML:

jCanvas example: Arc

This is fallback content for users of assistive technologies or of browsers that don"t have full support for the Canvas API.

CSS:

body {
  text-align: center;
}

canvas {
  margin: auto;
  display: block;
}

JS:

// Store the canvas object into a variable
var $myCanvas = $("#myCanvas");

$myCanvas.drawArc({
  strokeStyle: "steelblue",
  strokeStyle: "blue",
  strokeWidth: 4,
  x: 300, y: 100,
  radius: 50,
  // start and end angles in degrees
  start: 0, end: 200
});

Result:

jCanvas example: Arc

繪制一個圓形:

舉例來說,下面是如何只使用圓弧形狀來繪制出一個簡單的笑臉圖形:

$myCanvas.drawArc({
  // draw the face
  fillStyle: "yellow",
  strokeStyle: "#333",
  strokeWidth: 4,
  x: 300, y: 100,
  radius: 80
}).drawArc({
  // draw the left eye
  fillStyle: "#333",
  strokeStyle: "#333",
  x: 250, y: 70,
  radius: 5
}).drawArc({
  // draw the right eye
  fillStyle: "#333",
  strokeStyle: "#333",
  x: 350, y: 70,
  radius: 5
}).drawArc({
  // draw the nose
  strokeStyle: "#333",
  strokeWidth: 4,
  ccw: true,
  x: 300, y: 100,
  radius: 30,
  start: 0,
  end: 200
}).drawArc({
  // draw the smile
  strokeStyle: "#333",
  strokeWidth: 4,
  x: 300, y: 135,
  radius: 30,
  start: 90,
  end: 280
});    

請記住,jCanvas是基于jQuery的,因此,你可以像jQuery的鏈?zhǔn)讲僮饕粯?,在jCanvas中也可以使用鏈?zhǔn)讲僮鳌?/p>

下面是以上代碼在瀏覽器中的效果:

HTML:

jCanvas example: Smiling Face

This is fallback content for users of assistive technologies or of browsers that don"t have full support for the Canvas API.

CSS:

body {
  text-align: center;
}

canvas {
  margin: auto;
  display: block;
}

JS:

// Store the canvas object into a variable
var $myCanvas = $("#myCanvas");

$myCanvas.drawArc({
  // draw the face
  fillStyle: "yellow",
  strokeStyle: "#333",
  strokeWidth: 4,
  x: 300, y: 100,
  radius: 80
}).drawArc({
  // draw the left eye
  fillStyle: "#333",
  strokeStyle: "#333",
  x: 250, y: 70,
  radius: 5
}).drawArc({
  // draw the right eye
  fillStyle: "#333",
  strokeStyle: "#333",
  x: 350, y: 70,
  radius: 5
}).drawArc({
  // draw the nose
  strokeStyle: "#333",
  strokeWidth: 4,
  ccw: true,
  x: 300, y: 100,
  radius: 30,
  start: 0,
  end: 200
}).drawArc({
  // draw the smile
  strokeStyle: "#333",
  strokeWidth: 4,
  x: 300, y: 135,
  radius: 30,
  start: 90,
  end: 280
});

Result:

jCanvas example: Smiling Face

繪制線條和路徑

你可以用drawLine()方法快速的繪制直線,或者定義一系列的線條的連接點(diǎn)。

$myCanvas.drawLine({
  strokeStyle: "steelblue",
  strokeWidth: 10,
  rounded: true,
  closed: true,
  x1: 100, y1: 28,
  x2: 50, y2: 200,
  x3: 300, y3: 200,
  x4: 200, y4: 109
});

上面代碼設(shè)置了 rounded和closed屬性的值為true,從而所繪制的線和角都是閉合的。

HTML:

jCanvas example: Connected lines

This is fallback content for users of assistive technologies or of browsers that don"t have full support for the Canvas API.

CSS:

body {
  text-align: center;
}

canvas {
  margin: auto;
  display: block;
}

JS:

// Store the canvas object into a variable
var $myCanvas = $("#myCanvas");

$myCanvas.drawLine({
  strokeStyle: "steelblue",
  strokeWidth: 10,
  rounded: true,
  closed: true,
  x1: 100,
  y1: 28,
  x2: 50,
  y2: 200,
  x3: 300,
  y3: 200,
  x4: 200,
  y4: 109
});

Result:

jCanvas example: Connected lines

還可以使用drawPath()方法繪制路徑。

該drawPath()方法設(shè)置 x 和 y值,你還需要制定你要繪制的路徑的類型,例如直線,圓弧等。

下面教你如何使用 drawPath()方法和drawarrows()方法畫出一對水平和垂直方向的箭頭,后者是一個非常好用的jCanvas方法,能夠使你快速的在畫布上繪制一個箭頭形狀:

$myCanvas.drawPath({
  strokeStyle: "#000",
  strokeWidth: 4,
  x: 10, y: 10,
  p1: {
    type: "line",
    x1: 100, y1: 100,
    x2: 200, y2: 100
  },
  p2: {
    type: "line",
    rounded: true,
    endArrow: true,
    arrowRadius: 25,
    arrowAngle: 90,
    x1: 200, y1: 100,
    x2: 290, y2: 100
 },
 p3: {
   type: "line",
   rounded: true,
   endArrow: true,
   arrowRadius: 25,
   arrowAngle: 90,
   x1: 100, y1: 100,
   x2: 100, y2: 250
  }
});

結(jié)果展示:

HTML:

jCanvas example: Connected Arrows

This is fallback content for users of assistive technologies or of browsers that don"t have full support for the Canvas API.

CSS:

body {
  text-align: center;
}

canvas {
  margin: auto;
  display: block;
}

JS:

// Store the canvas object into a variable
var $myCanvas = $("#myCanvas");

$myCanvas.drawPath({
  strokeStyle: "#000",
  strokeWidth: 4,
  x: 10, y: 10,
  p1: {
    type: "line",
    x1: 100, y1: 100,
    x2: 200, y2: 100
  },
  p2: {
    type: "line",
    rounded: true,
    endArrow: true,
    arrowRadius: 25,
    arrowAngle: 90,
    x1: 200, y1: 100,
    x2: 290, y2: 100
  },
  p3: {
    type: "line",
    rounded: true,
    endArrow: true,
    arrowRadius: 25,
    arrowAngle: 90,
    x1: 100, y1: 100,
    x2: 100, y2: 250
  }
});
    
    

Result:

jCanvas example: Connected Arrows

繪制文本

你可以使用drawText()方法快速的繪制出你需要的文字,這個方法的主要的功能:

text:將此屬性設(shè)置為你想要顯示在畫布上的文字內(nèi)容:例如:‘Hello World’

fontsize:此屬性的值決定了在畫布上的文字的大小。你可以為這個屬性設(shè)置為一個數(shù)字,jCanvas默認(rèn)為像素。另外,你也可以使用pt,但是在這種情況下,你需要用引號將屬性值包括起來

fontFamily:允許你指定您的文字圖像的字體:"Verdana, sans-serif"。

這里的示例代碼:

$myCanvas.drawText({
  text: "Canvas is fun",
  fontFamily: "cursive",
  fontSize: 40,
  x: 290, y: 150,
  fillStyle: "lightblue",
  strokeStyle: "blue",
  strokeWidth: 1
});

在瀏覽器中將是這樣的效果:

HTML:

jCanvas example: Drawing text

This is fallback content for users of assistive technologies or of browsers that don"t have full support for the Canvas API.

CSS:

body {
  text-align: center;
}

canvas {
  margin: auto;
  display: block;
}

JS:

// Store the canvas object into a variable
var $myCanvas = $("#myCanvas");

$myCanvas.drawText({
  text: "jCanvas is fun",
  fontFamily: "cursive",
  fontSize: 40,
  x: 290, y: 150,
  fillStyle: "lightblue",
  strokeStyle: "blue",
  strokeWidth: 1
});

Result:

jCanvas example: Drawing text

繪制圖片

你可以使用drawImage()方法來導(dǎo)入和處理圖片。下面是一個例子:

$myCanvas.drawImage({
  source: "imgs/cat.jpg",
  x: 250, y: 100,
  fromCenter: false,
  shadowColor: "#222",
  shadowBlur: 3,
  rotate: 40
});

這是上面代碼的呈現(xiàn)方式:

HTML:

jCanvas example: Importing and manipulating an image

This is fallback content for users of assistive technologies or of browsers that don"t have full support for the Canvas API.

CSS:

body {
  text-align: center;
}

canvas {
  margin: auto;
  display: block;
}

JS:

// Store the canvas object into a variable
var $myCanvas = $("#myCanvas");

$myCanvas.drawImage({
  source: "https://s3-us-west-2.amazonaws.com/s.cdpn.io/123941/cat.jpg",
  x: 250, y: 100,
  fromCenter: false,
  shadowColor: "#222",
  shadowBlur: 3,
  rotate: 40
});
    
    
    

Result:

jCanvas example: Importing and manipulating an image

你可以隨便的改變上面示例的代碼,戳這里:CodePen demo

Canvas層

如果你曾經(jīng)使用過,如Photoshop或Gimp圖像編輯器類的應(yīng)用程序,你可能會對圖層有所了解,使用圖層最爽的地方在于,你可以在畫布上控制每個圖像。

jCanvas提供了一個功能強(qiáng)大的API,基于你的畫布增加了靈活性。

這里介紹了如何使用jCanvas的層。

添加圖層

你只能在每一個層上繪制一個對象。在你的jCanvas項(xiàng)目中你有兩種添加圖層的方式:

使用 addLayer()方法,其次是drawLayers()方法

在任何的繪制方法里設(shè)置layer屬性的值為true

下面是如何運(yùn)用第一種技術(shù)來繪制一個藍(lán)色矩形:

$myCanvas.addLayer({
  type: "rectangle",
  fillStyle: "steelblue",
  fromCenter: false,
  name: "blueRectangle",
  x: 50, y: 50,
  width: 400, height: 200
}).drawLayers();

HTML:

jCanvas example: Drawing a rectangle with addLayer()

This is fallback content for users of assistive technologies or of browsers that don"t have full support for the Canvas API.

CSS:

body {
  text-align: center;
}

canvas {
  margin: auto;
  display: block;
}

JS:

// Store the canvas object into a variable
var $myCanvas = $("#myCanvas");

$myCanvas.addLayer({
  type: "rectangle",
  fillStyle: "steelblue",
  fromCenter: false,
  name: "blueRectangle",
  x: 50, y: 50,
  width: 400, height: 200
}).drawLayers();
    

Result:

這里是你如何得到同樣矩形的第二種方法:

$myCanvas.drawRect({
  fillStyle: "steelblue",
  layer: true,
  name: "blueRectangle",
  fromCenter: false,
  x: 50, y: 50,
  width: 400, height: 200
});

HTML:

jCanvas example: Using drawing method with layer set to "true"

This is fallback content for users of assistive technologies or of browsers that don"t have full support for the Canvas API.

CSS:

    
body {
  text-align: center;
}

canvas {
  margin: auto;
  display: block;
}

JS:

// Store the canvas object into a variable
var $myCanvas = $("#myCanvas");

$myCanvas.drawRect({
  fillStyle: "steelblue",
  layer: true,
  name: "blueRectangle",
  fromCenter: false,
  x: 50, y: 50,
  width: 400, height: 200
});    
    
    

Result:

正如你所看到的,上面的兩種方法,我們得到了相同的結(jié)果。

最重要的一點(diǎn)是在上面兩個代碼樣本中可以發(fā)現(xiàn),上面的層你通過name設(shè)置的一個名稱。這使得他易于參照本層的代碼做出各種炫酷的東西,像改變其索引值,動畫,刪除等等。

讓我們看看如何能夠做到這一點(diǎn)。

動畫層

你可以使用jCanvas的 animateLayer()方法,快速的在你的基礎(chǔ)圖層上添加動畫,此方法接受以下參數(shù):

該層的 index 或者 name

具有鍵值對的動畫對象

以毫秒為單位的動畫時長(duration)。這是個默認(rèn)的參數(shù),如果不設(shè)置,默認(rèn)為400

動畫的運(yùn)動方式(easing )。這也是一個可選的參數(shù),如果不設(shè)置,則默認(rèn)為搖擺

動畫完成之后的回調(diào)函數(shù)(callback),也是可選的。

讓我們來看一下animateLayer() 方法的效果,我們將在一個層上繪制一個半透明的橙色圓圈,然后設(shè)置動畫的位置,顏色以及透明度屬性:

// Draw circle
$myCanvas.drawArc({
  name: "orangeCircle",
  layer: true,
  x: 50, y: 50,
  radius: 100,
  fillStyle: "orange",
  opacity: 0.5
});

// Animate the circle layer 
$myCanvas.animateLayer("orangeCircle", {
  x: 150, y: 150,
  radius: 50,
}, 1000, function(layer) { // Callback function
  $(this).animateLayer(layer, {
    fillStyle: "darkred",
    x: 250, y: 100,
    opacity: 1
  }, "slow", "ease-in-out");
});
    


看一下下面例子中的動畫:

HTML:

jCanvas example: Animating Layers

This is fallback content for users of assistive technologies or of browsers that don"t have full support for the Canvas API.

CSS:

body {
  text-align: center;
}

canvas {
  margin: auto;
  display: block;
}

JS:

// Store the canvas object into a variable
var $myCanvas = $("#myCanvas");

// Draw circle
$myCanvas.drawArc({
  name: "orangeCircle",
  layer: true,
  x: 50, y: 50,
  radius: 100,
  fillStyle: "orange",
  opacity: 0.5
});

// Animate the circle layer 
$myCanvas.animateLayer("orangeCircle", {
  x: 150, y: 150,
  radius: 50,
}, 1000, function(layer) { // Callback function
  $(this).animateLayer(layer, {
    fillStyle: "darkred",
    x: 250, y: 100,
    opacity: 1
  }, "slow", "ease-in-out");
});

Result:

jCanvas example: Animating Layers

可拖動圖層

我想提醒你注意的是它還有一個很酷的功能,你可以在可拖動層里設(shè)置draggable屬性和layer 屬性的值為true,就可以將一個普通的jCanvas層變成可拖動的層了。

具體方法如下:

$myCanvas.drawRect({
  layer: true,
  draggable: true,
  bringToFront: true,
  name: "blueSquare",
  fillStyle: "steelblue",
  x: 250, y: 150,
  width: 100, height: 100,
  rotate: 80,
  shadowX: -1, shadowY: 8,
  shadowBlur: 2,
  shadowColor: "rgba(0, 0, 0, 0.8)"
})
.drawRect({
  layer: true,
  draggable: true,
  bringToFront: true,
  name: "redSquare",
  fillStyle: "red",
  x: 190, y: 100,
  width: 100, height: 100,
  rotate: 130,
  shadowX: -2, shadowY: 5,
  shadowBlur: 3,
  shadowColor: "rgba(0, 0, 0, 0.5)"
});
    

在上面的代碼段中,通過把屬性draggable設(shè)置為true,繪制出了兩個可拖動的矩形層。此外,請小心使用bringToFront屬性,以確保當(dāng)你拖動層時,他會被自動拖到所有其他現(xiàn)有的圖層的前面。

最后,在上述代碼段中添加旋轉(zhuǎn)圖層的代碼并且設(shè)置一個盒子陰影,只是為了告訴你如何快速的在你的jCanvas圖紙上添加一些特效。

結(jié)果會是這樣的:

如果你想在在你拖動圖層之前,之間或者之后做一些事情的話,jCanvas 可以很容易的利用相關(guān)的回調(diào)函數(shù)來實(shí)現(xiàn)這一點(diǎn):

dragstart:當(dāng)你開始拖動圖層的時候的觸發(fā)器

drag:當(dāng)你正在拖動圖層時發(fā)生

dragstop:當(dāng)你停止拖動圖層時的觸發(fā)器

dragcancel:當(dāng)你拖動的圖層到了畫布表面的邊界時發(fā)生

比方說,當(dāng)用戶完成拖動層之后,你想在頁面上顯示一條消息,你可以通過添加一個回調(diào)函數(shù)dragstop來實(shí)現(xiàn),就像這樣:

$myCanvas.drawRect({
  layer: true,

  // Rest of the code as shown above...

  // Callback function
  dragstop: function(layer) {
    var layerName = layer.name;
    el.innerHTML = "The " + layerName + " layer has been dropped.";
  }
})
.drawRect({
  layer: true,

  // Rest of the code...

  // Callback function
  dragstop: function(layer) {
    var layerName = layer.name;
    el.innerHTML = "The " + layerName + " layer has been dropped.";
  }
});
結(jié)論

在這篇文章中,我向你介紹了jCanvas,一個新的基于jQuery能與HTML5的 Canvas API一起使用的庫。我已經(jīng)簡單的介紹了一些jCanvas的屬性和方法,能夠讓你快速的在畫布和是哪個繪制圖形,增加視覺效果,動畫和拖動圖層。

你可以訪問jCanvas文檔,這里有很多的詳細(xì)指導(dǎo)和示例。你要可以在 jCanvas網(wǎng)站的 sandbox上進(jìn)行快速測試。

作者信息

原文作者:Maria Antonietta Perna
原文鏈接:http://t.cn/Rt82jVj
翻譯自力譜宿云 LeapCloud旗下MaxLeap團(tuán)隊(duì)_前端研發(fā)人員:Ammie白
中文翻譯首發(fā):https://blog.maxleap.cn/archi...
譯者簡介:新晉前端一枚,目前負(fù)責(zé) MaxLeap 網(wǎng)站展示性內(nèi)容的實(shí)現(xiàn)。喜歡自己嘗試寫一些js特效小Demo。

相關(guān)文章
無需Flash實(shí)現(xiàn)圖片裁剪——HTML5中級進(jìn)階

作者往期佳作
如何結(jié)合Gulp使用PostCss

活動預(yù)告

報名鏈接:http://t.cn/Rt9ooRw

文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請注明本文地址:http://m.hztianpu.com/yun/87866.html

相關(guān)文章

  • Sass Mixin 和 Media Merging

    摘要:一些瀏覽器支持嵌套媒體查詢,例如,和但是和目前并沒有支持嵌套媒體查詢。因此,一方面,我們有一個斷點(diǎn)管理器從斷點(diǎn)的全局中選擇并處理錯誤消息,另一方面有一個斷點(diǎn)管理器允許使用多查詢條件。 如果你對 Sass不太熟悉的話,你可能不知道Sass增加了許多非常有趣的功能,例如媒體查詢(即 @media)功能(經(jīng)常被成為 Media Merging媒體合并)。 showImg(https://se...

    Cciradih 評論0 收藏0
  • 【譯】HTML5 游戲入門

    摘要:原文鏈接譯文來自我的博客簡介如果你想用做個游戲,那么來對地方了?,F(xiàn)在可以看到字母在屏幕上移動了,恭喜你,你已經(jīng)快入門了。 原文鏈接 譯文來自我的博客 簡介 如果你想用canvas做個游戲,那么來對地方了。 但是但是你至少知道javascript怎么拼寫(╯‵□′)╯︵┻━┻ 既然沒問題,那先來玩一下或者下載 創(chuàng)建canvas標(biāo)簽 廢話不多說,我們必須創(chuàng)建一個canvas標(biāo)簽,簡單起見,...

    kun_jian 評論0 收藏0

發(fā)表評論

0條評論

閱讀需要支付1元查看
<