jpdevries / makeanico

Accessible 16x16 favicon WYSIWYG creator
7 stars 0 forks source link

Are Dirty Art-board HTML weights OK? #10

Closed jpdevries closed 8 years ago

jpdevries commented 8 years ago

Also see weigh In section of the README https://github.com/jpdevries/makeanico#weigh-in

I've assumed that it ok initial page weights of "dirty" art–boards can creep above 10kB because they are themselves part of lazy loading. as the user draws, their art-board along with the URL itself grows. If they return to that URL it will have the art-board initially served inline for no-js support. One question I have reading the legal docs though:

Every public page of the entry must be usable WITHOUT the total download of the HTML page and all assets exceeding 10 kilobytes (10,240 bytes)
4. What Constitutes An Eligible Entry

I would hope that under that rule the only two pages of my application are the home screen and the accessibility page.

Dirty art-boards are publicly accessibly pages though (they can be shared) and their initial weight (if you don't factor in cacheing and service workers) can be ~15kB with GZIP. This is because the initial 5.7kB of weight grows to include populating the art–board and previews of the app. The markup weight grows because the data URI is repeated in a few places of the HTML.

Was my assumption Correct? Are "dirty" art–board OK?

jpdevries commented 8 years ago

I may be able to make even dirty art–boards stay under 10kB initially if I removed the .no-js support for the various at scale previews.

Waiting on hearing back from the competition because I'd like to think that it is lazy weight which aides accessibility. I've been assuming just the initial "blank" art–board counts as the initial weight for my 10kB but the way the legalese is worded has me nervous

jpdevries commented 8 years ago

Some last thoughts on this are that it kind of seems to boil down to if that part of the legalese means any page in the site map (of which there are two) or possible to be served via the API (of which there are countless) and with a certain amount of cells filled can pass 10kB.

More on the API here https://github.com/jpdevries/makeanico/#api

jpdevries commented 8 years ago

Added endpoints for /icos/random and /icos/randomalpha to easily create dirty art board full of random pixels. At solid transparency page sizes can get up to about 24kB

with alpha pixels 30kB

jpdevries commented 8 years ago

Pages with every cell filled have a lot of header weight. I'm counting as much as 2.5kB over GZIP.

``` GET /?c0=0x920F97&c1=0x5DA4B3&c2=0xB55BDA&c3=0xD8C2E4&c4=0x69EFC1&c5=0x916B25&c6=0xF433E8&c7=0x5793A0&c8=0x9E1DAB&c9=0xF64E44&c10=0xBF979E&c11=0x1161DB&c12=0xE9EDD8&c13=0x64C810&c14=0xD802D9&c15=0x29894D&c16=0x67EF9&c17=0xB90E33&c18=0x829C25&c19=0x8CA54&c20=0x95A6D7&c21=0x2D1F48&c22=0x28278F&c23=0x1567D6&c24=0x17BB8F&c25=0xC15EE3&c26=0x689BFB&c27=0x426645&c28=0x450EA8&c29=0xF383AB&c30=0x47E6FE&c31=0x34C6CD&c32=0xE19912&c33=0x803040&c34=0x70988E&c35=0xD02C15&c36=0x806E8D&c37=0xC742D1&c38=0xEA7DD9&c39=0x2A9B32&c40=0x3BB968&c41=0x6A13B9&c42=0x4927BF&c43=0xF9FBC5&c44=0xA2EEB&c45=0xBA511&c46=0x9659&c47=0x2F8392&c48=0xEC03D6&c49=0x6BDE6C&c50=0xD905C2&c51=0x708B6B&c52=0x410502&c53=0x697E5F&c54=0x39EA45&c55=0xE59BD6&c56=0x8937B1&c57=0x1C6782&c58=0x4F75B5&c59=0x4EDAA1&c60=0xCFC559&c61=0x52A8C6&c62=0x42027F&c63=0x4651BE&c64=0xD7F6A0&c65=0x227F7E&c66=0xD2D48A&c67=0xF3BB58&c68=0xF15E63&c69=0x9E10F1&c70=0xB202EE&c71=0x3A5872&c72=0xF28A0E&c73=0x13CB84&c74=0xD89338&c75=0xD53652&c76=0x838DB7&c77=0x648380&c78=0x86914F&c79=0x110799&c80=0x193ED5&c81=0xAD0D70&c82=0x5EFF52&c83=0x975A2&c84=0xE8ECC3&c85=0xB8CA81&c86=0x73C20E&c87=0x6D974&c88=0x23CF52&c89=0x7F6671&c90=0xE4B6B3&c91=0x3E1031&c92=0x4D3243&c93=0xCC1519&c94=0x463C18&c95=0x962AA0&c96=0x1A133D&c97=0x7BA59&c98=0xFA98BF&c99=0x4297E3&c100=0x53A51B&c101=0xCAFD46&c102=0x30D791&c103=0x88B340&c104=0x77EF26&c105=0xCD80FB&c106=0x4163D1&c107=0xC06076&c108=0xC52E90&c109=0xED4233&c110=0x1A14C7&c111=0x68BEC1&c112=0xDEF52D&c113=0x2D2E86&c114=0x6DA148&c115=0xB5639B&c116=0xC1A6F7&c117=0xE5592&c118=0x80D8F2&c119=0xA18B6&c120=0xF0383B&c121=0xB1643B&c122=0x9F3EBD&c123=0x32AE17&c124=0x82EBDB&c125=0xC37AD5&c126=0x59C600&c127=0x2A696C&c128=0x7ADC56&c129=0x86D4E&c130=0x460BA&c131=0xB013C4&c132=0xDA2B14&c133=0xF51390&c134=0x69904A&c135=0xCD3253&c136=0x1EB303&c137=0xFC86B5&c138=0xF1AF1&c139=0x7C4B0C&c140=0xC98B82&c141=0xDB6A57&c142=0x8BB747&c143=0x374403&c144=0x4ADA97&c145=0xAC780D&c146=0xB7B54C&c147=0xEEDD08&c148=0xE8F24F&c149=0xDB9E25&c150=0x54645C&c151=0x5FB5CC&c152=0x7E4FA3&c153=0xC03042&c154=0x498714&c155=0x9F8FCD&c156=0x1C8E3B&c157=0x1A05F8&c158=0x448E79&c159=0x14E88B&c160=0x71EC80&c161=0xC66505&c162=0x896150&c163=0x1D5459&c164=0x210E5&c165=0x368BBB&c166=0xA3C320&c167=0xD2125E&c168=0x11B729&c169=0x6F478F&c170=0x5C33FE&c171=0xC6C246&c172=0x5A6BD0&c173=0xAEC574&c174=0x3C4F26&c175=0x5882DC&c176=0xF4AAC9&c177=0x61FB5C&c178=0x4E52F0&c179=0x617F02&c180=0xEE7028&c181=0x88BA9B&c182=0x62AC87&c183=0x8D0F2D&c184=0x92492A&c185=0x99D08E&c186=0xF85E1E&c187=0xFE8574&c188=0xA45F0B&c189=0xA18A51&c190=0xAE4D0C&c191=0xE089A8&c192=0x8FF874&c193=0x12A0C9&c194=0xE66E41&c195=0xA38F7D&c196=0x5140A3&c197=0xA18AFF&c198=0xF416A5&c199=0x70BDF6&c200=0x132C36&c201=0x6228F7&c202=0xC0A0F5&c203=0x32313D&c204=0x57A5E6&c205=0xA2F750&c206=0xB4F86F&c207=0x7D8DC1&c208=0x36A103&c209=0xB322F9&c210=0x76C8B&c211=0xAF0FCC&c212=0xA91483&c213=0x13D26&c214=0x984997&c215=0xF7769&c216=0x687C6E&c217=0x707301&c218=0xC13C78&c219=0xB4B22E&c220=0xFEDCF8&c221=0x4395B2&c222=0x7E8D70&c223=0xFD9218&c224=0xE71712&c225=0x4F88F6&c226=0x29ACCC&c227=0xAF27BF&c228=0xA17BC6&c229=0xC78CB1&c230=0x5E33BE&c231=0x42EAEF&c232=0x608121&c233=0x71AF24&c234=0x6FFD09&c235=0xB8AF20&c236=0xBA21D7&c237=0x1C717F&c238=0x349372&c239=0xF8BCA5&c240=0x2E9B7E&c241=0x1B8ED9&c242=0x1C6F94&c243=0xF2E91F&c244=0xD93E3B&c245=0x969D0C&c246=0xE8897D&c247=0x315261&c248=0xBC0DC9&c249=0x227B01&c250=0xFFAB29&c251=0x1E390A&c252=0x8DABD8&c253=0x56B1C3&c254=0xD26483&c255=0x4F3E99 HTTP/1.1 Host: localhost:1188 Connection: keep-alive Pragma: no-cache Cache-Control: no-cache Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8 HTTP/1.1 200 OK X-Powered-By: Express Content-Type: text/html; charset=utf-8 ETag: W/"1c844-1j4eugWoaQBUvDi/lZCDqw" Vary: Accept-Encoding Content-Encoding: gzip Date: Sun, 02 Oct 2016 12:48:05 GMT Connection: keep-alive Transfer-Encoding: chunked ``` Example Headers for Dirty Artboard

I did a test where I stripped out the no-js support of the additional components, took out the static preview, and stripped out the markup for the favicon, and I measured initial weight of very dirty art-boards around 14kB without headers.

So with this HTML architecture and the way HTML weight scales when combining it with the accessibility consideration of initially serving semantic HTML, there is no way to keep it under 10kB. I even tried rounding the rgba decimals to only two places. If I remove the data-a attributes from the initial HTML markup I can get it down to 13.4kB with headers so around 11kB without.

``` MakeanIco

Artboard

RowColumn 0Column 1Column 2Column 3Column 4Column 5Column 6Column 7Column 8Column 9Column 10Column 11Column 12Column 13Column 14Column 15
Row A
Row B
Row C
Row D
Row E
Row F
Row G
Row H
Row I
Row J
Row K
Row L
Row M
Row N
Row O
Row P

Fill Selected Cells

Fill the selected cells above with the color you input below.

Input Color By:
Fill Color:

RGB Slider:
Transparency
``` Source Markup of Optimized Dirty Art–board still exceeds 10kB

So I think I just have to 🙏 that the initial load is just the two pages of the site map and not any URL that the API supports.

jpdevries commented 8 years ago

All of the code needed for folks to use your project should be contained in that 10kB. You can use techniques like lazy-loading to enhance the experience by pulling in additional functionality, higher-resolution imagery, etc. as it makes sense to do so. https://a-k-apart.com/faq#size

I feel all of the code needed for use is in the first 5.7kB. The initial HTML consisting of the tabular art–board and the fill component. Now as the application is used

This means that if no-js users make edits they will taken to new pages whose initial DOM can exceed 10kB because it contains the inlined artwork.

If a user visits the app, fills every cell, and shares that icons URL should that URL be considered a "public page" of the app under 4. What Constitutes An Eligible Entry?

If not, the app has two pages. If every possible icon the API can generate is considered a "public page" then there are a lot of pages:

`Math.pow(2,256)*(16777216*256);` ``` 497,323,236,409,786,496,072,176,360,240,032,312,792,176,144,456,072,040,768,256,104,168,336,824,720,024,720,232,056 ```
jpdevries commented 8 years ago

In https://github.com/jpdevries/makeanico/commit/dd16f8a8b03edddb79c01b43e80ef92203ef5a70 Got a dirty art–boad under 10kB with no-js https://github.com/jpdevries/makeanico/issues/11#issuecomment-251234639

jpdevries commented 8 years ago

In https://github.com/jpdevries/makeanico/commit/f372077fd27987ea0c1d8a6dd8efa201e6843598 got almost any dirty art–board under 10kB. http://makeanico.azurewebsites.net/icos/randomalpha can still go over. Every cell is an alpha pixel.

jpdevries commented 8 years ago

I got non–transparent dirty art–boards smaller by adding an option to not initially print the <input type="hidden"> of each cell. They are below 10kB so if I misinterpreted the rules and dirty art boards do also need to be under 10kB I could remove alpha transparency support and lazy–load the stylesheet and see if I could get away with that.

jpdevries commented 8 years ago

In https://github.com/jpdevries/makeanico/commit/ac7c499bf94591b4fa91ad43a49f954dc69d49e1 all non–transparent art–boards are < 10kB initial load and in https://github.com/jpdevries/makeanico/commit/7457ca289bf3b4d56fcf8a7d80cd71eb053de665 transparency support is removed if force10kB is on. the stylesheet gets dropped from the initial HTML load and is lazy loaded if art boards are over half full.

still not sure if this is necessary but basically a back up plan that some nice optimizations came out of.

jpdevries commented 8 years ago

Great news: we received your entry and have spun up your server on Azure! Check it out: https://make-an-ico-10kapart2016.azurewebsites.net/