Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

165 linhas
7.2 KiB

  1. <head><title>Other Icons</title>
  2. <script src="http://pablojs.com/downloads/pablo.min.js"></script>
  3. </head>
  4. <style>
  5. body {
  6. font-family: 'Segoe UI', Arial;
  7. background-color: #aaa;
  8. padding: 0;
  9. margin: 0;
  10. }
  11. .bg0 {
  12. background-image: url("https://github.com/benc-uk/icon-collection/raw/master/_tools/background.png")
  13. }
  14. .bg1 {
  15. background-color: #333;
  16. }
  17. .bg2 {
  18. background-color: #fff;
  19. }
  20. .imgbox img {
  21. width: 10.5rem;
  22. height: 10.5rem;
  23. object-fit: contain;
  24. cursor: pointer;
  25. }
  26. .imgbox {
  27. margin: 0.6rem;
  28. padding: 0.5rem;
  29. text-align: center;
  30. width: 12rem;
  31. height: 12rem;
  32. background-color: #e0e0e0;
  33. }
  34. h1 {
  35. font-size: 2.6rem;
  36. }
  37. .find, .find input {
  38. font-size: 1.5rem;
  39. }
  40. .top {
  41. position: -webkit-sticky;
  42. position: sticky;
  43. top: 0;
  44. background-color: #aaa;
  45. padding: 1rem;
  46. padding-top: 0;
  47. box-shadow: 0px 5px 18px 3px rgba(0,0,0,0.59);
  48. }
  49. .top button {
  50. float: right;
  51. position: relative;
  52. top: -2rem;
  53. font-size: 1.5rem;
  54. }
  55. .pngbox {
  56. position: absolute;
  57. top: 2rem;
  58. right: 1rem;
  59. font-size: 1.5rem;
  60. }
  61. input[type="checkbox"] {
  62. width: 1.6em;
  63. height: 1.6em;
  64. }
  65. .label {
  66. height: 2.5em;
  67. line-height: 1em;
  68. overflow: hidden;
  69. font-size: 0.9rem;
  70. }
  71. .grid {
  72. display: flex;
  73. flex-wrap: wrap;
  74. width: 100%;
  75. }
  76. </style>
  77. <body>
  78. <div class="top">
  79. <h1>Other Icons</h1>
  80. <span class="find">Finder: <input onkeyup="search()" id="finder"><br></span>
  81. <div class="pngbox"><input type="checkbox" id="pngcheck"><label for="pngcheck">Download as PNG</label></div>
  82. <button onclick="toggleBg()">Change Background</button>
  83. </div>
  84. <div class="grid">
  85. <div id="Kudu.svg" class="imgbox"><img src="Kudu.svg" class="bg0" onclick="download('Kudu.svg', this)"/><div class="label">Kudu.svg</div></div>
  86. <div id="aks-blue.svg" class="imgbox"><img src="aks-blue.svg" class="bg0" onclick="download('aks-blue.svg', this)"/><div class="label">aks-blue.svg</div></div>
  87. <div id="app-center-colour.svg" class="imgbox"><img src="app-center-colour.svg" class="bg0" onclick="download('app-center-colour.svg', this)"/><div class="label">app-center-colour.svg</div></div>
  88. <div id="app-center.svg" class="imgbox"><img src="app-center.svg" class="bg0" onclick="download('app-center.svg', this)"/><div class="label">app-center.svg</div></div>
  89. <div id="azure ml.svg" class="imgbox"><img src="azure ml.svg" class="bg0" onclick="download('azure ml.svg', this)"/><div class="label">azure ml.svg</div></div>
  90. <div id="cloud-security.svg" class="imgbox"><img src="cloud-security.svg" class="bg0" onclick="download('cloud-security.svg', this)"/><div class="label">cloud-security.svg</div></div>
  91. <div id="connector.svg" class="imgbox"><img src="connector.svg" class="bg0" onclick="download('connector.svg', this)"/><div class="label">connector.svg</div></div>
  92. <div id="container-insights.svg" class="imgbox"><img src="container-insights.svg" class="bg0" onclick="download('container-insights.svg', this)"/><div class="label">container-insights.svg</div></div>
  93. <div id="container-mon.svg" class="imgbox"><img src="container-mon.svg" class="bg0" onclick="download('container-mon.svg', this)"/><div class="label">container-mon.svg</div></div>
  94. <div id="container.svg" class="imgbox"><img src="container.svg" class="bg0" onclick="download('container.svg', this)"/><div class="label">container.svg</div></div>
  95. <div id="containerinstances-mono.svg" class="imgbox"><img src="containerinstances-mono.svg" class="bg0" onclick="download('containerinstances-mono.svg', this)"/><div class="label">containerinstances-mono.svg</div></div>
  96. <div id="cubes.svg" class="imgbox"><img src="cubes.svg" class="bg0" onclick="download('cubes.svg', this)"/><div class="label">cubes.svg</div></div>
  97. <div id="designer.svg" class="imgbox"><img src="designer.svg" class="bg0" onclick="download('designer.svg', this)"/><div class="label">designer.svg</div></div>
  98. <div id="devops-boards.svg" class="imgbox"><img src="devops-boards.svg" class="bg0" onclick="download('devops-boards.svg', this)"/><div class="label">devops-boards.svg</div></div>
  99. <div id="devops-pipelines.svg" class="imgbox"><img src="devops-pipelines.svg" class="bg0" onclick="download('devops-pipelines.svg', this)"/><div class="label">devops-pipelines.svg</div></div>
  100. <div id="devops-repos.svg" class="imgbox"><img src="devops-repos.svg" class="bg0" onclick="download('devops-repos.svg', this)"/><div class="label">devops-repos.svg</div></div>
  101. <div id="devops-testplans.svg" class="imgbox"><img src="devops-testplans.svg" class="bg0" onclick="download('devops-testplans.svg', this)"/><div class="label">devops-testplans.svg</div></div>
  102. <div id="devopsiconartifacts96.svg" class="imgbox"><img src="devopsiconartifacts96.svg" class="bg0" onclick="download('devopsiconartifacts96.svg', this)"/><div class="label">devopsiconartifacts96.svg</div></div>
  103. <div id="event-grid-topic.svg" class="imgbox"><img src="event-grid-topic.svg" class="bg0" onclick="download('event-grid-topic.svg', this)"/><div class="label">event-grid-topic.svg</div></div>
  104. <div id="machine-learning-diagram.svg" class="imgbox"><img src="machine-learning-diagram.svg" class="bg0" onclick="download('machine-learning-diagram.svg', this)"/><div class="label">machine-learning-diagram.svg</div></div>
  105. <div id="pickle.svg" class="imgbox"><img src="pickle.svg" class="bg0" onclick="download('pickle.svg', this)"/><div class="label">pickle.svg</div></div>
  106. <div id="resource-explorer.svg" class="imgbox"><img src="resource-explorer.svg" class="bg0" onclick="download('resource-explorer.svg', this)"/><div class="label">resource-explorer.svg</div></div>
  107. <div id="rss.svg" class="imgbox"><img src="rss.svg" class="bg0" onclick="download('rss.svg', this)"/><div class="label">rss.svg</div></div>
  108. <div id="shield.svg" class="imgbox"><img src="shield.svg" class="bg0" onclick="download('shield.svg', this)"/><div class="label">shield.svg</div></div>
  109. <div id="xcode.svg" class="imgbox"><img src="xcode.svg" class="bg0" onclick="download('xcode.svg', this)"/><div class="label">xcode.svg</div></div>
  110. </div>
  111. <script>
  112. var bg = 0;
  113. function toggleBg() {
  114. bg++
  115. if(bg > 2) bg = 0;
  116. for(let img of document.getElementsByTagName("img")) {
  117. img.className = `bg${bg}`;
  118. }
  119. }
  120. function search() {
  121. let q = document.getElementById('finder').value.trim().toLowerCase()
  122. if(q.length <= 0) {
  123. for(let imgbox of document.getElementsByClassName("imgbox")) {
  124. imgbox.style.display = "inline-block"
  125. }
  126. }
  127. for(let imgbox of document.getElementsByClassName("imgbox")) {
  128. imgbox.style.display = "inline-block"
  129. if(!imgbox.id.includes(q)) {
  130. imgbox.style.display = "none"
  131. }
  132. }
  133. }
  134. function download(f, e) {
  135. var downloadPNG = document.getElementById("pngcheck").checked;
  136. if(downloadPNG) {
  137. var data = getBase64Image(e);
  138. let a = document.createElement('a')
  139. a.href = "data:application/octet-stream;base64," + data
  140. a.download = f.replace('.svg', '.png')
  141. a.click()
  142. } else {
  143. let a = document.createElement('a')
  144. a.href = f
  145. a.download = f
  146. a.click()
  147. }
  148. }
  149. function getBase64Image(img) {
  150. var canvas = document.createElement("canvas");
  151. canvas.width = img.naturalWidth;
  152. canvas.height = img.naturalHeight;
  153. console.log(canvas.width , canvas.height)
  154. var ctx = canvas.getContext("2d");
  155. ctx.drawImage(img, 0, 0);
  156. var dataURL = canvas.toDataURL("image/png");
  157. return dataURL.replace(/^data:image\/(png|jpg);base64,/, "");
  158. }
  159. </script>
  160. </body></html>