diff --git a/assets/css/iconkit.css b/assets/css/iconkit.css index 095756b..96f0846 100644 --- a/assets/css/iconkit.css +++ b/assets/css/iconkit.css @@ -317,13 +317,13 @@ input:focus, select:focus, textarea:focus, button:focus { border-image: url('../../assets/select.png') 10 stretch !important; } -.iconTabButton, .glowToggle, .copyForm { +.iconTabButton, .glowToggle, .copyForm, .miscFormButton { margin: 0 5 0 5; transition: transform .1s ease-in-out; user-select: none; } -.iconTabButton:focus-visible, .glowToggle:focus-visible, .copyForm:focus-visible, .menuButton:focus-visible, .postButton:focus-visible { +.iconTabButton:focus-visible, .glowToggle:focus-visible, .copyForm:focus-visible, .menuButton:focus-visible, .postButton:focus-visible, .miscFormButton:focus-visible { transform: scale(1.1); } @@ -360,7 +360,7 @@ input:focus, select:focus, textarea:focus, button:focus { margin: 18 10 0 10 !important; } -.iconTabButton:active, .glowToggle:active, .copyForm:active { +.iconTabButton:active, .glowToggle:active, .copyForm:active, .miscFormButton:active { transform:scale(1.05) } diff --git a/assets/deatheffects/18.png b/assets/deatheffects/18.png new file mode 100644 index 0000000..4fb7d81 Binary files /dev/null and b/assets/deatheffects/18.png differ diff --git a/assets/deatheffects/19.png b/assets/deatheffects/19.png new file mode 100644 index 0000000..9ff8ab4 Binary files /dev/null and b/assets/deatheffects/19.png differ diff --git a/assets/deatheffects/20.png b/assets/deatheffects/20.png new file mode 100644 index 0000000..1b5862d Binary files /dev/null and b/assets/deatheffects/20.png differ diff --git a/assets/iconkitbuttons/btn-reveal.png b/assets/iconkitbuttons/btn-reveal.png new file mode 100644 index 0000000..fbc8b44 Binary files /dev/null and b/assets/iconkitbuttons/btn-reveal.png differ diff --git a/assets/iconkitbuttons/jetpack_off.png b/assets/iconkitbuttons/jetpack_off.png new file mode 100644 index 0000000..ad3c402 Binary files /dev/null and b/assets/iconkitbuttons/jetpack_off.png differ diff --git a/assets/iconkitbuttons/jetpack_on.png b/assets/iconkitbuttons/jetpack_on.png new file mode 100644 index 0000000..ac86fb2 Binary files /dev/null and b/assets/iconkitbuttons/jetpack_on.png differ diff --git a/assets/iconkitbuttons/spoilers.png b/assets/iconkitbuttons/spoilers.png new file mode 100644 index 0000000..8e69f7e Binary files /dev/null and b/assets/iconkitbuttons/spoilers.png differ diff --git a/assets/iconkitbuttons/spoilers_on.png b/assets/iconkitbuttons/spoilers_on.png new file mode 100644 index 0000000..f086275 Binary files /dev/null and b/assets/iconkitbuttons/spoilers_on.png differ diff --git a/html/achievements.html b/html/achievements.html index f126015..ba6858f 100644 --- a/html/achievements.html +++ b/html/achievements.html @@ -79,7 +79,7 @@ - + - + - + - + - + - + - + - + Online Icon Kit - + @@ -40,6 +40,17 @@ + +
@@ -56,7 +67,9 @@ + +

@@ -138,6 +151,9 @@ let selectedColW = null let selectedColU = null let enableGlow = 0 +let enableSpoilers = false +let clickedSpoilerWarning = false + let shops = ["the Shop", "Scratch's Shop", "the Community Shop"] let achievements = [] let shopIcons = [] @@ -189,6 +205,13 @@ function checkGlow() { checkAnimation() } +// check if white col tab should be visible +function checkWhite() { + let hasWhite = icon.layers[0].sections.some(x => x.colorType == "w") + if (hasWhite) { $('#colW').show(); $('#ccW').show() } + else { $('#colW').hide(); $('#ccW').hide(); $(`#colW-12`).trigger('click'); } +} + // check if animation selector should be visible function checkAnimation() { let animationData = iconData.robotAnimations.animations[selectedForm] @@ -198,9 +221,8 @@ function checkAnimation() { else if (!animationData) $('#animationOptions').hide() } -let commonAnimations = ["idle", "run", "walk"] function animationSort(anim) { - return Object.keys(anim).sort((a, b) => (commonAnimations.includes(b)) - (commonAnimations.includes(a)) || a.localeCompare(b)) + return Object.keys(anim).sort((a, b) => a.localeCompare(b)) } function appendAnimations(form, animationData) { @@ -232,6 +254,10 @@ function setExtras() { let foundCredit = iconStuff.iconCredits.find(x => x.form == selectedForm && x.id == selectedIcon) if (foundCredit) extraInfo["🎨 Artist"] = foundCredit.name + else if (icon.new) { + extraInfo["2.2 icon"] = "Yes!" + extraInfo["🎨 Artist"] = "(uncredited)" + } let extraData = Object.entries(extraInfo).map(x => `

${x[0]}: ${x[1]}

`) $('#extraInfo').html(extraData) @@ -262,8 +288,9 @@ fetch('../api/iconkit').then(res => res.json()).then(iconKitData => { let forms = Object.keys(iconStuff.forms) forms.forEach(form => { - $("#iconTabs").append(``) - $("#copyForms").append(``) + let spoil = ["swing", "jetpack"].includes(form) + $("#iconTabs").append(``) + $("#copyForms").append(``) }) $("#iconTabs").append(``) @@ -279,8 +306,8 @@ fetch('../api/iconkit').then(res => res.json()).then(iconKitData => { let noDome = selectedForm == "ufo" && iconSettings.includes("ufo") let foundForm = parseIconForm(selectedForm) - loadIconLayers(foundForm, selectedIcon, function(l, sprites) { - let iconArgs = {app, form: foundForm, id: selectedIcon, col1: getCol(selectedCol1), col2: getCol(selectedCol2), glow: enableGlow > 0} + loadIconLayers(foundForm, selectedIcon, function(l, sprites, isNew) { + let iconArgs = {app, form: foundForm, id: selectedIcon, col1: getCol(selectedCol1), col2: getCol(selectedCol2), glow: enableGlow > 0, new: isNew} if (selectedCol2 != selectedColG) iconArgs.colG = getCol(selectedColG) if (selectedColW) iconArgs.colW = getCol(selectedColW) if (selectedColU) iconArgs.colU = getCol(selectedColU) @@ -294,12 +321,15 @@ fetch('../api/iconkit').then(res => res.json()).then(iconKitData => { icon = new Icon(iconArgs) icon.sprite.position.set(app.renderer.width / 2, (app.renderer.height / 2) + (yOffsets[selectedForm] || 0)) updateDetails() + checkWhite() if (cb) cb() }) } - function filterIcon(name) { return iconStuff.previewIcons.filter(x => x.startsWith(name)).sort(function (a,b) {return a.replace(/[^0-9]/g, "") - b.replace(/[^0-9]/g, "");})} + function filterIcon(name) { + return iconStuff.previewIcons.concat(iconStuff.newPreviewIcons).filter(x => x.startsWith(name)).sort(function (a,b) {return a.replace(/[^0-9]/g, "") - b.replace(/[^0-9]/g, "");}) + } function appendIcon(form, formName) { @@ -311,8 +341,8 @@ fetch('../api/iconkit').then(res => res.json()).then(iconKitData => { if (hasMini) form.shift() form.forEach(function (i, p) { - // if (p != 0 && p % 12 == 0) formContainer.append('
') - formContainer.append(``) + let newOne = iconStuff.newPreviewIcons.includes(i) + formContainer.append(``) }) if (hasMini) formContainer.append(``) @@ -411,7 +441,7 @@ fetch('../api/iconkit').then(res => res.json()).then(iconKitData => { else $("#glow").attr('src', $("#glow").attr('src').replace('_on', '_off')) }) - $(document).on('click', '.glowToggle', function () { + $('#glowbtn').click(function () { if (enableGlow) { $("#glow").attr('src', $("#glow").attr('src').replace('_on', '_off')) @@ -427,7 +457,7 @@ fetch('../api/iconkit').then(res => res.json()).then(iconKitData => { updateDetails() }) - + $(document).on('click', '.copyForm', function () { $('.copyForm').each(function(x, y) {$(this).children().first().attr('src', $(this).children().first().attr('src').replace('_on', '_off'))}) formCopy = $(this).attr('form') @@ -442,9 +472,6 @@ fetch('../api/iconkit').then(res => res.json()).then(iconKitData => { selectedIcon = $(this).attr('num'); selectedForm = $(this).attr('form'); - if (iconStuff.whiteIcons.find(x => x[1] == selectedIcon && x[0] == selectedForm)) { $('#colW').show(); $('#ccW').show() } - else { $('#colW').hide(); $('#ccW').hide(); $(`#colW-12`).trigger('click'); } - if (selectedForm == "ufo") { $('#colU').show(); $('#ccU').show() } else { $('#colU').hide(); $('#ccU').hide(); $(`#colU-12`).trigger('click'); } @@ -664,6 +691,23 @@ function getUnlockMethod(iconNumber, form) { else if (foundMerch) return `Purchase in ${shops[foundMerch.shop]} for ${foundMerch.price} orbs` } +function toggleSpoilers() { + + if (enableSpoilers) { + $("#newIconBtn").attr('src', $("#newIconBtn").attr('src').replace('_on', '')) + enableSpoilers = false; + } + + else { + $("#newIconBtn").attr('src', $("#newIconBtn").attr('src').replace('.png', '_on.png')) + enableSpoilers = true; + } + + if (enableSpoilers) $('button[isNew]').show() + else $('button[isNew]').hide() + +} + function backButton() { if (window.history.length > 1 && document.referrer.startsWith(window.location.origin)) window.history.back() window.location.href = "../../../../../" diff --git a/html/leaderboard.html b/html/leaderboard.html index 12fe9a4..552dca6 100644 --- a/html/leaderboard.html +++ b/html/leaderboard.html @@ -102,7 +102,7 @@ - + - + - + - + - + - + - + - +