svg画大白

效果图

大白

index.html

<!DOCTYPE html>
<html lang="en">

<head>
    <title>untitled</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta charset="utf-8" />
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <meta name="generator" content="Geany 1.23.1" />
</head>

<body>
    <div id="output"></div>
    <script type+'text/javascript' src="raphael.js"></script>
    <script type="text/javascript" src="app.js"></script>
</body>

</html>

app.js

var paper = Raphael(document.getElementById('output'), 800, 800);
//left hand
var c = paper.path('M 74.94609,417.46053 C 67.91749,476.81182 -59.700493,336.78724 97.99542,131.42712');
c.attr({
        fill:'none',
        'fill-rule':'evenodd',
        'stroke':'#000000',
        'stroke-width':'1.0925945px',
        'stroke-linecap':'butt',
        'stroke-linejoin':'miter',
        'stroke-opacity':'1'
});
c = paper.path('m 236.30351,22.19397 c -49.57508,1.19468 -99.50126,25.25494 -130.00322,59.52119 -38.28073,43.00501 2.69553,61.0026 21.17779,69.36435 74.27209,33.60219 143.58723,36.40594 211.93371,1.81006 20.48657,-10.36997 47.22467,-27.41854 18.24156,-71.09228 C 324.3345,31.59017 267.56682,23.77289 236.30351,22.19397 Z');
c.attr({
        fill:'none',
        'fill-opacity':'1',
        stroke:'#000000',
        'stroke-width':'1.14147401',
        'stroke-opacity':'1'
});
var eyeStyle = {
        'fill':'#000000',
        'fill-opacity':'1',
        'stroke':'#000000',
        'stroke-width':'0.79915798',
        'stroke-opacity':'1'
};
c = paper.ellipse(181.00568,93.359497,17.070984,15.656772);
c.attr(eyeStyle);

c = paper.ellipse(276.75,94.112213,17.070984,15.656772);
c.attr(eyeStyle);

var faceStyle = {
    fill:'#ff5555',
    'fill-opacity':1,
    stroke:'none',
    'stroke-width':'0.72767806',
    'stroke-opacity':1
};
function animate(face) {
    var ani1 = Raphael.animation({fill:'#FFD1D1'}, 2000, 'linear', function() {
            face.animate(ani2);
        })
        .delay(1000);
    var ani2 = Raphael.animation({fill:'#ff5555'}, 2000, 'linear', function() {
            face.animate(ani1);
        })
        .delay(1000);
    face.animate(ani1);
}
var leftFace = paper.ellipse(175.77924,121.86917,12.156976,5.7930155);
leftFace.attr(faceStyle);
animate(leftFace);

rightFace = paper.ellipse(281.06128,120.75989,12.156976,5.7930155);
rightFace.attr(faceStyle);
animate(rightFace);

// nose
c = paper.path('m 197.50165,93.36605 c 25.06224,10.74556 39.40665,10.66903 62.67773,0.24977');
c.attr({
        fill:'none',
        'fill-rule':'evenodd',
        stroke:'#000000',
        'stroke-width':5,
        'stroke-linecap':'butt',
        'stroke-linejoin':'miter',
        'stroke-miterlimit':4,
        'stroke-dasharray':'none',
        'stroke-opacity':1
});
// right hand
c = paper.path('m 388.99116,417.58091 c 7.0286,59.35129 134.64658,-80.67329 -23.04933,-286.03341');
c.attr({
        fill:'none',
        'fill-rule':'evenodd',
        stroke:'#000000',
        'stroke-width':'1.0925945px',
        'stroke-linecap':'butt',
        'stroke-linejoin':'miter',
        'stroke-opacity':1
});
// body
c = paper.path('M 377.93726,239.94266 C 472.42105,531.3643 263.28425,423.30319 231.84363,444.57627 200.40301,423.18281 -8.4838,531.24392 85.99999,239.82228');
c.attr({
    fill:'none',
    'fill-rule':'evenodd',
    stroke:'#000000',
    'stroke-width':'0.93917829px',
    'stroke-linecap':'butt',
    'stroke-linejoin':'miter',
    'stroke-opacity':1
});
SVG是一种可扩展矢量图形格式,可以用它来制作各种拓扑图,包括厂区拓扑图。下面是一个简单的示例,演示如何使用SVG来绘制一个厂区拓扑图: ```html <!DOCTYPE html> <html> <head> <title>厂区拓扑图</title> <style> svg { width: 100%; height: 100%; } .factory { fill: #f7c242; stroke: #333; stroke-width: 2px; } .building { fill: #e57373; stroke: #333; stroke-width: 2px; } .machine { fill: #81c784; stroke: #333; stroke-width: 2px; } </style> </head> <body> <svg viewBox="0 0 800 600"> <rect x="0" y="0" width="800" height="600" fill="#fff" /> <rect x="50" y="50" width="700" height="500" class="factory" /> <rect x="100" y="100" width="200" height="200" class="building" /> <rect x="400" y="100" width="200" height="200" class="building" /> <circle cx="150" cy="150" r="50" class="machine" /> <circle cx="450" cy="150" r="50" class="machine" /> </svg> </body> </html> ``` 上面的示例代码使用了HTML、CSS和SVG来绘制一个简单的厂区拓扑图。其中,使用SVG的形状元素(如rect、circle)来绘制厂房、设备等图形,使用CSS来设置图形的样式,如填充色、边框色、边框宽度等。在SVG中,可以使用各种属性来控制形状元素的位置、大小、形状等。在这个示例中,使用了viewBox属性来设置SVG的视窗大小和位置,使其充满整个浏览器窗口。同时,在SVG元素内部,使用了一个矩形元素来作为背景,并设置了填充色为白色。这样,就可以得到一个简单的厂区拓扑图了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值