Browse Source

Style updates

intro
jlukic 9 years ago
parent
commit
9cb593f5bc
  1. 12
      server/documents/behaviors/api.html.eco
  2. 17
      server/documents/behaviors/visibility.html.eco
  3. 6
      server/documents/collections/breadcrumb.html.eco
  4. 173
      server/documents/introduction/new.html.eco
  5. 67
      server/documents/modules/sticky.html.eco
  6. 27
      server/documents/views/card.html.eco
  7. 61
      server/files/javascript/intro.js
  8. 6
      server/files/javascript/sticky.js
  9. 62
      server/files/stylesheets/docs.css

12
server/documents/behaviors/api.html.eco

@ -930,6 +930,12 @@ type : 'UI Behavior'
<td>Variables to use for replacement</td>
<td></td>
</tr>
<tr>
<td>encodeUrlData</td>
<td>true</td>
<td>Where url data should be encoded with <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent"><code>encodeURIComponent</code></a> before being added to URL.</td>
<td></td>
</tr>
<tr>
<td>mockResponse</td>
<td>false</td>
@ -997,7 +1003,7 @@ type : 'UI Behavior'
<tr>
<td>onSuccess(response, element)</td>
<td>state context</td>
<td>Callback on response object that passed <code>successTest</code></td>
<td>Callback after successful response, JSON response must pass <code>successTest</code></td>
</tr>
<tr>
<td>onComplete(response, element)</td>
@ -1007,7 +1013,7 @@ type : 'UI Behavior'
<tr>
<td>onFailure(response, element)</td>
<td>state context</td>
<td>Callback on response object that fails <code>successTest</code></td>
<td>Callback on failed response, or JSON response that fails <code>successTest</code></td>
</tr>
<tr>
<td>onError(errorMessage, element)</td>
@ -1017,7 +1023,7 @@ type : 'UI Behavior'
<tr>
<td>onAbort(errorMessage, element)</td>
<td>state context</td>
<td>Callback on abort caused by user clicking a link or manually cancelling request</td>
<td>Callback on abort caused by user clicking a link or manually cancelling request.</td>
</tr>
</tbody>
</table>

17
server/documents/behaviors/visibility.html.eco

@ -649,11 +649,7 @@ type : 'UI Behavior'
transition: all 0.5s ease;
background: transparent;
}
.visibility.example .fixed.overlay + .placeholder {
display: none;
}
/* fixed */
/* change style */
.visibility.example .fixed.overlay {
position: fixed;
padding: 1em;
@ -670,28 +666,17 @@ type : 'UI Behavior'
<a class="item">Option 3</a>
</div>
</div>
<div class="placeholder"></div>
<div class="ui clearing divider"></div>
<img src="/images/wireframe/centered-paragraph.png" class="ui wireframe image">
<div class="ui divider"></div>
<img src="/images/wireframe/short-paragraph.png" class="ui wireframe image">
<div class="ui divider"></div>
<img src="/images/wireframe/media-paragraph.png" class="ui wireframe image">
<div class="ui divider"></div>
<img src="/images/wireframe/paragraph.png" class="ui wireframe image">
<div class="ui divider"></div>
<img src="/images/wireframe/short-paragraph.png" class="ui wireframe image">
<div class="ui divider"></div>
<img src="/images/wireframe/centered-paragraph.png" class="ui wireframe image">
<div class="ui divider"></div>
<img src="/images/wireframe/short-paragraph.png" class="ui wireframe image">
<div class="ui divider"></div>
<img src="/images/wireframe/media-paragraph.png" class="ui wireframe image">
<div class="ui divider"></div>
<img src="/images/wireframe/paragraph.png" class="ui wireframe image">
<div class="ui divider"></div>
<img src="/images/wireframe/short-paragraph.png" class="ui wireframe image">
<div class="ui divider"></div>
</div>
</div>

6
server/documents/collections/breadcrumb.html.eco

@ -36,11 +36,11 @@ themes : ['Default']
</div>
<div class="another example">
<div class="ui breadcrumb segment">
<div class="ui breadcrumb">
<a class="section">Home</a>
<i class="right triangle icon divider"></i>
<i class="right angle icon divider"></i>
<a class="section">Store</a>
<i class="right triangle icon divider"></i>
<i class="right angle icon divider"></i>
<div class="active section">T-Shirt</div>
</div>
</div>

173
server/documents/introduction/new.html.eco

@ -59,8 +59,8 @@ type : 'Introduction'
</div>
</div>
<div class="highlighted example">
<h4 class="ui header">Evenly Divided</h4>
<p>The new <a href="#equal-width"><code>equal width</code></a> grid variation adjusts column widths automatically to split their container evenly without having to specify a column count.</p>
<h4 class="ui header">Automatic Columns</h4>
<p>The new <a href="#equal-width"><code>equal width</code></a> grid variation adjusts column widths automatically to split their container evenly without having to manually specify a column count.</p>
<div class="ui equal width grid">
<div class="column"></div>
<div class="column"></div>
@ -119,7 +119,8 @@ type : 'Introduction'
<div class="dropdown example">
<h4 class="ui header">Multiple Selection</h4>
<p>Multiple select dropdowns are now available, and can generate automatically from standard html selects. </p>
<p>Dropdowns all now support advanced keyboard shortcuts like <code>pagedown</code>, <code>delete</code>, <code>shift+left</code> <code>ctrl+click</code>, and selection using first letter of item.</p>
<p>Dropdowns now all support advanced keyboard shortcuts like <code>pagedown</code>, <code>delete</code>, <code>shift+left</code> <code>ctrl+click</code>, and selection using first letter of item.</p>
<p>Additionally dropdowns will now automatically open <code>upward</code> if there is not enough space available in the viewport below a dropdown.</p>
<select class="ui fluid dropdown" multiple>
<%- @partial('examples/single/state-options') %>
</select>
@ -127,7 +128,7 @@ type : 'Introduction'
<div class="user example">
<h4 class="ui header">User Tagging</h4>
<p>All dropdowns, single and multiple now support user tagging. Values can be automatically tokenized in a hidden input, or using a select</p>
<p>All dropdowns, single and multiple now support user tagging. Values can be automatically separated by a delimiter and placed in a hidden input, or extend an existing select element.</p>
<div class="ignored code" data-type="javascript">
$('.ui.dropdown')
.dropdown({
@ -147,7 +148,7 @@ type : 'Introduction'
<div class="remote example">
<h4 class="ui header">Remote Data</h4>
<p>All dropdowns now support loading remote data. Selected name value pairs retrieved remotely are stored in <code>sessionStorage</code> to make sure they appear just as retrieved on page refresh.</p>
<p>All dropdowns now support loading remote data. Selected name value pairs retrieved remotely are stored in <code>sessionStorage</code> so that selected values are repopulated correctly even after a page refresh.</p>
<div class="ignored code" data-type="javascript">
// somewhere in app
$.api.settings.api = {
@ -184,6 +185,7 @@ type : 'Introduction'
</div>
</div>
</div>
<div class="dropdown example">
<h4 class="ui header">Nested Menus</h4>
<p>Nested scrolling menus are now supported. These menus support all the same keyboard shortcuts and filtering as regular menus.</p>
@ -243,10 +245,15 @@ type : 'Introduction'
<p>Dropdowns support many, many new features, including:</p>
<ul class="ui large bulleted list">
<li>Maximum selection count is supported for multiple selects</li>
<li>Dropdowns will now automatically change direction to open upward if no space is left on the screen</li>
<li>Mutation observers will now watch for changes in menus or the elements they are generated from and will update choices automatically</li>
<li>Elements in all dropdowns can now be "jumped to" by pressing the first letter of the choice</li>
<li>Keyboard shortcuts now include power user shortcuts, <code>shift+select</code> for multiple <code>shift+right</code>, <code>page down</code> and <code>page up</code> and many more.</li>
<li>Keyboard shortcuts now include power user shortcuts
<ul>
<li><code>ctrl+click</code> will add a single additional selected label</li>
<li><code>shift+right</code> will extend selection</li>
<li><code>page down</code> and <code>page up</code> will select first element in next page</li>
<li><code>a-z</code> will select value matching first letter</li>
</ul>
<li>Custom error messages are now supported with search selects</li>
</ul>
</div>
@ -370,6 +377,88 @@ type : 'Introduction'
<h2 class="ui dividing header">API</h2>
<div class="remote example">
<h4 class="ui header">Local Caching</h4>
<p>API now supports <code>sessionStorage</code> caching. Using this setting will instantly return results for the same url across a user's session.</p>
<p>Try refreshing the page and searching the same letter, results will appear instantly without a server roundtrip.</p>
<div class="code" data-type="javascript">
$('.ui.dropdown')
.dropdown({
apiSettings: {
cache : 'local',
url: '//api.semantic-ui.com/tags/{query}'
}
})
;
</div>
<div class="ui form">
<div class="field">
<label>Favorite Animal</label>
<div class="ui search selection dropdown">
<input type="hidden">
<i class="dropdown icon"></i>
<input type="text" class="search">
<div class="default text">Select one...</div>
</div>
</div>
</div>
</div>
<div class="external example">
<h4 class="ui header">Translates Any API</h4>
<p>API now lets you adjust a server's JSON response using a new callback, <code>onResponse</code>. This can let you restructure third party APIs to match your local data requirements.</p>
<div class="ignored code" data-type="javascript">
$('.ui.search')
.search({
type : 'category',
minCharacters : 3,
apiSettings : {
onResponse: function(githubResponse) {
var
response = {
results : {}
}
;
// translate github api response to work with search
$.each(githubResponse.items, function(index, item) {
var
language = item.language || 'Unknown',
maxResults = 8
;
if(index >= maxResults) {
return false;
}
// Create new language category
if(response.results[language] === undefined) {
response.results[language] = {
name : language,
results : []
};
}
// Add result to category
response.results[language].results.push({
title : item.name,
description : item.description,
url : item.html_url
});
});
return response;
},
url: '//api.github.com/search/repositories?q={query}'
}
})
</div>
<div class="ui search">
<div class="ui left icon input">
<input class="prompt" type="text" placeholder="Search GitHub">
<i class="github icon"></i>
</div>
</div>
</div>
<div class="mock example">
<h4 class="ui header">Mocked Responses</h4>
<p>API now supports mocked responses, letting you specify how responses are returned in advance.</p>
@ -425,30 +514,58 @@ type : 'Introduction'
</div>
</div>
<div class="remote example">
<h4 class="ui header">Local Caching</h4>
<p>API now supports <code>sessionStorage</code> caching. Using this setting will instantly return results for the same url across a user's session.</p>
<p>Try refreshing the page and searching the same letter, results will appear instantly without a server roundtrip.</p>
<div class="code" data-type="javascript">
$('.ui.dropdown')
.dropdown({
apiSettings: {
cache : 'local',
url: '//api.semantic-ui.com/tags/{query}'
}
})
;
<h2 class="ui dividing header">Visibility</h2>
<div class="visibility example">
<h4 class="ui header">Simple Sticky</h4>
<p><a href="/behaviors/visibility.html">Visibility API</a>s now include useful shortcuts for sticky content. A placeholder will automatically be added when an element is passed making sure other content does not adjust position.</p>
<p>Additionally <a href="/behaviors/visibility.html">visibility</a> and <a href="/modules/sticky.html">sticky</a> have been rewritten to use a pub/sub pattern which is much more performant than <code>1.0</code></p>
<div class="ignored code" data-type="javascript">
$('.overlay')
.visibility({
type : 'fixed',
offset : 15 // give some space from top of screen
})
;
</div>
<div class="ui form">
<div class="field">
<label>Favorite Animal</label>
<div class="ui search selection dropdown">
<input type="hidden">
<i class="dropdown icon"></i>
<input type="text" class="search">
<div class="default text">Select one...</div>
<div class="ignored code" data-type="css">
.overlay {
background-color: #FFFFFF;
padding: 0.5em;
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
transition: all 0.5s ease;
background: transparent;
}
/* change style */
.fixed.overlay {
position: fixed;
padding: 1em;
box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2);
}
</div>
<div class="ui segment">
<div class="overlay">
<div class="ui secondary menu">
<a class="item">
<i class="sidebar icon"></i> Menu
</a>
<a class="item">Option 1</a>
<a class="item">Option 2</a>
<a class="item">Option 3</a>
</div>
</div>
<div class="ui clearing divider"></div>
<img src="/images/wireframe/centered-paragraph.png" class="ui wireframe image">
<img src="/images/wireframe/short-paragraph.png" class="ui wireframe image">
<img src="/images/wireframe/media-paragraph.png" class="ui wireframe image">
<img src="/images/wireframe/paragraph.png" class="ui wireframe image">
<img src="/images/wireframe/media-paragraph.png" class="ui wireframe image">
<img src="/images/wireframe/paragraph.png" class="ui wireframe image">
</div>
</div>
</div>

67
server/documents/modules/sticky.html.eco

@ -126,7 +126,6 @@ type : 'UI Module'
</div>
<div class="ui segment" id="example3">
<div class="left ui rail">
<img class="ui wireframe paragraph image" src="/images/wireframe/paragraph.png">
<div class="ui sticky">
<h3 class="ui header">Long Stuck Content</h3>
<div class="ui divided items">
@ -207,6 +206,72 @@ type : 'UI Module'
</div>
</div>
</div>
<div class="item">
<div class="ui tiny image">
<img src="/images/wireframe/image.png">
</div>
<div class="middle aligned content">
<a class="header">Followup Article</a>
<div class="meta">
<span class="author">By <a>Author</a></span>
</div>
</div>
</div>
<div class="item">
<div class="ui tiny image">
<img src="/images/wireframe/image.png">
</div>
<div class="middle aligned content">
<a class="header">Followup Article</a>
<div class="meta">
<span class="author">By <a>Author</a></span>
</div>
</div>
</div>
<div class="item">
<div class="ui tiny image">
<img src="/images/wireframe/image.png">
</div>
<div class="middle aligned content">
<a class="header">Followup Article</a>
<div class="meta">
<span class="author">By <a>Author</a></span>
</div>
</div>
</div>
<div class="item">
<div class="ui tiny image">
<img src="/images/wireframe/image.png">
</div>
<div class="middle aligned content">
<a class="header">Followup Article</a>
<div class="meta">
<span class="author">By <a>Author</a></span>
</div>
</div>
</div>
<div class="item">
<div class="ui tiny image">
<img src="/images/wireframe/image.png">
</div>
<div class="middle aligned content">
<a class="header">Followup Article</a>
<div class="meta">
<span class="author">By <a>Author</a></span>
</div>
</div>
</div>
<div class="item">
<div class="ui tiny image">
<img src="/images/wireframe/image.png">
</div>
<div class="middle aligned content">
<a class="header">Followup Article</a>
<div class="meta">
<span class="author">By <a>Author</a></span>
</div>
</div>
</div>
</div>
</div>
</div>

27
server/documents/views/card.html.eco

@ -10,7 +10,7 @@ title : 'Card'
description : 'A card displays site content in a manner similar to a playing card'
type : 'UI View'
themes : ['Default', 'Basic', 'Classic']
themes : ['Default', 'Basic', 'Classic', 'Instagram']
---
<%- @partial('header') %>
@ -46,6 +46,31 @@ themes : ['Default', 'Basic', 'Classic']
</div>
</div>
</div>
<div class="another example">
<div class="ui card">
<div class="content">
<div class="right floated meta">14h</div>
<img class="ui avatar image" src="/images/avatar/large/elliot.jpg"> Elliot
</div>
<div class="image">
<img class="ui wireframe image" src="/images/wireframe/image.png">
</div>
<div class="content">
<span class="right floated">
<i class="heart outline like icon"></i>
17 likes
</span>
<i class="comment icon"></i>
3 comments
</div>
<div class="extra content">
<div class="ui large transparent left icon input">
<i class="heart outline icon"></i>
<input type="text" placeholder="Add Comment...">
</div>
</div>
</div>
</div>
<div class="example">
<h4 class="ui header">Cards</h4>

61
server/files/javascript/intro.js

@ -57,6 +57,67 @@ semantic.intro.ready = function() {
}
})
;
$('.external.example .ui.search')
.search({
type : 'category',
minCharacters : 3,
apiSettings : {
onFailure: function() {
$(this).search('display message', '<b>Hold off a few minutes</b> <div class="ui divider"></div> GitHub rate limit exceeded for anonymous search.');
},
onResponse: function(githubResponse) {
var
response = {
results : {}
}
;
if(githubResponse.items.length === 0) {
// no results
return response;
}
$.each(githubResponse.items, function(index, item) {
var
language = item.language || 'Unknown',
maxLength = 200,
description
;
if(index >= 8) {
// only show 8 results
return false;
}
// Create new language category
if(response.results[language] === undefined) {
response.results[language] = {
name : language,
results : []
};
}
description = (item.description < maxLength)
? item.description
: item.description.substr(0, maxLength) + '...'
;
description = $.fn.search.settings.templates.escape(description);
// Add result to category
response.results[language].results.push({
title : item.name,
description : description,
url : item.html_url
});
});
return response;
},
url: '//api.github.com/search/repositories?q={query}'
}
})
;
// visiblity
$('.visibility.example .overlay')
.visibility({
type : 'fixed',
offset : 15 // give some space from top of screen
})
;
// menu

6
server/files/javascript/sticky.js

@ -24,7 +24,7 @@ semantic.sticky.ready = function() {
$sticky
.sticky({
context: $context,
offset: 50,
offset: 15,
pushing: true
})
;
@ -41,7 +41,7 @@ semantic.sticky.ready = function() {
$inlineSticky
.sticky({
context: $context,
offset: 39
offset: 15
})
;
}
@ -57,7 +57,7 @@ semantic.sticky.ready = function() {
$sticky
.sticky({
context: $context,
offset: 75
offset: 15
})
;
})

62
server/files/stylesheets/docs.css

@ -68,9 +68,10 @@ code {
border-radius: 3px;
display: inline-block;
font-family: "Monaco","Menlo","Ubuntu Mono","Consolas","source-code-pro",monospace;
font-size: 0.85714em;
font-size: 0.875em;
font-weight: bold;
padding: 0px 5px;
margin-top: -3px;
padding: 3px 6px;
vertical-align: baseline;
}
pre code {
@ -430,6 +431,63 @@ pre code {
color: rgba(0, 0, 0, 0.8);
}
/* Link Styles */
#example .main.container > p a,
#example .main.container > .tab > p a,
#example .main.container .example > .ignored a,
#example .main.container .example > p a {
display: inline-block;
position: relative;
overflow: hidden;
vertical-align: top;
z-index: 2;
-webkit-transition: color 0.2s;
transition: color 0.2s;
}
#example .main.container > p a > code,
#example .main.container > .tab > p a > code,
#example .main.container .example > .ignored a > code,
#example .main.container .example > p a > code {
background-color: rgba(0, 50, 100, 0.08);
}
#example .main.container > p a:before,
#example .main.container > .tab > p a:before,
#example .main.container .example > .ignored a:before,
#example .main.container .example > p a:before {
position: absolute;
top: 0;
left: 0;
z-index: -1;
width: 100%;
height: 100%;
background-color: #4183C4;
content: '';
-webkit-transition: all 0.2s;
transition: all 0.2s;
-webkit-transform: translateY(95%) scaleX(0);
transform: translateY(95%) scaleX(0);
}
/* Hover */
#example .main.container > p a:hover > code,
#example .main.container > .tab > p a:hover > code,
#example .main.container .example > .ignored a:hover > code,
#example .main.container .example > p a:hover > code {
background-color: rgba(0, 50, 100, 0.12);
}
#example .main.container > p a:hover:before,
#example .main.container > p a:focus:before,
#example .main.container > .tab > p a:hover:before,
#example .main.container > .tab > p a:focus:before,
#example .main.container .example > .ignored a:hover:before,
#example .main.container .example > .ignored a:focus:before,
#example .main.container .example > p a:hover:before,
#example .main.container .example > p a:focus:before {
background-color: #2C76BF;
-webkit-transform: translateY(95%) scaleX(1);
transform: translateY(95%) scaleX(1);
}
#example .ui.ad {
max-width: 100%;
}

Loading…
Cancel
Save