This commit is contained in:
neroduckale 2024-03-17 17:53:40 +05:00
parent e9d7dabd6d
commit 3703dc22f7
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 399E73062E1A3667
5 changed files with 300 additions and 210 deletions

View file

@ -1,6 +1,6 @@
@page @page
@model About @model About
@ViewData["Title"] = about @{ ViewData["Title"] = "about"; }
<div> <div>
<h1>neroduckale.</h1> <h1>neroduckale.</h1>
<h2><a href="https://t.me/neroduck" style="color: #00ff9d">telegram</a></h2> <h2><a href="https://t.me/neroduck" style="color: #00ff9d">telegram</a></h2>

View file

@ -1,11 +1,14 @@
@page @page
@model Minecraftia @model Minecraftia
@{ViewData["Title"] = "minecraft";} @{
ViewData["Title"] = "minecraft";
string[] custom = ["interact_with_crafting_table", "leave_game", "time_since_death", "damage_resisted", "sprint_one_cm","damage_blocked_by_shield","drop","talked_to_villager","play_time","deaths","jump","walk_on_water_one_cm","enchant_item","interact_with_furnace","sleep_in_bed","waystone_activated","damage_dealt","player_kills","crouch_one_cm","interact_with_smoker","interact_with_smithing_table","interact_with_anvil","mob_kills","damage_dealt_resisted","climb_one_cm","walk_one_cm","sneak_time","walk_under_water_one_cm","boat_one_cm","total_world_time","interact_with_stonecutter","interact_with_grindstone","time_since_rest","damage_absorbed","damage_taken","trigger_trapped_chest","swim_one_cm","fly_one_cm","pig_one_cm","open_chest","fall_one_cm"];
}
Статистика игрока Статистика игрока
<span> <span>
<input type="radio" id="nrdk" name="nickname" checked /><label for="huey">neroduckale</label> <input type="radio" id="nrdk" name="nickname" checked/><label for="nrdk">neroduckale</label>
<input type="radio" id="ygolek" name="nickname"/><label for="huey">ygolek</label> <input type="radio" id="ygolek" name="nickname"/><label for="ygolek">ygolek</label>
</span> </span>
<div>Сюда внесены первые десять позиций по количеству, типо какого предмета я скрафтил в больших количествах и так далее</div> <div>Сюда внесены первые десять позиций по количеству, типо какого предмета я скрафтил в больших количествах и так далее</div>
<div class="grid-cards"> <div class="grid-cards">
@ -43,14 +46,27 @@
</div> </div>
</div> </div>
<select name="choose" id="choose">
@{
foreach (var str in custom)
{
if (custom[0] == str)
{
<option selected> @str </option>
}
else
{
<option>@str</option>
}
}
}
</select>
<div class="stats grid-cards"> <div class="stats grid-cards">
<div class="card"> <div class="card">
<canvas id="sravn"> <canvas id="stat"></canvas>
</canvas>
</div> </div>
</div> </div>
<script type="module" src="https://unpkg.com/chart.js@4.2.1/dist/chart.umd.js"></script> <script type="module" src="https://unpkg.com/chart.js@4.2.1/dist/chart.umd.js"></script>
<script type="module" src="~/js/minecraft.js"></script> <script type="module" src="~/js/minecraft.js"></script>
<script type="module" src="~/js/inventory.js"></script>

View file

@ -1,5 +1,5 @@
@page @page
@model Ygolek @model Ygolek
@ViewData["Title"] = ygolek @{ ViewData["Title"] = "ygolek";}
<img src="~/img/ygolek.jpg" style="width: 75%; height: 500px;" alt="YGOLEK'S PHOTO"/> <img src="~/img/ygolek.jpg" style="width: 75%; height: 500px;" alt="YGOLEK'S PHOTO"/>

View file

@ -1,4 +1,6 @@
import {palette} from "./palette.js"; import {palette} from "./palette.js";
let chart = [];
let charts = []; let charts = [];
const keysToSort = [ const keysToSort = [
"minecraft:killed_by", "minecraft:killed_by",
@ -10,13 +12,54 @@ const keysToSort = [
"minecraft:picked_up", "minecraft:picked_up",
"minecraft:mined", "minecraft:mined",
]; ];
const custom = [
"minecraft:interact_with_crafting_table",
"minecraft:leave_game",
"minecraft:time_since_death",
"minecraft:damage_resisted",
"minecraft:sprint_one_cm",
"minecraft:damage_blocked_by_shield",
"minecraft:drop",
"minecraft:talked_to_villager",
"minecraft:play_time",
"minecraft:deaths",
"minecraft:jump",
"minecraft:walk_on_water_one_cm",
"minecraft:enchant_item",
"minecraft:interact_with_furnace",
"minecraft:sleep_in_bed",
"minecraft:waystone_activated",
"minecraft:damage_dealt",
"minecraft:player_kills",
"minecraft:crouch_one_cm",
"minecraft:interact_with_smoker",
"minecraft:interact_with_smithing_table",
"minecraft:interact_with_anvil",
"minecraft:mob_kills",
"minecraft:damage_dealt_resisted",
"minecraft:climb_one_cm",
"minecraft:walk_one_cm",
"minecraft:sneak_time",
"minecraft:walk_under_water_one_cm",
"minecraft:boat_one_cm",
"minecraft:total_world_time",
"minecraft:interact_with_stonecutter",
"minecraft:interact_with_grindstone",
"minecraft:time_since_rest",
"minecraft:damage_absorbed",
"minecraft:damage_taken",
"minecraft:trigger_trapped_chest",
"minecraft:swim_one_cm",
"minecraft:fly_one_cm",
"minecraft:pig_one_cm",
"minecraft:open_chest",
"minecraft:fall_one_cm"
]
let nrdkstats; let nrdkstats;
let ygolekstats; let ygolekstats;
let locale; let locale;
async function getJson(json) { async function getJson(json) {
let a; let a;
await fetch(`https://neroduck.ru/${json}`, { await fetch(`https://neroduck.ru/${json}`, {
@ -43,6 +86,7 @@ async function getJsons() {
locale = a; locale = a;
}); });
} }
async function parseStats(stats) { async function parseStats(stats) {
let values = { let values = {
valuedropped: [], valuedropped: [],
@ -83,6 +127,7 @@ async function parseStats(stats) {
createPie(values["value" + keyy], values["datas" + keyy], keyy); createPie(values["value" + keyy], values["datas" + keyy], keyy);
}); });
} }
async function createPie(items, datas, idcanvas) { async function createPie(items, datas, idcanvas) {
await charts.forEach((chart) => { await charts.forEach((chart) => {
@ -123,25 +168,24 @@ async function createPie(items, datas, idcanvas) {
charts.push(new Chart(canvas, config)) charts.push(new Chart(canvas, config))
} }
async function createBar() { async function createBar(value1, value2, stat) {
chart.forEach((a) => {
a.destroy();
});
const data = { const data = {
labels: ["Смерти"], labels: [stat],
datasets: [ datasets: [
{ {
label: "neroduckale", label: "neroduckale",
data: [nrdkstats["stats"]["minecraft:custom"]["minecraft:deaths"]], data: [value1],
backgroundColor: "#34b8e9", backgroundColor: "#34b8e9",
borderColor: "#ffffff", borderColor: "#ffffff",
hoverOffset: 6, hoverOffset: 6,
}, },
{ {
label: "ygolek", label: "ygolek",
data: [ygolekstats["stats"]["minecraft:custom"]["minecraft:deaths"]], data: [value2],
backgroundColor: "#e00000", backgroundColor: "#e00000",
borderColor: "#ffffff", borderColor: "#ffffff",
hoverOffset: 6, hoverOffset: 6,
@ -161,8 +205,32 @@ async function createBar() {
}, },
}, },
}; };
let canvas = document.getElementById("sravn"); let canvas = document.getElementById("stat");
let chart = new Chart(canvas, config) chart.push(new Chart(canvas, config));
}
async function changeBar(value1, value2, stat) {
chart[0].data = {
labels: [stat],
datasets: [
{
label: "neroduckale",
data: [value1],
backgroundColor: "#34b8e9",
borderColor: "#ffffff",
hoverOffset: 6,
},
{
label: "ygolek",
data: [value2],
backgroundColor: "#e00000",
borderColor: "#ffffff",
hoverOffset: 6,
},
],
};
chart[0].update();
//перевод, cm -> blocks
} }
function translate(item, type) { function translate(item, type) {
if (item.includes("minecraft:") === false) { if (item.includes("minecraft:") === false) {
@ -220,7 +288,13 @@ $('#nrdk').change(async function () {
return false; return false;
}); });
$('#choose').change(async function (event) {
let a = event.target.value;
await changeBar(nrdkstats["stats"]["minecraft:custom"]["minecraft:" + a], ygolekstats["stats"]["minecraft:custom"]["minecraft:" + a], a)
return false;
});
await getJsons(); await getJsons();
await parseStats(nrdkstats); await parseStats(nrdkstats);
await createBar(); await createBar(nrdkstats["stats"]["minecraft:custom"]["minecraft:interact_with_crafting_table"], ygolekstats["stats"]["minecraft:custom"]["minecraft:interact_with_crafting_table"], "minecraft:interact_with_crafting_table");