6.S063 Design for the Web: Languages and User Interfaces

← Assignment 2

Assignment 3

Due

Submitting your homework

We are going to use Github Classroom for this assignment. You need to have an account on GitHub and be logged in. Authorize Github Classroom here and accept the assignment, then follow the instructions there. Please follow the structure and naming of the starter repo, though you can add any additional files if you need them.

Please make sure each of your exercise-N directories are self contained, i.e. that you don't reference any files outside of the directory (e.g. from your repo root or other exercises). While having a common assets directory for all your exercises might be a good idea in general, we extract each exercise directory separately (as it may be graded by different people), and that will result in your pages not working correctly. Do not use root-relative URLs that expect a local server to run at a specific directory within your repo, and if you cannot avoid it, please document it in a README otherwise links may be broken for whomever is grading your homework.

If you submit after the deadline, it will count towards your slack hours.

Exercise 1: Critiquing CSS Demos (20%)

In the second exercise of this assignment you will be creating an interactive demo of a CSS feature. Your demo will be graded based on its usability and how well it helps people understand or learn the CSS feature. As preparation for the second exercise we want you to find two pre existing demos of CSS Features and write a couple of sentences about how each one succeeds or fails with regards to usability and/or teaching the CSS feature. Remember the dimensions of usability we covered in class (Learnability, Efficiency, and Safety). We've included a couple of CSS feature demos below which you can choose from, however feel free to find other demos on the web. For both of your write ups, include a link to the CSS feature demo you reviewed. - [Components.ai Gradient editor](https://components.ai/gradient/) - [CSS Gradient generator](https://www.joshwcomeau.com/gradient-generator/) - [Components.ai text-shadow editor](https://components.ai/text-shadow/) - [Grid layoutit!](https://grid.layoutit.com/) - [Smooth shadow generator](https://shadows.brumm.af/) - [Shadow Palette Generator](https://www.joshwcomeau.com/shadow-palette/) - [cubic-bezier.com](https://cubic-bezier.com) - [border-image.com](https://border-image.com) - [border-radius when all radii add up to 100%](https://9elements.github.io/fancy-border-radius/) - [html-css-js.com directory of CSS generators](https://html-css-js.com/css/generator/) - [webcode.tools directory of CSS generators](https://webcode.tools/css-generator) - [`font` shorthand generator at MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/font#live_sample)

Exercise 2: Making interactive CSS demos (77%)

As you may have noticed, CSS is much easier to learn with interactive demos. These demos can have interfaces that help you dynamically explore the design space. In this assignment you will make your own interactive demo for a small part of CSS. After the deadline, you can play with the demos your classmates made and learn from them!

First, sign up for a CSS feature you want to make a demo of in this spreadsheet (use your GitHub username). You can select up to two features and decide later on which one of the two you will make a demo of (please maake sure to free up the other one when you know so that another student can use it). Then, use HTML, CSS, and Mavo (or JS, if that’s your preference) to make an app that helps people interactively explore how this feature works and teaches them about it. It should be aimed at users who know CSS generally, but not this particular feature.

At a minimum, look up the CSS feature you chose using the MDN link(s) provided in the spreadsheet. However, you are strongly encouraged to do your own research, find where people struggle when learning this feature, and make your app so that it illustrates the pain points of learning this feature best.

Pick a CSS feature earlier rather than later: only up to 3 students can pick the same one, so if you leave it too late, you may find that all the ones you like are taken!

Want to make a demo of a feature (or set of features) that is not in the spreadsheet? Contact us and if it has the right scope we can add it!

Your assignment will be graded primarily on the usability of the interface you create, and on how well it achieves the desired goal of teaching CSS learners how the CSS feature works. To achieve that goal, your interface should:

- teach the user the CSS concept. In support of that goal, work hard at the learnability of the UI so that new users can understand how to use it to learn CSS. - Aim for a good graphic design that is aesthetically pleasing, to the extent possible based on what we've learned so far. Remember that documentation should be a last resort to increase learnability, don't just add "helpful" text all over your UI, spend time thinking how to make the purpose of each control clearer. That said, some text will likely be necessary to successfully teach about the feature. - provide appropriate controls and output that users can experiment with as many forms of the feature as possible (but not necessarily all), while still being sufficiently restricted that it facilitates learning. If you make it too freeform, it won't be of much more value than a text editor, but if you make it too restricted, it won't be teaching much. You need to find a good balance between the two. # Tips & caveats - You may find it helpful for your demo to let the user control a number of other, related, CSS features, so that the user can observe the interaction between the two. E.g. for a property related to layout, you would probably want to allow the user to control `width` and `height`, so they can see how different units and dimensions interact with the layout feature the demo is about. For `text-shadow`, you'd want to also offer control over `color`. - Don't just add one form control for every parameter and call it a day. That will only get you about halfway through. Think of what's the best way to help users conceptualize and learn the CSS feature you have picked. - You are not required to include aspects of your CSS feature of choice that are not implemented in Google Chrome 80 or are hidden behind flags. If you decide to do so, include a warning about it, and a link to browser support information (e.g. caniuse.com) - In some cases, there may be multiple plausible models for how a particular property works. E.g. for `text-shadow`, some users (especially developers) think of the shadow position as "Horizontal and vertical offset" and others (especially graphic designers) as "Distance and angle". Think about which mental model(s) you would like to teach the user---there will be tradeoffs.

Unsure if your demo achieves its desired goals? Get a classmate (who is working on a different CSS feature!) to use it and observe. Did they "get it" or were they confused? What did they struggle with?

# A note on scope Some of you will have broader features than others. E.g. `linear-gradient()` can be used in `background` too, that doesn't mean that the student who picks `background` needs to demo every possible gradient as well. Instead, the demo for `background` should focus on showcasing the different `background` parameters, with only basic control over the actual `background-image`, which is only one of `background`'s many longhands. Similarly, an app that demos `text-shadow` or `box-shadow` needs to provide a better shadow specification UI than an app that demos `filter`, of which `drop-shadow()` is only one of the many possible filters. Choose an appropriate level of depth that doesn't result in an overly complex demo. Be more liberal with breadth than depth. If there are shorthands in the CSS feature you picked, you need to make sure at least part of the functionality from every longhand is included in your demo. Similarly, if each parameter accepts multiple units, you are not required to provide UI to set all of them, or for any possible range. That would likely just clutter your interface and obscure its goal. You may pick one or a few units that are reasonable and provide UI for that. If you do want to include all, think about how to do so usably. If you want to broaden the scope of your demo, that's fine, as long as you cover all the functionality you would have covered without the broadening. E.g. if you have picked `radial-gradient()` but you want to make a general gradient generator that generates any type of gradient, that's fine, as long as it still demonstrates all parameters of `radial-gradient()` that you would have needed to demonstrate if you were only dealing with `radial-gradient()`. # Examples in the wild [Exercise 1](#ex1) contains a list of interactive CSS demos from around the Web. You can likely find many for the CSS feature you picked by googling property names and/or values and "generator" or "demo". However, do note that **most of these have usability issues** and often the CSS they generate is very old too (a good rule of thumb: when you see `-webkit-`, `-moz-` etc prefixes, the code dates back to circa 2009-2015). Take a look **so you can understand the problem you're trying to solve better, but not to imitate their UI decisions**. Furthermore, not all of these have UIs that could be implemented without custom JS. # Mavo examples of CSS generators And here are two examples of such demos, implemented with Mavo that we made for you, one for a value and one for a property, with some notes about how each attempts to make improvements over basic functionality. ## [`hsl()` colors](demos/hsl/) - Gradients aligned with the sliders to show the user what color each slider tweak will produce. - Gradients update dynamically to help the user explore the 3d HSL space - Checkerboard underneath semi-transparent colors to differentiate transparency with lightness. ## [the `filter` property](demos/filter/) - Editable sample image - Ticks on sliders for the midpoint when that is important (via `<datalist>`) - Small thumbnails previewing each filter individually to make it easier to experiment with multiple of them - Collapsible filters to just the type & preview, via the `<details>` element - Double duty: Type dropdown acts as header as well - Gradient on hue shift to indicate what each hue corresponds to Note that in the spreadsheet there are features that overlap with these. If you pick a feature for which we have provided a demo (or a very similar one, e.g. `backdrop-filter` instead of `filter`), you need to make sure you go a sufficiently different direction. Just turning in the provided demos with cosmetic changes will not earn you credit.

Exercise 3: HW2 feedback (3%)

Since this is a new class, we need your constructive feedback about every aspect of it: lectures, homeworks, labs etc. Please fill in your feedback about HW2 in `exercise-3/index.html`.