Skip to content

Commit

Permalink
[pys] Updated pre_commit.py
Browse files Browse the repository at this point in the history
  • Loading branch information
NSPC911 committed Jul 10, 2024
1 parent 4b46aee commit de58b95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pys/pre_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
indented += i
if i == "":
indented += " "
html_end = f'<div class="download-container"><div class="file-download"><input type="text" id="fileNameInput" placeholder="Enter Pack name"></div><button class="download-selected-button" onclick="downloadSelectedTweaks()">Download Selected Tweaks</button><div id="loading-circle"></div></div> </div><script src="resource-pack-page.js"></script></body><footer style="auto" class="footer-container"><div class="credits-footer">{indented} <p><a href="https://github.com/BedrockTweaks/Bedrock-Tweaks-Base">GitHub</a></p></div></footer></html>'
html_end = f'<div class="download-container"><div class="file-download"><input type="text" id="fileNameInput" placeholder="Enter Pack name"></div><button class="download-selected-button" onclick="downloadSelectedTweaks()">Download Selected Tweaks</button><div id="loading-circle"></div><div id="selected-tweaks" style="display: none;"></div></div></div><script src="resource-pack-page.js"></script></body><footer style="auto" class="footer-container"><div class="credits-footer">{indented}<p><a href="https://github.com/BedrockTweaks/Bedrock-Tweaks-Base">GitHub</a></p></div></footer></html>'

def pre_commit():
html = '<!DOCTYPE html><html lang="en"><head><meta content="Bedrock Edition Community Tweaks Resource Packs" name="author"/><meta content="Resource Pack tweak selector. Unofficially updated by BEComTweaks on GitHub" name="description"/><meta charset="utf-8"><meta content="width=device-width, initial-scale=1.0" name="viewport"><title>Resource Packs</title><link href="resource-pack-page.css" rel="stylesheet"/><link href="images/icon.png" rel="icon" type="image/x-icon"/></meta></meta></head><body><br/><div class="image-container"><a href="https://becomtweaks.github.io"><img alt="Resource Packs" id="title" src="images/title.png"/></a></div><div id="background-container"></div><script>const textures = [{src: "images/blocks/stone.png", probability: 0.618 },{ src: "images/blocks/copper_ore.png", probability: 0.128 },{ src: "images/blocks/coal_ore.png", probability: 0.128 },{ src: "images/blocks/iron_ore.png", probability: 0.064 },{ src: "images/blocks/lapis_ore.png", probability: 0.032 },{ src: "images/blocks/redstone_ore.png", probability: 0.016 },{ src: "images/blocks/gold_ore.png", probability: 0.008 },{ src: "images/blocks/emerald_ore.png", probability: 0.004 },{ src: "images/blocks/diamond_ore.png", probability: 0.002 }];function selectTexture() {const rand = Math.random();let cumulativeProbability = 0;for (const texture of textures) {cumulativeProbability += texture.probability;if (rand < cumulativeProbability) {return texture.src;}}}function createTiles() {const container = document.getElementById("background-container");const numColumns = Math.ceil(window.innerWidth / 100) + 2;const numRows = Math.ceil(window.innerHeight / 100) + 2;container.innerHTML = "";for (let i = 0; i < numColumns; i++) {const rowDiv = document.createElement("div");rowDiv.className = "row";for (let j = 0; j < numRows; j++) {const tile = document.createElement("div");tile.className = "tile";tile.style.backgroundImage = `url("${selectTexture()}")`;rowDiv.appendChild(tile);}container.appendChild(rowDiv);}}createTiles();window.addEventListener("resize", () => {document.getElementById("background-container").innerHTML = "";createTiles();});</script><ul class="large-nav"><li><a class="nav-link" href="https://becomtweaks.github.io">Home</a></li><li style="float:right"><a class="nav-link" href="https://becomtweaks.github.io/crafting-tweaks">Crafting Tweaks</a></li><li style="float:right"><a class="nav-link" href="https://becomtweaks.github.io/behaviour-packs">Behaviour Packs</a></li><li style="float:right"><a class="nav-link" href="https://becomtweaks.github.io/resource-packs">Resource Packs</a></li></ul><ul class="small-nav"><li><a class="nav-link" href="https://becomtweaks.github.io">Home</a></li><li style="float:right"><a class="nav-link" href="https://becomtweaks.github.io/crafting-tweaks">CTs</a></li><li style="float:right"><a class="nav-link" href="https://becomtweaks.github.io/behaviour-packs">BPs</a></li><li style="float:right"><a class="nav-link" href="https://becomtweaks.github.io/resource-packs">RPs</a></li></ul><div class="container"><!-- Categories -->'
Expand Down
2 changes: 2 additions & 0 deletions webUI/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5587,6 +5587,8 @@
</button>
<div id="loading-circle">
</div>
<div id="selected-tweaks" style="display: none;">
</div>
</div>
</div>
<script src="resource-pack-page.js">
Expand Down

0 comments on commit de58b95

Please sign in to comment.