Git Product home page Git Product logo

codepan's Introduction

CodePan

CircleCI chat

Play with JS/CSS/HTML so simple it hurts, the web playground that works offline.

Why

Aren't there already JSBin/CodePen/JSFiddle?

Yep! So why not one more? And this one could work offline for you!

How? codepan is just a single page app with no-backend! Built with Webpack and Vue.js, and the offline feature is provided by offline-plugin.

Browser Support

We aim to support latest version of Chrome, Safari, Firefox and Microsoft Edge.

Development

Clone this repository and install dependencies by running yarn, then:

  • yarn dev: Run in development mode
  • yarn build: Build in production mode
  • yarn lint: Run eslint

License

MIT ยฉ EGOIST

codepan's People

Contributors

egoist avatar fimars avatar jgierer12 avatar margani avatar prozi avatar realzcong avatar stroncium avatar thysultan 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codepan's Issues

Behind proxy with context

Hi there,

I found this pretty neat and cool ๐Ÿ‘ , but when i try to run behind a proxy server with a context like "xxx.com/codepan/", the asset path is not going under the context, I am not familiar with vuejs with poi, is there anyway to achieve that?

Thanks!

(index):68 GET http://xxx.com/vendor.js net::ERR_ABORTED
(index):68 GET http://xxx.com/client.js net::ERR_ABORTED
(index):68 GET http://xxx.com/manifest.js net::ERR_ABORTED
(index):68 GET http://xxx.com/vendor.js net::ERR_ABORTED
(index):68 GET http://xxx.com/client.js net::ERR_ABORTED

Add Preview Mode Toggle

Hi,

I am working on some prototypes which are spacing intensive to test the usability on small screen or screen with lack of height. It would be great if we have a way to toggle the top navigation and the output heading, please consider, thanks! ๐Ÿ˜„

screen shot 2018-03-21 at 3 07 32 pm

Vue JSX does not support spread.

When using spread vue's JSX transform adds an import which can not be handled at the moment. You can replicate that by trying:

const App = {
  data: () => ({
  	sel: 2
  }),
  render() {
    return (
      <input type="checkbox" {...{}} />
    );
  }
}

new Vue({
  el: '#app',
  render: h => h(App)
})

Make Gists human-readable

Currently, CodePan stores Gists in a way that is not very readable. CodePan-generated Gists would be much better to share if they were readable by humans without viewing through CodePan.

I suggest the following:

  • Store all CodePan config like opened pans in a file like codepan.json

  • Store pan contents in separate files like index.html, index.js, index.css

  • Infer pan and transformer from file extension like this:

    Filename Pan Transformer
    *.html HTML HTML
    *.scss CSS SCSS
    *.ts JS TypeScript

    This can be overwritten in the CodePan config like so:

    codepan.json

    {
      "files": {
        "index.js": {
          "transformer": "babel"
        },
        "test.txt": {
          "pan": "html",
          "transformer": "markdown"
        }
    }

    Alternatively, a pragma comment could be added at the top of files:

    index.js

    // @codepan { transformer: 'babel' }

    test.txt

    <!-- @codepan { pan: 'html', transformer: 'markdown' } -->
  • If, by these rules, multiple files should be displayed in the same tab, only use the alphabetically first one for the sake of simplicity

  • Preserve line breaks and spacing

Following these rules, this Gist would be formatted like this instead.

By using sensible defaults for codepan.json, this would potentially also have the side effect of being able to open any Gist even if it wasn't created in CodePan!

Github login with OAuth is not working

Steps to reproduce:

  1. Click Github Login
  2. Click OAuth

The message below appears after a few seconds:

image

I am using Chrome 65 on Macos High Sierra 10.13.3

Thanks.

build command gives error

When trying to build the project, I am getting this error -

> [email protected] build /Users/brijesh/projects/codepan
> poi build

> Running in production mode
> Using external Poi config file
> location: "~/projects/codepan/poi.config.js"
> Using external babel configuration
> location: "~/projects/codepan/.babelrc"
> Using external HTML template file
> location: "~/projects/codepan/index.ejs"
> Using main field in package.json as entry point

TypeError: config.module.noParse.add is not a function
    at extendWebpack (/Users/brijesh/projects/codepan/poi.config.js:13:8)
    at webpackFlows.forEach.flow (/Users/brijesh/projects/codepan/node_modules/poi/lib/index.js:64:43)
    at Array.forEach (native)
    at handleOptions.then.options (/Users/brijesh/projects/codepan/node_modules/poi/lib/index.js:64:27)

 FAIL  Failed to start!

npm ERR! code ELIFECYCLE
...

Something to do with -

config.module.noParse
      .add(/babel-preset-vue/)

in poi.config.js

Interactive console.

It would be cool, if user could evaluate expressions in console tab, like in JSbin.

[Question] Embedding into HTML presentations?

Can one embed CodePan snippets into an HTML presentation and show the presentation offline?

My specific usecase is teaching JS, and sometimes classrooms have internet connection issues.

Import packages from unpkg.com

Currently it imports from bundle.run, but we can use a special syntax import React from '@unpkg/react to allow the use of unpkg.com ๐Ÿ˜…

Maybe not, a comment // @unpkg would be better.

`get-imports` is missing

Hey

It seems that with your "last" commit 663c58b you have changed the way imports are parsed and I assume you forgot to add get-imports.js file or am I missing smth?

Save button

A save button for the rendered iframe would be wonderful.

Promote 'Update Gist' button to top bar

The 'Update Gist' button currently is a bit hidden in the overflow menu, and I think it is important enough to place in the top bar instead. It could be just the save icon like this:

image

Would you accept a PR for this change?

Production build issue

This works fine for me in dev mode, but production builds fail if I load
./index.html
./dist/index.html

from the browser. My url looks like: localhost/codepan and it's in /var/www/html/codepan

Save width of open or resized columns

As a user, I would like width of resized tabs/columns to be saved, so that when I open or close any other tabs they do not automatically resize the other open ones.

For example sometimes it is enough to have Output as a very thin column, but when I toggle HTML or CSS the Output column gets wide again. Expected behaviour - the Output tab should remain thin.

Set library & settings through URL [Feature]

For example:

https://codepan.js.org/#/?npm=react&format=html,css

Initialize with the react package from npm and display just the html & css panels.

BTW nice work on this ๐Ÿ‘

add query string parameters for setting panel width

Issuehunt badges

Currently writing a course and embedding codepan iframes for experimenting with JS, yet having large console is a design problem for integration. I was thinking about something like what Glitch does: https://glitch-embed.glitch.me/#preview


IssueHunt Summary

Backers (Total: $100.00)

Submitted pull Requests


Become a backer now!

Or submit a pull request to get the deposits!

Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

Auto-run

run code as editor value changes.

Add preference panel

Use this panel to:

  • set editor options
  • toggle auto-save
  • switch editor theme
  • ...

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.