From 55ad153d2bcbbd186e315eb82d1583f9eb7ea0d9 Mon Sep 17 00:00:00 2001 From: Index Date: Thu, 25 Apr 2024 17:04:38 -0500 Subject: [PATCH] 33 files changed - update + hoarders list - Added new feature: "Collectibles' Hoarders List" [ IMPROVEMENTS ] - Reorganized resources folder to be in the root directory rather than a sub-folder of the javascript folder - Added a new feature: "Quick Library Downloads" - Basically finished the "Event Items Store Category" feature - Added more manifest.json information --- css/popup.css | 60 ---- css/specific.css | 34 ++- icon-update.png => icons/icon-update.png | Bin icon.png => icons/icon.png | Bin js/account/avatar-sandbox.js | 2 +- js/account/avatar-sandbox2.js | 2 +- js/account/home.js | 2 +- js/account/profile.js | 69 ++--- js/account/transactions.js | 4 +- js/background.js | 31 +++ js/debug.js | 2 +- js/everywhere.js | 12 +- js/forum/forum-view.js | 2 +- js/guilds.js | 2 +- js/library-download.js | 59 ++++ js/op-comments.js | 3 +- js/places/place-view.js | 81 +++--- js/places/places.js | 5 + js/store/item-view.js | 260 ++++++++++++++++-- js/store/store.js | 251 ++++++++++++----- manifest.json | 26 +- .../avatar-sandbox.html | 0 {js/resources => resources}/currencies.json | 0 resources/registerTooltips.js | 3 + {js/resources => resources}/utils.js | 21 +- settings.html | 23 +- settings.js | 6 +- 27 files changed, 693 insertions(+), 267 deletions(-) delete mode 100755 css/popup.css rename icon-update.png => icons/icon-update.png (100%) rename icon.png => icons/icon.png (100%) create mode 100644 js/library-download.js rename {js/resources => resources}/avatar-sandbox.html (100%) rename {js/resources => resources}/currencies.json (100%) create mode 100644 resources/registerTooltips.js rename {js/resources => resources}/utils.js (77%) diff --git a/css/popup.css b/css/popup.css deleted file mode 100755 index 6e5f26a..0000000 --- a/css/popup.css +++ /dev/null @@ -1,60 +0,0 @@ -@font-face { - font-family: LexendRegular; - src: url('Lexend-Regular.ttf'); -} - -@font-face { - font-family: LexendLight; - src: url('Lexend-Light.ttf'); -} - -@font-face { - font-family: LexendBold; - src: url('Lexend-Bold.ttf'); -} - -@font-face { - font-family: LexendBlack; - src: url('Lexend-Black.ttf'); -} - -body { - margin: 0; - padding: 12px; - font-family: LexendRegular; - background-color: #242424; - color: white; -} - -.button { - border-radius: 20px; - background-color: #fff; - color: #424242; - width: 95%; - padding: 10px; - border: none; - font-weight: bold; - text-decoration: none; -} - -input { - border-radius: 20px; - background-color: #fff; - color: #007bff; - width: 95%; - padding: 10px; - border: none; - font-weight: bold; -} - -h1,.h1 { - font-family: LexendBlack; -} - -h2,.h2 { - font-family: LexendBold; -} - -hr { - border-color: transparent; -} \ No newline at end of file diff --git a/css/specific.css b/css/specific.css index 04c7eca..2403149 100755 --- a/css/specific.css +++ b/css/specific.css @@ -1,3 +1,7 @@ +/* + FRONTEND FIXES / SPACING IMPROVEMENTS +*/ + body[data-URL^="/my/friends"] .col-lg-3 { margin-bottom: 20px; } @@ -14,4 +18,32 @@ body[data-URL^="/create/"] .col.d-flex.align-content-between.flex-wrap { white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; -} \ No newline at end of file +} + +/* ------------------------------------------ */ + +/* + INLINE EDITING +*/ + +body[data-polyplus-inlineEditing="true"] .polyplus-inlineEditing-visible {display: block !important;} +.polyplus-inlineEditing-visible {display: none;} + +body[data-polyplus-inlineEditing="true"] .polyplus-inlineEditing-hidden {display: none !important;} +.polyplus-inlineEditing-hidden {display: block;} + +/* ------------------------------------------ */ + +/* + MODALS +*/ + +html:has(.polyplus-modal[open]), body:has(.polyplus-modal[open]) { + overflow: hidden; +} + +.polyplus-modal::backdrop { + background: rgba(0, 0, 0, 0.73); +} + +/* ------------------------------------------ */ \ No newline at end of file diff --git a/icon-update.png b/icons/icon-update.png similarity index 100% rename from icon-update.png rename to icons/icon-update.png diff --git a/icon.png b/icons/icon.png similarity index 100% rename from icon.png rename to icons/icon.png diff --git a/js/account/avatar-sandbox.js b/js/account/avatar-sandbox.js index 9615f8b..6f6cb10 100755 --- a/js/account/avatar-sandbox.js +++ b/js/account/avatar-sandbox.js @@ -42,7 +42,7 @@ let ItemCardContents = ` if (new URLSearchParams(new URL(window.location).search).get('sandbox') === 'true') { console.log('Avatar Sandbox!') - LoadFile(chrome.runtime.getURL('js/resources/avatar-sandbox.html'), function(html){ + LoadFile(chrome.runtime.getURL('resources/avatar-sandbox.html'), function(html){ PageContainer.innerHTML = html ItemGrid = document.getElementById('inventory') Wearing = document.getElementById('wearing') diff --git a/js/account/avatar-sandbox2.js b/js/account/avatar-sandbox2.js index d248088..9a1a070 100755 --- a/js/account/avatar-sandbox2.js +++ b/js/account/avatar-sandbox2.js @@ -27,7 +27,7 @@ let Avatar = { if (new URLSearchParams(new URL(window.location).search).get('sandbox') === 'true') { console.log('Avatar Sandbox!') - LoadFile(chrome.runtime.getURL('js/resources/avatar-sandbox.html'), function(html){ + LoadFile(chrome.runtime.getURL('resources/avatar-sandbox.html'), function(html){ PageContainer.innerHTML = html ItemGrid = document.getElementById('inventory') Wearing = document.getElementById('wearing') diff --git a/js/account/home.js b/js/account/home.js index af83351..30c908b 100755 --- a/js/account/home.js +++ b/js/account/home.js @@ -172,7 +172,7 @@ SecondaryColumn.insertBefore(NewTitle, SecondaryColumn.children[0]); async function IRLPrice() { (async () => { - Utilities = await import(chrome.runtime.getURL('/js/resources/utils.js')); + Utilities = await import(chrome.runtime.getURL('resources/utils.js')); Utilities = Utilities.default const TrendingItems = document.getElementById('home-trendingItems') diff --git a/js/account/profile.js b/js/account/profile.js index e93f746..0a50e1a 100755 --- a/js/account/profile.js +++ b/js/account/profile.js @@ -10,41 +10,46 @@ let CalculateButton; let Utilities; if (UserID && !isNaN(UserID)) { - chrome.storage.sync.get(['PolyPlus_Settings'], function(result) { - Settings = result.PolyPlus_Settings || {} - - if (Settings.IRLPriceWithCurrencyOn === true) { - (async () => { - Utilities = await import(chrome.runtime.getURL('/js/resources/utils.js')); - Utilities = Utilities.default + (async () => { + Utilities = await import(chrome.runtime.getURL('resources/utils.js')); + Utilities = Utilities.default + + chrome.storage.sync.get(['PolyPlus_Settings'], function(result) { + Settings = result.PolyPlus_Settings || {} + if (Settings.IRLPriceWithCurrencyOn === true) { IRLPrice() - })(); - } - - if (Settings.BestFriendsOn === true) { - BestFriends() - } + } + + if (Settings.BestFriendsOn === true) { + BestFriends() + } - if (Settings.OutfitCostOn === true) { - CalculateButton = document.createElement('small') - CalculateButton.classList = 'fw-normal text-success' - CalculateButton.style.letterSpacing = '0px' - CalculateButton.innerHTML = ` - $ calculate - ` - AvatarHeading.appendChild(CalculateButton) - - let Calculating = false - CalculateButton.addEventListener('click', function(){ - if (Calculating === false) { - Calculating = true - CalculateButton.innerText = '$ Calculating...' - OutfitCost() - } - }); - } - }); + if (Settings.OutfitCostOn === true) { + CalculateButton = document.createElement('small') + CalculateButton.classList = 'fw-normal text-success' + CalculateButton.style.letterSpacing = '0px' + CalculateButton.setAttribute('data-bs-toggle', 'tooltip') + CalculateButton.setAttribute('data-bs-title', 'Calculate this avatar\'s cost!') + CalculateButton.setAttribute('data-bs-placement', 'right') + CalculateButton.innerHTML = ` + $ calculate + ` + AvatarHeading.appendChild(CalculateButton) + + Utilities.InjectResource('registerTooltips') + + let Calculating = false + CalculateButton.addEventListener('click', function(){ + if (Calculating === false) { + Calculating = true + CalculateButton.innerText = '$ Calculating...' + OutfitCost() + } + }); + } + }); + })(); const AvatarIFrame = document.querySelector('[src^="/ptstatic"]') const DropdownMenu = document.getElementsByClassName('dropdown-menu dropdown-menu-right')[0] diff --git a/js/account/transactions.js b/js/account/transactions.js index ce475ec..8551bc0 100755 --- a/js/account/transactions.js +++ b/js/account/transactions.js @@ -1,7 +1,7 @@ /* let Currencies; -LoadFile(chrome.runtime.getURL('js/resources/currencies.json'), function(text){ +LoadFile(chrome.runtime.getURL('resources/currencies.json'), function(text){ Currencies = JSON.parse(text) console.log(new Date(Currencies.Date).toLocaleDateString("en-US", {day:"numeric",month:"long",year:"numeric"}), Currencies) }) @@ -9,7 +9,7 @@ LoadFile(chrome.runtime.getURL('js/resources/currencies.json'), function(text){ let Utilities; (async () => { - Utilities = await import(chrome.runtime.getURL('/js/resources/utils.js')); + Utilities = await import(chrome.runtime.getURL('resources/utils.js')); Utilities = Utilities.default })(); diff --git a/js/background.js b/js/background.js index bd95f2f..2d079c7 100755 --- a/js/background.js +++ b/js/background.js @@ -1,6 +1,14 @@ const Manifest = chrome.runtime.getManifest() const SettingsURL = chrome.runtime.getURL('settings.html') +/* +ON INSTALL: + +chrome.runtime.onInstalled.addListener(() => { + chrome.tabs.create({url: 'https://polyplus.vercel.app/app/welcome.html'}) +}); +*/ + // WHEN CLICKING ON EXTENSION ICON OPEN THE SETTINGS PAGE chrome.action.onClicked.addListener((tab) => { chrome.tabs.create({ active: true, url: SettingsURL }); @@ -143,6 +151,20 @@ chrome.contextMenus.onClicked.addListener(function (info, tab){ } }); +chrome.runtime.onMessage.addListener(function (message, sender) { + console.log('hi') + message = message.message || '' + console.log(message) + if (message === 'tooltip') { + console.log('is about tooltip') + chrome.scripting + .executeScript({ + target: {tabId: sender.tab.id}, + func: UpdateTooltips + }) + } +}); + /* GREEN LOGO WHEN EXTENSION APPLIES TO CURRENT TAB PAGE, RED WHEN IT DOESN'T COMING SOON @@ -196,4 +218,13 @@ function CopyAvatarHash(hash) { .catch(() => { alert('Failure to copy avatar hash.') }); +} + +function UpdateTooltips() { + const Script = document.createElement('script') + Script.innerHTML = ` + const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]') + const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl)) + ` + document.body.appendChild(Script) } \ No newline at end of file diff --git a/js/debug.js b/js/debug.js index 1a8be14..536c121 100644 --- a/js/debug.js +++ b/js/debug.js @@ -155,7 +155,7 @@ document.getElementById('edit-setting').addEventListener('click', function(){ }); document.getElementById('reset-settings').addEventListener('click', async function(){ - let Utilities = await import(chrome.runtime.getURL('/js/resources/utils.js')) + let Utilities = await import(chrome.runtime.getURL('resources/utils.js')) Utilities = Utilities.default chrome.storage.sync.set({ 'PolyPlus_Settings': Utilities.DefaultSettings }, function() { alert('Successfully reset settings to their defaults!') diff --git a/js/everywhere.js b/js/everywhere.js index 0bf5814..7c09795 100755 --- a/js/everywhere.js +++ b/js/everywhere.js @@ -1,16 +1,8 @@ var Settings; -let Theme = ` -html:has(.polyplus-modal[open]), body:has(.polyplus-modal[open]) { - overflow: hidden; -} - -.polyplus-modal::backdrop { - background: rgba(0, 0, 0, 0.73); -} -`; +let Theme = null; (async () => { - let Utilities = await import(chrome.runtime.getURL('/js/resources/utils.js')); + let Utilities = await import(chrome.runtime.getURL('resources/utils.js')); Utilities = Utilities.default chrome.storage.sync.get(["PolyPlus_Settings"], function(result) { diff --git a/js/forum/forum-view.js b/js/forum/forum-view.js index 8a523b3..e3dd2a5 100644 --- a/js/forum/forum-view.js +++ b/js/forum/forum-view.js @@ -24,7 +24,7 @@ function ForumMentions() { let match; while ((match = Regex.exec(text.innerText)) !== null) { const Username = match[0].substring(1) - FormattedText = FormattedText.replaceAll(match[0], `${match[0]}`) + FormattedText = FormattedText.replaceAll(match[0], `${match[0]}`) } text.innerHTML = FormattedText } diff --git a/js/guilds.js b/js/guilds.js index b0e8d1e..95ba4c3 100644 --- a/js/guilds.js +++ b/js/guilds.js @@ -8,7 +8,7 @@ chrome.storage.sync.get(['PolyPlus_Settings'], function(result){ if (Settings.IRLPriceWithCurrencyOn === true) { (async () => { - Utilities = await import(chrome.runtime.getURL('/js/resources/utils.js')); + Utilities = await import(chrome.runtime.getURL('resources/utils.js')); Utilities = Utilities.default for (let item of Array.from(StoreItems.children)) { diff --git a/js/library-download.js b/js/library-download.js new file mode 100644 index 0000000..eb88866 --- /dev/null +++ b/js/library-download.js @@ -0,0 +1,59 @@ +const AssetID = window.location.pathname.split('/')[2] +const LibraryType = document.querySelectorAll('ol a')[1].innerText +const LibraryTypes = [ + "Models", + "Audio", + "Decal", + "Mesh" +] + +var Success = true; + +if (LibraryTypes.indexOf(LibraryType) !== -1) { + chrome.storage.sync.get(['PolyPlus_Settings'], function(result){ + Settings = result.PolyPlus_Settings || {}; + + if (Settings.LibraryDownloadsOn === false) { return } + + const Dropdown = document.querySelector('#app div[style] .dropdown-menu li') + + const DownloadLink = document.createElement('a') + DownloadLink.classList = 'dropdown-item text-warning' + DownloadLink.href = '#' + DownloadLink.innerHTML = ` Download` + Dropdown.insertBefore(DownloadLink, Dropdown.children[Dropdown.children.length-1]) + + switch(LibraryType) { + case 'Models': + DownloadLink.href = 'https://api.polytoria.com/v1/models/get-model?id=' + AssetID + break + case 'Audio': + const AudioBlob = new Blob([document.getElementsByTagName('audio')[0]], {type: 'octet-steam'}) + DownloadLink.href = URL.createObjectURL(AudioBlob) + DownloadLink.download = document.getElementsByTagName('h1')[0].innerText + '.mp3' + case 'Decal': + const DecalBlob = new Blob([document.getElementsByClassName('store-thumbnail')[0]], {type: 'image/png'}) + DownloadLink.href = URL.createObjectURL(DecalBlob) + DownloadLink.download = document.getElementsByTagName('h1')[0].innerText + '.png' + break + } + + if (LibraryType === 'Mesh') { + let MeshURL = null + DownloadLink.addEventListener('click', async function(){ + if (MeshURL !== null) { return } + MeshURL = await fetch('https://api.polytoria.com/v1/assets/serve-mesh/' + AssetID) + MeshURL = await MeshURL.json() + + if (MeshURL.success === true) { + DownloadLink.href = MeshURL.url + DownloadLink.download = document.getElementsByTagName('h1')[0].innerText + '.glb' + + DownloadLink.click() + } else { + alert('Failure to fetch .glb file for mesh') + } + }) + } + }); +} \ No newline at end of file diff --git a/js/op-comments.js b/js/op-comments.js index 053f93d..253fa32 100755 --- a/js/op-comments.js +++ b/js/op-comments.js @@ -48,8 +48,9 @@ function LoadCreatorTag(element) { Tag.style.marginLeft = '5px' Tag.style.verticalAlign = 'text-top' Tag.innerText = 'CREATOR' + if (Type === 'guilds') { Tag.innerText = 'LEADER' } NameElement.appendChild(Tag) - //console.log(window.bootstrap) + //new window.bootstrap.Tooltip(Tag, {toggle:"tooltip",title:"This user is the creator of this asset!"}) } } \ No newline at end of file diff --git a/js/places/place-view.js b/js/places/place-view.js index 677246e..524cad5 100644 --- a/js/places/place-view.js +++ b/js/places/place-view.js @@ -12,7 +12,9 @@ let InfoColumns = document.querySelectorAll('#main-content .col:has(#likes-data- let CalculateRevenueButton; const AchievementsTab = document.getElementById('achievements-tabpane') -const Achievements = Array.from(AchievementsTab.getElementsByClassName('card')) +const GamepassesTab = document.getElementById('gamepasses-tabpane') +const Achievements = Array.from(AchievementsTab.getElementsByClassName('card')) || [] +const Gamepasses = Array.from(GamepassesTab.getElementsByClassName('card')) || [] !(() => { if (PlaceID === undefined) { return } @@ -42,30 +44,29 @@ const Achievements = Array.from(AchievementsTab.getElementsByClassName('card')) chrome.storage.sync.get(['PolyPlus_Settings'], async function(result) { Settings = result.PolyPlus_Settings || {} + + Utilities = await import(chrome.runtime.getURL('resources/utils.js')); + Utilities = Utilities.default if (Settings.PinnedGamesOn === true) { PinnedGames() } - // Work in Progress - if (Settings.InlineEditingOn === true) { + if (Settings.InlineEditingOn === true && GameCreator === UserID) { InlineEditing() } - // Work in Progress - /* - if (Settings.GameProfilesOn === true) { - GameProfiles() + const Description = document.querySelector('.col:has(#likes-data-container) .card.mcard.mb-2 .card-body.p-3.small') + if (Settings.GameProfilesOn === true && Description !== null) { + const GameProfileRegex = /p\+gp;(#(?:[A-Fa-f0-9]{3}){1,2}\b(;#(?:[A-Fa-f0-9]{3}){1,2}\b)+)/gm + if (GameProfileRegex.test(Description.innerText)) { + const Info = GameProfileRegex.exec(Description.innerText)[1].split(';') + GameProfile(Info) + } } - */ if (Settings.IRLPriceWithCurrencyOn === true) { - (async () => { - Utilities = await import(chrome.runtime.getURL('/js/resources/utils.js')); - Utilities = Utilities.default - - IRLPrice() - })(); + IRLPrice() } if (Settings.ShowPlaceRevenueOn === true) { @@ -108,22 +109,7 @@ const Achievements = Array.from(AchievementsTab.getElementsByClassName('card')) async function PinnedGames() { chrome.storage.sync.get(['PolyPlus_PinnedGames'], function(result){ PinnedGamesData = result.PolyPlus_PinnedGames || []; - /* - const PinBtn = document.createElement('button'); - PinBtn.classList = 'btn btn-warning btn-sm'; - PinBtn.style = 'position: absolute; right: 0; margin-right: 7px;' - - if (PinnedGamesData[PlaceID]) { - PinBtn.innerHTML = ' Un-pin'; - } else { - if (PinnedGames.length !== 5) { - PinBtn.innerHTML = ' Pin' - } else { - PinBtn.setAttribute('disabled', true) - PinBtn.innerHTML = ' Pin (max 5/5)' - } - } - */ + const PinBtn = document.createElement('button'); PinBtn.classList = 'btn btn-warning btn-sm'; PinBtn.style = 'position: absolute; right: 0; margin-right: 7px;' @@ -131,11 +117,11 @@ async function PinnedGames() { if (PinnedGamesData.includes(parseInt(PlaceID))) { PinBtn.innerHTML = ' Un-pin'; } else { - if (PinnedGamesData.length !== 5) { + if (PinnedGamesData.length !== Utilities.Limits.PinnedGames) { PinBtn.innerHTML = ' Pin' } else { PinBtn.setAttribute('disabled', true) - PinBtn.innerHTML = ' Pin (max 5/5)' + PinBtn.innerHTML = ` Pin (max ${Utilities.Limits.PinnedGames}/${Utilities.Limits.PinnedGames})` } } @@ -197,12 +183,12 @@ async function PinnedGames() { if (PinnedGamesData.includes(parseInt(PlaceID))) { PinBtn.innerHTML = ' Un-pin' } else { - if (PinnedGamesData.length !== 5) { + if (PinnedGamesData.length !== Utilities.Limits.PinnedGames) { PinBtn.removeAttribute('disabled') PinBtn.innerHTML = ' Pin' } else { PinBtn.setAttribute('disabled', true) - PinBtn.innerHTML = ' Pin (max 5/5)' + PinBtn.innerHTML = ` Pin (max ${Utilities.Limits.PinnedGames}/${Utilities.Limits.PinnedGames})` } } }); @@ -212,14 +198,11 @@ async function PinnedGames() { } async function InlineEditing() { - // Fix description editing - // Make it possible to edit description even if the game doesn't initially have a description - // Add the ability to edit the game's genre - // Improve editing visuals overall - - if (GameCreator !== UserID) { - return - } + /* + INLINE EDITING TO-DO: + - Make it possible to edit the description even if there is no description initially + - Make it possible to edit the place's genre + */ let Editing = false @@ -344,9 +327,7 @@ async function InlineEditing() { }); } -async function GameProfiles(data) { - return - data = Data +async function GameProfile(data) { document.querySelector('h1.my-0') .setAttribute('game-key', 'true'); document.querySelector('div[style="min-height: 60vh;"]') @@ -356,16 +337,16 @@ async function GameProfiles(data) { Style.innerHTML = ` div#app { - background: ${Data.bg} !important; + background: ${data[0]} !important; } #gameprofile { - /*font-family: ${Data.font} !important;*/ - color: ${Data.text} !important; + /*font-family: no !important;*/ + color: ${data[4]} !important; } #gameprofile .card { - --bs-card-bg: ${Data.cardBg}; + --bs-card-bg: ${data[3]}; } /* @@ -376,7 +357,7 @@ async function GameProfiles(data) { */ #gameprofile .card.mcard [game-key] { - background: linear-gradient(to bottom, ${Data.accent}, ${Data.secondary}); + background: linear-gradient(to bottom, ${data[1]}, ${data[2]}); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; diff --git a/js/places/places.js b/js/places/places.js index 01717ec..b6ac1f5 100644 --- a/js/places/places.js +++ b/js/places/places.js @@ -1,3 +1,8 @@ +/* + THIS FILE DOES NOT RUN + IT WAS ADDED WHILE I CONSIDER WHETHER OR NOT TO ADD PINNED GAMES TO THE MAIN PLACES PAGE +*/ + let Settings; let PinnedGamesData; diff --git a/js/store/item-view.js b/js/store/item-view.js index 34fbe21..1476081 100755 --- a/js/store/item-view.js +++ b/js/store/item-view.js @@ -23,7 +23,7 @@ var ItemOwned; (async () => { if (!(window.location.href.split('/')[4]) || ItemType === "achievement") {return} - Utilities = await import(chrome.runtime.getURL('/js/resources/utils.js')); + Utilities = await import(chrome.runtime.getURL('resources/utils.js')); Utilities = Utilities.default chrome.storage.sync.get(['PolyPlus_Settings'], async function(result){ @@ -56,6 +56,10 @@ var ItemOwned; Sales.children[1].innerText = Owners.toLocaleString() } } + + if (Settings.HoardersListOn === true && document.getElementById('resellers') !== null) { + HoardersList() + } }) })(); @@ -179,12 +183,6 @@ function TryOnItems() { } let AssetType = document.querySelector('.px-4.px-lg-0.text-muted.text-uppercase.mb-3 .badge').innerHTML - console.log(AssetType, MeshTypes[AssetType], MeshTypes[AssetType.toLowerCase()]) - /* - if (HatTypes[AssetType.toLowerCase()] !== undefined) { - AssetType = "hat" - } - */ const ItemThumbnail = document.getElementsByClassName('store-thumbnail')[0] const IFrame = document.getElementsByClassName('store-thumbnail-3d')[0] @@ -194,6 +192,8 @@ function TryOnItems() { const TryOnBtn = document.createElement('button') TryOnBtn.classList = 'btn btn-outline-warning' TryOnBtn.style = 'position: absolute; bottom: 60px; right: 10px;' + TryOnBtn.setAttribute('data-bs-toggle', 'tooltip') + TryOnBtn.setAttribute('data-bs-title', 'Try this item on your avatar') TryOnBtn.innerHTML = '' TryOnBtn.addEventListener('click', function (){ TryOnModal.showModal() @@ -205,7 +205,7 @@ function TryOnItems() { TryOnModal.innerHTML = `
Preview
- Try on this item! + Try this avatar on your avatar before purchasing it!