Skip to content

Commit 4b78312

Browse files
committed
Keep release files and move p5 feature sketches
1 parent 0497bfd commit 4b78312

File tree

143 files changed

+251218
-41
lines changed

Some content is hidden

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

143 files changed

+251218
-41
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ src/templates/pages/examples/*
2626
src/offline-reference
2727
!src/templates/pages/examples/.gitkeep
2828
dist/*
29+
!dist/git-pull.php
30+
!dist/download/release.php

Gruntfile.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ module.exports = function(grunt) {
213213
src: '**',
214214
dest: '<%= config.dist %>/assets/learn'
215215
},
216+
p5_featured: {
217+
expand: true,
218+
cwd: '<%= config.src %>/assets/p5_featured',
219+
src: '**',
220+
dest: '<%= config.dist %>/assets/p5_featured'
221+
},
216222
examples: {
217223
expand: true,
218224
cwd: '<%= config.src %>/data/examples',
@@ -243,12 +249,6 @@ module.exports = function(grunt) {
243249
src: ['**'],
244250
dest: '<%= config.dist %>/zh-Hans/reference'
245251
},
246-
gitDeploy: {
247-
expand: true,
248-
cwd: '<%= config.src %>',
249-
src: 'git-pull.php',
250-
dest: '<%= config.dist %>'
251-
},
252252
offlineReference: {
253253
files: [
254254
{
@@ -284,14 +284,8 @@ module.exports = function(grunt) {
284284
clean: {
285285
assets: [
286286
'<%= config.dist %>/**/*.*',
287+
'!<%= config.dist %>/download/release.php',
287288
'!<%= config.dist %>/git-pull.php',
288-
'!<%= config.dist %>/**/reference/**/*.*',
289-
'!<%= config.dist %>/**/helpers/**/*.*',
290-
'!<%= config.dist %>/assets/img/**/*.*',
291-
'!<%= config.dist %>/assets/p5_featured/**/*.*',
292-
'!<%= config.dist %>/download/version*.json',
293-
'!<%= config.dist %>/download/*.php',
294-
'!<%= config.dist %>/learn/books/**/*.*',
295289
'<%= config.src %>/offline-reference/**/*.*'
296290
]
297291
},

dist/git-pull.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
echo system('git reset --hard');
3+
echo system('git checkout -- .');
4+
echo system('git pull git://github.com/processing/p5.js-website.git gh-pages');
5+
?>

git-pull.php

Lines changed: 0 additions & 14 deletions
This file was deleted.
1.62 KB
Loading
2.81 KB
Loading
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title></title>
5+
<script type="text/javascript" src="src/Tone.js"></script>
6+
<script type="text/javascript" src="src/Player.js"></script>
7+
<script type="text/javascript" src="src/Player02.js"></script>
8+
<script type="text/javascript" src="src/p5.js"></script>
9+
<script type="text/javascript" src="src/p5.dom.js"></script>
10+
<script type="text/javascript" src="src/Splash.js"></script>
11+
<script type="text/javascript" src="src/SplashSystem.js"></script>
12+
<script type="text/javascript" src="src/Visualizer.js"></script>
13+
14+
<!-- to load font -->
15+
<link type="text/css" rel="stylesheet" href="http://fonts.googleapis.com/css?family=Abel|Inconsolata:400,700&amp;nftmvh" media="all">
16+
17+
<style type="text/css">
18+
body{
19+
margin: 0px;
20+
background-color: #fafafa;
21+
font-family: 'Inconsolata', "Courier New", Courier, monospace, "Times New Roman", Times, serif;
22+
font-size : 10px;
23+
}
24+
25+
#textarea{
26+
font-family: 'Inconsolata', "Courier New", Courier, monospace, "Times New Roman", Times, serif;
27+
vertical-align: text-top;
28+
position: fixed;
29+
border : 0px;
30+
opacity: 0.7;
31+
width : 400px;
32+
height: 400px;
33+
top: 160px;
34+
left: 280px;
35+
z-index: 1;
36+
}
37+
#textarea:focus {
38+
outline: none !important;
39+
}
40+
41+
#p5Canvas {
42+
margin: 0px;
43+
position: absolute;
44+
top : 0px;
45+
left : 0px;
46+
z-index: -1;
47+
}
48+
#logo {
49+
position: fixed;
50+
top: 20px;
51+
left: 383px;
52+
z-index: 1;
53+
54+
}
55+
#footer {
56+
color: #aaa;
57+
position:fixed;
58+
text-align: center;
59+
left: 255px;
60+
bottom: 10px;
61+
62+
}
63+
#footer a {
64+
color: #aaa;
65+
}
66+
#footer a:hover {
67+
color: #aaa;
68+
text-decoration: line-through;
69+
}
70+
</style>
71+
</head>
72+
<body>
73+
<script>
74+
//get visualizer object
75+
var mVisualizers = [];
76+
var maxNumVisualizers = 7;
77+
78+
for(var i = 0; i < maxNumVisualizers; i ++){
79+
mVisualizers[i] = new Visualizer();
80+
}
81+
82+
function setup(){
83+
var VisualizerWidth = mVisualizers[0].returnWindowWidth();
84+
var VisualizerHeight = mVisualizers[0].returnWindowHeight();
85+
canvas = createCanvas(VisualizerWidth, VisualizerHeight);
86+
canvas.id("p5Canvas");
87+
frameRate(60);
88+
angleMode(DEGREES);
89+
90+
for(var i = 0; i < maxNumVisualizers; i ++){
91+
mVisualizers[i].setup();
92+
}
93+
};
94+
95+
function draw(){
96+
clear();
97+
for(var i = 0; i < maxNumVisualizers; i ++){
98+
mVisualizers[i].update();
99+
mVisualizers[i].draw();
100+
101+
if( mVisualizers[i].returnTrigger() ){
102+
// console.log("mVisualizers[i].returnTrigger() : " + mVisualizers[i].returnTrigger());
103+
104+
var note = mPlayer.playRain();
105+
note.start();
106+
}
107+
}
108+
};
109+
110+
111+
112+
113+
//create class object
114+
var mPlayer = new Player02();
115+
mPlayer.whiteNoise();
116+
mPlayer.preSetting();
117+
118+
Tone.Buffer.onload = function(){};
119+
120+
//when you type something then excute keyIncreas()
121+
document.onkeyup = keyIncrease;
122+
123+
var keyCount = 0;
124+
var newInterval = 1;
125+
126+
function keyIncrease(event){
127+
//when you type something then this function will be excuted and then make keyCount increase
128+
keyCount += 3;
129+
130+
//set maximum of keyCount
131+
if(keyCount > 100){
132+
keyCount = 100;
133+
}
134+
135+
//typewritter
136+
var key = event.keyCode;
137+
138+
if( key == 32 && Tone.Buffer.allLoaded){
139+
var note = mPlayer.playKeyReturn();
140+
note.start();
141+
} else if (key == 13 && Tone.Buffer.allLoaded){
142+
var note = mPlayer.playKeySpace();
143+
note.start();
144+
} else if (Tone.Buffer.allLoaded){
145+
var note = mPlayer.playKeyStroke();
146+
note.start();
147+
}
148+
}
149+
150+
//it will excute keyDecrease() every 50ms
151+
setInterval(keyDecrease, 50);
152+
153+
function keyDecrease(){
154+
//every 50ms, keyCount decreased
155+
keyCount -= 1;
156+
157+
//set minimun of keyCount
158+
if(keyCount < 0){
159+
keyCount = 0;
160+
}
161+
162+
//remap keyCount to newInterval, this variable will have range of values between 0.15 to 1.00
163+
newInterval = Math.abs(0.85 - keyCount * 0.01 + 0.15);
164+
if(newInterval < 0.15){
165+
//just in case..
166+
newInterval = 0.15;
167+
}
168+
169+
for(var i = 0; i < maxNumVisualizers; i ++){
170+
mVisualizers[i].getNewInterval(newInterval);
171+
}
172+
}
173+
174+
175+
//html
176+
function resetTextarea(){
177+
document.getElementById('textarea').value = ' ';
178+
}
179+
</script>
180+
181+
<!-- <div id="logo"><img src="../image/logo.png"></div>
182+
<textarea id="textarea" onfocus="resetTextarea()" >Type what you feel with Interactive rainy sound. </textarea>
183+
<div id="footer">Interactive Music @ITP 2015 Spring / Javascript/HTML/CSS/TONE.js/P5.js / <a href =" http://kimsehyun.kr" target="_blank">http://kimsehyun.kr</a></div> -->
184+
</body>
185+
</html>
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)