Skip to content

Commit

Permalink
Merge pull request #4 from DeltaRager/delta-pizza-eleven
Browse files Browse the repository at this point in the history
Added option to remove vercel logo
  • Loading branch information
therealsujitk authored Oct 27, 2021
2 parents 80fca42 + fd6c35f commit 7241f3e
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 6 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,21 @@ For the application [`http://therealsujitk.vercel.app`](http://therealsujitk.ver

- **`?style=`** - The style of the badge. Available styles: **`flat`** (Default), **`flat-square`** & **`plastic`**.
- **`?root=`** - Use this paramater if you'd like to check the deployment of a different path. Example: To check the deployment of [`http://therealsujitk.vercel.app/projects/vercel-badge`](http://therealsujitk.vercel.app/projects/vercel-badge), specify root as `projects/vercel-badge`.
- **`?logo=`** - Use this paramater if you'd like to disable the vercel logo on the badge. Available values: **`true`** (Default), **`false`**.


To combine paramaters, use **`&`**. Example:

![Vercel](http://therealsujitk-vercel-badge.vercel.app/?app=therealsujitk-vercel-badge&style=flat-square&logo=false)

```http
http://therealsujitk-vercel-badge.vercel.app/?app=therealsujitk-vercel-badge&style=flat-square
http://therealsujitk-vercel-badge.vercel.app/?app=therealsujitk-vercel-badge&style=flat-square&logo=false
```

## Styles

| `flat` (Default) | `flat-square` | `plastic` | `for-the-badge` |
| ---------------- | ------------- | --------- | --------------- |
| ![Vercel](/public/assets/images/vercel-deployed-flat.svg) | ![Vercel](/public/assets/images/vercel-deployed-flat-square.svg) | ![Vercel](/public/assets/images/vercel-deployed-plastic.svg) | ![Vercel](/public/assets/images/vercel-deployed-for-the-badge.svg) |
| ![Vercel](/public/assets/images/vercel-not-found-flat.svg) | ![Vercel](/public/assets/images/vercel-not-found-flat-square.svg) | ![Vercel](/public/assets/images/vercel-not-found-plastic.svg) | ![Vercel](/public/assets/images/vercel-not-found-for-the-badge.svg) |
| ![Vercel](/public/assets/images/vercel-failed-flat.svg) | ![Vercel](/public/assets/images/vercel-failed-flat-square.svg) | ![Vercel](/public/assets/images/vercel-failed-plastic.svg) | ![Vercel](/public/assets/images/vercel-failed-for-the-badge.svg) |
| ![Vercel](/public/assets/images/logo/vercel-deployed-flat.svg) | ![Vercel](/public/assets/images/logo/vercel-deployed-flat-square.svg) | ![Vercel](/public/assets/images/logo/vercel-deployed-plastic.svg) | ![Vercel](/public/assets/images/logo/vercel-deployed-for-the-badge.svg) |
| ![Vercel](/public/assets/images/logo/vercel-not-found-flat.svg) | ![Vercel](/public/assets/images/logo/vercel-not-found-flat-square.svg) | ![Vercel](/public/assets/images/logo/vercel-not-found-plastic.svg) | ![Vercel](/public/assets/images/logo/vercel-not-found-for-the-badge.svg) |
| ![Vercel](/public/assets/images/logo/vercel-failed-flat.svg) | ![Vercel](/public/assets/images/logo/vercel-failed-flat-square.svg) | ![Vercel](/public/assets/images/logo/vercel-failed-plastic.svg) | ![Vercel](/public/assets/images/logo/vercel-failed-for-the-badge.svg) |
9 changes: 7 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const https = require('https');
app.use(express.static(__dirname + '/public'));

app.get('/*', (req, res) => {
var app = "", root = "", style = "flat";
var app = "", root = "", style = "flat", logo_path = "logo";
const query = req.query;

// The Vercel application name
Expand All @@ -22,6 +22,11 @@ app.get('/*', (req, res) => {
root = query["root"];
}

// To Logo or No to logo, that is the question - DeltaRager 2021
if ("logo" in query && query["logo"] == "false"){
logo_path = "no-logo"
}

// The style of the badge
if ("style" in query) {
if (query["style"] == "flat-square") {
Expand Down Expand Up @@ -50,7 +55,7 @@ app.get('/*', (req, res) => {
// 200 - 299 -> Successful Responses
// 100 - 199 -> Informational Responses

res.status(200).sendFile(__dirname + "/public/assets/images/vercel-" + status + "-" + style + ".svg");
res.status(200).sendFile(`${__dirname}/public/assets/images/${logo_path}/vercel-${status}-${style}.svg`);
}

try {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/assets/images/no-logo/vercel-deployed-flat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/assets/images/no-logo/vercel-deployed-plastic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/assets/images/no-logo/vercel-failed-flat-square.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/assets/images/no-logo/vercel-failed-flat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/assets/images/no-logo/vercel-failed-plastic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/assets/images/no-logo/vercel-not-found-flat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/assets/images/no-logo/vercel-not-found-plastic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit 7241f3e

@vercel
Copy link

@vercel vercel bot commented on 7241f3e Oct 27, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.