Coder Social home page Coder Social logo

gdcolon / gdbrowser Goto Github PK

View Code? Open in Web Editor NEW
332.0 20.0 163.0 52.87 MB

A website that lets you browse all of Geometry Dash's online features, and more!

Home Page: https://gdbrowser.com

License: MIT License

JavaScript 58.76% CSS 5.53% HTML 35.71%
geometry-dash geometry-dash-api

gdbrowser's Introduction

hi, this is colon from the future.

what the FUCK was wrong with me back then???? seriously this is some of the worst code i've ever seen

welp, here's the readme. but you've been warned,,,

GDBrowser

Uh... so I've never actually used GitHub before this. But I'll try to explain everything going on here.

Sorry for my messy code. It's why I was skeptical about making this open source, but you know what, the code runs fine in the end.

How do I run this?

If you're just here to use GDBrowser locally because the site is down or blocked or restricted or god knows what, this is the only part you really need to read

To run GDBrowser locally:

  1. Install node.js if you don't already have it
  2. Clone/download this repository
  3. Open cmd/powershell/terminal in the main folder (with index.js)
  4. Type npm i to flood your hard drive with code that's 99% useless
  5. Type node index to run the web server
  6. GDBrowser is now running locally at http://localhost:2000

If you want to disable rate limits, ip forwarding, etc you can do so by modifying settings.js. Doing this is probably a good idea if you feel like obliterating Rob's servers for some reason. (please don't)

Using this for a GDPS?

I mean, sure. Why not. Hold up, wait a minute... private servers are an official feature now!

If you would like to add your GDPS to GDBrowser, fill out this quick form and I'll be happy to add it (provided the server is relatively large and active)

If you 100% insist on adding a private server to your own magical little fork, you can do so by adding it to servers.json. Simply add a new object to the array with the following information:

identifier description
name The display name of the server
link The server's website URL (unrelated to the actual endpoint)
author The creator(s) of the server
authorLink The URL to open when clicking on the creator's name
id An ID for the server, also used as the subdomain (e.g. something would become something.gdbrowser.com)
endpoint The actual endpoint to spam send requests to (e.g. http://boomlings.com/database/ - make sure it ends with a slash!)

There's also a few optional values for fine-tuning. I'll add more over time

identifier description type
timestampSuffix A string to append at the end of timestamps. Vanilla GD uses " ago" string
demonList The URL of the server's Demon List API, if it has one (e.g. http://pointercrate.com/ - make sure it ends with a slash!) string
disabled An array of menu buttons to "disable" (mappacks, gauntlets, daily, weekly, etc). They appear greyed out but are still clickable. array
pinned "Pins" the server to the top of the GDPS list. It appears above all unpinned servers and is not placed in alphabetical order. bool
onePointNine Makes a bunch of fancy changes to better fit 1.9 servers. (removes orbs/diamonds, hides some pointless buttons, etc) bool
weeklyLeaderboard Enables the lost but not forgotten Weekly Leaderboard, for servers that still milk it bool
substitutions A list of parameter substitutions, because some servers rename/obfuscate them. (e.g. { "levelID": "oiuyhxp4w9I" }) object
overrides A list of endpoint substitutions, because some servers use renamed or older versions. (e.g. { "getGJLevels21": "dorabaeChooseLevel42" }) object

Folders

GDBrowser has a lot of folders. [citation needed]

I pride myself in keeping my files neat, without doing the whole src/main/data/stuff/code/homework/newfolder/util/actualcode garbage

Most folders contain exactly what you'd expect, but here's some in-depth info in case you're in the dark.

API

This is where all the backend stuff happens! Yipee!

They're all fairly similar. Fetch something, parse the response, and serve it in a crisp and non-intimidating JSON. This is probably what you came for.

Assets

Assets! Assets everywhere!

All the GD stuff was ripped straight from the GD spritesheets via Absolute's texture splitter hack. If you want a nice categorized version, I've done all the dirty work for you.

I'd explain what's in all the subfolders but it's pretty obvious. I tried my best to organize everything nicely.

Classes

What's a class you ask? Good question.

I guess the best way to put it is uh... super fancy functions???

Level.js parses the server's disgusting response and sends back a nice object with all the level info

XOR.js encrypts/decrypts stuff like GD passwords

HTML

The HTML files! Nothing too fancy, since it can all be seen directly from gdbrowser. Note that profile.html and level.html (and some parts of home.html) have [[VARIABLES]] (name, id, etc) replaced by the server when they're sent.

Misc

Inevitable misc folder

Level Analysis Stuff (in a separate folder)

name description
blocks.json The object IDs in the different 'families' of blocks
colorProperties.json Color channel cheatsheet
initialProperties.json Level settings cheatsheet
objectProperties.json Object property cheatsheet. Low budget version of AlFas' one
objects.json IDs for portals, orbs, triggers, and misc stuff

Everything Else

name description
achievements.json List of all GD/meltdown/subzero/etc achievements. parseAchievementPlist.js automatically creates this file
achievementTypes.json An object containing different categories of achievements (stars, shards, vault, etc) and how to identify them
credits.json Credits! (shown on the homepage)
dragscroll.js Used on several pages for drag scrolling
global.js Excecuted on most pages. Used for the 'page isn't wide enough' message, back button, icons, and a few other things
music.json An array of the official GD tracks (name, artist)
sampleIcons.json A pool of icons, one of which will randomly appear when visiting the icon kit. Syntax is [Name, ID, Col1, Col2, Glow]
secretStuff.json GJP goes here, needed for level leaderboards. Not included in the repo for obvious reasons

happy gdbrowsing and god bless.

gdbrowser's People

Contributors

101arrowz avatar alphalaneous avatar asdfd3v avatar boss-gamerdev avatar dimtpap avatar gamingascz avatar gavhern avatar gdcolon avatar gdjosef avatar gducrash avatar hiimjustin000 avatar iandyhd3 avatar jozsefsallai avatar kontrollfreek avatar nadwey avatar nicknamegg avatar oftenuser avatar punctuations avatar qimiko avatar rudxain avatar starpelly avatar sudocode1 avatar tildeman avatar toxicscientist avatar vimaexd avatar wegfan avatar xparadoxical avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gdbrowser's Issues

I want to load "/api/profile/id" data through 'accountID'.

Currently in id "/api/profile/id" api, id only works with playerID. Can I load this with accountID? I looked at the api documentation, but I could not find it. As expected, I think it's not woking yet on GDBrowser, or only accountID cannot be loaded from GD's load data php.
Is there any way to add this function or load playerID by accountID only?

password bug

if you go on a level information to see its password and if the password of the level starts with a 0, the 0 won't be shown.
i think it's because you saved the passwords as an integer and so the code says that for example if the password is 0688 that it equals to 688 so it'll show 688 instead of 0688
to fix it you have to save the passwords as a string instead of an integer.
have a nice day

Find better dragscroll script

Find a script that supports drag scrolling (comments, searching, etc) but also allows you to select text.
(Is it normal to submit issues for your own project? I'm just doing this so I don't forget :P)

[Feature Request] Import save data for level progress (and potentially the icon kit?)

When saving data to the cloud, it also saves the progress you have on levels, both normal and practice. It also saves attempts, I believe.

It would be pretty cool to be able to load your account data to save your progress, and potentially even be able to use it to comment on GDBrowser.

The icon kit might also be nice to add for this feature as well.

Analysis of Old Levels with Colors

I'll be honest here: I was planning on doing this myself (and had - at the expense of 2.0 color support).
The header colors are parsed the exact same way minus some things:
Opacity is always 1, there are no copied colors, and they're not in the kS38 header but split into many more header values.
One thing is that I have no idea how it should be integrated into the API, you could either do it the 1.9 way and send it as part of the settings, which would require anything using the API to deal with it or parse it into the 2.1 format, which would require the API itself to deal with it.

[FEATURE REQUEST] Full-fledged level editor/viewer

This is a far-future idea, but at some point levels can be edited (or at least viewed, which would be a lot easier I'd think) in the browser and offer the option to download it to a user's computer. Heck, with a physics engine you could even play it!

We can abuse others' hard work to determine what is what in the encrypted data. I have no C# experience (only some Java) but I can probably try to steal it all port their code over to Node.js.

Let me know if this is an idea for the future or if it isn't a goal for GDBrowser.

(By the way, that code is one part of the parsing step - UI is a whole different animal. If this is an idea, it definitely won't be possible without at least three or four weeks of work by multiple people. Also, I know analyze.js already exists, but this is an extension of it. Maybe you've already seen the GDE project and used it for analyze.js but again this is an idea.)

add music to the site

maybe add the menu music to the site? add a volume slider so people can turn it off if they want to. it would make the geometry dash "aesthetic." just an idea tho.

Display trail and death effect on GD user profiles

I'm not sure if these get sent at all with the other icon data, but if they do it could be pretty handy to have them be displayed along the rest of the selected icon data. Also, maybe display the swing gamemode along the icons as well, so people know what it'll look like come 2.2?

Would also be handy to display default mini icon settings, dash fire colour settings, spider teleport effect settings and wave trail colour settings in the profile as well but I doubt those get sent over the server at all.

Analyze URL in documentation is wrong

Title says it all. In the API documentation the URL for level analysis is "api/leaderboardLevel/levelID" instead of "api/analyze/levelID. Would do PR but it's too minor so eh.

Comment/Leaderboard buttons being dumb

In some cases, the buttons on the comment or leaderboard page stop working, most likely because the code did an oopsie somewhere. No errors logged. Happens when page 1 of compact comments is too small, or when weekly leaderboards are empty.

To anyone reading this who isn't me: Don't worry, I'll figure out this one myself, just putting this issue so I remember about it

Cannot find module "SecretStuff.json"

npm install: npm notice created a lockfile as package-lock.json. You should commit this file. added 267 packages from 215 contributors and audited 539 packages in 241.841s found 0 vulnerabilities
node index.js Error: Cannot find module './misc/secretStuff.json'
Did i miss anything? I thought this file already existed after i ran npm install.

Using a CDN to improve load time

If the server ever gets very overloaded, something that can help loading assets and fonts is a CDN. I use a CDN Bunny which is very inexpensive. In fact, my credits for my CDN account are hardly depleted even though I use the CDN for 5 different sites! If you wanted a CDN, you could use my account if you wanted to save on the $10 minimum account deposit which you will definitely not need to use all of (I speak from experience.)

some sort of visual bug

I've gotten about three or four bug reports with something along the lines of this:
(glitchy auto faces)

Any of y'all have any ideas on what's causing it?
Screenshot is freshly harvested from a Discord DM.

image

Cannot search for levels with song Stay Inside Me

There are levels such as 35032968 which are hacked to have practice mode music set as the level's actual theme, but searching with Stay Inside Me set to the song name doesn't work, and there's not enough room to fit "Practice: " before it either.

GDBrowser sends bugged status messages to GD

When sending a status to GDBrowser, it looks fine on the site:

But on Geometry Dash, it looks... well, different:

For comparisons sake, here’s a normal status:

Which works as expected on GDBrowser:

Alternative way to fill in names for default songs

Since it takes time to type in the name of a song, maybe there could be a faster way to input song names? One thought would be to have a button which could be pressed, revealing a menu with the name of each song, and clicking on the name of such a song would automatically input it as text into the input text box. Would be quicker for the ones with longer names

Use flexbox instead of hardcoded values

I'm starting to feel that I'm making so many issues and PRs that I'm being annoying, so please let me know if that's the case and I'll take the pace down a notch haha.

Flexbox is a CSS layout format that allows content to resize based on the amount of space it's allotted and removes the need to hardcode values such as padding-right: 11% to make three items in a <div> symmetrical. Instead, we use flexbox with justify-content: space-between and simply put the three items in. The browser puts space between the elements for us, automatically and evenly. There's other benefits such as align-items: center to automatically align things vertically. It's really cool, and I suggest you take a look even if you decide it isn't the right call for GDBrowser.

I'm only making this issue because there are many places when seemingly random values are coded in where flexbox would serve much better.

Thanks for reading!

Daily enhancements

I’ve noticed that daily was unchanged for a while. If this ever happens again, it breaks the daily page. Is there a way to fix this, for example GDProfiles’ daily page? After all, there is a node.js package for accessing the API here, but I have no idea how limited it is for dailies and weeklies.

edit: ok i was kinda harsh to robtop ngl

Stereo Madness instead of actual songs on Search page

Certain songs display as Stereo Madness instead of the actual song when on the Search page (doesn't happen on Level page)

Only song I have found that causes this issue right now is Zyzyx - Pixel Jungle (Ravitex remix)

Stereo Madness instead of actual song

[Feature Request] A rewrite.

I as a primary JavaScript developer am willing to help out with an overall code rewrite, or to maintain one if allowed by you. I understand if you wish not to by virtue of the code working; but I ask if I may help out with such on the basis of improvement and to make it easier on future contributors to help out with the codebase, such as myself; to improve and build upon what is provided here.

I primarily say this not out of spite or disgust with the current codebase, but as a helping figure.

Redo download.js

Get all the information through search.js, and then switch over to download.js for the extra stuff. Saves the need for like 3-4 different requests to the GD servers

Use best practices on frontend

There are three things that could be improved on the frontend for GDBrowser.

Firstly, build tooling should be used. Build tools bundle together multiple files while minifying and improving cross-platform compatibility. If the Parcel bundler is used, the users could get the website delivered much faster and have it work on nearly any browser.

Using build tools goes hand in hand with making the website an SPA, or single-page application. The name should misleading; the main change will be putting all the HTML into one file and changing the shown page via JavaScript. This will make loading new pages instantaneous and has other benefits. This can be implemented by having multiple <section> tags that enclose the individual pages, having them all hidden by default, and showing them a certain page when their path matches that page's name. There are a couple more complex elements involved, such as using the Browser History API, but if you agree with this idea I'll submit a PR so you won't need to worry about it.

Lastly, removing jQuery is also a good idea. It's buggy, has security vulnerabilities, adds a ton to bundle size, and every feature it has can be replaced easily with native JS. That's why it isn't used in modern web development. Check out You Might Not Need jQuery. Again, I can submit a PR with the changes.

Its also possible to use a JS-based UI library such as React, which I'm very experienced with, but that requires a complete rewrite off the app, and it's hard to learn. That's why I'm not recommending it.

Let me know which (if any) of these suggestions you'd like me to implement. Thanks for taking the time to read!

Improve Documentation

The server side code is mostly undocumented and are therefore hard to read. As an example, the LOADMODULES.js file, as far as i can tell, recursively goes through the /api directory and requires each file in it. Because of odd coding practices (like using a ternary when we could just use logical OR) it took me a while to figure out.

PS: I'm not trying to diss your skills, hope I didn't come off too rude!

Replace PNG UI elements

I noticed that many of the images on the site are not actually used to their full resolution. There are many of them used as UI elements. This generally considered a bad practice but one that is hard to circumvent since many of GD's UI elements are shiny and complex graphics. I have some alternatives that can save on loading dozens of PNGs. 1. Using CSS for the more simple elements. An example of this is on the nav buttons for https://gdforums.com 2. Replacing PNGs with SVGs. GD's graphics aren't that complex and are generally made from many simple shapes and gradients. Converting the PNGs into SVGs, although time consuming due to some edge cases, can dramatically reduce the amount of data that gets sent on page load.

Make GDBrowser installable

Thanks for the shoutout in your video on GDBrowser! ❤️

I haven't been working on this lately because I was doing some other projects.

I still have the copy of the flexbox version of GDBrowser, and I highly, highly suggest you reopen and merge the PR... muh mobile support

Onto the actual content of the issue:

Modern browsers support installation of websites as applications on any device: be that a mobile phone (running Android or iOS), a Mac, a Windows machine, etc.

This uses a technology called the Service Worker, which saves all the files for offline use.

Here's an example. If you're using a modern version of chrome, you should see an "Install" button at the right side of the URL bar. You can install it, and it creates a shortcut on your desktop/home screen. When you open it, it doesn't open in Chrome, it opens in a separate window (which is actually just Chrome but it looks like a real, native app!)

I can make a PR for this if you want. The point is less the offline support and more the "ooh it's an app!" factor.

Oh yeah, and also I can make your servers able to handle a LOT more users, but you'll have to do some things you may not like, which I can elaborate on if you want later.

This idea goes hand in hand with mobile support. I know I'm being annoying but PLEASE consider asking your viewers to try the not-exactly-the-same-as-GD version and asking them if they mind or not. 42% of your users are not on desktop!

Cannot search for a mixture of non-demon and demon difficulties

Searching just seems to return only demon difficulties if you were on the demons page, or non-demons if you select from the non-demons page.

Might be best that all 13 difficulties are just displayed in the one shot instead of hiding all the demons behind a button.

Level analysis: Ability to display a full list of counts of each unique object

Currently the level analysis only displays specific object counts for triggers, rings, and groups the remaining objects into categories. I think there should be a more specific and in-depth analysis option as well, which lists all unique object types in order of their internal numeric ID.

Objects which cannot normally be accessed through the editor (e.g. old colour triggers, deprecated clubstep blocks) could have a separate font colour.

28651344 could be used to test this feature.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.