Something went wrong. Try again.
a proof of concept realtime collaborative text editor using atproto as a sync server jake.tngl.io/y-pds
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768@import url("./reset.css");
@import url("https://esm.sh/prosemirror-view/style/prosemirror.css");@import url("https://esm.sh/prosemirror-menu/style/menu.css");@import url("https://esm.sh/prosemirror-example-setup/style/style.css");@import url("https://esm.sh/prosemirror-gapcursor/style/gapcursor.css");
html { --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; font-family: var(--font);}
input,select,textarea { flex: 1; width: 100%; padding: 0.4rem 0.5rem; border: 1px solid #ccc; border-radius: 4px; font-size: 1.3125rem; background: #fff; transition: border-color 0.15s;
&:focus { outline-offset: 1px; outline: 2px solid rgba(from blue r g b / 0.5); }}
actor-typeahead { flex: 1;}
button { padding: 0.4rem 0.75rem; border: 1px solid #ccc; border-radius: 4px; background: #fff; font-size: 1.3125rem; font-family: var(--font); cursor: pointer; transition: background 0.15s;
&:hover { background: #f5f5f5; }
&:active { background: #eee; }}
label { display: block; flex: 1; width: 100%; font-size: 1.125rem;}
html,body { height: 100%;}
body { display: flex; flex-direction: column;}
#app { flex: 1; display: flex; flex-direction: column;}
.login { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 16px;}
.login-form { display: flex; flex-direction: column; gap: 8px; text-align: left;}
.login-blurb { font-size: 1.125rem;}
.loading { display: flex; width: 100%; height: 100%; justify-content: center; align-items: center; opacity: 0; animation: 1s fade-in 1s forwards;}
@keyframes fade-in { from { opacity: 0; }
to { opacity: 1; }}
.editor-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0;}
#editor { flex: 1; min-height: 0; overflow-y: auto; padding: 0; font-family: ui-serif, Georgia, serif; font-size: 1.5rem; line-height: 1.6;}
.ProseMirror { min-height: 100%; outline: none; padding: 1rem; margin-trim: block;
> :first-child, > :first-child p { margin-top: 0; }
> :last-child, > :last-child p { margin-bottom: 0; }}
.ProseMirror-menubar-wrapper { height: 100%;}
.ProseMirror-menubar { display: flex; padding-right: 0;}
.ProseMirror-menuitem { align-self: center;}
.ProseMirror-menuitem:has(.toolbar-right) { margin-left: auto; padding: 4px; flex-shrink: 0;}
.toolbar-right { display: flex; align-items: center; gap: 4px;}
dialog { overflow: visible; place-self: center; width: 100%; max-width: 720px; border: none; border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
&::backdrop { background: rgba(0, 0, 0, 0.25); }
header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #dddddd; }
> * { padding: 12px; }}
.icon-button { all: unset; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0.25rem; border-radius: 4px; color: #888;
&:hover { color: #333; background: #f0f0f0; }}
#editors { ul { list-style: none; }
&:empty { display: none; }
> li { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0;
.avatar { width: 32px; height: 32px; border-radius: 50%; }
.member-info { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
strong { font-size: 1.3125rem; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
small { font-size: 1.125rem; color: #888; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } } }}
.copy-link { display: flex; align-items: center; background: #f5f5f5; border-radius: 4px;
input { all: unset; flex: 1; color: #666; padding: 0.4rem 0.5rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.icon-button { flex-shrink: 0; }}
.share-footer { display: flex; flex-direction: column; gap: 12px;}
#add-member { display: flex; gap: 0.5rem; align-items: flex-end;}
.accounts-popover { position: fixed; inset: auto; top: 2.5rem; right: 0.5rem; width: 280px; padding: 0; margin: 0; border: 1px solid #ddd; border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); background: #fff;
&:popover-open { animation: popover-in 0.1s ease; }
header { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid #ddd; }
h2 { font-size: 1.3125rem; font-weight: 600; margin: 0; }}
@keyframes popover-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); }}
.accounts-list { list-style: none; margin: 0; padding: 8px 0; display: flex; flex-direction: column;
> li { display: flex; align-items: center; gap: 4px; padding: 0 8px;
&:not(.active):hover { background: #f0f0f0; }
&.active { background: #e8f0fe;
.account-row { cursor: default; } } }}
.account-row { all: unset; flex: 1; display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0; cursor: pointer; min-width: 0;
&:hover { background: transparent; }
.avatar { border-radius: 50%; flex-shrink: 0; }
.avatar-placeholder { width: 32px; height: 32px; border-radius: 50%; background: #e0e0e0; flex-shrink: 0; }
.member-info { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
strong { font-size: 1.3125rem; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
small { font-size: 1.125rem; color: #888; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } }}
.accounts-footer { border-top: 1px solid #ddd; padding: 10px 12px;
form { display: flex; gap: 0.5rem; align-items: flex-end; }}
.readonly-banner { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: #f8f8f8; border: 1px solid #ddd; border-radius: 8px; padding: 0.5rem 1rem; font-size: 1.2rem; color: #666; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); z-index: 10; white-space: nowrap; animation: 0.3s fade-in;}
.collab-cursor { position: relative; border-left: 2px solid var(--color); margin-left: -1px; pointer-events: none;}
.collab-cursor::after { content: attr(data-name); position: absolute; top: -1.4em; left: -2px; background: var(--color); color: white; font-size: 1.05rem; font-family: sans-serif; padding: 0 4px; border-radius: 3px 3px 3px 0; white-space: nowrap; pointer-events: none;}
/* ── Devtools panel ── */
.devtools-resize-handle { height: 6px; margin-top: -3px; margin-bottom: -3px; position: relative; z-index: 10; cursor: ns-resize; flex-shrink: 0;}
.devtools-panel { display: flex; flex-direction: column; border-top: 1px solid #ddd; background: #fff; font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace; font-size: 12px; zoom: 2;}
.devtools-header { display: flex; align-items: center; gap: 4px; background: #f5f5f5; border-bottom: 1px solid #e0e0e0; height: 32px; padding: 0 6px; flex-shrink: 0;}
.devtools-tabs { display: flex; height: 100%; margin-right: 4px;
button { all: unset; padding: 0 10px; font-size: 11px; font-family: var(--font); cursor: pointer; color: #666; border-bottom: 2px solid transparent; height: 100%;
&:hover { color: #333; background: rgba(0, 0, 0, 0.05); }
&.active { color: #1a73e8; border-bottom-color: #1a73e8; } }}
.devtools-pause { display: flex; align-items: center; gap: 4px; font-size: 11px; font-family: var(--font); padding: 3px 6px !important;}
.devtools-pause,.devtools-close { padding: 4px !important; color: #888;}
.devtools-body { flex: 1; display: flex; overflow: hidden; min-height: 0;}
.devtools-tab-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0;}
.devtools-subtabs { display: flex; flex-shrink: 0; border-bottom: 1px solid #e8e8e8; padding: 0 4px; overflow-x: auto;
button { all: unset; padding: 3px 10px; font-size: 11px; font-family: var(--font); cursor: pointer; color: #888; border-bottom: 2px solid transparent; white-space: nowrap;
&:hover { color: #333; } &.active { color: #1a73e8; border-bottom-color: #1a73e8; } }}
.devtools-body-inner { flex: 1; display: flex; overflow: hidden; min-width: 0; min-height: 0;
&:not(.has-detail) { overflow-y: auto; }
&.has-detail > .devtools-timeline { width: 340px; flex-shrink: 0; border-right: 1px solid #e8e8e8; }}
.devtools-empty { color: #999; text-align: center; padding: 24px; font-family: var(--font);}
/* Timeline tab */
.devtools-timeline { flex: 1; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 4px;}
.devtools-entry { border: 1px solid #eee; border-radius: 5px; padding: 7px 9px; background: #fafafa; cursor: pointer;
&:hover { background: #f0f4ff; border-color: #c8d8ff; }
&.active { background: #e8f0fe; border-color: #4285f4; }}
.devtools-entry-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px;}
.devtools-entry-index { font-size: 10px; font-weight: 700; color: #bbb; min-width: 14px;}
.devtools-entry-author { font-weight: 600; font-size: 11px; font-family: var(--font);}
.devtools-entry-time { font-size: 10px; color: #aaa; margin-left: auto;}
.devtools-entry-uri { font-size: 10px; color: #1a73e8; margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
.devtools-entry-json { font-size: 10px; color: #555; margin: 0; white-space: pre; line-height: 1.5; overflow: hidden; max-height: 60px;}
/* Detail panel */
.devtools-detail { flex: 1; overflow-y: auto; padding: 10px; min-width: 0;}
.devtools-detail-meta { font-size: 11px; color: #888; margin-bottom: 10px; font-family: var(--font);}
.devtools-detail-label { font-size: 10px; font-weight: 600; color: #aaa; text-transform: uppercase; letter-spacing: 0.05em; margin: 10px 0 4px;}
.devtools-ops { width: 100%; border-collapse: collapse; font-size: 11px;
th { text-align: left; color: #aaa; font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px 4px 0; border-bottom: 1px solid #eee; }
td { padding: 3px 8px 3px 0; vertical-align: top; border-bottom: 1px solid #f5f5f5; }}
.devtools-op-num { color: #888; white-space: nowrap;}
.devtools-op-desc { color: #333; word-break: break-word;}
/* Doc Record tab */
.devtools-doc { padding: 10px; overflow-y: auto; flex: 1;}
.devtools-doc-uri { font-size: 11px; color: #1a73e8; margin-bottom: 8px; word-break: break-all;}
.devtools-doc-json { font-size: 12px; color: #333; margin: 0; white-space: pre; line-height: 1.5;}