Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 176 additions & 37 deletions Extensions/pokes.css
Original file line number Diff line number Diff line change
@@ -1,73 +1,212 @@
/*
* Style for Pokémon appearing on Dashboard
*/
.poke {
position: absolute;
right: -126px;
}

.poke_background {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASBAMAAACk4JNkAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNvyMY98AAAAhUExURf///zAwMEhQUHh4gJhIOKCgwNhYONjI8PiQOPjQOPj4+CJu/FkAAAALdFJOUwC0tLS0tLS0tLS0/fXDXAAAAH1JREFUCNdjYGBgEBQUZAADwY6ODjCTEcjoaBMAsiRmgpiJQKHOVTOArDQBJJZEB1g2LRHIAutAYYmAWWlpjgxCHk1KQEaKIoOQkupStTQnJUUGRiOtVUpKSspA86pMlwIZpUDrxBcbl5eXB4JcEA5khAqAXRUaGgpzINilAJ/TLm7LlTr9AAAAAElFTkSuQmCC) no-repeat;
background-size: 100px 100px;
image-rendering: pixelated;
}

.poke img {
width: 100px;
image-rendering: pixelated;
}

.caught img {
width: 55px;
image-rendering: pixelated;
}

.poke::after {
font-size:26px;
font-size: 26px;
font-weight: bold;
position: relative;
left: -26px;
}

.caught .poke_gender div::after {
font-size:26px;
font-weight:bold;
position:relative;
top:-20px;
}

.poke[data-pokegender="male"]::after,
.caught[data-pokegender="male"] .poke_gender div::after {
.poke[data-pokegender="male"]::after {
content: "\2642";
color: #6CA0DC;
}

.poke[data-pokegender="female"]::after,
.caught[data-pokegender="female"] .poke_gender div::after {
.poke[data-pokegender="female"]::after {
content: "\2640";
color: #FF69B4;
}

.poke[data-pokegender="genderless"]::after,
.caught[data-pokegender="genderless"] .poke_gender div::after {
.poke[data-pokegender="genderless"]::after {
content: "\26AA";
color: #9370DB;
}

.caught {
border-bottom: 1px solid rgb(190,190,190);
/*
* Menu of the Pokés extension
*/
#xkit-pokes-custom-panel {
width: 100%
}

.caught .poke_sprite{
width: 65px;
#xkit-loading_pokemon {
text-align: center;
position: relative;
}

.caught .poke_stats {
vertical-align: middle;
.xkit-pokes-menu_button {
box-sizing: border-box;
width: 178px;
height: 175px;
float: left;
display: inline-block;
position: relative;
padding: 70px 20px 20px 20px;
text-align: center;
cursor: pointer;
border: 1px solid #D0D0D0;
}

#xkit-pokes-custom-panel {
width: 100%
.xkit-pokes-menu_button.disabled {
cursor: default;
}
.xkit-pokes-menu_button.disabled .title:after {
content: "Unavailable";
}
.xkit-pokes-menu_button.disabled .description:after {
content: "This feature is not ready just yet!";
}
.xkit-pokes-menu_button .title {
font-weight: bold;
margin-top: 4px;
}
.xkit-pokes-menu_button .description {
max-height: 60px;
overflow: hidden;
text-overflow: ellipsis;
}
.xkit-pokes-menu_button .icon {
position: absolute;
top: 20px;
left: 50%;
margin-left: -16px;
border-radius: 5px;
width: 32px;
height: 32px;
background-size: contain;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAACVBMVEX///8iIiIiIiLMFIP7AAAAA3RSTlMAf4C/aSLHAAAAVElEQVR4Ae3KMQrAIBQE0Z/c/9BJIQwsrFPaOI1/5c3tcM9KGZkjc2SO9i7vAnOZY3f4/u0hDjkloCQQAOQjAvAIzN1lccBV3l3SlMyROVJHsNvRPjeEAcfzDmAhAAAAAElFTkSuQmCC');
}
#xkit-pokes-show_poke_list .icon {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAD80lEQVRYR7WXP2zbRhTGPxWqTQJFK27iyFFjvFVLE7mAW7mTtdlb5RZFJTl1JCQwrNGC4dSyU8fKEEjZ5E2aaiUZxLiLsimjlg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hzW7e2wNVl6P4PqoJIISAVN8TFETAGHNag36G3vY25+XXydn1dPqwpYSEbThYMdCwBqCJ5ZA/6fPKAVB1mzFn4LcE4ARt2zrB0kPnczutta6PITOJ1LmY24Io/TDVrc+OCjYU5pOsPGighNiwn/2muJ8N98i4dCw3e/8wBQC8tKBCH3DyMsYgyuC8bDh/nyVMM7bm5UY/Vb7lOMB+9rOxt57NqFGrFkyhc8+YwtLw8uEJmNS9B1pNY6i1MoQ2JPeHisPhxeWrffNtPTJUROcEACGkLnY6/WQBNC+dIryHMbv/iYEoG8MKpNMxTdTWGA2tNPUje6Ltm6Yn2Tg/3XNDbbW2BgBc9pyhr/VXdQZM149Dt8xtyW62W24YQ01FamuFWwX4Xn0eEqlqq4d0OA9roUlrlCDaGun2WgS2TvfzKNfYMUIDymwv773oTP5unZ5taYeHwyh+hI0RE0H5qk+spUb/rwgEtEEQxAhN1Ud03eta51TcP8vNo+nJ3btk9oeDEsKhbFijAGimDJDaitCGQqUBhBgodglnLcUXp+6fUbSx4h0VQ0yJjKBYkfBYOfer8wCgMhpRtGJAUEYjCKwlvGiTwqswkhShIsFCmhAUCAkhkXgmhEpLFFI8tDb7I9evzgOASlvSCQ0JUFETJGigNCFQJIwA8KINEZFTR7pzhEiEIaMRsL836b3cCx+Job86DwCqRITSjJDghdQUGUbx1E4JKm33lS+34RSFntuesR5E/b+Q+xh8AUCEEChNKqqSiR7bN5biZWvA5mv4hScQvxD+CQ0gmrvyhM6LAAAAAElFTkSuQmCC');
}

#xkit-loading_pokemon {
/*
* Pokémon list style
*/
.xkit-pokes-lightbox {
position: fixed;
top: 0px;
bottom: 0px;
right: 0px;
left: 0px;
z-index: 15000;
overflow: hidden;
background-color: rgba(25,25,25,.92);
}
.gender {
display: none;
float: right;
font-size: 20px;
}
.nickname {
display: none;
font-weight: 700;
font-size: 25px;
}
.nickname::before {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what's supposed to show up here, but it doesn't show up.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is display: none that keeps it from showing up. The icon is supposed to be the edit pen that tumblr uses on posts you can edit if you know what I mean. I did not implement nicknaming yet so I decided to hide the symbol until Nicknames become a thing

content: "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be specified in a hex format like the rest of the symbols

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not know what the hex format was. I copied it from tumblr's CSS file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a

font-family: "tumblr-icons";
float: left;
display: none;
}
.species {
display: none;
font-size: 16px;
margin-top: 3px;
}
#xkit-pokes-nickinput {
font-size: 20px;
}
.xkit-pokes-pc {
max-width: 800px;
border-radius: 40px;
height: 600px;
background: #EFEFE7;
position: relative;
margin: 50px auto;
}
.xkit-pokes-pc-pokemon {
height: 350px;
width:85%;
padding: 10px;
margin: 50px;
position: absolute;
border: 4px solid #6B94B5;
border-radius: 20px;
background: #B6E4EF;
}
.xkit-pokes-pc-info {
position: absolute;
background: #fff;
height: 90px;
width: 85%;
padding: 10px;
margin: 440px 50px 50px 50px;
border: 4px solid #6B94B5;
border-radius: 20px;
-webkit-filter: grayscale(30%);
filter: grayscale(0%);
}
.xkit-pokes-pc-info .gender[data-pokegender="male"]::after {
content: " \2642";
color: #6CA0DC;
}
.xkit-pokes-pc-info .gender[data-pokegender="female"]::after {
content: " \2640";
color: #FF69B4;
}
.xkit-pokes-pc-info .gender[data-pokegender="genderless"]::after {
content: " \26AA";
color: #9370DB;
}
.xkit-pokes-pc-info .caught_stats {
text-align: center;
font-weight: bold;
font-size: 20px;
}
.caught.active {
background: rgba(255,255,255,.7);
}
#xkit-loading_pokemon {
overflow-y:scroll;
height: 100%;
}
.caught {
display: inline-block;
width: 90px;
height: 90px;
border-radius: 10px;
}
.caught img {
width: 90px;
height: auto;
vertical-align:middle;
image-rendering: pixelated;
}
.caught::after {
float: right;
font-size: 30px;
position: relative;
top: -40px;
font-weight: 100;
}
.caught[data-pokegender="male"]::after {
content: " \2642";
color: #6CA0DC;
}
.caught[data-pokegender="female"]::after {
content: " \2640";
color: #FF69B4;
}
.caught[data-pokegender="genderless"]::after {
content: " \26AA";
color: #9370DB;
}
102 changes: 92 additions & 10 deletions Extensions/pokes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//* TITLE Pokés **//
//* VERSION 0.4.1 **//
//* VERSION 0.5.0 **//
//* DESCRIPTION Gotta catch them all! **//
//* DETAILS Randomly spawns Pokémon on your dash for you to collect. **//
//* DEVELOPER new-xkit **//
Expand All @@ -16,7 +16,11 @@ XKit.extensions.pokes = {
text: "Give Pokémon a background (for visibility)",
default: false,
value: false
}
},
"pokes_menu_header": {
text: "Menu",
type: "separator",
},
},

run: function() {
Expand Down Expand Up @@ -173,27 +177,105 @@ XKit.extensions.pokes = {
XKit.post_listener.remove("pokes");
},

cpanel: function(m_div) {
m_div.append('<div id="xkit-loading_pokemon">Loading Pokémon, please wait...</div>');
render_pokelist: function() {
var m_html =
'<div class="xkit-pokes-lightbox" style="opacity: 0">' +
'<div class="xkit-pokes-pc">' +
'<div class="xkit-pokes-pc-info">' +
'<div class="gender"></div>' +
'<div class="nickname"></div>' +
'<div class="species"></div>' +
'<div class="caught_stats"></div>' +
'</div>' +
'<div class="xkit-pokes-pc-pokemon">' +
'<div id="xkit-loading_pokemon">' +
'Loading Pokémon, please wait...' +
'</div>' +
'</div>' +
'</div>';

$("body").prepend(m_html);
$(".xkit-pokes-lightbox").click(function(e) {
if (e.target !== this) return;
$(this).animate({
opacity: 0
}, {
complete: function() {
$(this).remove();
}
});
});
$(".xkit-pokes-lightbox").animate({
opacity: 1
});
XKit.extensions.pokes.fetch_pokedex(function(mdata) {
var caught = JSON.parse(XKit.storage.get("pokes","pokemon_storage","[]"));
var header = "<p>You've caught " + caught.length + " total Pokémon!<br/> That's ";
var checklist = [];
var m_html = "<table id=\"xkit-pokes-custom-panel\" class='pokemon_display'>";
var m_html = "";
$.each(caught, function(index, value) {
m_html = m_html + "<tr class='caught' data-pokegender='" + value.gender + "'><td class='poke_sprite'><div><img src='" + mdata[value.id].sprite + "'></div></td><td class='poke_gender'><div></div></td><td class='poke_stats'><div>Name: " + mdata[value.id].name + "</div></td></tr>";
m_html = m_html + "<div class='caught' data-pokegender='" + value.gender + "' data-pokespecies='" + mdata[value.id].name + "' data-pokenick='" + (value.nickname || "") + "'><img class='caught poke_sprite' src='" + mdata[value.id].sprite + "'></div>";
if (checklist.indexOf(value.id) === -1) checklist.push(value.id);
});
m_html = m_html + "</table>";
header += checklist.length + " out of " + mdata.length + " different species of Pokémon!</p>";
$("#xkit-loading_pokemon").html(m_html);
$("#xkit-loading_pokemon").prepend(header);
$(".caught_stats").html(header);
$(".xkit-pokes-pc-pokemon .caught").click(function () {
if ($(this).hasClass("active")) {
$(this).removeClass("active");
$(".xkit-pokes-pc-info .caught_stats").show();
$(".xkit-pokes-pc-info .gender").hide();
$(".xkit-pokes-pc-info .species").hide();
$(".xkit-pokes-pc-info .nickname").hide();
} else {
$(".active").removeClass("active");
$(this).addClass("active");
$(this).find("img").addClass("active");
$(".xkit-pokes-pc-info .caught_stats").hide();
$(".xkit-pokes-pc-info .gender").show();
$(".xkit-pokes-pc-info .species").show();
$(".xkit-pokes-pc-info .nickname").show();
$(".xkit-pokes-pc-info .gender").attr( "data-pokegender", ( $(this).attr("data-pokegender") ) );
$(".xkit-pokes-pc-info .gender").text( $(this).attr("data-pokegender") );
$(".xkit-pokes-pc-info .species").text( "Species: " + $(this).attr("data-pokespecies") );
if (typeof $(this).attr("data-pokenick") !== "undefined" && $(this).attr("data-pokenick")) {
$(".xkit-pokes-pc-info .nickname").html("<div>" + $(this).attr("data-pokenick") + "</div>" );
} else {
$(".xkit-pokes-pc-info .nickname").html("<div title='Click to nickname!'>" + $(this).attr("data-pokespecies") + "</div>");
}
}
});
}, function(response) {
$("#xkit-loading_pokemon").html("<div id='xkit-pokes-custom-panel'>Failed to load Pokémon Data!<br>Please refresh the page or try again later!</div>");
});

},

cpanel: function(m_div) {
var m_html = '<div id="xkit-pokes-menu">' +
'<div class="xkit-pokes-menu_button" id="xkit-pokes-show_poke_list">' +
'<div class="icon"></div>' +
'<div class="title">Pokémon</div>' +
'<div class="description">Check which Pokémon you have caught</div>' +
'</div>' +
'<div class="xkit-pokes-menu_button disabled">' +
'<div class="icon"></div>' +
'<div class="title"></div>' +
'<div class="description"></div>' +
'</div>' +
'<div class="xkit-pokes-menu_button disabled">' +
'<div class="icon"></div>' +
'<div class="title"></div>' +
'<div class="description"></div>' +
'</div>' +
'</div>';
m_div.append(m_html);

$("#xkit-pokes-show_poke_list").click(function() {
XKit.extensions.xkit_preferences.close();
setTimeout(XKit.extensions.pokes.render_pokelist, 250);
});

$("#xkit-extensions-panel-right").nanoScroller();
$("#xkit-extensions-panel-right").nanoScroller({ scroll: 'top' });

}
};