jeudi 21 décembre 2017

Snow



<svg id="svgEssai" width="800" height="450"  xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
  <linearGradient y2="1" x2="0" id="bleu">
   <stop offset="0" stop-opacity="0.99609" stop-color="#101035"/>
   <stop offset="1" stop-opacity="0.99609" stop-color="#4d85bc"/>
  </linearGradient>
<g id="flake" transform="scale(0.3)">
<g>
<path d="M 50.62,19.95 C 49.43,16.73 50.69,13.95 50.62,11.00 50.62,11.00 49.51,5.19 49.51,5.19 49.66,3.88 50.22,3.05 51.29,2.32 56.46,-1.21 57.41,4.76 60.30,7.11 62.50,8.90 66.00,9.28 66.76,14.04 67.53,18.86 64.70,20.13 65.00,27.00 65.00,27.00 72.00,14.00 72.00,14.00 72.00,14.00 74.00,14.00 74.00,14.00 77.67,21.94 74.66,26.38 67.00,30.00 67.00,30.00 69.00,36.00 69.00,36.00 73.02,32.62 74.47,31.47 77.46,27.00 78.56,25.36 80.22,21.97 82.15,21.34 85.32,20.30 86.15,24.77 85.67,26.96 84.56,32.04 75.46,37.01 71.00,39.00 71.00,39.00 76.00,49.00 76.00,49.00 82.74,46.20 96.27,46.20 103.00,49.00 103.00,49.00 108.00,39.00 108.00,39.00 103.81,37.13 96.24,32.88 94.02,28.83 92.09,25.31 93.69,20.30 96.85,21.34 98.78,21.97 100.44,25.36 101.54,27.00 104.53,31.47 105.98,32.62 110.00,36.00 110.00,36.00 112.00,30.00 112.00,30.00 104.34,26.38 101.33,21.94 105.00,14.00 105.00,14.00 107.00,14.00 107.00,14.00 107.00,14.00 114.00,27.00 114.00,27.00 114.30,20.13 111.47,18.86 112.24,14.04 112.99,9.33 116.44,8.90 118.73,7.11 121.37,5.05 125.05,-2.38 129.25,3.43 131.34,6.23 128.44,8.14 129.25,13.00 129.19,14.81 129.83,16.04 129.25,18.00 128.02,25.81 121.17,22.49 117.00,29.00 117.00,29.00 131.00,26.00 131.00,26.00 128.84,36.10 122.80,34.26 115.00,32.00 115.00,32.00 113.00,37.00 113.00,37.00 118.64,38.37 121.34,38.11 127.00,37.59 128.46,37.46 130.92,37.03 131.83,38.61 133.41,41.36 129.21,44.19 127.00,44.65 123.16,45.45 114.27,41.97 110.00,41.00 109.44,42.95 107.17,47.88 107.58,49.39 108.07,51.21 112.07,54.35 113.55,56.07 117.57,60.76 120.84,64.82 122.00,71.00 122.00,71.00 126.99,70.37 126.99,70.37 136.95,68.13 129.11,58.05 133.02,51.11 134.91,47.76 139.29,46.43 140.19,49.33 140.75,51.11 138.43,56.81 137.90,59.00 137.01,62.65 137.03,64.33 137.00,68.00 144.83,65.10 140.21,61.47 143.17,56.06 145.27,52.23 148.15,52.13 152.00,52.00 152.00,52.00 146.00,66.00 146.00,66.00 152.86,61.71 151.08,58.40 156.02,56.60 159.76,55.24 162.59,57.41 165.00,57.92 168.68,58.69 170.97,56.52 173.15,58.64 173.95,59.43 174.45,60.87 174.51,61.98 174.77,66.50 170.27,66.37 167.59,68.57 165.65,70.16 164.53,72.71 160.98,73.55 155.44,74.86 154.39,70.19 147.00,69.00 147.00,69.00 158.00,80.00 158.00,80.00 148.03,82.82 146.37,78.29 143.00,70.00 143.00,70.00 138.00,71.00 138.00,71.00 138.00,71.00 150.00,89.13 150.00,89.13 147.57,89.67 145.60,90.27 143.10,89.13 138.30,87.30 134.87,76.80 134.00,72.00 134.00,72.00 124.00,74.00 124.00,74.00 123.99,84.63 122.13,92.26 118.00,102.00 118.00,102.00 126.00,108.00 126.00,108.00 129.81,101.48 141.34,90.42 147.00,101.00 147.00,101.00 129.00,109.00 129.00,109.00 129.00,109.00 129.00,111.00 129.00,111.00 130.83,111.54 132.00,112.14 134.00,111.82 138.50,110.51 144.72,102.12 150.00,111.82 150.00,111.82 137.00,115.00 137.00,115.00 137.00,115.00 137.00,117.00 137.00,117.00 143.10,117.54 155.92,114.02 153.00,127.00 162.90,131.67 156.96,136.62 154.89,136.95 152.50,137.34 150.50,135.24 148.00,134.43 145.38,133.57 142.64,134.29 140.15,132.82 135.07,129.84 139.36,126.59 134.00,119.00 132.92,125.04 132.52,126.90 134.00,132.89 133.20,132.99 132.64,133.41 131.06,132.89 123.17,129.61 130.14,119.13 129.43,116.62 128.94,114.91 127.30,114.00 126.00,113.00 126.00,113.00 123.44,124.00 123.44,124.00 123.44,124.00 122.00,133.00 122.00,133.00 110.41,128.80 119.36,116.36 124.00,110.00 121.92,108.62 118.44,105.74 116.00,105.69 113.69,105.64 110.25,108.17 108.01,109.22 101.66,112.19 98.30,114.64 91.00,115.00 91.00,115.00 91.00,126.00 91.00,126.00 96.10,126.41 107.09,127.37 109.83,132.13 110.90,133.99 110.88,135.94 111.00,138.00 111.00,138.00 91.00,130.00 91.00,130.00 91.00,130.00 91.00,136.00 91.00,136.00 100.07,136.44 103.76,138.55 104.00,148.00 104.00,148.00 91.00,140.00 91.00,140.00 92.89,146.09 103.43,150.35 96.57,157.59 95.42,158.80 94.38,159.21 93.00,160.00 94.12,163.99 94.50,170.14 88.13,168.53 84.64,167.64 85.38,164.66 84.42,162.00 83.05,158.17 79.49,155.53 80.47,151.02 81.47,146.40 84.54,147.33 88.00,140.00 88.00,140.00 74.00,148.00 74.00,148.00 74.26,137.91 78.75,136.78 88.00,136.00 88.00,136.00 88.00,130.00 88.00,130.00 88.00,130.00 68.00,138.00 68.00,138.00 68.12,135.94 68.10,133.99 69.17,132.13 71.91,127.37 82.90,126.41 88.00,126.00 88.00,126.00 88.00,115.00 88.00,115.00 80.99,114.66 76.16,112.04 70.00,108.97 67.66,107.80 64.67,105.36 62.00,105.87 59.55,106.35 56.77,109.33 55.00,111.00 60.63,116.52 67.96,129.03 57.00,133.00 57.00,133.00 55.56,123.00 55.56,123.00 55.56,123.00 53.00,113.00 53.00,113.00 51.70,113.95 50.10,114.78 49.62,116.47 48.88,119.14 55.80,129.62 47.94,132.89 46.36,133.41 45.80,132.99 45.00,132.89 46.48,126.90 46.08,125.04 45.00,119.00 39.81,126.35 43.62,129.88 38.77,132.82 36.37,134.29 33.57,133.59 31.00,134.43 28.50,135.24 26.50,137.34 24.11,136.95 22.04,136.62 16.10,131.67 26.00,127.00 23.08,114.02 35.90,117.54 42.00,117.00 42.00,117.00 42.00,115.00 42.00,115.00 42.00,115.00 29.00,111.82 29.00,111.82 34.17,102.34 40.21,110.48 45.00,111.82 47.02,112.14 48.15,111.55 50.00,111.00 50.00,111.00 50.00,109.00 50.00,109.00 50.00,109.00 42.00,105.05 42.00,105.05 42.00,105.05 32.00,101.00 32.00,101.00 37.99,89.79 48.85,102.55 54.00,108.00 54.00,108.00 61.00,102.00 61.00,102.00 56.87,92.26 55.01,84.63 55.00,74.00 55.00,74.00 45.00,72.00 45.00,72.00 44.13,76.80 40.70,87.30 35.90,89.13 33.40,90.27 31.43,89.67 29.00,89.13 29.00,89.13 41.00,71.00 41.00,71.00 41.00,71.00 36.00,70.00 36.00,70.00 32.63,78.29 30.97,82.82 21.00,80.00 21.00,80.00 32.00,69.00 32.00,69.00 24.61,70.19 23.56,74.86 18.02,73.55 14.47,72.71 13.35,70.16 11.41,68.57 8.78,66.41 4.23,66.43 4.37,62.00 4.41,60.85 4.88,59.57 5.74,58.78 7.87,56.82 10.20,58.48 14.00,57.63 17.09,56.93 19.49,55.30 22.96,56.60 27.63,58.36 26.01,61.65 33.00,66.00 33.00,66.00 27.00,52.00 27.00,52.00 29.44,52.08 31.68,51.97 33.72,53.60 39.88,58.50 33.15,64.72 42.00,68.00 41.97,64.33 41.99,62.65 41.10,59.00 40.57,56.81 38.25,51.11 38.81,49.33 39.68,46.54 43.84,47.59 45.83,51.11 50.00,58.51 42.03,68.12 52.01,70.37 52.01,70.37 57.00,71.00 57.00,71.00 58.10,65.20 61.67,60.51 65.46,56.07 66.93,54.35 70.90,51.33 71.37,49.54 71.79,47.97 69.57,42.99 69.00,41.00 63.47,42.26 50.33,48.55 47.17,41.00 46.37,39.10 47.21,37.85 49.15,37.24 51.72,37.00 57.24,39.13 66.00,37.24 66.00,37.24 64.00,32.00 64.00,32.00 56.20,34.26 50.16,36.10 48.00,26.00 48.00,26.00 62.00,29.00 62.00,29.00 57.71,22.28 53.28,26.20 50.62,19.95 Z M 58.97,20.00 C 62.72,19.94 64.89,14.35 58.97,12.74 52.32,14.85 55.10,20.06 58.97,20.00 Z M 121.00,20.14 C 124.75,20.14 127.20,13.67 120.09,12.66 114.20,14.95 117.78,20.14 121.00,20.14 Z M 78.00,52.00 C 80.79,58.26 84.75,65.55 90.00,70.00 90.00,70.00 101.00,52.00 101.00,52.00 97.00,52.04 94.47,51.46 92.00,55.00 92.00,55.00 86.00,55.00 86.00,55.00 83.69,51.69 81.80,52.10 78.00,52.00 Z M 71.00,63.00 C 71.00,63.00 67.00,67.00 67.00,67.00 62.69,67.48 62.17,68.35 60.00,72.00 60.00,72.00 81.00,74.00 81.00,74.00 81.00,74.00 75.00,54.00 75.00,54.00 71.24,57.05 70.17,58.09 71.00,63.00 Z M 98.00,74.00 C 98.00,74.00 119.00,72.00 119.00,72.00 119.00,72.00 110.34,64.09 110.34,64.09 110.34,64.09 105.00,54.00 105.00,54.00 102.09,58.72 98.85,68.48 98.00,74.00 Z M 20.02,68.55 C 23.62,68.11 25.95,62.33 20.02,61.03 14.18,63.65 16.52,69.00 20.02,68.55 Z M 158.27,68.34 C 162.13,69.77 166.51,64.20 159.94,61.17 154.23,62.20 155.52,67.32 158.27,68.34 Z M 59.00,76.00 C 59.67,80.25 59.69,82.46 64.00,84.00 63.06,88.76 62.68,93.29 64.00,98.00 64.00,98.00 79.00,83.00 79.00,83.00 79.00,83.00 59.00,76.00 59.00,76.00 Z M 92.00,86.00 C 92.00,86.00 95.00,83.00 95.00,83.00 95.00,83.00 94.00,77.00 94.00,77.00 83.75,75.42 82.12,82.76 92.00,86.00 Z M 100.00,83.00 C 102.72,88.74 109.82,94.31 115.00,98.00 115.00,98.00 116.02,87.09 116.02,87.09 116.02,87.09 120.00,76.00 120.00,76.00 120.00,76.00 100.00,83.00 100.00,83.00 Z M 67.00,102.00 C 67.00,102.00 77.87,104.77 77.87,104.77 77.87,104.77 88.00,111.00 88.00,111.00 88.00,111.00 85.00,90.00 85.00,90.00 79.13,92.83 71.19,97.06 67.00,102.00 Z M 91.00,111.00 C 91.00,111.00 101.13,104.77 101.13,104.77 101.13,104.77 112.00,102.00 112.00,102.00 112.00,102.00 95.00,90.00 95.00,90.00 92.22,94.30 91.44,105.59 91.00,111.00 Z M 34.90,129.18 C 38.43,128.33 39.37,121.11 32.31,121.66 28.00,125.18 31.74,129.93 34.90,129.18 Z M 145.99,129.18 C 149.61,128.36 151.79,122.03 145.13,121.74 140.02,124.93 142.49,129.96 145.99,129.18 Z M 89.97,155.71 C 93.88,155.71 95.79,150.53 89.97,148.86 83.37,150.65 85.99,155.71 89.97,155.71 Z" fill="white" stroke="none"/>
<animateTransform attributeType="xml" attributeName="transform" type="rotate" values="0 27 24;360 27 24" dur="4s" repeatCount="indefinite"/>
</g>
</g>
</defs>
<rect width="800" height="450" x="0" y="0" fill="url(#bleu)"/>
</svg>

<script>
function myFunctionC() {
for (var i = 0; i < 150; i++) {
var cx = Math.floor(800*Math.random());
var cy = Math.floor(450*Math.random());
var r = Math.floor(2*Math.random())+2;
var d = Math.floor(6*Math.random())+6;
var d2 = Math.floor(2*Math.random())+2;
var o = Math.random();
var x = Math.floor(10*Math.random())+10;

var circle1 = document.createElementNS(svgEssai.namespaceURI, 'circle');
    circle1.setAttributeNS(null, 'cx', cx);
    circle1.setAttributeNS(null, 'cy', cy);
    circle1.setAttributeNS(null, 'r', r);
    circle1.setAttributeNS(null, 'fill', '#ffffff');
    circle1.setAttributeNS(null, 'opacity', o);

var animation1 = document.createElementNS(svgEssai.namespaceURI, 'animateMotion');
    animation1.setAttribute('path', 'm0 -450L0 450');
    animation1.setAttribute('begin', '0s');
    animation1.setAttribute('dur', d);
    animation1.setAttribute('repeatCount', 'indefinite');

var animation2 = document.createElementNS(svgEssai.namespaceURI, 'animateMotion');
    animation2.setAttribute('path', 'm0 0l'+x+' 0z');
    animation2.setAttribute('begin', '0s');
    animation2.setAttribute('dur', d2);
    animation2.setAttribute('repeatCount', 'indefinite');

var g1 = document.createElementNS(svgEssai.namespaceURI, 'g');

var g2 = document.createElementNS(svgEssai.namespaceURI, 'g');

    g1.appendChild(animation1);
    g1.appendChild(circle1);
    g2.appendChild(animation2);
    g2.appendChild(g1);
    svgEssai.appendChild(g2);
}
for (var i = 0; i < 10; i++) {
var fx = Math.floor(800*Math.random());
var fy = Math.floor(450*Math.random());
var d2 = Math.floor(6*Math.random())+6;
var d3 = Math.floor(2*Math.random())+2;
var o2 = Math.random();

var g3 = document.createElementNS(svgEssai.namespaceURI, 'g');


var animation3 = document.createElementNS(svgEssai.namespaceURI, 'animateMotion');
    animation3.setAttribute('path', 'm0 -450L0 450');
    animation3.setAttribute('begin', '0s');
    animation3.setAttribute('dur', d2);
    animation3.setAttribute('repeatCount', 'indefinite');


var use1 = document.createElementNS(svgEssai.namespaceURI, 'use');
    use1.setAttributeNS(null, 'href', '#flake');
    use1.setAttributeNS(null, 'opacity', o2);
    use1.setAttributeNS(null, 'transform', 'translate('+fx+' '+fy+')');

    g3.appendChild(animation3);
    g3.appendChild(use1);
    svgEssai.appendChild(g3);

}}
myFunctionC()
</script>