You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

172 lines
7.3 KiB

  1. <head><title>Other Icons</title>
  2. <link rel="icon" type="image/png" href="../favicon.png">
  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. box-shadow: 0px 5px 18px 3px rgba(0,0,0,0.59);
  47. }
  48. .top button {
  49. float: right;
  50. position: relative;
  51. top: -2rem;
  52. font-size: 1.5rem;
  53. }
  54. .pngbox {
  55. position: absolute;
  56. top: 2rem;
  57. right: 1rem;
  58. font-size: 1.5rem;
  59. }
  60. input[type="checkbox"] {
  61. width: 1.6em;
  62. height: 1.6em;
  63. }
  64. .label {
  65. height: 2.5em;
  66. line-height: 1em;
  67. overflow: hidden;
  68. font-size: 0.9rem;
  69. }
  70. .grid {
  71. display: flex;
  72. flex-wrap: wrap;
  73. width: 100%;
  74. }
  75. h1 {
  76. display:inline;
  77. }
  78. .home {
  79. font-size: 3rem;
  80. text-decoration: none
  81. }
  82. </style>
  83. <body>
  84. <div class="top">
  85. <a href=".." class="home">⮤</a> &nbsp; <h1>Other Icons</h1>
  86. <br/><br/>
  87. <span class="find">Finder: <input onkeyup="search()" id="finder"><br></span>
  88. <div class="pngbox"><input type="checkbox" id="pngcheck"><label for="pngcheck">Download as PNG</label></div>
  89. <button onclick="toggleBg()">Change Background</button>
  90. </div>
  91. <div class="grid">
  92. <div id="Kudu.svg" class="imgbox"><img src="Kudu.svg" class="bg0" onclick="download('Kudu.svg', this)"/><div class="label">Kudu.svg</div></div>
  93. <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>
  94. <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>
  95. <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>
  96. <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>
  97. <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>
  98. <div id="connector.svg" class="imgbox"><img src="connector.svg" class="bg0" onclick="download('connector.svg', this)"/><div class="label">connector.svg</div></div>
  99. <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>
  100. <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>
  101. <div id="container.svg" class="imgbox"><img src="container.svg" class="bg0" onclick="download('container.svg', this)"/><div class="label">container.svg</div></div>
  102. <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>
  103. <div id="cubes.svg" class="imgbox"><img src="cubes.svg" class="bg0" onclick="download('cubes.svg', this)"/><div class="label">cubes.svg</div></div>
  104. <div id="designer.svg" class="imgbox"><img src="designer.svg" class="bg0" onclick="download('designer.svg', this)"/><div class="label">designer.svg</div></div>
  105. <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>
  106. <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>
  107. <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>
  108. <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>
  109. <div id="devopsiconartifacts96.svg" class="imgbox"><img src="devopsiconartifacts96.svg" class="bg0" onclick="download('devopsiconartifacts96.svg', this)"/><div class="label">devopsiconartifacts96.svg</div></div>
  110. <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>
  111. <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>
  112. <div id="pickle.svg" class="imgbox"><img src="pickle.svg" class="bg0" onclick="download('pickle.svg', this)"/><div class="label">pickle.svg</div></div>
  113. <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>
  114. <div id="rss.svg" class="imgbox"><img src="rss.svg" class="bg0" onclick="download('rss.svg', this)"/><div class="label">rss.svg</div></div>
  115. <div id="shield.svg" class="imgbox"><img src="shield.svg" class="bg0" onclick="download('shield.svg', this)"/><div class="label">shield.svg</div></div>
  116. <div id="xcode.svg" class="imgbox"><img src="xcode.svg" class="bg0" onclick="download('xcode.svg', this)"/><div class="label">xcode.svg</div></div>
  117. </div>
  118. <script>
  119. var bg = 0;
  120. function toggleBg() {
  121. bg++
  122. if(bg > 2) bg = 0;
  123. for(let img of document.getElementsByTagName("img")) {
  124. img.className = `bg${bg}`;
  125. }
  126. }
  127. function search() {
  128. let q = document.getElementById('finder').value.trim().toLowerCase()
  129. if(q.length <= 0) {
  130. for(let imgbox of document.getElementsByClassName("imgbox")) {
  131. imgbox.style.display = "inline-block"
  132. }
  133. }
  134. for(let imgbox of document.getElementsByClassName("imgbox")) {
  135. imgbox.style.display = "inline-block"
  136. if(!imgbox.id.includes(q)) {
  137. imgbox.style.display = "none"
  138. }
  139. }
  140. }
  141. function download(f, e) {
  142. var downloadPNG = document.getElementById("pngcheck").checked;
  143. if(downloadPNG) {
  144. var data = getBase64Image(e);
  145. let a = document.createElement('a')
  146. a.href = "data:application/octet-stream;base64," + data
  147. a.download = f.replace('.svg', '.png')
  148. a.click()
  149. } else {
  150. let a = document.createElement('a')
  151. a.href = f
  152. a.download = f
  153. a.click()
  154. }
  155. }
  156. function getBase64Image(img) {
  157. var canvas = document.createElement("canvas");
  158. canvas.width = img.naturalWidth;
  159. canvas.height = img.naturalHeight;
  160. console.log(canvas.width , canvas.height)
  161. var ctx = canvas.getContext("2d");
  162. ctx.drawImage(img, 0, 0);
  163. var dataURL = canvas.toDataURL("image/png");
  164. return dataURL.replace(/^data:image\/(png|jpg);base64,/, "");
  165. }
  166. </script>
  167. </body></html>