-
Notifications
You must be signed in to change notification settings - Fork 0
/
tools.html
106 lines (105 loc) · 7.18 KB
/
tools.html
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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="dark_green.css">
<title>Tools - SamsterBirdies</title>
<link rel="icon" href="./images/favicon.webp"/>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
</head>
<body>
<div class='sidebar' id='aside'>
<img class="border" src="./images/sb.webp" alt="sb.webp" width="97%" >
<h1 style='font-size: 22.5px; color: white'>SamsterBirdies</h1>
<nav>
<a class="button buttonaside" href="./index.html">Home</a><br>
<a class="button buttonaside buttonselected" href="./tools.html">Tools</a><br>
<a class="button buttonaside" href="./tables.html">Tables</a><br>
<a class="button buttonaside" href="./post.html">Post</a><br>
<a class="button buttonaside" href="./repo.html">Repo</a><br>
<a class="button buttonaside" href="./about.html">About</a><br>
</nav>
</div>
<div class='borderDecor borderDecorL'></div> <div class='borderDecor borderDecorR'></div> <!--just for decoration-->
<div class='main'>
<!--search and other -->
<nav>
<textarea class="textareainput" id="searchInputBox" oninput="Search()" cols="30" rows="1" spellcheck="false" placeholder="Search tools" style="resize: none;"></textarea>
<button class="button buttonsmall" type="button" onclick="ToggleToolButtons()" id="toolToggleButton">Hide buttons</button>
</nav>
<!--tool buttons-->
<nav>
<button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('aspectratio', 'Easily calculate resolutions for the aspect ratio','400px', '300px')" id="aspectratioButton">Aspect Ratio</button>
<button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('basenumconvert', 'Convert a number from one base to another.','400px', '400px')" id="basenumconvertButton">Base Number Converter</button>
<button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('bcdimensions', 'Find nearest ideal BC dimensions (dds)','700px', '600px')" id="bcdimensionsButton">BC Dimensions</button>
<button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('dbconvert', 'Convert Decibels to Amplitude and vice versa.','375px', '570px')" id="dbconvertButton">dB/Amplitude</button>
<button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('fortspivots', 'Used for calculating pivots in Forts modding','800px', '720px')" id="fortspivotsButton">Forts Pivots</button>
<button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('hash', 'Hashing is used to verify the integrity of data','1200px', '670px')" id="hashButton">Hash text/files</button> <button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('lpcmdatasize', 'Calculate data or time for LPCM','675px', '500px')" id="lpcmdatasizeButton">LPCM datasize calculator</button>
<button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('morsecode', 'Turn text into morse code and vice versa.', '680px', '1200px')" id="morsecodeButton">Morse code/txt</button>
<button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('numberletter', 'Convert numbers to letters and vice versa.', '500px', '500px')" id="numberletterButton">Number-Letter converter</button>
<button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('pixeldensity', 'Calculate pixel density for a screen with resolution, screen size, and viewing distance.', '650px', '350px')" id="pixeldensityButton">Pixel Density calculator</button>
<button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('randomforts', 'Generate random commanders and weapons.', '475px', '675px')" id="randomfortsButton">Random Forts</button>
<button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('rgbhex', 'Convert RGB values into Hex HTML color values and preview color. And vice versa.','370px', '250px')" id="rgbhexButton">RGB/Hex Color picker</button>
<button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('shadercompare', 'Compare different Minecraft shader packs. Drag corner to resize window','1200px', '800px')" id="shadercompareButton">Shader Comparer</button>
<button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('inflation', 'Convert USD prices across two given years, accounting for inflation.', '575px', '675px')" id="inflationButton">USD Inflation tool</button>
<button class="button buttonsmall buttontool" type="button" onclick="ToolEnable('info', 'Shows information about the browser, device, etc.', '800px', '800px')" id="infoButton">User Information</button>
</nav>
<p id="ToolDesc"></p>
<div id="iframediv" class="iframediv"><iframe id="iFrame" class="iframe" src="./tools/blank.html" title="Number-Letter converter"></iframe></div>
<p>Drag corner to resize window</p>
<p>Tool Link:
<a class="link" href="" id="toolLink"></a></p>
</div>
</body>
<script src="./scripts/cookieAPI.js"></script>
</html>
<script>
cookieChangeStyle();
function ToolEnable(src, desc, width, height) {
//Enables a tool and shows it in the window.
document.getElementById("ToolDesc").innerHTML = desc;
document.getElementById("iframediv").style = "width:" + width + "; height:" + height;
document.getElementById("iFrame").title = document.getElementById(src+"Button");
document.getElementById("iFrame").src = "./tools/" + src + ".html";
for (disable of document.getElementsByClassName("button buttonsmallselected buttontool")) {
disable.className = "button buttonsmall buttontool";
}
document.getElementById(src + "Button").className = "button buttonsmall buttonsmallselected buttontool";
//link to tool
document.getElementById("toolLink").href = "https://www.samsterbirdies.com/tools/"+src;
document.getElementById("toolLink").innerHTML = "www.samsterbirdies.com/tools/"+src;
}
function Search(){
//Will hide buttons that dont match the search. Will be useful if a bunch of new tools ever get added in the future.
var searchWords = document.getElementById("searchInputBox").value.split(" ");
for (button of document.getElementsByClassName("buttontool")){
let matches = true;
for (word of searchWords){
if (button.innerHTML.toLowerCase().search(word.toLowerCase()) == -1){ //lowercase regex search
matches = false;
}
}
if (matches) {
button.style.display = "inline";
} else {
button.style.display = "none";
}
}
}
function ToggleToolButtons(){
//Toggles whether the tool buttons will display or not. Will be useful if a bunch of new tools ever get added in the future.
for (button of document.getElementsByClassName("buttontool")){
if (document.getElementById("toolToggleButton").innerHTML == "Hide buttons"){
button.style.display = "none";
}else{
button.style.display = "inline";
}
}
if (document.getElementById("toolToggleButton").innerHTML == "Hide buttons"){
document.getElementById("toolToggleButton").innerHTML = "Show buttons";
}else{
document.getElementById("toolToggleButton").innerHTML = "Hide buttons";
}
}
</script>