Browse Source

header size setting added

master
Christian Müller 11 years ago
parent
commit
dccf9e3966
  1. 2
      LANDING.md
  2. 4
      README.md
  3. 3
      resources/public/js/themes.js
  4. 27
      resources/public/styles/main.less

2
LANDING.md

@ -9,7 +9,7 @@
- **API**: Integrate the publishing functionality into your editor using the official [NoteHub API](/api). - **API**: Integrate the publishing functionality into your editor using the official [NoteHub API](/api).
## Changelog ## Changelog
- **2014-09**: text size setting added ([example](/2014/3/31/demo-note?text-font=monospace&header-font=Courier&text-size=0.8)) - **2014-09**: text size setting added ([example](/2014/3/31/demo-note?text-font=monospace&header-font=Courier&text-size=0.7&header-size=1.1))
- **2014-07**: deprecated all API versions less than 1.4 & performance improvements. - **2014-07**: deprecated all API versions less than 1.4 & performance improvements.
- **2014-03**: note expiration implemented. - **2014-03**: note expiration implemented.
- **2014-02**: a simple JS-client for API testing [added](/api-test.html). - **2014-02**: a simple JS-client for API testing [added](/api-test.html).

4
README.md

@ -25,9 +25,9 @@ and for the text itself:
notehub.org/.../title?header-font=FONT-NAME&text-font=FONT-NAME2 notehub.org/.../title?header-font=FONT-NAME&text-font=FONT-NAME2
Analogously, you can specify you can change the text size by specifying a scale factor: Analogously, you can specify you can change the text or header size by specifying a scale factor:
notehub.org/.../title?header-font=FONT-NAME&text-font=FONT-NAME2&text-size=1.5 notehub.org/.../title?header-font=FONT-NAME&text-font=FONT-NAME2&text-size=1.1&header-size=1.2
See an example of the font formatting [here](http://www.notehub.org/8m4l9). See an example of the font formatting [here](http://www.notehub.org/8m4l9).

3
resources/public/js/themes.js

@ -98,7 +98,8 @@ if(ui["header-font"] || ui["text-font"]) {
}, ""); }, "");
} }
if(ui["text-size"]) vars["@font_size"] = ui["text-size"] + "em"; if(ui["text-size"]) vars["@text_size_factor"] = ui["text-size"];
if(ui["header-size"]) vars["@header_size_factor"] = ui["header-size"];
fontURL = fontURL.replace(/%s/, injection); fontURL = fontURL.replace(/%s/, injection);
var fileref = document.createElement("link") var fileref = document.createElement("link")

27
resources/public/styles/main.less

@ -13,7 +13,8 @@
@header_font: 'Noticia Text'; @header_font: 'Noticia Text';
@text_font: 'Georgia'; @text_font: 'Georgia';
@font_size: 1.2em; @header_size_factor: 1;
@text_size_factor: 1;
// mixins // mixins
.helvetica { .helvetica {
@ -110,6 +111,24 @@ h1, h2, h3, h4, h5, h6 {
font-weight: bold; font-weight: bold;
font-family: @header_font,'Noticia Text','PT Serif','Georgia'; font-family: @header_font,'Noticia Text','PT Serif','Georgia';
} }
h1 {
font-size: 1.8em * @header_size_factor;
}
h2 {
font-size: 1.6em * @header_size_factor;
}
h3 {
font-size: 1.4em * @header_size_factor;
}
h4 {
font-size: 1.2em * @header_size_factor;
}
h5 {
font-size: 1.1em * @header_size_factor;
}
h6 {
font-size: 1em * @header_size_factor;
}
#hero h1 { #hero h1 {
font-size: 2.5em; font-size: 2.5em;
} }
@ -124,12 +143,12 @@ article {
text-align: justify; text-align: justify;
} }
article p { article p {
font-size: @font_size; font-size: 1.2em * @text_size_factor;
line-height: 140%; line-height: 140%;
} }
article > h1:first-child { article > h1:first-child {
text-align: center; text-align: center;
font-size: 2em; font-size: 2em * @header_size_factor;
margin: 2em; margin: 2em;
} }
.centered { .centered {
@ -141,7 +160,7 @@ article > h1:first-child {
code, pre { code, pre {
font-family: monospace; font-family: monospace;
background: @background_halftone; background: @background_halftone;
font-size: @font_size; font-size: 1.2em * @text_size_factor;
} }
pre { pre {
border-radius: 3px; border-radius: 3px;

Loading…
Cancel
Save