Skip to content

Commit 51471b9

Browse files
author
lauren mccarthy
committed
v 0.0.8 fixing mouse and scaling issues, adding doc
1 parent c4dd52c commit 51471b9

File tree

306 files changed

+33826
-5379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+33826
-5379
lines changed

docs/css/main.css

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@
1010
Base styles: opinionated defaults
1111
========================================================================== */
1212

13-
td {
14-
vertical-align: top;
15-
font-size: 1.2em;
16-
padding-bottom: 0.75em;
17-
}
18-
19-
td:first-child {
20-
padding-right: 0.5em;
21-
}
2213

2314
/*
2415
//////////////////////////////////////////////////
@@ -132,10 +123,14 @@ section#reference h2 {
132123
border: none !important;
133124
}
134125

126+
.norender pre {
127+
left: 0px !important;
128+
}
129+
135130
.example-content pre {
136131

137132
margin-top: 0 !important;
138-
width: 33.5em !important;
133+
width: 30.5em !important;
139134
}
140135

141136
.example-content .edit_space {
@@ -291,6 +286,16 @@ body {
291286
line-height: 1.4;
292287
}
293288

289+
td {
290+
vertical-align: top;
291+
font-size: 1.2em;
292+
padding-bottom: 0.75em;
293+
}
294+
295+
td:first-child {
296+
padding-right: 0.5em;
297+
}
298+
294299
/*
295300
* Remove text-shadow in selection highlight: h5bp.com/i
296301
* These selection rule sets have to be separate.
@@ -382,11 +387,11 @@ textarea {
382387
}
383388

384389
#exampleDisplay .edit_button {
385-
left: 29.55em;
390+
left: 29em;
386391
}
387392

388393
#exampleDisplay .reset_button {
389-
left: 32.55em;
394+
left: 32em;
390395
}
391396

392397
#exampleDisplay .edit_space {
@@ -399,7 +404,7 @@ textarea {
399404

400405
#exampleEditor {
401406
height: 500em;
402-
width: 720px;
407+
width: 710px;
403408
overflow: hidden;
404409
margin-top: 0.5em;
405410
color: #222;

docs/css/prism.css

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ textarea {
3636
/* Code blocks */
3737
pre[class*="language-"] {
3838
position:relative;
39-
padding: 0.5em 1em;
39+
padding: 0.5em 1.0em;
4040
margin: 0.5em 0 0 -0.5em;
4141
border-left: 0.5em solid #AFAFAF; /* coy og blue 10px solid 358ccb */
4242
background-color: #fff; /* coy og white #fdfdfd */
4343
/* lines */
44-
background-image: -webkit-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%);
45-
background-image: -moz-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%);
46-
background-image: -ms-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%);
47-
background-image: -o-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%);
48-
background-image: linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%);
44+
background-image: -webkit-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.06) 50%);
45+
background-image: -moz-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.06) 50%);
46+
background-image: -ms-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.06) 50%);
47+
background-image: -o-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.06) 50%);
48+
background-image: linear-gradient(transparent 50%, rgba(69, 142, 209, 0.06) 50%);
4949
background-size: 2.9em 2.9em; /* adjusts height of alternating lines */
5050
background-origin:content-box;
5151
/* set overflow to just let the code roll */
@@ -56,7 +56,6 @@ pre[class*="language-"] {
5656
}
5757

5858
code[class*="language"] {
59-
6059
}
6160

6261

@@ -172,42 +171,44 @@ pre[class*="language-"]:after {
172171
}
173172

174173
pre.line-numbers {
175-
position: relative;
176-
padding-left: 3.8em;
177-
counter-reset: linenumber;
174+
position: relative;
175+
padding-left: 3.8em;
176+
counter-reset: linenumber;
178177
}
179178

180179
pre.line-numbers > code {
181-
position: relative;
180+
position: relative;
182181
}
183182

184183
.line-numbers .line-numbers-rows {
185-
position: absolute;
186-
pointer-events: none;
187-
top: 0;
184+
position: absolute;
185+
pointer-events: none;
186+
top: 0;
188187
font-size: 100%;
189-
left: -3.8em;
190-
width: 3em; /* works for line-numbers below 1000 lines */
191-
letter-spacing: -1px;
192-
border-right: 1px solid #999;
188+
left: -3.8em;
189+
width: 3em; /* works for line-numbers below 1000 lines */
190+
letter-spacing: -1px;
191+
border-right: 1px solid #999;
193192

194-
-webkit-user-select: none;
195-
-moz-user-select: none;
196-
-ms-user-select: none;
197-
user-select: none;
193+
-webkit-user-select: none;
194+
-moz-user-select: none;
195+
-ms-user-select: none;
196+
user-select: none;
198197

199198
}
200199

201200
.line-numbers-rows > span {
202-
pointer-events: none;
203-
display: block;
204-
counter-increment: linenumber;
201+
pointer-events: none;
202+
display: block;
203+
counter-increment: linenumber;
205204
}
206205

207206
.line-numbers-rows > span:before {
208-
content: counter(linenumber);
209-
color: #999;
210-
display: block;
211-
padding-right: 0.8em;
212-
text-align: right;
213-
}
207+
content: counter(linenumber);
208+
color: #999;
209+
display: block;
210+
padding-right: 0.8em;
211+
text-align: right;
212+
}
213+
214+

docs/js/examples.js

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
var examples = {
2+
init: function(file) {
3+
4+
// Editor
5+
6+
examples.editor = ace.edit('exampleEditor');
7+
//examples.editor.setTheme('ace/theme/monokai');
8+
examples.editor.getSession().setMode('ace/mode/javascript');
9+
examples.editor.getSession().setTabSize(2);
10+
11+
examples.dims = [];
12+
13+
// Button
14+
15+
$('#runButton').click( function() {
16+
examples.runExample();
17+
});
18+
$('#resetButton').click( function() {
19+
examples.resetExample();
20+
});
21+
22+
// Example Frame
23+
24+
$('#exampleFrame').load(function() {
25+
var exampleCode = examples.editor.getSession().getValue();
26+
27+
try {
28+
29+
if (exampleCode.indexOf('new p5()') === -1) {
30+
exampleCode += '\nnew p5();';
31+
}
32+
33+
if (examples.dims.length < 2) {
34+
var re = /createCanvas\((.*),(.*)\)/g;
35+
var arr = exampleCode.split(re);
36+
$('#exampleFrame').height(arr[2]+'px');
37+
} else {
38+
$('#exampleFrame').height(examples.dims[1]+'px');
39+
}
40+
41+
var userScript = $('#exampleFrame')[0].contentWindow.document.createElement('script');
42+
userScript.type = 'text/javascript';
43+
userScript.text = exampleCode;
44+
userScript.async = false;
45+
$('#exampleFrame')[0].contentWindow.document.body.appendChild(userScript);
46+
47+
} catch (e) {
48+
console.log(e.message);
49+
}
50+
});
51+
52+
// Capture clicks
53+
54+
$.ajax({
55+
url: file,
56+
dataType: 'text'
57+
})
58+
.done(function (data) {
59+
$('#exampleSelector').hide();
60+
// strip description
61+
62+
var frameRe = /@frame (.*),(.*)/g;
63+
//var re = /createCanvas\((.*),(.*)\)/g;
64+
var arr = data.split(frameRe);
65+
if (arr.length > 2) {
66+
examples.dims[0] = arr[1];
67+
examples.dims[1] = arr[2];
68+
}
69+
70+
var ind = data.indexOf('*/');
71+
data = data.substring(ind+3);
72+
examples.resetData = data;
73+
74+
examples.showExample();
75+
})
76+
},
77+
showExample: function() {
78+
examples.editor.getSession().setValue(examples.resetData);
79+
80+
//resize height of editor
81+
var rows = examples.editor.getSession().$rowLengthCache.length;
82+
var lineH = examples.editor.renderer.lineHeight;
83+
$('#exampleEditor').height(rows*lineH+'px');
84+
85+
examples.runExample();
86+
$('#exampleDisplay').show();
87+
},
88+
runExample: function() {
89+
$('#exampleFrame').attr('src', $('#exampleFrame').attr('src'));
90+
},
91+
resetExample: function() {
92+
examples.showExample();
93+
}
94+
}

docs/js/main.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
/*
1+
$('#family form').hover(
2+
function() {
3+
$('#search_field').css('visibility', 'visible');
4+
$('#search_field').animate({width: '9.75em'}, 100);
5+
},
6+
function() {
7+
if ($('#search_field').val() === '') {
8+
closeSearch();
9+
}
10+
}
11+
);
212

3-
Hastily written scroll to fixed position:
4-
5-
TO DO:
6-
7-
- needs to not fail on resize of resize after scrolling,
8-
- and needs to use animate() to add jquery easing
9-
10-
*/
11-
12-
var elementPosition = $('#menu').offset();
13-
14-
$(window).scroll(function(){
15-
if($(window).scrollTop() > elementPosition.top){
16-
var top = Math.round($(window).scrollTop()-elementPosition.top);
17-
$('#menu').css({'margin-top': top});
18-
} else {
19-
$('#menu').css({'margin-top': 0});
20-
}
13+
$('#family form').focusout(function() {
14+
closeSearch();
2115
});
16+
17+
function closeSearch() {
18+
$('#search_field').css('width', '0em');
19+
$('#search_field').css('visibility', 'hidden');
20+
console.log($('#search_field').attr('width'));
21+
}

0 commit comments

Comments
 (0)