typeplate / typeplate.github.io

Official Website for Typeplate: “A Typographic Starter Kit.”
http://typeplate.com
Other
1.35k stars 111 forks source link

User-defined scales #70

Closed eldruz closed 11 years ago

eldruz commented 11 years ago

Hi there,

First of all thanks guys for typeplate, I used it to setup my blog and it has been a breeze to use. The only thing that made me tickle is the absence of support for user-defined scales, as typeplate hard-coded its own scale from the base value of 18 pixels, which made experimenting with different scales tedious.

So I changed how the $zeta through $tera values are defined. They now take their values from a list, which is called $values_list. To change the scale, you just have to change the list. I provided a function which returns a list computed from the diatonic scale as an example. I also built a helper function which applies a scale, which is defined as a list of multipliers, to a base value and constructs the $values_list. I replicated the scale you provided as the default value. So now, users can define several scales and easily switch between them to see the effect the scales have on their design.

Everything I just said is commented in the code, along with some examples. I prefixed every function name with "eldruz" for clarity. Let me now if you found this useful, or if you have any questions at all.

Andrés, aka eldruz.

P.S.: you can safely ignore the first commit (hashed '4ebeb4d'), I should have deleted it really.

grayghostvisuals commented 11 years ago

@eldruz I can't accept this PR for a few reasons so before I start I want to say thanks for the effort:beers:. That being said...

  1. Your commits need to be squashed into one. I can't have multiple commits in a PR like you have here.
  2. You cannot prefix stuff with your name for this project.
  3. The example code is not updated for the main page
  4. While we provide default values it is up to the author to define and customize. You're still hard coding values either way you slice it with your PR changes.
  5. You're making things way more complicated than needed.
  6. Your formatting is single spaces and not tabs

If you feel you need these lines of code then I encourage you to keep it in a customized file of your own or another branch of typeplate in your own repo. Once again thanks for the effort and time taken to contribute. :+1: