lyonlyke

CalRender() is svg icon

Jul 25th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>calRender() SVG JS</title>
  5.  
  6. <style>
  7.  
  8. body {background-color:black;}
  9.  
  10.  
  11. #boxe {
  12. display:block;
  13. margin:0 auto;
  14. height:300px;
  15. width:300px;
  16. }
  17.  
  18.  
  19. #boxe svg {
  20. width:100%;
  21. height:100%;
  22. margin:0 auto;
  23. }
  24.  
  25. </style>
  26.  
  27. </head>
  28. <body>
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. <script>
  36.  
  37. function calRender(){
  38. var pieces = [
  39. '#FF3636','0,5 32,5 32,20 0,20 0,5',
  40. '#F40000','32,5 64,5 64,20 32,20 32,5',
  41. '#68544F','6,0 6,10 9,10 9,0 6,0',
  42. '#68544F','22,0 22,10 25,10 25,0 22,0',
  43. '#68544F','39,0 39,10 42,10 42,0 39,0',
  44. '#68544F','55,0 55,10 58,10 58,0 55,0',
  45. '#EDE9E8','0,20 0,64 32,64 32,20 0,20',
  46. '#DFD7D5','32,20 32,64 64,64 64,20 32,20',
  47. '#D2C5C2','9,28 9,40 21,40 21,28 9,28',
  48. '#D2C5C2','9,45 9,57 21,57 21,45 9,45',
  49. '#D2C5C2','26,28 26,40 32,40 32,28 26,28',
  50. '#D2C5C2','26,45 26,57 32,57 32,45 26,45',
  51. '#C4B3AF','32,28 32,40 38,40 38,28 32,28',
  52. '#C4B3AF','32,45 32,57 38,57 38,45 32,45',
  53. '#C4B3AF','43,28 43,40 55,40 55,28 43,28',
  54. '#C4B3AF','43,45 43,57 55,57 55,45 43,45',
  55. '#C4B3AF','58,64 58,58 64,58'];
  56.  
  57. document.write('<span id="boxe"><svg viewBox="0 0 64 64">');
  58. document.write('<defs>');
  59. document.write('<pattern id="slate" width="64" height="64" patternUnits="userSpaceOnUse"><g>');
  60.  
  61. for(i = 0; i < pieces.length;i = i + 2){
  62. var j = i + 1;
  63.  
  64. document.write('<polyline fill="'+pieces[i]+'" points="'+pieces[j]+'"><\/polyline>');
  65. }
  66.  
  67. document.write('<\/g><\/pattern><\/defs>');
  68. document.write('<rect x="0" y="0" width="100%" height="100%" fill="url(#slate)" \/>');
  69. document.write('<\/svg><\/span>');
  70. }
  71. calRender();
  72.  
  73. </script>
  74.  
  75.  
  76. </body>
  77. </html>
Advertisement
Add Comment
Please, Sign In to add comment