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.
 
 
 

158 line
5.0 KiB

  1. <head><title>Azure.com Various</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>Azure.com Various</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="backup-archive.svg" class="imgbox"><img src="backup-archive.svg" class="bg0" onclick="download('backup-archive.svg', this)"/><div class="label">backup-archive.svg</div></div>
  93. <div id="blockchain.svg" class="imgbox"><img src="blockchain.svg" class="bg0" onclick="download('blockchain.svg', this)"/><div class="label">blockchain.svg</div></div>
  94. <div id="digital-marketing.svg" class="imgbox"><img src="digital-marketing.svg" class="bg0" onclick="download('digital-marketing.svg', this)"/><div class="label">digital-marketing.svg</div></div>
  95. <div id="e-commerce.svg" class="imgbox"><img src="e-commerce.svg" class="bg0" onclick="download('e-commerce.svg', this)"/><div class="label">e-commerce.svg</div></div>
  96. <div id="high-performance-computing.svg" class="imgbox"><img src="high-performance-computing.svg" class="bg0" onclick="download('high-performance-computing.svg', this)"/><div class="label">high-performance-computing.svg</div></div>
  97. <div id="hybrid-cloud-app.svg" class="imgbox"><img src="hybrid-cloud-app.svg" class="bg0" onclick="download('hybrid-cloud-app.svg', this)"/><div class="label">hybrid-cloud-app.svg</div></div>
  98. <div id="internet-of-things.svg" class="imgbox"><img src="internet-of-things.svg" class="bg0" onclick="download('internet-of-things.svg', this)"/><div class="label">internet-of-things.svg</div></div>
  99. <div id="lob-applications.svg" class="imgbox"><img src="lob-applications.svg" class="bg0" onclick="download('lob-applications.svg', this)"/><div class="label">lob-applications.svg</div></div>
  100. <div id="saas.svg" class="imgbox"><img src="saas.svg" class="bg0" onclick="download('saas.svg', this)"/><div class="label">saas.svg</div></div>
  101. <div id="serverless.svg" class="imgbox"><img src="serverless.svg" class="bg0" onclick="download('serverless.svg', this)"/><div class="label">serverless.svg</div></div>
  102. <div id="solutions.svg" class="imgbox"><img src="solutions.svg" class="bg0" onclick="download('solutions.svg', this)"/><div class="label">solutions.svg</div></div>
  103. </div>
  104. <script>
  105. var bg = 0;
  106. function toggleBg() {
  107. bg++
  108. if(bg > 2) bg = 0;
  109. for(let img of document.getElementsByTagName("img")) {
  110. img.className = `bg${bg}`;
  111. }
  112. }
  113. function search() {
  114. let q = document.getElementById('finder').value.trim().toLowerCase()
  115. if(q.length <= 0) {
  116. for(let imgbox of document.getElementsByClassName("imgbox")) {
  117. imgbox.style.display = "inline-block"
  118. }
  119. }
  120. for(let imgbox of document.getElementsByClassName("imgbox")) {
  121. imgbox.style.display = "inline-block"
  122. if(!imgbox.id.includes(q)) {
  123. imgbox.style.display = "none"
  124. }
  125. }
  126. }
  127. function download(f, e) {
  128. var downloadPNG = document.getElementById("pngcheck").checked;
  129. if(downloadPNG) {
  130. var data = getBase64Image(e);
  131. let a = document.createElement('a')
  132. a.href = "data:application/octet-stream;base64," + data
  133. a.download = f.replace('.svg', '.png')
  134. a.click()
  135. } else {
  136. let a = document.createElement('a')
  137. a.href = f
  138. a.download = f
  139. a.click()
  140. }
  141. }
  142. function getBase64Image(img) {
  143. var canvas = document.createElement("canvas");
  144. canvas.width = img.naturalWidth;
  145. canvas.height = img.naturalHeight;
  146. console.log(canvas.width , canvas.height)
  147. var ctx = canvas.getContext("2d");
  148. ctx.drawImage(img, 0, 0);
  149. var dataURL = canvas.toDataURL("image/png");
  150. return dataURL.replace(/^data:image\/(png|jpg);base64,/, "");
  151. }
  152. </script>
  153. </body></html>