Advertisement
PeterSvP

GameTextures Browser

Feb 6th, 2018
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Browser for GameTextures</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  5. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  6. <style>
  7. div.usage
  8. {
  9. border: 1px solid #333;
  10. font-family: Arial;
  11. font-size: 12px;
  12. font-weight: lighter;
  13. color: rgba(255,255,255,0.6);
  14. padding: 4px;
  15. margin: 4px;
  16. }
  17.  
  18. body
  19. {
  20. background: #222;
  21. }
  22.  
  23. li
  24. {
  25. display: inline-block !important;
  26. width:255px;
  27. height:255px;
  28. border: 1px solid #333;
  29. overflow:hidden;
  30. position:relative;
  31. }
  32.  
  33. h2
  34. {
  35. display:block;
  36. position: absolute;
  37. left:6px;
  38. top:0px;
  39. right:0px;
  40. bottom:0px;
  41. z-index: 11;
  42. color: white;
  43. font-family: Arial;
  44. font-size: 12px;
  45. font-weight: lighter;
  46. color: rgba(255,255,255,0.3);
  47. }
  48.  
  49. a.woocommerce-main-image img
  50. {
  51. display:block;
  52. width: 255px;
  53. height: 255px;
  54. position: absolute;
  55. left:0px;
  56. top:0px;
  57. z-index: 10;
  58. background: #222;
  59. }
  60. li>a
  61. {
  62. display:block;
  63. position: absolute;
  64. left:0px;
  65. top:0px;
  66. right:0px;
  67. bottom:0px;
  68. z-index: 20;
  69. }
  70.  
  71. a.pop-content
  72. {
  73. display: none;
  74. }
  75. </style>
  76. <script>
  77. function getParameterByName(name, url, defval) {
  78. if (!url) url = window.location.href;
  79. name = name.replace(/[\[\]]/g, "\\$&");
  80. var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
  81. results = regex.exec(url);
  82. if (!results) return null;
  83. if (!results[2]) return defval;
  84. return decodeURIComponent(results[2].replace(/\+/g, " "));
  85. }
  86.  
  87. function fetch(page, entries, cat)
  88. {
  89. var link = "http://www.gametextures.com/wp-content/themes/gametextures/woocommerce/callbacks/product-archive.php?paged="
  90. + page + "&posts_per_load=" + entries + "&product_cat=" + cat;
  91. console.log(link);
  92. $.get(link, function(data){$("body").append(data);});
  93. }
  94.  
  95. var category = getParameterByName("cat", null, "architectural");
  96. var start = Number(getParameterByName("start",null,1));
  97. var numpages = Number(getParameterByName("numpages",null,4));
  98. console.log("start = " + start);
  99. console.log("numpages = " + numpages);
  100.  
  101. for(var i = start; i < start + numpages; i++)
  102. {
  103. fetch(i, getParameterByName("perpage",null,10), category);
  104. }
  105. /**/
  106. </script>
  107. </head>
  108.  
  109. <body>
  110. <div class="usage">GameTextures Browser. Example usage: <tt>GTBrowser.html?start=1&numpages=10&perpage=7&cat=natural</tt>. Valid categories: architectural, natural, decal, misc. <i>To use this tool, disable CORS!</i></div>
  111. </body>
  112.  
  113. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement