• Stars
    star
    3,462
  • Rank 12,874 (Top 0.3 %)
  • Language
    HTML
  • License
    MIT License
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The world smallest office suite

Awfice - the world smallest office suite

Awfice is a collection of tiny office suite apps:

  • a word processor, a spreadsheet, a drawing app and a presentation maker
  • each less than 1KB of plain JavaScript
  • each is literally just one line of code
  • packaged as data URLs, so you can use them right away, without downloading or installing
  • you can also use them offline
  • but they can't store their state, so whatever you type there would be lost on page refresh
  • which can be also sold as a "good for your privacy" feature
  • this project is only a half-joke, I actually use a few Awfice apps as quick scratchpads.
  • the only way to save your job is to save a HTML or send it to the printer/print to PDF.

Text editor - 59 bytes!

A simple rich text editor. Type whatever you want, it won't be saved anywhere, but it might be convenient for quick throwaway notes. You should be able to use Ctrl+B and Ctrl+I to mark text selection as bold or italic. Undo/redo should work as well. You can also copy/paste text and images from other sources.

Copy and add to bookmarks or open in the URL bar:

data:text/html,<body contenteditable style=line-height:1.5;font-size:20px>

Try it!

Spreadsheet - 679 bytes!

A very basic spreadsheet with math formulas. It has 100 rows and 26 columns (A..Z). If the value in the cell starts with an "=" = it is evaluated as a formula. You may refer to other cell values, i.e. "=(A10+A11)/A12". Under the hood it uses eval(), so be careful.

Copy and add to bookmarks or open in the URL bar:

data:text/html,<table id=t><script>z=Object.defineProperty,p=parseFloat;for(I=[],D={},C={},q=_=>I.forEach(e=>{try{e.value=D[e.id]}catch(e){}}),i=0;i<101;i++)for(r=t.insertRow(-1),j=0;j<27;j++)c=String.fromCharCode(65+j-1),d=r.insertCell(-1),d.innerHTML=i?j?"":i:c,i*j&&I.push(d.appendChild((f=>(f.id=c+i,f.onfocus=e=>f.value=C[f.id]||"",f.onblur=e=>{C[f.id]=f.value,q()},get=_=>{v=C[f.id]||"";if("="!=v.charAt(0))return isNaN(p(v))?v:p(v);with(D)return eval(v.slice(1))},a={get},z(D,f.id,a),z(D,f.id.toLowerCase(),a),f))(document.createElement`input`)))</script><style>#t{border-collapse:collapse}td{border:1px solid gray;text-align:right}input{border:none;width:4rem;text-align:center}</style>

Try it!

Drawing app - 327 bytes!

Nothing simpler than drawing on a blank canvas with mouse. Works with touch screens as well. To save your results... well, do a screenshot maybe...

Copy and add to bookmarks or open in the URL bar:

data:text/html,<canvas id=v><script>d=document,d.body.style.margin=0,P="onpointer",c=v.getContext`2d`,v.width=innerWidth,v.height=innerHeight,c.lineWidth=2,f=0,d[P+"down"]=e=>{f=e.pointerId+1;e.preventDefault();c.beginPath();c.moveTo(e.x,e.y)};d[P+"move"]=e=>{f==e.pointerId+1&&c.lineTo(e.x,e.y);c.stroke()},d[P+"up"]=_=>f=0</script></canvas>

Try it!

Presentation maker - 622 bytes!

Just a variant of a rich text editor with some hotkeys. There are 50 blank slides for you (I hope you don't need to bore your audience with more slides). Each slide is a rich text editor, but there are some hotkeys to make styling better:

  • Ctrl+Alt+1: Header
  • Ctrl+Alt+2: Normal style
  • Ctrl+Alt+3: Align left
  • Ctrl+Alt+4: Align center
  • Ctrl+Alt+5: Align right
  • Ctrl+Alt+6: Outdent
  • Ctrl+Alt+7: Indent
  • Ctrl+Alt+8: Make a list

Copy and add to bookmarks or open in the URL bar:

data:text/html,<body><script>d=document;for(i=0;i<50;i++)d.body.innerHTML+='<div style="position:relative;width:90%;padding-top:60%;margin:5%;border:1px solid silver;page-break-after:always"><div contenteditable style=outline:none;position:absolute;right:10%;bottom:10%;left:10%;top:10%;font-size:5vmin>';d.querySelectorAll("div>div").forEach(e=>e.onkeydown=e=>{n=e.ctrlKey&&e.altKey&&e.keyCode-49,f="formatBlock",j="justify",x=[f,f,j+"Left",j+"Center",j+"Right","outdent","indent","insertUnorderedList"][n],y=["<h1>","<div>"][n],x&&d.execCommand(x,!1,y)})</script><style>@page{size:6in 8in landscape}@media print{*{border:0 !important}}

Try it!

Code editor - 686 bytes!

A simple code editor. You can type in HTML, CSS & Javascript.

Copy and add to bookmarks or open in the URL bar:

data:text/html,<body oninput="i.srcdoc=h.value+'<style>'+c.value+'</style><script>'+j.value+'</script>'"><style>textarea,iframe{width:100%;height:50%;}body{margin:0;}textarea{width: 33.33%;font-size:18px;padding:0.5em}</style><textarea placeholder="HTML" id="h"></textarea><textarea placeholder="CSS" id="c"></textarea><textarea placeholder="JS" id="j"></textarea><iframe id="i"></iframe><script>document.querySelectorAll("textarea").forEach((t)=>t.addEventListener("keydown",function(t){var e,s;"Tab"==t.key&&(t.preventDefault(),e=this.selectionStart,s=this.selectionEnd,this.value=this.value.substring(0,e)+"  "+this.value.substring(s),this.selectionStart=this.selectionEnd=e+1)}))</script></body>

Try it!

Calculator - 657 bytes!

A simple calculator which supports the basic operational symbol to calculate.

Copy and add to bookmarks or open in the URL bar:

data:text/html,<table style="text-align: center;width:80vw;margin: 0 auto;"><tbody><tr><td colspan="4"><textarea></textarea></td></tr></tbody><script>let d=document;let tbl=d.querySelector('tbody');let z=d.querySelector('textarea');let oc=(x)=>z.value+=x;let cl=()=>z.value='';let re=()=>{try{z.value=eval(z.value);}catch(error){cl();}};[[1,2,3,'+'],[4,5,6,'-'],[7,8,9,'*'],['C',0,'=','/']].forEach((a)=>{let r=d.createElement('tr');r.style.lineHeight='64px';tbl.appendChild(r);a.forEach((b)=>{let tb=d.createElement('tb');tb.innerText=b;tb.style.padding='16px';tb.style.border='1px solid';r.appendChild(tb);tb.onclick=b==='='?re:b==='C'?cl:()=>oc(b);})})</script></table>

Try it!

Contributions

The code is distributed under MIT license. PRs are always welcome, especially if they fix something or make the code smaller, or add features that are valuable, but do not require a lot of code.

To modify something - edit HTML files directly. There is README.sh script that re-generates the README and embeds apps code into it.

More Repositories

1

lorca

Build cross-platform modern desktop apps in Go + HTML5
Go
7,954
star
2

jsmn

Jsmn is a world fastest JSON parser/tokenizer. This is the official repo replacing the old one at Bitbucket
C
3,633
star
3

fenster

The most minimal cross-platform GUI library
C++
513
star
4

tray

Cross-platform, super tiny C99 implementation of a system tray icon with a popup menu.
C
484
star
5

partcl

ParTcl - a micro Tcl implementation
C
467
star
6

metric

Minimal metrics for Go (counter/gauge/histogram). No dependencies. Compatible with expvar. Web UI included.
Go
353
star
7

luash

Tiny lua module to write shell scripts with lua (inspired by Python's sh module)
Lua
302
star
8

pt

Protothreads (coroutines) in C99. Highly portable, but work best in low-end embedded systems.
C
267
star
9

o

Tiny and simple React clone
JavaScript
249
star
10

lua-promises

A+ promises in Lua
Lua
216
star
11

log

Ultimately minimal (yet very convenient) logger for Android and Java
Java
157
star
12

tojvm

A toy JVM in Go
Go
156
star
13

webview-python

Python bindings to webview
Objective-C
151
star
14

bfapi

Resilient, scalable Brainf*ck, in the spirit of modern systems design
Go
144
star
15

nokia-composer

Nokia Composer in 512 bytes
HTML
125
star
16

expr

Fast and lightweight math expression evaluator in C99
C
119
star
17

hid

Simple HID driver for Go (pure golang, no dependencies, no cgo)
Go
119
star
18

zs

Absolutely minimal static site generator in Go (powers https://zserge.com)
Go
91
star
19

tinysh

Tiny UNIX shell, de-obfuscated, modernized, and "rewritten in Rust".
C
88
star
20

nanonn

A nano-framework for neural networks
Rust
83
star
21

dotfiles

git clone --bare https://github.com/zserge/dotfiles $HOME/.dotfiles && git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME checkout
Vim Script
79
star
22

lc3-forth

Post-Apocalyptic Computing: bootstrapping Forth environment for LC-3 CPU
C
79
star
23

1bitr

Minimalistic text-based 1-bit music tracker
C
73
star
24

carnatus

A tiny chess engine in Go (sunfish port)
Go
65
star
25

odetoj

Rewrite of Arthur Whitney's one-page J interpreter in Rust
Rust
61
star
26

headline

Ascetic RSS reader in JavaScript, no server required
JavaScript
57
star
27

glob-grep

A little experiment: compare the languages aimed to replace C
Zig
52
star
28

buckbone

A simple android project generator for the Buck build system
Shell
52
star
29

q

Tiny and simple VueJS clone
JavaScript
46
star
30

beep

Cross-platform beep() function
C
43
star
31

slide

An attempt to implement Trikita Slide for desktop
C++
39
star
32

figma-simplify-path

Figma plugin to simplify vector paths
JavaScript
26
star
33

mucks

A tiny terminal session manager for Tmux, Screen and DVTM
Shell
20
star
34

anvil-kotlin-demos

Minimal tutorial/demos for Anvil+Kotlin
Kotlin
18
star
35

zserge.github.io

My static site
HTML
14
star
36

kv

An ultimately minimal persistent key-value store + LRU cache
Go
12
star
37

jsmn.lua

The world fastest JSON parser ported to Lua
Lua
11
star
38

aint

Code for the "AI or AIN'T" blog posts
Go
11
star
39

yu

Yu is a tee-like tool, but with rotation feature like logrotate
C
10
star
40

tab

🎼 A tiny CLI tool to render tabs for music instruments (🎹🎷🎺🎸🪕🪈 and many others!)
C
9
star
41

bsoz

One of the most minimal MOS6502 and retro computer emulators!
C
8
star
42

mdns

Very pragmatic mDNS implementation in Go
Go
8
star
43

kveer

A tiny in-memory key-value storage in Go with optional persistence (atomic backup file, or append-only)
Go
7
star
44

bf

Well, everyone has to write a brainf*ck interpreter at some point
C
7
star
45

covered

Trello Cover Card Generator
JavaScript
6
star
46

toy-java-agent

Toy Java agent
Java
6
star
47

atomicwriter

Atomic file writes in Go (using a unique temporary file and atomic rename)
Go
5
star
48

lex

A library for writing lexers in Go
Go
4
star
49

textizer

Minimal android widgets in Scheme
Java
4
star
50

chess

JavaScript
4
star
51

ping

An ultimately minimal social network, messaging, pub/sub and home automation app
4
star
52

tinylangs

Real programming langauges in 50 lines of code
Python
4
star
53

photo

Minimalistic private photo booth
HTML
3
star
54

incr

incr.it backend
JavaScript
3
star
55

zine

Tiny CSS template to produce micro-zines (folded 8-page magazines)
Python
3
star
56

one-click-hugo-cms

CSS
2
star
57

grafana-zero

Python
2
star
58

gif

Simple GIF recorder
HTML
2
star
59

protoc-gen-micro

Protobuf code generation for micro
Go
2
star
60

scaffold

Templates for quick project start
Java
1
star
61

r

Something that rhymes. Or not.
1
star