-
-
Notifications
You must be signed in to change notification settings - Fork 13
⚠️ 📖 DRAFT: <tag-complete> #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
6833d8b
504008b
5332444
80108c4
f783911
d2859d3
bcebf26
cd2e718
d2df475
653a03d
4987974
98bebf6
a08ecf6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| <title><email></title> | ||
|
|
||
| <link rel=stylesheet href=style.css> | ||
|
|
||
| <email-recipients> | ||
|
|
||
| <template name=recipients> | ||
| <address> | ||
| <button id={#} | ||
| onclick=onremove | ||
| title='Remove <{self}> from recipients'>x</button> | ||
|
|
||
| <label> | ||
| <input name=recipients[] type=checkbox value={self} checked> | ||
| {self} | ||
| </label> | ||
| </address> | ||
| </template> | ||
|
|
||
| <input | ||
| type=search | ||
| name=address | ||
| list=contacts | ||
| onchange=addrecipient | ||
| placeholder=email@example.com> | ||
|
|
||
| <datalist id=contacts> | ||
| <template name=contacts> | ||
| <option value={email}>{name} <{email}> | ||
| </template> | ||
| </datalist> | ||
|
|
||
| </email-recipients> | ||
|
|
||
| <script src=/snuggsi.es></script> | ||
| <script defer> | ||
|
|
||
| Element `email-recipients` | ||
|
|
||
| (class extends HTMLElement { | ||
|
|
||
| initialize () { | ||
| this.context.recipients = | ||
| ['angelo@isawesome.com', 'snuggs@isawesome.com'] | ||
| } | ||
|
|
||
| onconnect () { | ||
| this.context | ||
| .contacts = [ | ||
| { name: 'Tim', email: 'tim@isawesome.com' }, | ||
| { name: 'Rob Cole', email: 'robcole@isawesome.com' } | ||
| ] | ||
| } | ||
|
|
||
| // use Array.prototype.splice | ||
| // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice | ||
| onremove (event, id = event.target.id, address) { | ||
| address = | ||
| this.context | ||
| .recipients.splice | ||
| (event.target.id, 1) | ||
|
|
||
| this.select | ||
| `input[name=address]`.focus() | ||
| } | ||
|
|
||
| addrecipient (event, input = event.target) { | ||
| this.context | ||
| .recipients.push | ||
| (input.value) | ||
|
|
||
| input.value = '' | ||
| } | ||
|
|
||
| get recipients () | ||
| { return this.context.recipients } | ||
|
|
||
| get contacts () | ||
| { return this.context.contacts } | ||
| }) | ||
|
|
||
| </script> | ||
|
|
||
| <script src=/browser-sync.es></script> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if we load this conditionally based on localhost?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, hadn't picked up on that. well played. |
||
| <script | ||
| name=polyfill | ||
| src=//cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.0.0/webcomponents-hi-ce.js> | ||
| </script> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| :root { | ||
| --email-recipients-corner-radius: 1vw; | ||
| } | ||
|
|
||
| email-recipients > address:hover, | ||
| email-recipients { | ||
| box-shadow: 0 0 0.28em rgba(40,40,40,0.8); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no spaces between rgba values?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @brandondees i'm down with that
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @albertoponti @brandondees hit me with "Tsu"! f783911 |
||
| border-radius: var(--email-recipients-corner-radius) | ||
| } | ||
|
|
||
| email-recipients { | ||
| padding: 1em; | ||
| display: flex; | ||
| flex-basis: auto; | ||
| flex-flow: row wrap; | ||
| } | ||
|
|
||
| email-recipients > * { | ||
| font-size: 90%; | ||
| line-height: 1.612em; | ||
| } | ||
|
|
||
| email-recipients > address { | ||
| display: flex; | ||
| cursor: pointer; | ||
| margin: 0; | ||
| font-style: normal; | ||
| align-items: center; | ||
| flex-flow: row nowrap; | ||
| font-family: sans-serif; | ||
| } | ||
| email-recipients > address::after { | ||
| content: ", "; | ||
| margin-top: -0.4em; | ||
| font-size: 2em; | ||
| color: rgba(50,50,50,0.7); | ||
| } | ||
| email-recipients > address:hover { | ||
| background: rgba(220,220,220,0.9) | ||
| } | ||
| email-recipients > address button { | ||
| opacity: 0; | ||
| border: none; | ||
| background: none; | ||
| margin-right: 0.12em; | ||
| padding: 0 0.12em 0 0.2em; | ||
| border-right: 1px solid red; | ||
| } | ||
|
|
||
| email-recipients > address:hover button { | ||
| opacity: 0.5; | ||
| font-size: 80%; | ||
| cursor: pointer; | ||
| color: rgba(230,0,0,0.9); | ||
| } | ||
| email-recipients > address button:hover { | ||
| opacity: 1.0 | ||
| } | ||
|
|
||
| email-recipients input[name='recipients[]'] { | ||
| display: none; | ||
| } | ||
| email-recipients input[name=address] { | ||
| flex: 0; | ||
| border: none; | ||
| outline: none; | ||
| background; yellow; | ||
| line-height: 1em; | ||
| align-items: flex-start; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is address allowed to be email address, not just physical? TIL
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brandondees. May want to ask @kurtcagle or @janz93 @mrbernnz