Loading...

Top
PFQ Banner

This is PokéFarm Q, a free online Pokémon collectables game.

Already a user? New to PFQ?

Free CSS, Userscripts, etc

Forum Index > Other > Other Art >

Pages: 123··· 678

DrWho's AvatarDrWho
DrWho's Avatar
Posts on this thread are always welcome! Whether it's a question, suggestion, idea or anything else really. If you prefer a PM that's fine too! A note on usage: Any code I post in this thread is always free. You're free to use it, free to modify it, free to share or sell your modified code as your own.

Bookmarks

PFQ Variables by Erable
Avatar by Kaelwolfur. Sent from my PokéNav
DrWho's AvatarDrWho
DrWho's Avatar
Archived post - I made this template but prefer to take it down. Do with the code what you like though, no need to credit or reference this post. Code here: https://gitlab.com/alythal/pfq-stuff/-/raw/master/about-me-pages The code contains a free to use photograph by ingmar @ unsplash [link], if you use the image please credit the artist.
DrWho's AvatarDrWho
DrWho's Avatar
Another post! This one is about making counters, like the special counters at the top of the page.

Dark Gems ★

Mytrhil soon :'D

Shiny Eevee

Eevee is the most common shiny on site, and not without good reason!

Fising

Blub.. Blub.. Blub.. You really need a lot of patience for this.
We start off with this boilerplate, it won't show any counters yet but it sets up the necessary CSS.
[sc=counters] [/sc] [style] .fillcounter(@collecting,@image,@progress,@goal){.icon:after{content:url(@image)}.icon:before{height:calc(100% - 100*@progress/@goal)}.quantity:before{content:"" + @progress}h3:before{float:left;content:url(@image);padding:4px;background:@col-bg3;border:1px solid @col-border1;border-radius:4px;margin-right:0.5rem}h3{display:block;flex-flow:row wrap;text-align:left;margin-bottom:.8rem}h3:after{font-weight:400;font-size:1rem;display:block;content:@progress + "/" + @goal + "\A " + @collecting}}.counters{position:relative;margin:-2px;display:flex;flex-flow:row wrap;align-items:flex-end;span.bbcode_tooltip{border-bottom:none}.tooltip_content{left:0;bottom:0;transform:translate3d(0,100%,0)}}.counter{position:static !important;text-align:center;margin:0 2px}.counter .icon{background: linear-gradient(to bottom, #77c7d7, #d7ffbf); position:relative;overflow:hidden;display:inline-block;&:before{position:absolute;content:"";top:0;left:0;width:100%;background:rgba(0,0,0,0.75)}}.counter > .quantity{display:block} [/style]
Let's add a counter! Add this to the BBCode between the [sc=counters][/sc] tags
[sc=counters] [sc=counter umbreon][pit="[sc=icon][/sc][sc=quantity][/sc]"][h3]Dark Gems ★[/h3]Mytrhil soon :'D[/pit][/sc] [/sc]
umbreon
- is a unique name for the counter
Dark Gems ★
- is the headline for that counter.
Mytrhil soon :'D
- Is the description Now add this to the CSS. We're passing 4 piece of information between the round brackets ( ) separated by commas
  1. A name for what you're collecting, this appears as the 3rd line in the popup
  2. The image URL for the counter
  3. Your current count, e.g. an inventory code
  4. Your goal
[style] .umbreon { .fillcounter( "Dark Gems", "https://pfq-static.com/img/pkmn/o/d/t.png", [math][inventory=Dark Gem]+10*[inventory=Medium Dark Gem][/math], 100 ) } /*The long block from above goes here*/ [/style]
You can add as many counters as you like, just repeat the 2 steps we did for the dark gem counter. Here's the full example you see at the top of this page:

Code

[sc=counters] [sc=counter umbreon][pit="[sc=icon][/sc][sc=quantity][/sc]"][h3][url=/index]Dark Gems ★[/url][/h3]I love dark types and dark gems![/pit][/sc] [sc=counter eevee][pit="[sc=icon][/sc][sc=quantity][/sc]"][h3]Shiny Eevee[/h3]Look at those adorable silver cuties![/pit][/sc] [sc=counter lanturn][pit="[sc=icon][/sc][sc=quantity][/sc]"][h3]Fising[/h3]Blub.. Blub.. Blub.. You really need a lot of patience for this.[/pit][/sc] [/sc] . . . . . . . [style] .umbreon { .fillcounter( "Dark Gems", "https://pfq-static.com/img/pkmn/o/d/t.png", [math][inventory=Dark Gem]+10*[inventory=Medium Dark Gem][/math], 100 ) } .eevee { .fillcounter( "Shiny Eevee", "https://pfq-static.com/img/pkmn/n/0/m.png", 3, 8 ) } .lanturn { .fillcounter( "Fish hooked", "https://pfq-static.com/img/pkmn/4/z/f.png", 700, 1500 ) } .fillcounter(@collecting,@image,@progress,@goal){.icon:after{content:url(@image)}.icon:before{height:calc(100% - 100*@progress/@goal)}.quantity:before{content:"" + @progress}h3:before{float:left;content:url(@image);padding:4px;background:@col-bg3;border:1px solid @col-border1;border-radius:4px;margin-right:0.5rem}h3{display:block;flex-flow:row wrap;text-align:left;margin-bottom:.8rem}h3:after{font-weight:400;font-size:1rem;display:block;content:@progress + "/" + @goal + "\A " + @collecting}}.counters{position:relative;margin:-2px;display:flex;flex-flow:row wrap;align-items:flex-end;span.bbcode_tooltip{border-bottom:none}.tooltip_content{left:0;bottom:0;transform:translate3d(0,100%,0)}}.counter{position:static !important;text-align:center;margin:0 2px}.counter .icon{background: linear-gradient(to bottom, #77c7d7, #d7ffbf); position:relative;overflow:hidden;display:inline-block;&:before{position:absolute;content:"";top:0;left:0;width:100%;background:rgba(0,0,0,0.75)}}.counter > .quantity{display:block} [/style]
DrWho's AvatarDrWho
DrWho's Avatar

Replacing images with CSS

QUOTE originally posted by Spewpa

Just curious, is there a way to replace the images on the counters?
Spewpa asked for a way to replace counter images. That gave me the idea to make a post about replacing images with CSS. There's two type of images:

1. As a CSS property

The image is loaded as a CSS property, so you can just set a new property. For example, select all fields with the 'normal2.png' background and set a new custom background. .field[style*='normal2.png'] { background-image: url("https://placekitten.com/g/600/345") !important }

2. As the src of an img tag

The more interesting case is when the image is loaded as the HTML <img> element. There's no way to tell CSS "select all images and replace the value of src with something else". CSS cannot modify existing attributes. But there's one trick we can use, the object-position property. For an img tag, object-position describes where the graphic is positioned relative to the box of the img element. To make this clear, here's a cat loaded with the img tag. We give the img a red border and padding to highlight the box of the element.
img { box-sizing: border-box; border: 3px solid red; padding: 3px; } Now, we use object-position to move the position of the cat pixels relative to the box. img { box-sizing: border-box; border: 3px solid red; padding: 3px; object-position: 25px 10px; } So, the trick is to move the old sprite way off the visible screen with object-position. Then we can set a background-image to fill the now empty img element. If your new background-image has a different size than the original, use the CSS width and height properties to resize the img element. img { box-sizing: border-box; border: 3px solid red; padding: 3px; height: 90px; width: 90px; object-position: 9999px; background-image: url("https://placekitten.com/90/90"); }
Link: object-position on Mozilla Developer Network.
DrWho's AvatarDrWho
DrWho's Avatar
You can re-play the animation of any pokemon hatching. It is a Javascript code you run in the browser console. Please keep in mind you should never run a script you do not trust. 1. Go to the party page 2. Find the ID of the egg you want to see ‘hatch’. This must be an egg, it does not work with a Pokemon. Ideally this should be a ready-to-hatch egg of the same species you want to see ‘hatch’ Copy the URL of the egg’s summary, the part after the last / is its ID. 3. Open your browser’s Developer Tools. Right click on the page background and select ‘Inspect Element’, or access Developer Tools from your browser’s toolbar. Switch to the ‘Console’ Tab 4. Copy the code below and modify the first few lines before the /* --- */. species – The name of the species gender – f, m or n hatched_sprite - The URL of the image of the sprite you want to see hatch (e.g. a melan skiddo sprite) gem - The type of gem you want to hatch with the pokemon pokemon_id – The ID of the egg to run the hatch animation on 5. You may want to edd this line as well: If you want to see melan sparkles, put a // before every shiny1 and shiny2 except the lines ending with melan1.png and melan2.png v = { cracks : "https://pfq-static.com/img/pkmn/cracks.png", //shiny1 : "https://pfq-static.com/img/particles/shiny1.png", //shiny2 : "https://pfq-static.com/img/particles/shiny2.png", //shiny1 : "https://pfq-static.com/img/particles/albino1.png", //shiny2 : "https://pfq-static.com/img/particles/albino2.png", shiny1 : "https://pfq-static.com/img/particles/melan1.png", shiny2 : "https://pfq-static.com/img/particles/melan2.png", }
species = `Skiddo` gender = `f` hatched_sprite = `https://pfq-static.com/img/pkmn/t/u/9/x.png/t=1543796180` gem = 'Grass' pokemon_id = `F8Cgx` /* ----- */ c = pokemon_id a = $(`[data-pid="${c}"]`) b = { gems: `<img src="https://pfq-static.com/img/items/gem_${gem.toLowerCase()}.png/t=1369079719" class="itemsprite" alt="${gem} Gem" data-tooltip/>`, name: `<a class="summarylink" draggable="false" href="/summary/F8CqW" style="width:184px">${species}</a><img src="https://pfq-static.com/img/pkmn/gender_${gender}.png/t=1401213007" title="[F]"/>`, sprite: hatched_sprite, } n = $(`[data-pid="${c}"] > div.pkmn`) e = hatched_sprite v = { cracks : "https://pfq-static.com/img/pkmn/cracks.png", //shiny1 : "https://pfq-static.com/img/particles/shiny1.png", //shiny2 : "https://pfq-static.com/img/particles/shiny2.png", //shiny1 : "https://pfq-static.com/img/particles/albino1.png", //shiny2 : "https://pfq-static.com/img/particles/albino2.png", shiny1 : "https://pfq-static.com/img/particles/melan1.png", shiny2 : "https://pfq-static.com/img/particles/melan2.png", } q = function () { a.find(">.pkmn").html('<div class="pokemon" style="background-image: url(\'' + b.sprite + "')\"></div>"); a.find(">.name").html(b.name); a.find(">.expbar").css("visibility", "hidden"); a.find(">.action").html('<table><tr><td>Egg hatched!<br /><span class="hatchgems">' + b.gems + "</span><button>OK</button></td></tr></table>"); a.find(">.action button").on("click", function () { a.css("opacity", 0); var b = $(this); b.prop("disabled", !0); setTimeout(function () { ajax("summary/load", { id: c, smallberries: !0 }).success(function (b) { b = $(b.html); a.html(b.html()); a.css("opacity", "") }).failure(function () { b.prop("disabled", !1); a.css("opacity", ""); return !0 }) }, 500) }); a.trigger("pfq-hatch") } $.PFQanim.hatch(n,e,v,q)

QUOTE originally posted by FinalAbsolution

I also noticed that the code for hatching works on shelter eggs/eggs you don't own. Works the same way, grab the code of whatever egg you wanna see hatch and it'll do it if you're on the egg's page as long as nothing else is causing an error.
Thank you FinalAbsolution for discovering this!! Here's the journal post fae made on it!
DrWho's AvatarDrWho
DrWho's Avatar
Update 2020-12-09 This is now a "Sanctioned Userscript" and you can enable it at Farm > Options > Userscripts. More on this in the News annoucncement Sanctioned Userscripts
Note 20020-12-10 Just a reminder since it's been brought up a few times.. This code or any parts of it, like anything I post here, is and always has been free to use, modify and distribute for any commercial or non-commercial purposes. The block feature is useful to the community and the code is free for anyone to read, learn from or contribute to. Plus I had fun implementing and learning from it too. That's the only compensation I hoped for and I explicitly don't want any other. Let's release it under an MIT license to be specific :'D
Today I've started to write a QoL userscript you can use to block users. You can find the code, installation instructions and feature showcase here: https://gitlab.com/alythal/pfq-stuff Many players have said this feature is important to them, and a lot of time and effort has been put into writing up these reasons on the forums. So I hope I can contribute something that helps. If you think this is a good idea and want to see it go furhter, it would help a lot if you share feedback, how it works and what other features you'd like to see. If you want to contribute code, please add your name to the authors and submit a PR, or reach out to me directly. Note: If a user changes their username you will have to block their new usersname. Updates:
  • Threads created by a blocked user are now blocked. Thanks for the suggestion, anonymous PM!
DrWho's AvatarDrWho
DrWho's Avatar
Hi! Someone asked me how the template works where you can navigate left and right with arrows. I'm not sure what the best way to explain it - if I explain it line by line it may be too dense to read. But if you'd prefer that kind of post I'll make it! I think I'll try to give a basic rundown of what's happening, and a very minimal, commented version of the CSS. I think that'll make it easier to try it out yourself and use it for your own templates. As always if you have any suggestions, questions or you get stuck please post and I'll try my best to explain.
  • One
  • Two
  • Three
  • Four
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam placerat tempor felis vitae consequat. Donec at sapien sapien. Nulla lectus ipsum, ultricies id maximus eget, luctus id tellus.
Donec pellentesque ligula sit amet purus efficitur suscipit. Nunc nisi arcu, vulputate vel tortor et, volutpat malesuada lorem.
Etiam fermentum erat ac ultrices elementum. Ut at nibh justo. Vestibulum odio orci, sodales eu sapien et, consequat viverra risus.
Duis posuere sem enim, sit amet iaculis purus accumsan finibus. Proin ante arcu, ullamcorper a neque in, tempor ultricies metus. Donec at ipsum interdum, elementum mauris quis, efficitur dolor.
[sc=tabbed_interface horizontal] [ul] [li]One[/li] [li]Two[/li] [li]Three[/li] [li]Four[/li] [/ul] [sc=tab]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam placerat tempor felis vitae consequat. Donec at sapien sapien. Nulla lectus ipsum, ultricies id maximus eget, luctus id tellus.[/sc] [sc=tab]Donec pellentesque ligula sit amet purus efficitur suscipit. Nunc nisi arcu, vulputate vel tortor et, volutpat malesuada lorem.[/sc] [sc=tab]Etiam fermentum erat ac ultrices elementum. Ut at nibh justo. Vestibulum odio orci, sodales eu sapien et, consequat viverra risus.[/sc] [sc=tab]Duis posuere sem enim, sit amet iaculis purus accumsan finibus. Proin ante arcu, ullamcorper a neque in, tempor ultricies metus. Donec at ipsum interdum, elementum mauris quis, efficitur dolor.[/sc] [/sc] [style] /* ignore whitespace between elements */ .tabbed_interface { white-space: nowrap; &>ul>li, &>div { white-space: pre-line; } } /* reset styles */ .tabbed_interface, .tabbed_interface > ul, .tabbed_interface > ul > li, .tabbed_interface > div { padding: 0; margin: 0; background: none; box-shadow: none; border: none; border-radius: 0; } .tabbed_interface { --tab-height: 50px; --tab-width: 50px; & > ul { position: relative; min-height: var(--tab-height); /* previous tab */ & > li { position: absolute; height: var(--tab-height); width: var(--tab-width); background: black; color: white; } /* current tab */ & > li.tab-active { display: none; } /* next tab */ & > li.tab-active + li { left: 50px; } /* after the next tab */ & > li.tab-active + li ~ li { display: none; } } } [/style]

It is actually a .tabbed_interface. Usually when you click the n-th tab it takes you to the n-th page. We use CSS selectors to identify two special tabs:
  • The tab right before the current tab. This will be the left arrow.
  • The tab right after the current tab. This will be the right arrow
Note, you can't actually select the 'previous' tab - You'll have to select all the previous tab. You'll stack them and put them in one place, either using CSS grid or absolute positioning. That's your left arrow! Then you position the next tab as well - and that's it for a very basic version! If anyone wants I go on to extend the skeleton? Perhaps with the content boxes that go left and right smoothly, or the scrolling background?
DrWho's AvatarDrWho
DrWho's Avatar
Archived post. I made this template but prefer to take it down. Do with the code what you like, no need to reference or credit this post.

F2U About me/post template (It's the same code, it works as both sizes). The code has lots of variables so you can quickly change colors and spacing. I hope you like it!

variables example

As always I love to hear suggestions, ideas and to see what you do with the template. Questions and edits are welcome as always, if you need help just post here. I'd love to see if people make edits and share their version as well. Amazing F2U umbreon icon by Kiwicide @ deviantart Code here

Click to try different colors!

DrWho
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam placerat tempor felis vitae consequat. Donec at sapien sapien. Nulla lectus ipsum, ultricies id maximus eget, luctus id tellus. F2U Umbeon Icon by Kiwicide @ deviantart
Donec pellentesque ligula sit amet purus efficitur suscipit. Nunc nisi arcu, vulputate vel tortor et, volutpat malesuada lorem.

hide title

hide content
Table header ATable header B
Table cellAnother table cell
Etiam fermentum erat ac ultrices elementum. Ut at nibh justo. Vestibulum odio orci, sodales eu sapien et, consequat viverra risus.
Duis posuere sem enim, sit amet iaculis purus accumsan finibus. Proin ante arcu, ullamcorper a neque in, tempor ultricies metus. Donec at ipsum interdum, elementum mauris quis, efficitur dolor.
DrWho
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam placerat tempor felis vitae consequat. Donec at sapien sapien. Nulla lectus ipsum, ultricies id maximus eget, luctus id tellus. F2U Umbeon Icon by Kiwicide @ deviantart
Donec pellentesque ligula sit amet purus efficitur suscipit. Nunc nisi arcu, vulputate vel tortor et, volutpat malesuada lorem.

hide title

hide content
Table header ATable header B
Table cellAnother table cell
Etiam fermentum erat ac ultrices elementum. Ut at nibh justo. Vestibulum odio orci, sodales eu sapien et, consequat viverra risus.
Duis posuere sem enim, sit amet iaculis purus accumsan finibus. Proin ante arcu, ullamcorper a neque in, tempor ultricies metus. Donec at ipsum interdum, elementum mauris quis, efficitur dolor.
DrWho
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam placerat tempor felis vitae consequat. Donec at sapien sapien. Nulla lectus ipsum, ultricies id maximus eget, luctus id tellus. F2U Umbeon Icon by Kiwicide @ deviantart
Donec pellentesque ligula sit amet purus efficitur suscipit. Nunc nisi arcu, vulputate vel tortor et, volutpat malesuada lorem.

hide title

hide content
Table header ATable header B
Table cellAnother table cell
Etiam fermentum erat ac ultrices elementum. Ut at nibh justo. Vestibulum odio orci, sodales eu sapien et, consequat viverra risus.
Duis posuere sem enim, sit amet iaculis purus accumsan finibus. Proin ante arcu, ullamcorper a neque in, tempor ultricies metus. Donec at ipsum interdum, elementum mauris quis, efficitur dolor.
DrWho
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam placerat tempor felis vitae consequat. Donec at sapien sapien. Nulla lectus ipsum, ultricies id maximus eget, luctus id tellus. F2U Umbeon Icon by Kiwicide @ deviantart
Donec pellentesque ligula sit amet purus efficitur suscipit. Nunc nisi arcu, vulputate vel tortor et, volutpat malesuada lorem.

hide title

hide content
Table header ATable header B
Table cellAnother table cell
Etiam fermentum erat ac ultrices elementum. Ut at nibh justo. Vestibulum odio orci, sodales eu sapien et, consequat viverra risus.
Duis posuere sem enim, sit amet iaculis purus accumsan finibus. Proin ante arcu, ullamcorper a neque in, tempor ultricies metus. Donec at ipsum interdum, elementum mauris quis, efficitur dolor.

Forum size

DrWho
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam placerat tempor felis vitae consequat. Donec at sapien sapien. Nulla lectus ipsum, ultricies id maximus eget, luctus id tellus. F2U Umbeon Icon by Kiwicide @ deviantart
Donec pellentesque ligula sit amet purus efficitur suscipit. Nunc nisi arcu, vulputate vel tortor et, volutpat malesuada lorem.

hide title

hide content
Table header ATable header B
Table cellAnother table cell
Etiam fermentum erat ac ultrices elementum. Ut at nibh justo. Vestibulum odio orci, sodales eu sapien et, consequat viverra risus.
Duis posuere sem enim, sit amet iaculis purus accumsan finibus. Proin ante arcu, ullamcorper a neque in, tempor ultricies metus. Donec at ipsum interdum, elementum mauris quis, efficitur dolor.
IconicAnemone's AvatarIconicAnemone
IconicAnemone's Avatar
could you post the exact code for a signiture version of the template above this post?
Comms are open! Annie's Art Shop!
Sweet Heart

Sweet Heart

Consumable

(: 0)

A heart-shaped chocolate given to you by someone who cares about you! Feed to a Pokémon to boost Happiness by 20.

Sells for 1

Lv. 100 — +11,563,601
Aspear BerryAspear Berry
Aspear Berry (SOUR)
Cheri BerryCheri Berry
Cheri Berry (SPICY)
Chesto BerryChesto Berry
Chesto Berry (DRY)
Pecha BerryPecha Berry
Pecha Berry (SWEET)
Rawst BerryRawst Berry
Rawst Berry (BITTER)
Likes:
Spicy food
Dark
Happiness MAX
Brave nature
carinae's Avatarcarinae
carinae's Avatar

quote

QUOTE originally posted by DrWho

Here's a free template! It works as a post template as well as an about me template. You can find the code here: https://gitlab.com/alythal/pfq-stuff/-/raw/master/about-me-pages
  • move left and right with < > buttons
  • background scrolls by a configurable abount when you navigate
  • sidebar that pops out
In the code you'll find some variables at the very start to quickly change the background, colours or fonts. When you want to dig deeper and edit anything you like you're of course free to do so :)
  • Page One
  • Page Two
  • Page Three

Page One

background by ingmar @ unsplash link eevee from the pokemon anime bottom text

hide

hide content
thisis
thisis
atable

Page Two

Page Two Content Page Two Content Page Two Content Page Two Content

Page Three

Page Three Content
keep this for the background!
just wanted to say, i think you should add coding and background image credit somewhere else, not in the three lines! i've seen some users removing the credit.
elliot • they/them quit, dm xim#7352 if you need me

Pages: 123··· 678

Cannot post: Please log in to post

© PokéFarm 2009-2024 (Full details)Contact | Rules | Privacy | Reviews 4.6★Get shortlink for this page