diff --git a/css/specific.css b/css/specific.css index ec8cc1d..ec312e4 100755 --- a/css/specific.css +++ b/css/specific.css @@ -95,4 +95,26 @@ body:has(.polyplus-modal[open]) { 0%{background-position:10% 0%} 50%{background-position:91% 100%} 100%{background-position:10% 0%} +} + +/* - */ + +/* + AVATAR SANDBOX +*/ + +.ribbon-polyplus-custom span { + background-color: orange !important; +} + +.ribbon-polyplus-custom::after, .ribbon-polyplus-custom::before { + border-color: #c68000 !important; +} + +.ribbon-polyplus-unknown span { + background-color: #000 !important; +} + +.ribbon-polyplus-unknown::after, .ribbon-polyplus-unknown::before { + border-color: #121212 !important; } \ No newline at end of file diff --git a/js/account/avatar-sandbox.js b/js/account/avatar-sandbox.js index 0902d01..6b31bf7 100644 --- a/js/account/avatar-sandbox.js +++ b/js/account/avatar-sandbox.js @@ -367,6 +367,11 @@ async function UpdateAvatar() { ribbon: "unknown" } } + + if (["mesh", "decal", "audio"].indexOf(ItemCache[x].type) !== -1) { + ItemCache[x].type = document.getElementById('load-asset-type').options[document.getElementById('load-asset-type').selectedIndex].value + ItemCache[x].ribbon = 'custom' + } } if (ItemCache[x].asset === undefined) { @@ -374,10 +379,6 @@ async function UpdateAvatar() { if (MeshURL.success) { ItemCache[x].asset = MeshURL.url - if (["mesh", "decal", "audio"].indexOf(ItemCache[x].type) !== -1) { - ItemCache[x].type = document.getElementById('load-asset-type').options[document.getElementById('load-asset-type').selectedIndex].value - } - if (ItemCache[x].type === 'hat') { FormattedAvatar.items[index] = MeshURL.url } else { @@ -427,11 +428,16 @@ async function UpdateAvatar() { ribbon: "unknown" } } + + if (["mesh", "decal", "audio"].indexOf(ItemCache[x].type) !== -1) { + ItemCache[x].ribbon = 'custom' + } } if (ItemCache[x].asset === undefined) { const TextureURL = (await (await fetch('https://api.polytoria.com/v1/assets/serve/' + x + '/Asset')).json()) if (TextureURL.success) { + ItemCache[x].asset = TextureURL.url if (x === Avatar.shirt) { FormattedAvatar.shirt = TextureURL.url @@ -558,6 +564,7 @@ async function LoadItems() { } item.asset = 'https://poly-upd-archival.pages.dev/glb/' + item.id + '.glb' item.id = item.id*-1 + item.ribbon = 'retro' ItemCache[item.id] = item }) @@ -606,14 +613,17 @@ async function LoadItems() { item.price = false } + const Ribbon = ChooseRibbon(item) + const ItemColumn = document.createElement('div') ItemColumn.classList = 'col-auto' ItemColumn.innerHTML = `