Skip to content

Commit d24f249

Browse files
committed
random updates
random updates
1 parent 48d27bb commit d24f249

File tree

8 files changed

+213
-27
lines changed

8 files changed

+213
-27
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.bat

articles.json

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
11
[
22
{
3-
"id": "id1",
3+
"id": "repo_tools",
44
"title": "CTR-tools",
5-
"text": "Main project aimed to provide converters for most binary formats found in Crash Team Racing (PS1)."
5+
"text": "A toolset aimed to provide converters for most binary formats found in Crash Team Racing (PS1).",
6+
"lang": "C#",
7+
"link": "https://github.com/CTR-tools/CTR-tools"
68
},
79
{
8-
"id": "id2",
10+
"id": "repo_modsdk",
11+
"title": "CTR-ModSDK",
12+
"text": "CTR-ModSDK is a powerful modding toolkit that allows to write custom C code for the game, compile it using modern GCC toolchain and debug it in PCSX-Redux in real time.",
13+
"lang": "C, Python",
14+
"link": "https://github.com/CTR-tools/CTR-ModSDK"
15+
},
16+
{
17+
"id": "repo_blender",
918
"title": "io_ctr_tools",
10-
"text": "A Blender plugin to import CTR scene files directly."
19+
"text": "A Blender plugin to import CTR scene files directly from game files.",
20+
"lang": "Python",
21+
"link": "https://github.com/CTR-tools/io_ctr_tools"
1122
},
1223
{
13-
"id": "id3",
24+
"id": "repo_editor",
1425
"title": "CTR-LevEdit",
15-
"text": "Unity based project, able to load CTR levels. Maybe more in the future."
26+
"text": "Unity based project, so far able to load CTR levels. Hopefully more in the future.",
27+
"lang": "C#",
28+
"link": "https://github.com/CTR-tools/CTR-LevEdit"
1629
}
1730
]

images/ghfavicon.png

589 Bytes
Loading

images/ytfavicon.png

281 Bytes
Loading

index.html

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
66
<link rel="stylesheet" href="stylesheet.css">
77
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Outfit">
8+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat">
89

910
<script>
1011

@@ -25,9 +26,9 @@
2526
function addArticle(article) {
2627
$(content).append(
2728
$('<article/>').attr("id", article.id).addClass("articlemain").append(
28-
$('<h1/>').addClass("articleheader").text(article.title)
29+
$('<h1/>').addClass("articleheader").append($('<a/>').text(article.title).attr('href', article.link))
2930
).append(
30-
$('<p/>').addClass("articlehmain").text(article.text)
31+
$('<p/>').addClass("articlemain").text(article.text)
3132
)
3233
);
3334
}
@@ -38,23 +39,40 @@
3839

3940
<body>
4041
<div id="page" class="divcentered">
41-
<img id="logo" class="imgcentered" src="https://raw.githubusercontent.com/CTR-tools/CTR-tools/master/ctr-tools-logo.png" alt="ctr-tools logo"></img>
4242

43-
A wippy wip.
43+
<div style="width:100%; text-align: center; margin-top: 1em">
44+
<div>Crash Team Racing modding community</div>
45+
<div>presents</div>
46+
</div>
4447

45-
<nav>
46-
<ul>
47-
<li><a href="https://ctr-tools.github.io"><button>Main</button></a></li>
48-
<li><a href="https://github.com/CTR-tools/CTR-tools/releases/latest"><button>Releases</button></a></li>
49-
<li><a href="https://discord.gg/WHkuh2n"><button>Discord</button></a></li>
50-
</ul>
51-
</nav>
5248

53-
<div id="content"/>
49+
<img id="logo" class="imgcentered logo" src="https://raw.githubusercontent.com/CTR-tools/CTR-tools/master/ctr-tools-logo.png" alt="ctr-tools logo"></img>
50+
51+
<nav>
52+
<ul>
53+
<li><a href="https://github.com/CTR-tools/CTR-tools/releases/latest"><img class="ytfavicon" src="images\ghfavicon.png" /> Download CTR-tools</a></li>
54+
<li><a href="https://github.com/CTR-tools/CTR-ModSDK/releases/latest"><img class="ytfavicon" src="images\ghfavicon.png" /> Download ModSDK</a></li>
55+
<li><a href="https://discord.gg/WHkuh2n">Discord</a></li>
56+
</ul>
57+
</nav>
58+
59+
<nav>
60+
<ul>
61+
<li><a href="https://www.youtube.com/c/DCxDemo"><img class="ytfavicon" src="images\ytfavicon.png" /> DCxDemo</a></li>
62+
<li><a href="https://www.youtube.com/c/Darkaiser"><img class="ytfavicon" src="images\ytfavicon.png" /> Darkaiser</a></li>
63+
<li><a href="https://www.youtube.com/c/theredhotbr"><img class="ytfavicon" src="images\ytfavicon.png" /> TheRedhotbr</a></li>
64+
</ul>
65+
</nav>
66+
67+
<div id="content"/>
5468

55-
<footer>
56-
once upon a time
57-
</footer>
5869
</div>
70+
71+
72+
<div id="utils">
73+
<a href="utils\rgb16.htm">RGB16 online tool</a><br>
74+
<a href="utils\cheats.htm">Gex/Ctr cheat mnemonics helper</a>
75+
</div>
76+
5977
</body>
6078
</html>

stylesheet.css

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ body {
44

55
.divcentered {
66
margin: auto;
7-
border: 3px solid green;
87
padding: 10px;
98
}
109

@@ -19,11 +18,53 @@ body {
1918
margin-right: auto;
2019
}
2120

21+
.logo {
22+
padding-bottom: 1em;
23+
padding-top: 1em;
24+
}
25+
26+
h1 {
27+
margin-top: .5em;
28+
margin-bottom: .5em;
29+
}
30+
2231
.articlemain {
32+
margin-top: .5em;
33+
margin-bottom: 1.5em;
34+
}
35+
36+
.articleheader {
37+
font-family: 'Montserrat', sans-serif;
38+
}
39+
40+
41+
ul {
42+
list-style-type: none;
43+
margin: 0;
44+
padding: 0;
45+
overflow: hidden;
46+
background-color: #444444;
47+
}
48+
49+
li {
50+
float: left;
51+
}
52+
53+
li a {
54+
display: block;
55+
color: white;
56+
text-align: center;
57+
padding-top: 0.5em;
58+
padding-bottom: 0.5em;
59+
padding-left: 1em;
60+
padding-right: 1em;
61+
text-decoration: none;
2362
}
2463

25-
.articleeheader {
64+
li a:hover {
65+
background-color: #111111;
2666
}
2767

28-
.articlebody {
68+
.ytfavicon {
69+
vertical-align: middle;
2970
}

utils/cheats.htm

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
<script>
2+
3+
function dec2bin(dec) {
4+
return padLeadingZeros((dec >>> 0).toString(2), 5);
5+
}
6+
7+
function dec2hex(dec) {
8+
return padLeadingZeros((dec >>> 0).toString(16), 4).toUpperCase();
9+
}
10+
11+
function colorhex(dec) {
12+
return padLeadingZeros((dec >>> 0).toString(16), 2);
13+
}
14+
15+
function padLeadingZeros(num, size) {
16+
var s = num+"";
17+
while (s.length < size) s = "0" + s;
18+
return s;
19+
}
20+
21+
function $(element) {
22+
return document.getElementById(element);
23+
}
24+
25+
/*
26+
function updateRgbControl() {
27+
28+
r = $('red').value;
29+
g = $('green').value;
30+
b = $('blue').value;
31+
stp = $('stp').checked ? 1 : 0;
32+
33+
r8 = r / 31 * 255;
34+
g8 = g / 31 * 255;
35+
b8 = b / 31 * 255;
36+
37+
color16 = stp << 15 | b << 10 | g << 5 | r;
38+
color24 = (colorhex(r8) + colorhex(g8) + colorhex(b8)).toUpperCase();
39+
40+
$('resultbin').value = ($('stp').checked ? '1' : '0') + dec2bin(b) + dec2bin(g) + dec2bin(r);
41+
$('resulthex').value = dec2hex(color16);
42+
$('resulthex888').value = color24 + '';
43+
44+
$('redval').innerText = dec2bin(r);
45+
$('greenval').innerText = dec2bin(g);
46+
$('blueval').innerText = dec2bin(b);
47+
48+
$('red8').innerText = Math.round(r8);
49+
$('green8').innerText = Math.round(g8);
50+
$('blue8').innerText = Math.round(b8);
51+
52+
$('redperc').innerText = (r / 31 * 100).toFixed(2) + '%';
53+
$('greenperc').innerText = (g / 31 * 100).toFixed(2) + '%';
54+
$('blueperc').innerText = (b / 31 * 100).toFixed(2) + '%';
55+
56+
$('preview').style.backgroundColor = '#' + color24;
57+
}
58+
*/
59+
60+
function cheatString(cheatname) {
61+
result = '';
62+
cheatname = cheatname.toUpperCase();
63+
64+
for (var i = 0; i < cheatname.length; i++) {
65+
switch(cheatname.charAt(i)) {
66+
case 'L':
67+
case 'W': result = result + 'Left'; break;
68+
case 'R':
69+
case 'E': result = result + 'Right'; break;
70+
case 'D':
71+
case 'S': result = result + 'Down'; break;
72+
case 'U':
73+
case 'N': result = result + 'Up'; break;
74+
case 'C':
75+
case 'O': result = result + 'Circle'; break;
76+
case 'X':
77+
case 'B': result = result + 'Cross'; break;
78+
case 'S':
79+
case 'A': result = result + 'Square'; break;
80+
case 'T': result = result + 'Triangle'; break;
81+
case 'P': result = result + 'Triangle'; break;
82+
default: result = result + '[___]';
83+
}
84+
85+
if (i < cheatname.length - 1)
86+
result = result + ', ';
87+
}
88+
89+
return result;
90+
}
91+
92+
function processCheat() {
93+
$('cheatoutput').innerText = cheatString($('cheatinput').value);
94+
}
95+
96+
</script>
97+
98+
<style>
99+
td {
100+
padding:6px 4px;
101+
}
102+
103+
</style>
104+
105+
<body style="font-family: Courier New, serif" onload="processCheat()">
106+
107+
<div class="cheat_control" style="border: solid 1px black; margin: 1em; padding: 1em;">
108+
<table id="sliders">
109+
<tr><td>Cheat input:</td><td><input type="text" id="cheatinput" oninput="processCheat()" /></td></tr>
110+
<tr><td>Cheat output:</td><td><span id="cheatoutput" /></td></tr>
111+
</table>
112+
</div>
113+
114+
</body>

rgb16test.htm renamed to utils/rgb16.htm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,10 @@
9696

9797
<tr><td colspan="5">
9898
<input type="checkbox" id="stp" oninput="updateRgbControl()">
99-
<label for="stp">Semi-transparency bit</label>
100-
</input>
99+
<label for="stp">Semi-transparency bit</label>
101100
</td></tr>
102101

103-
<tr id="preview" style="height: 64px;"><td style="border: solid 1px black;" colspan="5"</td></tr>
102+
<tr id="preview" style="height: 64px;"><td style="border: solid 1px black;" colspan="5"></td></tr>
104103
</table>
105104

106105
</div>

0 commit comments

Comments
 (0)