-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoverview.html
More file actions
108 lines (95 loc) · 12 KB
/
overview.html
File metadata and controls
108 lines (95 loc) · 12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<style>
* { font-family: "Segoe UI",Arial,sans-serif !important; }
body {background-color: rgb(200,200,200); font-size:14px !important;}
.vert {vertical-align:middle}figure {display:inline-block}
figcaption {width:128px}
figure {padding:8px;margin:0}
figure, input {
background: rgb(158,157,159);
border-top: 4px solid rgb(55,55,55);
border-left: 4px solid rgb(55,55,55);
border-bottom: 4px solid rgb(253,253,253);
border-right: 4px solid rgb(253,253,253);
}
input {background: rgb(130,130,130);color:white;}
.sea {margin:0; margin-bottom:4px;}
label {padading:5vw;}
aaaa {vertical-align:top !important;}
.bimg {
object-fit: cover;
width:128px;
height:128px;
}
</style>
<body>
<div class="w3-container w3-content">
<div style="width:100%;padding:12px;" class="sea">
<div class="w3-twothird"><label for="fname" style="font-size:18px;">Texture Overview</label> <label for="fname" style="font-size:18px;float:right">Search: </label></div>
<div class="w3-rest"><input type="text" id="fname" name="fname" oninput="searched()" style="width:99%;vertical-align:middle;"></div>
</div>
<div id="demo"></div>
</div>
<script>
function searched() {
var text = document.getElementById('fname').value;
var items = document.getElementsByClassName('fig');
for (var i=0; i < items.length; i++) {
var el = items[i]; if (el.innerHTML.includes(text)){ el.style.display="inline-block"; } else el.style.display="none";
}
}
const xmlhttp = new XMLHttpRequest();
xmlhttp.onload = function() {
var myArr = JSON.parse(this.responseText);
var tree = myArr['tree'];
var bkup = false;
if (undefined == tree) {
console.log(this.responseText);
myArr = JSON.parse(backup());
tree = myArr['tree'];
bkup = true;
}
var els = "";
for (var i = 0; i < tree.length; i++) {
var el = tree[i];
if ( !(el.path.includes(".png")) || el.path.includes('ctm/') || el.path.includes("512") || !el.path.includes("/")) {continue;}
var path = el.path;
if (bkup) path = "x128/HD-x128/assets/minecraft/textures/" + el.path;
els += "<figure class='fig'><img class='lazy vert bimg' src='data:,' data-src='https://isaiahmc.github.io/resourcepack/" + path + "' width='128' loading='lazy'><figcaption class='vert'>" + strip(path) + "</figcaption></figure>";
if (path.includes("512")) break;
}
document.getElementById("demo").innerHTML = els;
do_evt();
}
xmlhttp.open("GET", "https://api.github.com/repos/IsaiahMC/resourcepack/git/trees/master?recursive=1", true);
xmlhttp.send();
function strip(s) {
var sub = s.substring(s.lastIndexOf('/')+1);
sub = sub.split(".")[0];
if (sub.includes('hardened_clay_stained')){return 'Hard Clay (' + sub.replace('hardened_clay_stained_', '') + ')';}
return sub;
}
function do_evt() {
var lis = [].slice.call(document.querySelectorAll("img.lazy"));
if ("IntersectionObserver" in window) {
var liObserver = new IntersectionObserver(function(entries, observer) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
var li = entry.target;
li.src = li.dataset.src;
li.classList.remove("lazy");
liObserver.unobserve(li);
}
});
});
lis.forEach(function(li){ liObserver.observe(li); });
}
}
function backup() {
return '{"tree":[{"path":"blocks/bedrock.png"},{"path":"blocks/bee_nest_bottom.png"},{"path":"blocks/bee_nest_front_honey.png"},{"path":"blocks/bee_nest_side.png"},{"path":"blocks/bee_nest_top.png"},{"path":"blocks/birch_planks.png"},{"path":"blocks/brick.png"},{"path":"blocks/cactus_bottom.png"},{"path":"blocks/cactus_side.png"},{"path":"blocks/cactus_top.png"},{"path":"blocks/clay.png"},{"path":"blocks/coal_ore.png"},{"path":"blocks/coarse_dirt.png"},{"path":"blocks/cobblestone.png"},{"path":"blocks/cobblestone_mossy.png"},{"path":"blocks/concrete_powder_black.png"},{"path":"blocks/concrete_powder_blue.png"},{"path":"blocks/concrete_powder_brown.png"},{"path":"blocks/concrete_powder_cyan.png"},{"path":"blocks/concrete_powder_gray.png"},{"path":"blocks/concrete_powder_green.png"},{"path":"blocks/concrete_powder_light_blue.png"},{"path":"blocks/concrete_powder_lime.png"},{"path":"blocks/concrete_powder_magenta.png"},{"path":"blocks/concrete_powder_orange.png"},{"path":"blocks/concrete_powder_pink.png"},{"path":"blocks/concrete_powder_purple.png"},{"path":"blocks/concrete_powder_red.png"},{"path":"blocks/concrete_powder_silver.png"},{"path":"blocks/concrete_powder_white.png"},{"path":"blocks/concrete_powder_yellow.png"},{"path":"blocks/copper_block.png"},{"path":"blocks/copper_ore.png"},{"path":"blocks/crafting_table_front.png"},{"path":"blocks/crafting_table_side.png"},{"path":"blocks/crafting_table_top.png"},{"path":"blocks/crimson_door_bottom.png"},{"path":"blocks/crimson_door_top.png"},{"path":"blocks/crimson_planks.png"},{"path":"blocks/cut_copper.png"},{"path":"blocks/daylight_detector_inverted_top.png"},{"path":"blocks/daylight_detector_top.png"},{"path":"blocks/destroy_stage_0.png"},{"path":"blocks/destroy_stage_1.png"},{"path":"blocks/destroy_stage_2.png"},{"path":"blocks/destroy_stage_3.png"},{"path":"blocks/destroy_stage_4.png"},{"path":"blocks/destroy_stage_5.png"},{"path":"blocks/destroy_stage_6.png"},{"path":"blocks/destroy_stage_7.png"},{"path":"blocks/destroy_stage_8.png"},{"path":"blocks/destroy_stage_9.png"},{"path":"blocks/diamond_block.png"},{"path":"blocks/diamond_ore.png"},{"path":"blocks/dirt.png"},{"path":"blocks/dispenser_front_horizontal.png"},{"path":"blocks/dispenser_front_vertical.png"},{"path":"blocks/door_birch_lower.png"},{"path":"blocks/door_birch_upper.png"},{"path":"blocks/door_dark_oak_lower.png"},{"path":"blocks/door_dark_oak_upper.png"},{"path":"blocks/door_iron_lower.png"},{"path":"blocks/door_iron_upper.png"},{"path":"blocks/door_spruce_lower.png"},{"path":"blocks/door_spruce_upper.png"},{"path":"blocks/door_wood_lower.png"},{"path":"blocks/door_wood_upper.png"},{"path":"blocks/emerald_block.png"},{"path":"blocks/end_stone.png"},{"path":"blocks/farmland.png"},{"path":"blocks/furnace_front_off.png"},{"path":"blocks/furnace_front_on.png"},{"path":"blocks/furnace_side.png"},{"path":"blocks/furnace_top.png"},{"path":"blocks/glazed_terracotta_black.png"},{"path":"blocks/glazed_terracotta_cyan.png"},{"path":"blocks/glazed_terracotta_gray.png"},{"path":"blocks/glowstone.png"},{"path":"blocks/gold_block.png"},{"path":"blocks/gold_ore.png"},{"path":"blocks/grass_path_top.png"},{"path":"blocks/grass_side.png"},{"path":"blocks/grass_side_overlay.png"},{"path":"blocks/grass_side_snowed.png"},{"path":"blocks/grass_top.png"},{"path":"blocks/gravel.png"},{"path":"blocks/hardened_clay.png"},{"path":"blocks/hardened_clay_stained_black.png"},{"path":"blocks/hardened_clay_stained_blue.png"},{"path":"blocks/hardened_clay_stained_brown.png"},{"path":"blocks/hardened_clay_stained_cyan.png"},{"path":"blocks/hardened_clay_stained_gray.png"},{"path":"blocks/hardened_clay_stained_green.png"},{"path":"blocks/hardened_clay_stained_light_blue.png"},{"path":"blocks/hardened_clay_stained_lime.png"},{"path":"blocks/hardened_clay_stained_magenta.png"},{"path":"blocks/hardened_clay_stained_orange.png"},{"path":"blocks/hardened_clay_stained_pink.png"},{"path":"blocks/hardened_clay_stained_purple.png"},{"path":"blocks/hardened_clay_stained_red.png"},{"path":"blocks/hardened_clay_stained_silver.png"},{"path":"blocks/hardened_clay_stained_white.png"},{"path":"blocks/hardened_clay_stained_yellow.png"},{"path":"blocks/hay_block_side.png"},{"path":"blocks/hay_block_top.png"},{"path":"blocks/ice.png"},{"path":"blocks/ice_packed.png"},{"path":"blocks/iron_bars.png"},{"path":"blocks/iron_block.png"},{"path":"blocks/iron_ore.png"},{"path":"blocks/jungle_log.png"},{"path":"blocks/ladder.png"},{"path":"blocks/lapis_block.png"},{"path":"blocks/leaves_birch.png"},{"path":"blocks/leaves_oak.png"},{"path":"blocks/lever.png"},{"path":"blocks/log_acacia.png"},{"path":"blocks/log_acacia_top.png"},{"path":"blocks/log_big_oak.png"},{"path":"blocks/log_birch.png"},{"path":"blocks/log_birch_top.png"},{"path":"blocks/log_oak.png"},{"path":"blocks/log_oak_top.png"},{"path":"blocks/log_spruce.png"},{"path":"blocks/magma.png"},{"path":"blocks/melon_side.png"},{"path":"blocks/melon_top.png"},{"path":"blocks/nether_brick.png"},{"path":"blocks/nether_bricks.png"},{"path":"blocks/netherrack.png"},{"path":"blocks/note_block.png"},{"path":"blocks/observer_back.png"},{"path":"blocks/observer_back_lit.png"},{"path":"blocks/observer_front.png"},{"path":"blocks/observer_side.png"},{"path":"blocks/observer_top.png"},{"path":"blocks/obsidian.png"},{"path":"blocks/piston_bottom.png"},{"path":"blocks/piston_side.png"},{"path":"blocks/piston_top.png"},{"path":"blocks/piston_top_sticky.png"},{"path":"blocks/planks_acacia.png"},{"path":"blocks/planks_big_oak.png"},{"path":"blocks/planks_birch.png"},{"path":"blocks/planks_jungle.png"},{"path":"blocks/planks_oak.png"},{"path":"blocks/planks_spruce.png"},{"path":"blocks/prismarine_dark.png"},{"path":"blocks/purpur_block.png"},{"path":"blocks/purpur_pillar.png"},{"path":"blocks/quartz_block_top.png"},{"path":"blocks/quartz_pillar.png"},{"path":"blocks/red_glazed_terracotta.png"},{"path":"blocks/red_sand.png"},{"path":"blocks/red_sandstone.png"},{"path":"blocks/red_sandstone_top.png"},{"path":"blocks/redstone_lamp_off.png"},{"path":"blocks/redstone_lamp_on.png"},{"path":"blocks/redstone_ore.png"},{"path":"blocks/reeds.png"},{"path":"blocks/repeater_off.png"},{"path":"blocks/repeater_on.png"},{"path":"blocks/sand.png"},{"path":"blocks/sandstone_bottom.png"},{"path":"blocks/sandstone_normal.png"},{"path":"blocks/sandstone_top.png"},{"path":"blocks/shulker_top_black.png"},{"path":"blocks/shulker_top_blue.png"},{"path":"blocks/shulker_top_brown.png"},{"path":"blocks/shulker_top_cyan.png"},{"path":"blocks/shulker_top_gray.png"},{"path":"blocks/shulker_top_green.png"},{"path":"blocks/shulker_top_light_blue.png"},{"path":"blocks/shulker_top_lime.png"},{"path":"blocks/shulker_top_magenta.png"},{"path":"blocks/snow.png"},{"path":"blocks/sponge.png"},{"path":"blocks/spruce_leaves.png"},{"path":"blocks/stone.png"},{"path":"blocks/stone_andesite.png"},{"path":"blocks/stone_andesite_smooth.png"},{"path":"blocks/stone_diorite.png"},{"path":"blocks/stone_diorite_smooth.png"},{"path":"blocks/stone_granite.png"},{"path":"blocks/stone_granite_smooth.png"},{"path":"blocks/stone_slab_side.png"},{"path":"blocks/stone_slab_top.png"},{"path":"blocks/stonebrick.png"},{"path":"blocks/stonebrick_mossy.png"},{"path":"blocks/tallgrass.png"},{"path":"blocks/tnt_bottom.png"},{"path":"blocks/tnt_side.png"},{"path":"blocks/tnt_top.png"},{"path":"blocks/wheat_stage_7.png"},{"path":"blocks/wool_colored_black.png"},{"path":"blocks/wool_colored_blue.png"},{"path":"blocks/wool_colored_brown.png"},{"path":"blocks/wool_colored_cyan.png"},{"path":"blocks/wool_colored_gray.png"},{"path":"blocks/wool_colored_green.png"},{"path":"blocks/wool_colored_light_blue.png"},{"path":"blocks/wool_colored_lime.png"},{"path":"blocks/wool_colored_magenta.png"},{"path":"blocks/wool_colored_orange.png"},{"path":"blocks/wool_colored_pink.png"},{"path":"blocks/wool_colored_purple.png"},{"path":"blocks/wool_colored_red.png"},{"path":"blocks/wool_colored_silver.png"},{"path":"blocks/wool_colored_white.png"},{"path":"blocks/wool_colored_yellow.png"},{"path":"ctm/grass_top/0.png"},{"path":"ctm/grass_top/1.png"},{"path":"ctm/grass_top/2.png"},{"path":"ctm/grass_top/3.png"},{"path":"ctm/grass_top/4.png"},{"path":"entity/chest/normal.png"},{"path":"entity/iron_golem.png"},{"path":"entity/squid.png"},{"path":"font/ascii.png"},{"path":"gui/container/generic_54.png"},{"path":"gui/options_background.png"},{"path":"gui/widgets.png"},{"path":"items/beef_cooked.png"},{"path":"items/beef_raw.png"},{"path":"items/diamond.png"},{"path":"items/diamond_sword.png"},{"path":"items/iron_chestplate.png"},{"path":"items/iron_leggings.png"},{"path":"items/iron_sword.png"},{"path":"items/porkchop_raw.png"},{"path":"items/sign.png"},{"path":"items/snowball.png"},{"path":"items/stick.png"},{"path":"items/stone_sword.png"},{"path":"items/wood_axe.png"},{"path":"items/wood_pickaxe.png"},{"path":"items/wood_sword.png"},{"path":"x128/HD-x128/pack.png"}]}';
}
</script>
</body>
</html>