第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

走進SVG

難度中級
時長 4小時56分
學習人數(shù)
綜合評分9.53
42人評價 查看評價
10.0 內(nèi)容實用
9.2 簡潔易懂
9.4 邏輯清晰
  • SVG動畫

    查看全部
    0 采集 收起 來源:SVG-動畫原理

    2020-01-03

  • 徑向漸變

    radial

    查看全部
  • 線性漸變linear

    查看全部
  • HSL顏色

    查看全部
    0 采集 收起 來源:SVG-RGB和HSL

    2020-01-01

  • <!DOCTYPE?html>
    <html?lang="en">
    <head>
    ??<meta?charset="UTF-8">
    ??<title>sin?text</title>
    ??<style>
    ????html,?body,?svg?{
    ??????margin:?0;
    ??????padding:?0;
    ??????width:?100%;
    ??????height:?100%;
    ????}
    ??</style>
    </head>
    <body>
    <form?>
    ??<fieldset>
    ????<legend>參數(shù)設置</legend>
    ????<label?>
    ??????振幅:<input?max="150"?min="10"?oninput="h?=?this.value"?type="range">
    ????</label>
    ????<label?>
    ??????周期:<input?max="10000"?min="1"?oninput="w?=?this.value?/?10000"?type="range">
    ????</label>
    
    ??</fieldset>
    </form>
    <svg?xmlns="http://www.w3.org/2000/svg">
    ??<!--網(wǎng)格-->
    ??<g>
    ????<defs>
    ??????<pattern?height="10"?id="grid"?patternContentUnits="userSpaceOnUse"
    ???????????????patternUnits="userSpaceOnUse"?width="10"?x="0"
    ???????????????y="0">
    ????????<rect?fill="none"?height="10.5"?stroke="#f0f0f0"?stroke-dasharray="2"?stroke-width=".5"
    ??????????????width="10.5"?x="0"
    ??????????????y="0"></rect>
    ??????</pattern>
    ??????<pattern?height="50"?id="bigGrid"?patternContentUnits="userSpaceOnUse"
    ???????????????patternUnits="userSpaceOnUse"?width="50"?x="0"
    ???????????????y="0">
    ????????<rect?fill="url(#grid)"?height="50.5"?stroke="#e0e0e0"?stroke-width=".5"
    ??????????????width="50.5"></rect>
    ??????</pattern>
    ????</defs>
    ????<rect?fill="url(#bigGrid)"?height="100%"?width="100%"?x="0"?y="0"></rect>
    ??</g>
    
    ??<g>
    ????<text?id="sinText"??x="200"?y="200"></text>
    ??</g>
    </svg>
    <script>
    ??//?獲取文本對象
    ??const?textEle?=?document.getElementById('sinText');
    
    ??//?dx?=?[20,?20,?20,?...]
    ??//?y?=?λsin(ω?*?x?+?t),絕對位置
    ??//?由于dy屬性是相對于之前文字的位置設置的,相對位置的dy
    ??//?dy?=?λsin(ω?*?x?+?t)?-?λsin(ω?*?(x-1)?+?t)
    ??//?由于?正弦函數(shù)具有周期性所有直接?dy?=?λsin(ω?*?x?+?t)?也是可以的
    
    ??const?text?=?'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
    ??let?n?=?text.length,
    ????dxDistance?=?10,
    ????//?振幅
    ????h?=?80,
    ????//?周期
    ????w?=?.02,
    ????dxArr?=?new?Array(n),
    ????dyArr?=?new?Array(n);
    
    ??const?frg?=?document.createDocumentFragment();
    ??for?(let?i?=?0;?i?<?n;?i++)?{
    ????dxArr[i]?=?dxDistance;
    ????//?使用tspan設置每一個字符的單獨顏色
    ????const?tspan?=?document.createElementNS('http://www.w3.org/2000/svg',?'tspan');
    ????//?不能用這個屬性
    ????//?tspan.innerText?=?text[i];
    ????tspan.textContent?=?text[i];
    ????tspan.setAttribute('fill',?`hsl(${360?*?i?/?n},?100%,?80%)`);
    
    ????frg.appendChild(tspan)
    ??}
    
    ??textEle.appendChild(frg);
    
    ??//?計算dy數(shù)組
    ??const?render?=?(t?=?0)?=>?{
    ????//?計算絕對的dy
    ????const?calcDy?=?x?=>?{
    ??????return?~~(h?*?Math.sin(w?*?x?+?t))
    ????};
    ????for?(let?i?=?0;?i?<?n;?i++)?{
    ??????//?dyArr[i]?=?calcDy(dxDistance?*?i)
    ??????//?計算相對?dy
    ??????dyArr[i]?=?calcDy(dxDistance?*?i)?-?calcDy(dxDistance?*?(i?-?1))
    ????}
    
    ????//?設置dy
    ????textEle.setAttribute('dx',?dxArr.join(','));
    ????textEle.setAttribute('dy',?dyArr.join(','))
    ??};
    
    ??let?t?=?0;
    ??const?frame?=?()?=>?{
    ????render(t?+=?.02);
    ????requestAnimationFrame(frame)
    ??};
    ??frame()
    
    
    </script>
    </body>
    </html>

    dy是一個相對參數(shù),正確的計算應該減去上一個字符的dy

    查看全部
  • svg使用方式

    查看全部
    0 采集 收起 來源:SVG簡介

    2019-11-30

  • 基本操作API

    • 創(chuàng)建圖形

      document.createElementNS(ns,tagName)

    • 添加圖形

      element.appendChild(childElement)

    • 設置/獲取屬性

      element.setAttribute(name,value)

      element.getAttribute(name)

    查看全部
    0 采集 收起 來源:基本操作API

    2019-07-30

  • svg 基本圖形和屬性

    • 基本圖形

      <rect>? ?矩形

      <circle> 圓形

      <ellipse> 橢圓

      <line> 直線

      <polyline> 折線

      <polygon> 多邊形

    基本屬性

    fill 填充顏色、 stroke? 描邊顏色、 stroke-width? 描邊的粗細、transform? ?變形屬性(后期會有詳細介紹)

    https://img1.sycdn.imooc.com//5d3fa9b90001ae5606040389.jpg

    rect :

    https://img1.sycdn.imooc.com//5d3fa22e0001454107430470.jpg?

    circle:

    https://img1.sycdn.imooc.com//5d3fa3160001561806820458.jpg

    ellipse:

    https://img1.sycdn.imooc.com//5d3fa355000195fe07020442.jpg

    line:

    https://img1.sycdn.imooc.com//5d3fa7f900016c8c07070443.jpgpolyline :

    https://img1.sycdn.imooc.com//5d3fa863000140d106770421.jpgpolygon :

    https://img1.sycdn.imooc.com//5d3fa8c700010df606890411.jpg

    查看全部
  • W3C標準:http://www.w3.org/TR/SVG11/

    矢量圖和位圖

    ????????位圖(BMP、PNG、JPG等)? 基于顏色的描述

    ????????矢量圖(SVG、AI等) 基于數(shù)學的描述

    SVG--使用方式

    1. 在瀏覽器中直接打開

    2.在HTML中使用 <img> 標簽引用

    https://img1.sycdn.imooc.com//5d3f9d5700016ff205950365.jpg

    3.直接在HTML中使用 SVG 標簽

    https://img1.sycdn.imooc.com//5d3f9e420001e74d06560406.jpg

    4.作為 CSS 背景

    https://img1.sycdn.imooc.com//5d3f9e6100013ca507660444.jpg

    查看全部
    0 采集 收起 來源:SVG簡介

    2019-07-30

    • 1.1

    https://www.w3.org/TR/SVG11/

    打開方式:?

    ? 直接用瀏覽器打開.svg文件

    ? <image>標簽src屬性引用

    ? css方式,background設置url(some.svg)

    ? html標簽中使用<svg></svg>來使用

    • 1.2

    <rect>矩形?<circle>圓形?<ellipse>橢圓 <line>線條 <polyline>折線 <polygon>多邊形

    <g> <path>

    fill strock stroke-width transform

    • 1.3

    document.createElementNS(ns, tagName)

    element.appendChild(childElement)

    element.setAttribute(name, value)

    element.getAttribute(name)

    • 1.4





    查看全部
    0 采集 收起 來源:SVG簡介

    2019-03-10

  • 基本圖形

    <rect> x,y,width,height,rx,ry

    <circle> cx, cy, r

    <ellipse> cx, cy, rx ry

    <line> x1,y1,x2,y2

    <polyline>points="x1 y1 x2 y2 x3 y3"

    <polygon>points="x1 y1 x2 y2 x3 y3"

    基本屬性

    fill, stroke, stroke-width, transform


    查看全部
  • HSL的介紹

    查看全部
    0 采集 收起 來源:SVG-RGB和HSL

    2019-01-09

  • 矩形畫圖值


    查看全部
  • M(X,Y) 移動畫筆,后面如果有重復參數(shù),會當做是L命令處理

    L(x,y)繪制直線到指定位置

    H(x)繪制水平先到指定的x位置

    V(y) 繪制直線到指定的y位置

    mlhv使用相對位置繪制

    查看全部
  • 基本操作API

    創(chuàng)建圖形:document.createElementNS(ns,tagName);

    添加圖形:element.appendChild(childElement)

    設置/獲取屬性:

    element.setAttribute(name,value)

    element.getAttribute(name)

    查看全部
    0 采集 收起 來源:基本操作API

    2018-11-19

舉報

0/150
提交
取消
課程須知
1.具備HTML+CSS知識基礎;2.對CSS3有一定了解;3.具備一定JS的知識
老師告訴你能學到什么?
讓學生能熟悉使用 SVG 在實際的 Web 項目中進行一些 2D 繪圖、特效的開發(fā)。

微信掃碼,參與3人拼團

微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號

友情提示:

您好,此課程屬于遷移課程,您已購買該課程,無需重復購買,感謝您對慕課網(wǎng)的支持!