×
HeadHunter and Superjob rezume updater on Ruby on Rails (21 авг 2017)

Практикуемся в написании кода под rails.

Решено Lazy Line Painter. Чудеса и трюки jQuery

Больше
3 года 2 нед. назад #1 от Aleksej
Aleksej создал эту тему: Lazy Line Painter. Чудеса и трюки jQuery
Подробности - в блоге, загляните по ссылке , здесь лишь публикую код, работающий на страничке. Возможно, кому-то пригодится; особенно если этот "кто-то" умеет рисовать чуть лучше, чем я. :)


<script src="jquery-1.9.1.min.js"></script>
<script>window.jQuery || document.write('<script src="jquery-1.9.1.min.js"><\/script>')</script>
<script src="raphael-min.js"></script> 

<script src="jquery.lazylinepainter-1.4.1.min.js"></script> 

<script type="text/javascript"> 
(function( $ ){ 
var svgData = { 
"demo" :
{ 
"strokepath" :
[ 
{ "path": "M 314.5,179. L 313.5,179.5 310.5,178.5 307.5,177.5 304.5,177.5 299.5,177.5 297.5,177.5 295.5,177.5 294.5,177.5 293.5,177.5 292.5,177.5 290.5,177.5 287.5,179.5 286.5,181.5 285.5,181.5 285.5,182.5 284.5,182.5 284.5,184.5 284.5,185.5 283.5,186.5 283.5,187.5 283.5,188.5 283.5,189.5 283.5,191.5 283.5,192.5 283.5,193.5 283.5,195.5 283.5,196.5 283.5,197.5 283.5,198.5 285.5,200.5 286.5,201.5 287.5,203.5 289.5,205.5 290.5,206.5 291.5,206.5 293.5,207.5 295.5,207.5 299.5,208.5 300.5,208.5 301.5,208.5 302.5,208.5 303.5,208.5 304.5,208.5 305.5,208.5 306.5,208.5 307.5,207.5 307.5,205.5 308.5,205.5 309.5,204.5 309.5,203.5 309.5,202.5 310.5,202.5 311.5,202.5 312.5,201.5 312.5,200.5 312.5,199.5 312.5,198.5 313.5,198.5 313.5,197.5 313.5,196.5 314.5,195.5 314.5,194.5 314.5,193.5 314.5,192.5 315.5,190.5 315.5,189.5 316.5,189.5 316.5,188.5 316.5,187.5 316.5,186.5 316.5,185.5 316.5,184.5 316.5,183.5 316.5,182.5 315.5,182.5 314.5,182.5 313.5,182.5 ",
"duration": 1800
},
{
"path": "M 301.5 208.5 L 300.5 271.5",
"duration": 600
},
{
"path": "M 302.5 211.5 L 242.5 197.5",
"duration": 600
},
{
"path": "M 306.5 211.5 L 343.5 254.5",
"duration": 600
},
{
"path": "M 300.5 267.5 L 257.5 335.5",
"duration": 600
},
{
"path": "M 257.5 335.5 L 230.5 335.5",
"duration": 600
},
{
"path": "M 300.5 269.5 L 330.5 324.5",
"duration": 600
},
{
"path": "M 330.5 324.5 L 314.5 333.5",
"duration": 600
},
{
"path": "M 251.5 145.5 L 238.5 212.5",
"duration": 600
},
{
"path": "M 184.5 139.5 L 343.5 142.5",
"duration": 600
},
{
"path": "M 270.5 96.5 L 188.5 139.5",
"duration": 600
},
{
"path": "M 270.5 98.5 L 345.5 140.5",
"duration": 600
},
{
"path": "M 483.5 2.5 L 483.5 15.5",
"duration": 600
},
{
"path": "M 482.5 15.5 L 485.5 30.5",
"duration": 600
},
{
"path": "M 485.5 30.5 L 494.5 52.5",
"duration": 600
},
{
"path": "M 494.5 52.5 L 508.5 70.5",
"duration": 600
},
{
"path": "M 507.5 70.5 L 522.5 92.5",
"duration": 600
},
{
"path": "M 522.5 92.5 L 546.5 111.5",
"duration": 600
},
{
"path": "M 546.5 111.5 L 572.5 122.5",
"duration": 600
},
{
"path": "M 572.5 122.5 L 600.5 133.5",
"duration": 600
},
{
"path": "M 599.5 132.5 L 619.5 141.5",
"duration": 600
},
{
"path": "M 618.5 141.5 L 627.5 143.5",
"duration": 600
},
{
"path": "M 626.5 143.5 L 637.5 143.5",
"duration": 600
},
{
"path": "M 470.5 4.5 L 85.5 33.5",
"duration": 600
},
{
"path": "M 467.5 30.5 L 352.5 73.5",
"duration": 600
},
{
"path": "M 484.5 68.5 L 373.5 124.5",
"duration": 600
},
{
"path": "M 496.5 100.5 L 370.5 208.5",
"duration": 600
},
{
"path": "M 529.5 144.5 L 420.5 339.5",
"duration": 600
},
{
"path": "M 586.5 176.5 L 557.5 452.5",
"duration": 600
},
{
"path": "M 28.5 361.5 L 10.5 429.5",
"duration": 600
},
{
"path": "M 31.5 364.5 L 35.5 397.5",
"duration": 600
},
{
"path": "M 36.5 397.5 L 56.5 361.5",
"duration": 600
},
{
"path": "M 56.5 361.5 L 40.5 423.5",
"duration": 600
},
{
"path": "M 61.5 397.5 L 54.5 422.5",
"duration": 600
},
{
"path": "M 60.5 398.5 L 84.5 399.5",
"duration": 600
},
{
"path": "M 84.5 399.5 L 77.5 419.5",
"duration": 600
},
{
"path": "M 62.5 407.5 L 79.5 407.5",
"duration": 600
},
{
"path": "M 111.5 394.5 L 97.5 394.5",
"duration": 600
},
{
"path": "M 97.5 394.5 L 93.5 407.5",
"duration": 600
},
{
"path": "M 93.5 407.5 L 111.5 407.5",
"duration": 600
},
{
"path": "M 111.5 407.5 L 108.5 420.5",
"duration": 600
},
{
"path": "M 107.5 419.5 L 88.5 419.5",
"duration": 600
},
{
"path": "M 134.5 393.5 L 127.5 418.5",
"duration": 600
},
{
"path": "M 121.5 391.5 L 155.5 390.5",
"duration": 600
},
{
"path": "M 166.5 389.5 L 156.5 417.5",
"duration": 600
},
{
"path": "M 156.5 417.5 L 176.5 417.5",
"duration": 600
},
{
"path": "M 164.5 404.5 L 172.5 403.5",
"duration": 600
},
{
"path": "M 168.5 391.5 L 184.5 392.5",
"duration": 600
},
{
"path": "M 195.5 387.5 L 188.5 417.5",
"duration": 600
},
{
"path": "M 197.5 386.5 L 214.5 387.5",
"duration": 600
},
{
"path": "M 214.5 387.5 L 214.5 398.5",
"duration": 600
},
{
"path": "M 214.5 398.5 L 193.5 404.5",
"duration": 600
},
{
"path": "M 193.5 404.5 L 209.5 412.5",
"duration": 600
},
{
"path": "M 230.5 383.5 L 225.5 413.5",
"duration": 600
},
{
"path": "M 234.5 387.5 L 250.5 386.5",
"duration": 600
},
{
"path": "M 250.5 385.5 L 246.5 400.5",
"duration": 600
},
{
"path": "M 246.5 400.5 L 227.5 404.5",
"duration": 600
},
{
"path": "M 265.5 384.5 L 259.5 417.5",
"duration": 600
},
{
"path": "M 265.5 386.5 L 286.5 385.5",
"duration": 600
},
{
"path": "M 286.5 385.5 L 283.5 399.5",
"duration": 600
},
{
"path": "M 284.5 397.5 L 265.5 400.5",
"duration": 600
},
{
"path": "M 265.5 400.5 L 282.5 414.5",
"duration": 600
},
{
"path": "M 300.5 382.5 L 296.5 414.5",
"duration": 600
},
{
"path": "M 296.5 413.5 L 314.5 413.5",
"duration": 600
},
{
"path": "M 314.5 413.5 L 317.5 379.5",
"duration": 600
},
{
"path": "M 300.5 383.5 L 319.5 382.5",
"duration": 600
},
{
"path": "M 331.5 406.5 L 332.5 411.5",
"duration": 600
},
{
"path": "M 354.5 380.5 L 360.5 410.5",
"duration": 600
},
{
"path": "M 368.5 393.5 L 368.5 394.5",
"duration": 600
},
{
"path": "M 368.5 395.5 L 363.5 404.5",
"duration": 600
},
{
"path": "M 367.5 393.5 L 375.5 406.5",
"duration": 600
},
{
"path": "M 377.5 405.5 L 389.5 378.5",
"duration": 600
},
{
"path": "M 417.5 379.5 L 401.5 379.5",
"duration": 600
},
{
"path": "M 402.5 378.5 L 395.5 390.5",
"duration": 600
},
{
"path": "M 395.5 390.5 L 406.5 390.5",
"duration": 600
},
{
"path": "M 406.5 390.5 L 410.5 390.5",
"duration": 600
},
{
"path": "M 410.5 390.5 L 406.5 406.5",
"duration": 600
},
{
"path": "M 406.5 406.5 L 387.5 407.5",
"duration": 600
},
{
"path": "M 5.5 445.5 L 524.5 416.5",
"duration": 600
},
{
"path": "M 264.5 107.5 L 236.5 127.5",
"duration": 600
},
{
"path": "M 265.5 112.5 L 260.5 128.5",
"duration": 600
},
{
"path": "M 275.5 110.5 L 302.5 129.5",
"duration": 600
}
],
"dimensions": {
"width": 640,
"height": 480 }
}
}

$(document).ready(function(){

$('#demo').lazylinepainter({
'svgData' : svgData,
'strokeWidth':7, 
'strokeColor':'#dc908e',
'onComplete' : function(){
} 
}
) 

$('#demo').lazylinepainter('paint');
})
})( jQuery );

</script>

<div id='demo'></div>

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.