GithubHelp home page GithubHelp logo

stevebauman / showcode Goto Github PK

View Code? Open in Web Editor NEW
391.0 5.0 64.0 31.97 MB

Create beautiful images of code.

Home Page: https://showcode.app

License: MIT License

JavaScript 28.70% Vue 59.60% PHP 8.63% CSS 2.58% TypeScript 0.33% HTML 0.16%
netlify screenshots utility

showcode's Introduction

Create beautiful images of code.

Showcode API

Showcode can also be accessed via an API. View the documentation here:

https://api.showcode.app/docs

Showcode Desktop

Showcode can also be purchased as a standalone desktop application:

https://showcode.app/buy

Thank you for your support! πŸ™

Local Installation

  1. Clone the git repo
  2. Run npm install && npm run dev
  3. Visit http://localhost:3000

showcode's People

Contributors

ash-jc-allen avatar bradestey avatar dimaslz avatar johnathonkoster avatar lupinitylabs avatar stevebauman 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

showcode's Issues

Consider drag handles on window

The image constraints can be adjusted by drag handles, however there is a "window padding" control to effectively adjust the constraints of the code window.

It would probably feel more consistent to allow changing the size of the window using drag handles as well?

[idea]: github sync

By Github personal token or log in with the account, store all snippets in a repo.

I donΒ΄t know if could be useful, but I prefer to share the idea.

I like this kind of tool, I work in dev-tools also :).

Background Padding control conflicts with dragging

The background padding control is a little confusing, because it seems to compete with the drag resizing / is not properly synched with the image dimensions. I recorded a video to illustrate that.

Basically the background padding makes sure you cannot make the image smaller than the padding, which is good.

However, the padding is not added to the dimensions shown beneath the drag handles. When resizing the image afterwards using the handles, there is a dead zone of (backgroundPadding * 2) px where the dimensions increase, but the image does not get bigger. That's easy to explain, since it does not get added to the actual dimensions as stated earlier, so the top and bottom padding needs to be caught up to first.

Resizing-Issue.mp4

Switching theme using arrow keys?

When you have selected a theme and press up/down key, it only switches the theme once and then the select becomes inactive. I think it would be better if you could just keep pressing up/down key to switch between themes. this might be a bug.

Ability to recall / save settings

πŸ’œ Seriously love this tool!

I would love to be able to easily recall the settings of past code exports. Maybe the initial implementation can be as simple as saving the last known settings in localStorage?

Thanks for considering this feature!

Being able to flip code and preview

I'm probably a bit weird like this, but I would love to be able to code on the right side.

Somehow my wires get crossed when I "code" on the left, and see the results on the right.

Create tests

Marking this as a bug for importance. Showcode should have tests.

Can't drag the window horizontally to make the image wider

Screen.Recording.2021-12-02.at.1.23.52.PM.mov

Often I'd like to have more of the background gradient shown so I want to make the image wider, but keep the code the same. It looks like this should work by dragging the side handles, but it doesnt.

The only way I can hack around it is to add a bunch of padding and then scale the padding back down

Feature request: Add emoticon menu?

πŸ‘€ I guess it would be really πŸ”₯ to add an emoticon menu somewhere on the code editor to easily add emoticons for illustration purposes. πŸ₯°

Copy to clipboard fails silently on Firefox

Firefox implemented support for ClipboardItem about a year ago (see https://bugzilla.mozilla.org/show_bug.cgi?id=1619947), but they still don't have it activated by default.

grafik

Unless the user manually sets dom.events.asyncClipboard.clipboardItem in about:config, clicking the copy button in the app will throw a ReferenceError: ClipboardItem is not defined that is unhandled.

I would suggest adding a .catch() handler in the promise resolved at

navigator.clipboard
, and/or to disable the copy button altogether (and probably showing a helpful message on how you can activate the feature) if typeof ClipboardItem === 'undefined'.

I would do a PR for it myself, but I don't want to mess around in your code without knowing how you would want that handled.

Performance issues in Google Chrome

Hey there, first of all: loving the app.

I used the app today and saw that there were some updates. This new version, however, had some performance issues in Chrome for me. In Firefox, the app works fine. The issue was encountered today for the first time, but the preview time I used it was October 16th. Back then, the performance issues weren't showing yet.

The performance issues start when I want to type some new code in the editor. All other buttons and options work fine for me. When typing, it can take up to 20 seconds before the code is shown in the editor. This is fine when it only happens in the preview. But the editor itself should be performant IMO.

Export of configuration
{
  "tab": {
    "id": "ed1005d4-b60c-4164-825d-6297713ea1a4",
    "created_at": "2021-12-10T10:07:29.435Z",
    "name": "Advent of Code"
  },
  "page": {
    "editors": [
      {
        "id": "57bfdd34-e361-46d0-a52f-05502fce70e9",
        "tabSize": 4,
        "language": "php",
        "value": "<?php\n\n$input = explode(PHP_EOL, file_get_contents('puzzle-input.txt'));\n\n$answer = collect($input)\n    ->map(fn (string $line) => new LineSyntaxChecker($line))\n    ->each(fn (LineSyntaxChecker $line) => $line->validate())\n    ->reject(fn (LineSyntaxChecker $line) => $line->isValid())\n    ->groupBy(fn (LineSyntaxChecker $line) => $line->errorScore())\n    ->map(fn (Collection $lines, int $score) => $score * $lines->count())\n    ->sum();\n\necho 'hello world';"
      }
    ],
    "sizes": [
      40,
      60
    ],
    "orientation": "landscape",
    "previousOrientation": null
  },
  "settings": {
    "width": 799,
    "height": 408,
    "showHeader": true,
    "showTitle": true,
    "showShadow": true,
    "showColorMenu": true,
    "showLineNumbers": false,
    "background": "conic-26",
    "backgroundPadding": "32",
    "themeType": "dark",
    "themeOpacity": 1,
    "themeName": "material-default",
    "themeBackground": "rgba(38,50,56,1)",
    "borderRadius": 12,
    "fontSize": 16,
    "lineHeight": "22",
    "padding": "16"
  }
}

I did a performance run in Chrome. If you open the image in a new tab, you may see something useful there. I'm not sure what I'm looking at but I thought I'd share it anyway.

Screenshot of performance run in Chrome

image

If there is any more information you need of tests I can run for you, please let me know. I'm not sure what is causing this problem. If I have to take a wild guess, the image gets regenerated on every keypress and Chrome sends a lot of power to that rendering process.

Automatically resize for 16:9 aspect

16:9 is the ideal for posting to twitter due to cropping, would be nice if there was a "Make 16:9" button that would resize the background or padding so the exported image would crop nicely on twitter

Ability to add custom backgrounds

Store the used ones in localstorage so that they can be reused in the future.

Maybe check out what Carbon uses for the UI to set colors & gradients

Ability to change blur strength

Sometimes I'd like to blur out some lines not because I'd like to hide them, but because I'd like to de-emphasize them. The current blur is good for hiding code, but it's too strong for just de-emphasizing.

Changing the blur strength would be a good solution to this.

Alternatively, let the users pick an "emphasis mode" where they could pick if they want to blur the non-emphasized lines, or if they want to lower their opacity (again to a configurable number). That'd probably be even better than blur for some things.

Project title is not used for exported image filename

Even if the "project" title is changed to something else than Untitled-1, the exported image will still be named Untitled-1.png/jpg/svg.

Also, every exported image is called Untitled-1, even if I have multiple tabs open.

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.