Skip to content

Commit

Permalink
added docs + some theme changes + workflow
Browse files Browse the repository at this point in the history
wait what is wrong with line 21 huh
  • Loading branch information
NSPC911 committed Sep 24, 2024
1 parent f568d05 commit f142053
Show file tree
Hide file tree
Showing 6 changed files with 320 additions and 203 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Prettify

on:
push:
workflow_dispatch:

jobs:
prettify:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with fetch-depth: 0

- name: Install Prettier
run: npm install prettier

- name: Prettify Repo
run: npx prettier --write "**/*.{css,html}"

- name: Commit changes
run: |
git config --global user.name "NSPBot911"
git config --global user.email ${{ secrets.BOT_EMAIL }}
git add -A
if git diff-index --quiet HEAD --; then
echo "No changes to commit"
else
git commit -m "[actions] Formatted Repository" -m "skip-checks: true"
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
89 changes: 89 additions & 0 deletions bg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// Array of textures
const textures = [
{
src: "dirt/0.png",
},
{
src: "dirt/1.png",
},
{
src: "dirt/2.png",
},
{
src: "dirt/3.png",
},
{
src: "dirt/4.png",
},
{
src: "dirt/5.png",
},
{
src: "dirt/6.png",
},
{
src: "dirt/7.png",
},
{
src: "dirt/8.png",
},
{
src: "dirt/9.png",
},
{
src: "dirt/10.png",
},
{
src: "dirt/11.png",
},
{
src: "dirt/12.png",
},
{
src: "dirt/13.png",
},
{
src: "dirt/14.png",
},
{
src: "dirt/15.png",
},
];

// Function to select a texture with equal probability
function selectTexture() {
const index = Math.floor(Math.random() * textures.length);
return textures[index].src;
}

// Function to create tiles with random background images
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"; // Add a class for styling purposes if needed

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);
}
}

// Call the function to create tiles
createTiles();

// Redraw tiles on window resize to maintain the grid
window.addEventListener("resize", () => {
document.getElementById("background-container").innerHTML = "";
createTiles();
});
152 changes: 64 additions & 88 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,90 +1,66 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta content="Bedrock Edition Community Tweaks" name="author"/>
<meta content="Home page of Bedrock Edition Community Tweaks" name="description"/>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bedrock Edition Community Tweaks</title>
<link rel="stylesheet" href="landing-page.css">
<link href="icon.png" rel="icon" type="image/x-icon"/>
</head>
<body>
<br>
<div class="image-container">
<img id="title" alt="BedrockTweaks" src="title.png">
</div>
<div id="background-container"></div>
<script>
// Array of textures
const textures = [
{ src: "dirt/0.png" },
{ src: "dirt/1.png" },
{ src: "dirt/2.png" },
{ src: "dirt/3.png" },
{ src: "dirt/4.png" },
{ src: "dirt/5.png" },
{ src: "dirt/6.png" },
{ src: "dirt/7.png" },
{ src: "dirt/8.png" },
{ src: "dirt/9.png" },
{ src: "dirt/10.png" },
{ src: "dirt/11.png" },
{ src: "dirt/12.png" },
{ src: "dirt/13.png" },
{ src: "dirt/14.png" },
{ src: "dirt/15.png" }
];

// Function to select a texture with equal probability
function selectTexture() {
const index = Math.floor(Math.random() * textures.length);
return textures[index].src;
}

// Function to create tiles with random background images
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"; // Add a class for styling purposes if needed

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);
}
}

// Call the function to create tiles
createTiles();

// Redraw tiles on window resize to maintain the grid
window.addEventListener("resize", () => {
document.getElementById("background-container").innerHTML = "";
createTiles();
});
</script>
<div class="text">
<h3>BEComTweaks will not be prioritised for updates.</h3>
<p>Welcome to <a href="https://becomtweaks.github.io">becomtweaks.github.io</a>, an open-sourced, updated version of <a href="https://bedrocktweaks.net">bedrocktweaks.net</a></p>
<p>Server sponsorship are accepted, as self-hosting is not really a good option.</p>
</div>
<div class="text">
<h3>Pages:</h3>
<button class="rpbutton" onclick="document.location='https://becomtweaks.github.io/resource-packs'">Resource Packs</button>
<button class="ctbutton" onclick="document.location='https://becomtweaks.github.io/crafting-tweaks'">Crafting Tweaks</button>
<button class="bpbutton" onclick="document.location='https://becomtweaks.github.io/behaviour-packs'">Behaviour Packs</button>
</div>
<br>
</body>
<head>
<meta content="Bedrock Edition Community Tweaks" name="author" />
<meta
content="Home page of Bedrock Edition Community Tweaks"
name="description"
/>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Bedrock Edition Community Tweaks</title>
<link rel="stylesheet" href="theme.css" />
<link href="icon.png" rel="icon" type="image/x-icon" />
</head>
<body>
<div id="background-container"></div>
<script src="bg.js"></script>
<div class="half-dark">
<br />
<div class="image-container">
<img id="title" alt="BedrockTweaks" src="title.png" />
</div>
<div class="text">
<p>
Welcome to
<a href="https://becomtweaks.github.io">becomtweaks.github.io</a>, a
fully open-sourced, updated, cool version of
<a href="https://bedrocktweaks.net">bedrocktweaks.net</a>
</p>
<p>
Hosted in [@YzaBeast1](https://github.com/YzaBeast1)'s garrage. Themed
and animated by [@NSPC911](https://github.com/NSPC911).
</p>
</div>
<div class="text">
<h3>Pages:</h3>
<button
class="rpbutton"
onclick="document.location='https://becomtweaks.github.io/resource-packs'"
>
Resource Packs
</button>
<button
class="ctbutton"
onclick="document.location='https://becomtweaks.github.io/crafting-tweaks'"
>
Crafting Tweaks
</button>
<button
class="bpbutton"
onclick="document.location='https://becomtweaks.github.io/behaviour-packs'"
>
Behaviour Packs
</button>
<br />
<button
class="docbutton"
onclick="document.location='https://becomtweaks.github.io/docs'"
>
Docs
</button>
</div>
</div>
<br />
</body>
</html>
115 changes: 0 additions & 115 deletions landing-page.css

This file was deleted.

Binary file added others/bookshelf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f142053

Please sign in to comment.