-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·704 lines (615 loc) · 30.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>VFEM usługi inżynierskie</title>
<meta name="author" content="Łukasz Małecki" />
<meta name="description" content="Usługi inżynierskie: bazujące na Metodzie Elementów Skończonych - MES, tłumaczenia na techniczny angielski oraz fotografia przemysłowa" />
<meta name="keywords" content="VFEM, MES, FEM, translation, tłumaczenia, techniczny angielski, technical english, fotografia przemysłowa, industial photography, obliczenia, obliczenia MES" />
<meta name="robots" content="all">
<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
<script src="js/jquery.min.js"></script>
<script src="js/jquery.scrolly.min.js"></script>
<script src="js/jquery.dropotron.min.js"></script>
<script src="js/jquery.scrollex.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/skel-layers.min.js"></script>
<script src="js/init.js"></script>
<script src="js/imagelightbox.js"></script>
<script src="js/ga.js"></script>
<script>
$( function()
{
// CAPTION
captionOn = function()
{
var description = $( 'a[href="' + $( '#imagelightbox' ).attr( 'src' ) + '"] img' ).attr( 'alt' );
if( description.length > 0 )
$( '<div id="imagelightbox-caption">' + description + '</div>' ).appendTo( 'body' );
},
captionOff = function()
{
$( '#imagelightbox-caption' ).remove();
},
$( 'a[data-imagelightbox="a"]' ).imageLightbox(
{
onLoadStart: function() { captionOff() },
onLoadEnd: function() { captionOn() },
onEnd: function() { captionOff() }
});
$( 'a[data-imagelightbox="b"]' ).imageLightbox(
{
onLoadStart: function() { captionOff() },
onLoadEnd: function() { captionOn() },
onEnd: function() { captionOff() }
});
$( 'a[data-imagelightbox="c"]' ).imageLightbox(
{
onLoadStart: function() { captionOff() },
onLoadEnd: function() { captionOff() },
onEnd: function() { captionOff() }
});
});
</script>
<link rel="stylesheet" href="css/Gallery.css"/>
<noscript>
<link rel="stylesheet" href="css/skel.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-large.css" />
</noscript>
<!--[if lte IE 9]><link rel="stylesheet" href="css/ie/v9.css" /><![endif]-->
<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
</head>
<body class="landing">
<!-- Header -->
<header id="header">
<h1 id="logo"><a href="index.html">VFEM</a></h1>
<!-- Navigate -->
<nav id="nav">
<ul>
<li><a href="index.html#intro">Wprowadzenie</a></li>
<li>
<a href="">Obliczenia MES</a>
<ul>
<li><a href="#statykaMES">Statyka</a></li>
<li><a href="#dynamikaMES">Dynamika</a></li>
</ul>
</li>
<li><a href="#projektowanie">Projektowanie</a></li>
<li><a href="#fotografika">Animacja, fotografa</a></li>
<li><a href="#translations">Tłumaczenia</a></li>
<li><a href="#kontakt" class="button special">Kontakt</a></li>
</ul>
</nav>
</header>
<!-- Banner -->
<section id="banner">
<div class="content">
<header>
<h2>VFEM</h2>
<h2>Varie et Finite Element Method</h2>
<p>Usługi różne oraz zagadnienia wykorzystujące<br/> Metodę Elementów Skończonych</p>
</header>
<canvas id="myCanvas" width="210" height="135">
Wymanana nowsza przeglądarka
<a href="http://www.apple.com/safari">Safari</a>,
<a href="https://www.google.com/chrome">Chrome</a>,
<a href="http://www.mozilla.org/">Firefox</a>,
<a href="http://www.opera.com/">Opera</a>, or
<a href="http://www.microsoft.com/ie">Internet Explorer 9+</a>
</canvas>
<!--
<span class="image"><img src="images/pic01.jpg" alt="" /></span>
-->
</div>
<a href="#intro" class="goto-next scrolly">Next</a>
</section>
<!-- One -->
<section id="intro" class="spotlight style1 bottom">
<span class="image fit main"><img src="images/pic02.jpg" alt="" /></span>
<div class="content">
<div class="container">
<div class="row">
<div class="4u 12u$(medium)">
<header>
<h2>Usługi inżynierskie</h2>
<p>
Jeżeli dzięki zastosowaniu nowoczesnych metod komputerowych chcesz zmniejszyć koszty projektowania i produkcji zapraszam do działu kontakt.
</p>
</header>
</div>
<div class="4u 12u$(medium)">
<h1>Świadczone usługi :</h1>
<a href="#statykaMES">
<p>- Obliczenia statyki oraz dynamiki konstrukcji, optymalizacja elementów maszyn</p><!-- to-do linki-->
</a>
<a href="#projektowanie">
<p>- Projektowanie 3D i 2D CAD</p>
</a>
<a href="#translations">
- Szybkie i profesjonalne tłumaczenia na techniczny język angielski<br/>
</a>
</div>
<div class="4u$ 12u$(medium)">
<p>
<a href="#translations">
- Jeszcze szybsze tłumaczenia z technicznego języka angielskiego<br/>
</a>
<a href="#fotografika">
- Fotografia i animacja przemysłowa<br/>
</a>
</p>
</div>
</div>
</div>
</div>
<a href="#statykaMES" class="goto-next scrolly">Next</a>
</section>
<!-- Two -->
<<section id="statykaMES" class="wrapper style1 special fade-up">
<div class="container">
<header class="major">
<h2>Obliczenia statyki oraz dynamiki konstrukcji</h2>
<p>Analizy statyczne</p>
</header>
<!---->
<!--Poniżej przedstawione zostały przykładowe analizy-->
<p>Analizy termomechaniczne:<br />
Określenie rodzaju wykończenia powierzchni oraz dobór stosowanej farby (na podstawie zmiany współczynnika emisyjnności), aby zapewnić najniższą temperaturę analizowanego układu na podstawie jego emisyjności<br />
Określenie odkształceń i naprężeń w elementach obciążonych statycznie i termicznie analizy układów hamujących<br />
Analiza i optymalizacja nowo projektowanych konstrukcji nośnych, elementów maszyn<br />
Analiza konstrukcji skorodowanej, pozwalająca na określenie które elementy muszą zostać wzmocnione.<br />
Obliczenia konstrukcji skorodowanej mogą być prowadzone na podstawie założonego stopnia korozji lub na podstawie badań grubości elementów istniejącej konstrukcji.<br />
Projektowanie modernizacji elementów maszyn - obliczenia konstrukcji w celu zwiększenia jej wytrzymałości oraz zmniejszenia odkształcalności.<br />
Przykładowe analizy:
<div id="container">
<ul>
<li><a href="images/show1/slide001.jpg" data-imagelightbox="a"><img src="images/show1/thumbs/slide001.jpg" alt="Analiza rozkładu temperatury tarczy hamulcowej"></a></li>
<li><a href="images/show1/slide002.jpg" data-imagelightbox="a"><img src="images/show1/thumbs/slide002.jpg" alt="Deformacja podstawy prasy"></a></li>
<li><a href="images/show1/slide003.jpg" data-imagelightbox="a"><img src="images/show1/thumbs/slide003.jpg" alt="Naprężenia występujące w skorodowanej konstrukcji"></a></li>
<li><a href="images/show1/slide004.jpg" data-imagelightbox="a"><img src="images/show1/thumbs/slide004.jpg" alt="Rama agregatu ciągnika kolejki"></a></li>
<li><a href="images/show1/slide005.jpg" data-imagelightbox="a"><img src="images/show1/thumbs/slide005.jpg" alt="Sworzeń główny kolejki"></a></li>
<li><a href="images/show1/slide006.jpg" data-imagelightbox="a"><img src="images/show1/thumbs/slide006.jpg" alt="Rama agregatu ciągnika kolejki"></a></li>
<li><a href="images/show1/slide007.jpg" data-imagelightbox="a"><img src="images/show1/thumbs/slide007.jpg" alt="Ramię wahacza napędu ciernego kolejki"></a></li>
<li><a href="images/show1/slide008.jpg" data-imagelightbox="a"><img src="images/show1/thumbs/slide008.jpg" alt="Obliczenia konstrukcji betonowej (Naprężenia główne P1: Rc, Rr)"></a></li>
</ul>
</div>
</div>
<!--<a href="#dynamikaMES" class="goto-next scrolly">Next</a>-->
</section>
<!-- three -->
<section id="dynamikaMES" class="spotlight style3 right fade-up">
<span class="image fit main bottom"><img src="images/pic03.jpg" alt="" /></span>
<div class="content">
<header class="major">
<p>Analizy dynamiczne:</p>
</header>
<p>Testy zderzeniowe,<br />
modelowanie poduszek powietrznych,<br />
modelowanie pasów bezpieczeństwa,<br />
modelowanie procesów w celu optymalizacji narzędzi,<br />
wytłaczanie, kucie, obróbka ubytkowa,<br />
procesy złożone z wielu faz,<br />
kolizja łopatek silnika odrzutowego,<br />
uderzenia ptaków o skrzydła samolotu,<br />
analiza uszkodzeń produktu w wyniku upadku (droptest),<br />
analizy elementów obciążonych falą uderzeniową w wyniku wybuchu,<br />
mechnika płynów z uwzględnieniem interakcji z ciałem stałym,<br />
obliczenia kamizelek kuloodpornych,<br />
obliczenia zdolności zatrzymania przemieszczajacego się obiektu przez konstrukcję barier.</p>
</div>
<a href="#projektowanie" class="goto-next scrolly">Next</a>
</section>
<!-- four-->
<section id="projektowanie" class="spotlight style3 left">
<span class="image fit main bottom"><img src="images/pic04.jpg" alt="" /></span>
<div class="content">
<header>
<h2>Projekty CAD 2d / 3d</h2>
</header>
<p>Pilny termin realizacji projektu? Jestem w stanie szybko wdrożyć się i przynieść pomoc choćby poprzez sprawdzenie lub wykończenie rysunków, czy tłumaczenie projektu na angielski</p>
<div id="container" style="width:350px; margin:0 auto;">
<ul>
<li><a href="images/show2/slide009.jpg" data-imagelightbox="b"><img src="images/show2/thumbs/slide009.jpg" alt="Widok modelu 3D belki łączącej"></a></li>
<li><a href="images/show2/slide010.jpg" data-imagelightbox="b"><img src="images/show2/thumbs/slide010.jpg" alt="Fragment dokumentacji rysunkowej"></a></li>
</ul>
</div>
Dla belek wsporczych konstrukcji znajdujących się pod innymi kątami dobrano odpowiednie skręcenie blach łączących na belce łączącej, tak aby zachować pion na środnikach belek wynikowych.
</div>
<a href="#fotografika" class="goto-next scrolly">Next</a>
</section>
<!-- five -->
<section id="fotografika" class="wrapper style1 special fade-up">
<div class="container">
<div class="content">
<header class="major">
<h2>Grafika, animacja i fotografia przemysłowa</h2>
<p>Jedno zdjęcie lub grafika potrafi zastąpić tysiąc słów opisu, a animacja potrafi zastąpić serię zdjęć...</p>
</header>
<p>Wykorzystując zaawansowane techniki fotografii cyfrowej oraz profesjonalny sprzęt oferuję wykonanie zdjęć produktu lub procesu do celów promocji, prezentacji, reklamy.
<br />Również mogę wykonać nowoczesne i medialne grafiki 2D i 3D. Potrzebna animacja komputerowa do celów prezentacji, lub reklamy? <br />
Przykład takiej animacji znajduje się pod
<a href="https://www.youtube.com/watch?v=UXwxXtz4TlM">tym linkiem</a>.</p>
<div id="container">
<ul>
<li><a href="images/show3/spawacz1.jpg" data-imagelightbox="c"><img src="images/show3/thumbs/slide001.jpg" alt=""></a></li>
<li><a href="images/show3/spawacz2.jpg" data-imagelightbox="c"><img src="images/show3/thumbs/slide002.jpg" alt=""></a></li>
<li><a href="images/show3/diagram1.jpg" data-imagelightbox="c"><img src="images/show3/thumbs/slide003.jpg" alt=""></a></li>
<li><a href="images/show3/diagram2.jpg" data-imagelightbox="c"><img src="images/show3/thumbs/slide004.jpg" alt=""></a></li>
</ul>
</div>
</div>
</div>
<!--<a href="#translations" class="goto-next scrolly">Next</a>-->
</section>
<!-- six -->
<section id="translations" class="spotlight style3 right">
<span class="image fit main bottom"><img src="images/pic05.jpg" alt="" /></span>
<div class="content">
<header>
<h2>Tłumaczenie technicznego języka angielskiego</h2>
<p>Szybkie i profesjonalne tłumaczenia techniczne</p>
</header>
<!--Szybkie i profesjonalne tłumaczenia na techniczny język angielski-->
<p>W dzisiejszym świecie techniki język angielski stał się międzynarodowym standardem. Często szkolenia czy spotkania biznesowe prowadzone w krajach niemiecko czy francuskojęzycznych są prowadzone w języku angielskim. Wynika to z faktu, że różnice w technicznych językach obcych są zależne od dialektu danego regionu, a techniczny język angielski jest międzynarodowym standardem.<br />
Oferuję:<br />
tłumaczenia dokumentacji tekstowej oraz rysunkowej,<br />
tłumaczenia na żywo zarówno na spotkaniach biznesowych podczas ustaleń projektowych jak i później podczas szkoleń pracowników.
</p>
</div>
<a href="#kontakt" class="goto-next scrolly">Next</a>
</section>
<!-- eight -->
<section id="kontakt" class="wrapper style2 special fade">
<div class="container">
<header>
<br />
<p>Kontakt:</p>
<br />
<h2>Łukasz Małecki</h2>
<br /> <br />
<p>(+48) 537-172-173</p>
<br /> <br />
<div><a href="mailto://[email protected]" class="icon alt fa-envelope"><span class="label">Email</span></a><a href="mailto://[email protected]"><p>[email protected]</p></a></div>
<br /> <br />
</header>
<ul class="icons">
<li><a href="https://twitter.com/luqqer" class="icon alt fa-twitter"><span class="label">Twitter</span></a></li>
<li><a href="http://pl.linkedin.com/pub/%C5%82ukasz-ma%C5%82ecki/63/59/420" class="icon alt fa-linkedin"><span class="label">LinkedIn</span></a></li>
<li><a href="mailto://[email protected]" class="icon alt fa-envelope"><span class="label">Email</span></a></li>
<!--
<li><a href="#" class="icon alt fa-facebook"><span class="label">Facebook</span></a></li>
<li><a href="#" class="icon alt fa-instagram"><span class="label">Instagram</span></a></li>
<li><a href="#" class="icon alt fa-github"><span class="label">GitHub</span></a></li>
-->
</ul>
<!--
<form method="post" action="#" class="container 50%">
<div class="row uniform 50%">
<div class="8u 12u$(xsmall)"><input type="email" name="email" id="email" placeholder="Your Email Address" /></div>
<div class="4u$ 12u$(xsmall)"><input type="submit" value="Get Started" class="fit special" /></div>
</div>
</form>
-->
</div>
</section>
<!-- Footer -->
<footer id="footer">
<ul class="copyright">
<br />
<li>© VFEM. Wszystkie prawa zastrzeżone.</li><li>Projekt na podstawie: <a href="http://html5up.net">HTML5 UP</a></li>
</ul>
</footer>
<script>
window.requestAnimFrame = (function(callback) {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
function(callback) {
window.setTimeout(callback, 1000 / 60);
};
})();
function initBalls() {
balls = [];
var blue = '#3A5BCD';
var red = '#EF2B36';
var yellow = '#FFC636';
var green = '#02A817';
balls.push(new Ball(9.142486,20.792216,0.000000, 0, blue));
balls.push(new Ball(11.137885,30.342907,0.000000, 0, blue));
balls.push(new Ball(9.142486,20.792216,0.000000, 0, blue));
balls.push(new Ball(11.137885,30.342907,0.000000, 0, blue));
balls.push(new Ball(11.137885,30.342907,0.000000, 0, blue));
balls.push(new Ball(12.407684,40.074938,0.000000, 0, blue));
balls.push(new Ball(12.407684,40.074938,0.000000, 0, blue));
balls.push(new Ball(13.873441,50.202626,0.000000, 0, blue));
balls.push(new Ball(13.873441,50.202626,0.000000, 0, blue));
balls.push(new Ball(15.143241,59.692868,0.000000, 0, green));
balls.push(new Ball(15.143241,59.692868,0.000000, 0, green));
balls.push(new Ball(16.41304,69.908479,0.000000, 0, green));
balls.push(new Ball(16.41304,69.908479,0.000000, 0, green));
balls.push(new Ball(18.567628,79.208337,0.000000, 0, green));
balls.push(new Ball(18.567628,79.208337,0.000000, 0, green));
balls.push(new Ball(19.103596,89.204433,0.000000, 0, green));
balls.push(new Ball(19.103596,89.204433,0.000000, 0, green));
balls.push(new Ball(22.362494,81.281308,0.000000, 0, green));
balls.push(new Ball(22.362494,81.281308,0.000000, 0, green));
balls.push(new Ball(26.217001,72.369946,0.000000, 0, green));
balls.push(new Ball(26.217001,72.369946,0.000000, 0, green));
balls.push(new Ball(29.687564,63.567202,0.000000, 0, green));
balls.push(new Ball(29.687564,63.567202,0.000000, 0, green));
balls.push(new Ball(33.190827,54.466247,0.000000, 0, green));
balls.push(new Ball(33.190827,54.466247,0.000000, 0, green));
balls.push(new Ball(37.175408,45.084983,0.000000, 0, green));
balls.push(new Ball(37.175408,45.084983,0.000000, 0, blue));
balls.push(new Ball(40.653188,36.238292,0.000000, 0, blue));
balls.push(new Ball(40.653188,36.238292,0.000000, 0, blue));
balls.push(new Ball(44.302618,26.857029,0.000000, 0, blue));
balls.push(new Ball(44.302618,26.857029,0.000000, 0, blue));
balls.push(new Ball(48.030059,17.834992,0.000000, 0, blue));
balls.push(new Ball(73.533165,16.957583,0.000000, 0, blue));
balls.push(new Ball(82.695159,17.975259,0.000000, 0, blue));
balls.push(new Ball(82.695159,17.975259,0.000000, 0, blue));
balls.push(new Ball(92.759449,17.880184,0.000000, 0, blue));
balls.push(new Ball(92.759449,17.880184,0.000000, 0, blue));
balls.push(new Ball(102.291625,17.648893,0.000000, 0, blue));
balls.push(new Ball(102.291625,17.648893,0.000000, 0, blue));
balls.push(new Ball(112.332802,17.51012,0.000000, 0, blue));
balls.push(new Ball(70.519246,25.494466,0.000000, 0, blue));
balls.push(new Ball(69.038518,34.977353,0.000000, 0, blue));
balls.push(new Ball(69.038518,34.977353,0.000000, 0, blue));
balls.push(new Ball(67.055201,44.389946,0.000000, 0, green));
balls.push(new Ball(67.055201,44.389946,0.000000, 0, green));
balls.push(new Ball(71.436532,46.814643,0.000000, 0, green));
balls.push(new Ball(71.436532,46.814643,0.000000, 0, green));
balls.push(new Ball(81.519092,46.641414,0.000000, 0, green));
balls.push(new Ball(81.519092,46.641414,0.000000, 0, green));
balls.push(new Ball(91.14848,46.855331,0.000000, 0, green));
balls.push(new Ball(91.14848,46.855331,0.000000, 0, green));
balls.push(new Ball(100.884862,46.427495,0.000000, 0, green));
balls.push(new Ball(66.112072,54.556391,0.000000, 0, green));
balls.push(new Ball(64.614167,64.182716,0.000000, 0, green));
balls.push(new Ball(64.614167,64.182716,0.000000, 0, green));
balls.push(new Ball(63.116263,74.022959,0.000000, 0, green));
balls.push(new Ball(63.116263,74.022959,0.000000, 0, green));
balls.push(new Ball(61.832344,83.649284,0.000000, 0, green));
balls.push(new Ball(152.237065,16.068871,0.000000, 0, green));
balls.push(new Ball(142.527476,15.882208,0.000000, 0, green));
balls.push(new Ball(142.527476,15.882208,0.000000, 0, green));
balls.push(new Ball(132.444441,16.628861,0.000000, 0, green));
balls.push(new Ball(132.444441,16.628861,0.000000, 0, green));
balls.push(new Ball(126.954553,16.422417,0.000000, 0, green));
balls.push(new Ball(126.954553,16.422417,0.000000, 0, green));
balls.push(new Ball(125.047003,22.078603,0.000000, 0, green));
balls.push(new Ball(125.047003,22.078603,0.000000, 0, green));
balls.push(new Ball(123.591027,31.918386,0.000000, 0, green));
balls.push(new Ball(123.591027,31.918386,0.000000, 0, green));
balls.push(new Ball(121.908214,41.594775,0.000000, 0, blue));
balls.push(new Ball(121.908214,41.594775,0.000000, 0, blue));
balls.push(new Ball(120.030897,51.275507,0.000000, 0, blue));
balls.push(new Ball(120.030897,51.275507,0.000000, 0, blue));
balls.push(new Ball(118.898104,61.147399,0.000000, 0, blue));
balls.push(new Ball(118.898104,61.147399,0.000000, 0, red));
balls.push(new Ball(117.439511,70.988801,0.000000, 0, red));
balls.push(new Ball(117.439511,70.988801,0.000000, 0, red));
balls.push(new Ball(115.758281,80.652798,0.000000, 0, red));
balls.push(new Ball(115.758281,80.652798,0.000000, 0, red));
balls.push(new Ball(115.633736,90.757749,0.000000, 0, red));
balls.push(new Ball(115.633736,90.757749,0.000000, 0, blue));
balls.push(new Ball(125.462465,89.755796,0.000000, 0, blue));
balls.push(new Ball(125.462465,89.755796,0.000000, 0, blue));
balls.push(new Ball(135.646839,89.238659,0.000000, 0, blue));
balls.push(new Ball(135.646839,89.238659,0.000000, 0, blue));
balls.push(new Ball(145.37166,88.687541,0.000000, 0, blue));
balls.push(new Ball(127.087177,54.021247,0.000000, 0, blue));
balls.push(new Ball(136.3921,53.362053,0.000000, 0, blue));
balls.push(new Ball(136.3921,53.362053,0.000000, 0, blue));
balls.push(new Ball(145.477222,52.92259,0.000000, 0, green));
balls.push(new Ball(161.30649,87.388238,0.000000, 0, green));
balls.push(new Ball(162.644811,78.240552,0.000000, 0, green));
balls.push(new Ball(162.644811,78.240552,0.000000, 0, green));
balls.push(new Ball(164.090751,69.097168,0.000000, 0, green));
balls.push(new Ball(164.090751,69.097168,0.000000, 0, green));
balls.push(new Ball(166.11096,60.072052,0.000000, 0, green));
balls.push(new Ball(166.11096,60.072052,0.000000, 0, green));
balls.push(new Ball(168.581674,51.062818,0.000000, 0, green));
balls.push(new Ball(168.581674,51.062818,0.000000, 0, green));
balls.push(new Ball(169.777981,41.415827,0.000000, 0, green));
balls.push(new Ball(169.777981,41.415827,0.000000, 0, green));
balls.push(new Ball(171.570745,32.244728,0.000000, 0, green));
balls.push(new Ball(171.570745,32.244728,0.000000, 0, green));
balls.push(new Ball(173.553027,23.480641,0.000000, 0, green));
balls.push(new Ball(173.553027,23.480641,0.000000, 0, blue));
balls.push(new Ball(175.403087,21.163029,0.000000, 0, blue));
balls.push(new Ball(175.403087,21.163029,0.000000, 0, blue));
balls.push(new Ball(176.957783,26.661752,0.000000, 0, blue));
balls.push(new Ball(176.957783,26.661752,0.000000, 0, blue));
balls.push(new Ball(178.021512,35.711263,0.000000, 0, blue));
balls.push(new Ball(178.021512,35.711263,0.000000, 0, blue));
balls.push(new Ball(179.179055,45.296894,0.000000, 0, blue));
balls.push(new Ball(179.179055,45.296894,0.000000, 0, blue));
balls.push(new Ball(180.989775,55.646922,0.000000, 0, red));
balls.push(new Ball(180.989775,55.646922,0.000000, 0, red));
balls.push(new Ball(184.627594,52.334789,0.000000, 0, red));
balls.push(new Ball(184.627594,52.334789,0.000000, 0, red));
balls.push(new Ball(187.241997,43.663208,0.000000, 0, red));
balls.push(new Ball(187.241997,43.663208,0.000000, 0, red));
balls.push(new Ball(190.247752,34.342673,0.000000, 0, red));
balls.push(new Ball(190.247752,34.342673,0.000000, 0, red));
balls.push(new Ball(193.041143,24.786004,0.000000, 0, red));
balls.push(new Ball(193.041143,24.786004,0.000000, 0, red));
balls.push(new Ball(194.713541,21.255545,0.000000, 0, red));
balls.push(new Ball(194.713541,21.255545,0.000000, 0, red));
balls.push(new Ball(195.264579,26.223846,0.000000, 0, blue));
balls.push(new Ball(195.264579,26.223846,0.000000, 0, blue));
balls.push(new Ball(195.535311,36.002205,0.000000, 0, blue));
balls.push(new Ball(195.535311,36.002205,0.000000, 0, blue));
balls.push(new Ball(195.883454,45.513165,0.000000, 0, blue));
balls.push(new Ball(195.883454,45.513165,0.000000, 0, blue));
balls.push(new Ball(196.659523,55.535578,0.000000, 0, blue));
balls.push(new Ball(196.659523,55.535578,0.000000, 0, blue));
balls.push(new Ball(196.873272,65.473511,0.000000, 0, blue));
balls.push(new Ball(196.873272,65.473511,0.000000, 0, blue));
balls.push(new Ball(197.595956,75.095636,0.000000, 0, blue));
balls.push(new Ball(197.595956,75.095636,0.000000, 0, blue));
balls.push(new Ball(197.864103,85.35465,0.000000, 0, blue));
return balls;
}
function getMousePos(canvas, evt) {
// get canvas position
var obj = canvas;
var top = 0;
var left = 0;
while(obj.tagName != 'BODY') {
top += obj.offsetTop;
left += obj.offsetLeft;
obj = obj.offsetParent;
}
// return relative mouse position
var mouseX = evt.clientX - left + window.pageXOffset;
var mouseY = evt.clientY - top + window.pageYOffset;
return {
x: mouseX,
y: mouseY
};
}
function updateBalls(canvas, balls, timeDiff, mousePos) {
var context = canvas.getContext('2d');
var collisionDamper = 0.3;
var floorFriction = 0.0005 * timeDiff;
var mouseForceMultiplier = 1 * timeDiff;
var restoreForce = 0.002 * timeDiff;
for(var n = 0; n < balls.length; n++) {
var ball = balls[n];
// set ball position based on velocity
ball.y += ball.vy;
ball.x += ball.vx;
// restore forces
if(ball.x > ball.origX) {
ball.vx -= restoreForce;
}
else {
ball.vx += restoreForce;
}
if(ball.y > ball.origY) {
ball.vy -= restoreForce;
}
else {
ball.vy += restoreForce;
}
// mouse forces
var mouseX = mousePos.x;
var mouseY = mousePos.y;
var distX = ball.x - mouseX;
var distY = ball.y - mouseY;
var radius = Math.sqrt(Math.pow(distX, 2) + Math.pow(distY, 2));
var totalDist = Math.abs(distX) + Math.abs(distY);
var forceX = (Math.abs(distX) / totalDist) * (1 / radius) * mouseForceMultiplier;
var forceY = (Math.abs(distY) / totalDist) * (1 / radius) * mouseForceMultiplier;
if(distX > 0) {// mouse is left of ball
ball.vx += forceX;
}
else {
ball.vx -= forceX;
}
if(distY > 0) {// mouse is on top of ball
ball.vy += forceY;
}
else {
ball.vy -= forceY;
}
// floor friction
if(ball.vx > 0) {
ball.vx -= floorFriction;
}
else if(ball.vx < 0) {
ball.vx += floorFriction;
}
if(ball.vy > 0) {
ball.vy -= floorFriction;
}
else if(ball.vy < 0) {
ball.vy += floorFriction;
}
// floor condition
if(ball.y > (canvas.height - ball.radius)) {
ball.y = canvas.height - ball.radius - 2;
ball.vy *= -1;
ball.vy *= (1 - collisionDamper);
}
// ceiling condition
if(ball.y < (ball.radius)) {
ball.y = ball.radius + 2;
ball.vy *= -1;
ball.vy *= (1 - collisionDamper);
}
// right wall condition
if(ball.x > (canvas.width - ball.radius)) {
ball.x = canvas.width - ball.radius - 2;
ball.vx *= -1;
ball.vx *= (1 - collisionDamper);
}
// left wall condition
if(ball.x < (ball.radius)) {
ball.x = ball.radius + 2;
ball.vx *= -1;
ball.vx *= (1 - collisionDamper);
}
}
}
function Ball(x, y, vx, vy, color) {
this.x = x;
this.y = y;
this.vx = vx;
this.vy = vy;
this.color = color;
this.origX = x;
this.origY = y;
this.radius = 5;
}
function animate(canvas, balls, lastTime, mousePos) {
var context = canvas.getContext('2d');
// update
var date = new Date();
var time = date.getTime();
var timeDiff = time - lastTime;
updateBalls(canvas, balls, timeDiff, mousePos);
lastTime = time;
// clear
context.clearRect(0, 0, canvas.width, canvas.height);
// render
for(var n = 0; n < balls.length; n++) {
var ball = balls[n];
context.beginPath();
context.arc(ball.x, ball.y, ball.radius, 0, 2 * Math.PI, false);
context.fillStyle = ball.color;
context.fill();
}
// request new frame
requestAnimFrame(function() {
animate(canvas, balls, lastTime, mousePos);
});
}
var canvas = document.getElementById('myCanvas');
var balls = initBalls();
var date = new Date();
var time = date.getTime();
/*
* set mouse position really far away
* so the mouse forces are nearly obsolete
*/
var mousePos = {
x: 9999,
y: 9999
};
canvas.addEventListener('mousemove', function(evt) {
var pos = getMousePos(canvas, evt);
mousePos.x = pos.x;
mousePos.y = pos.y;
});
canvas.addEventListener('mouseout', function(evt) {
mousePos.x = 9999;
mousePos.y = 9999;
});
animate(canvas, balls, time, mousePos);
</script>
</body>
</html>