Turning your phone into a virtual-joystick

Image
Update: I kept working on this and I have released it as a package for Windows, Linux and macOS. Check it out: https://github.com/zenineasa/joystick/releases/tag/v1.0.0 -- During the days when I was pursying my master's programme, my friends and I used to occasionally go to a classroom in the university, turn on a projector, connect devices like Nintento Switch or Gaming computers and loads of joysticks, and play different simple multiplayer games; MarioKart was my favourite. From time-to-time, when I get together with people, I ponder that it would be a good idea if I bought such devices. Indeed, I do have a laptop, which could easily run such games; SuperTuxKart is similar enough to MarioKart and it can run on Linux, Windows and Mac. However, I do not have joysticks with me at the moment. Therefore, I think it would be a good idea if I simply worked on a project that would enable using our phones as joysticks. From a high-level, the plan is to host APIs on a NodeJS server that wo...

How to remove Blogger (or any free blogging platform) credits from the footer

I am not sure if removing the footer credits is legal or not, but I just wanted to try doing it. As I searched the internet, I found several pages describing how it could be done by making some adjustments in CSS. However, I could not find an article which uses simple JavaScript commands to do the same. So, I decided the write this.

As you can see now, my footer does have Powered By Blogger credit signature. I am intending on keeping it that way until I am sure that removing it would not get me into any legal issues. I am just writing this article for the educational purposes.

Right click on the Powered By Blogger button and click on Inspect to have Chrome Developer tools loaded with the div that holds the credit content.



You can see that the element should have a content similar to the following. Notice that the div is having a class value blogger. We can use this to our advantage.

<div class="blogger">
<a href="https://www.blogger.com" rel="nofollow">
<svg class="svg-icon-24">
<use xlink:href="/responsive/sprite_v1_6.css.svg#ic_post_blogger_black_24dp" xmlns:xlink="http://www.w3.org/1999/xlink"></use>
</svg>
Powered by Blogger
</a>
</div>
As a JavaScript developer, the Console (Tab on the top) would always come in handy. I started trying in the following commands and I confirmed that this could be done.



  • document.getElementsByClassName('blogger')
    This returned an HTMLCollection with just one element in it. This confirms that the 0th element is the signature that we are looking for.
  • document.getElementsByClassName('blogger')[0].style.display = "none"
    As I ran the above command, the credit vanished. So that is what we need.




Now, you can add this JavaScript command in such a way that the command gets loaded after the credit is loaded. Therefore, I decided to put this up in a Gadget. Go to Layout > Add Gadget and click on HTML/JavaScript.



Add the following into the content and save.

<script>
document.getElementsByClassName('blogger')[0].style.display = "none";
</script>



Now, just refresh your blog and you can observe the Powered By Blogger credit gone. You use the same technique to remove almost all credits from different Blogging service provider, different free website hosting services, etc.

Comments

Popular posts from this blog

First impression of Lugano - Mindblowing

Thinking about developing an opensource P2P social network

Created a video to help people get started with HexHoot