Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shittiest codepen known to man

i don't particularly like codepen; the layout's cramped and there are too many knobs and switches. this project is a codepen clone which is basically just a textarea and an iframe. it represents a couple hours of work, the maximum i was willing to invest in something "kinda useful". it ain't much but its ~~~honest work~~~ just the right balance of capability/simplicity for me.

whole thing is implemented using the VANILLA stack, where we just use the platform as is, for the frontend and deno for the backend.

here's an overview of the different files ordered by approximate importance:

  1. views/: templates for html shown to user
  2. src/server.ts: renders views in views/ + interacts with database through src/model.ts + notifies clients of changes using server-sent events
  3. src/model.ts: interacts with database + contains business logic
  4. src/config.ts: contains various configuration variables. can be overwritten with environment variables
  5. deno.lock: deno's dependencies are just urls. this file ensures there's no tomfoolery going on. flake.nix also uses this to achieve deterministic dependencies.
  6. deno.json: super boringgggg

at some point i'd like to...

  • add syntax highlighting. chris did this in vanilla js without too much work
  • remove trailing whitespace automatically
  • add support for multiple files. like glitch except only for static files and also way worse
  • isolate iframe in own process to avoid <script>while(1);</script> breaking editor

About

shittiest codepen clone

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages