Skip to content

Commit

Permalink
AI for Template
Browse files Browse the repository at this point in the history
Update the AI
  • Loading branch information
yanyiyi committed Aug 15, 2015
1 parent 7ceae39 commit 6d5f16c
Show file tree
Hide file tree
Showing 5 changed files with 5,331 additions and 22 deletions.
35 changes: 22 additions & 13 deletions css.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ input{
width: 320px;
}

button{
color: #bab7b1;
background-color: rgba(255,255,255,0.4);
font-size: 18px;
border: 1px #FFF dotted;
width: 320px;
}


input[type="range"]{

Expand Down Expand Up @@ -43,29 +37,44 @@ iframe{
width: 1173px;
height: 800px;
overflow: hidden;
position: relative;
}

input[type="range"]:nth-child(even){
width: 100px;
}
@media print{
input {
display:none;
display: none;
}

iframe{
width: 1120px;
height: 740px;

}
buttom{
display:none;
button{
display: none;
}

span{
display: none;
}
}

#cameraC{
margin: 0 auto;
position: absolute;
bottom: 10%;
right: 30%;
}
top: 650px;
left: 640px;
color: #FFF;
}

button{
color: #bab7b1;
background-color: #3f9;
font-size: 18px;
border: 1px #FFF dotted;
width: 120px;
opacity: 0.5;
}
5 changes: 2 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
<body>
<div id="all">
<iframe src="p5js.html" ></iframe>
<INPUT NAME="print" TYPE="button" id="cameraC" VALUE="拍下此刻"
ONCLICK="varitext()">

<button NAME="print" TYPE="button" id="cameraC"
ONCLICK="varitext()">Print</button>
</div>

</body>
Expand Down
24 changes: 18 additions & 6 deletions sketch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
var img;
var fTitle;
var tName,tSay,camX,camY,camOffsetX,camOffsetY,yearX,nBtn;

var tag1,tag2,tag3,tag4,tag5;
function preload() {
img1 = loadImage("coscup-01.png");
img2 = loadImage("coscup-02.png");
Expand All @@ -23,9 +25,9 @@ function setup() {
tName.position(640,232);
tSay = createInput("你想說的話").size(320,24);
tSay.position(640,455);
camX = createSlider(490,720,490);
camX = createSlider(490,720,605);
camX.position(250,500);
camY = createSlider(368,480,368);
camY = createSlider(368,480,424);
camY.position(40,285);

camOffsetX = createSlider(-150,150,0);
Expand All @@ -34,9 +36,19 @@ function setup() {
camOffsetY.position(40,310);
yearX = createSlider(1,7,7);
yearX.position(210,700);
nBtn = createButton("存下此刻",0);
nBtn = createButton("Save",0);
nBtn.position(640,600);
varX = 0;
tag1 = createElement("span","高矮");
tag2 = createElement("span","寬瘦");
tag3 = createElement("span","上下");
tag4 = createElement("span","左右");
tag5 = createElement("span","年");
tag1.position(5,285);
tag2.position(215,500);
tag3.position(5,310);
tag4.position(215,525);
tag5.position(188,700);
varX = 0;
}
var displayName,displaySay,displayX,displayY,ofX,ofY;
function draw() {
Expand All @@ -47,7 +59,7 @@ displayY = camY.value();
ofX = camOffsetX.value();
ofY = camOffsetY.value();
imgX = yearX.value();
image(capture, 150+ofX, 90+ofY, displayX, displayY);
image(capture, 350+ofX-displayX/2, 315+ofY-displayY/2, displayX, displayY);


switch(imgX) {
Expand Down Expand Up @@ -95,7 +107,7 @@ function mousePressed() {
}
if (mouseX > 590 && mouseX < 960 && mouseY > 590 && mouseY < 700){

saveCanvas(canvas,'myCanvas'+varX, 'png');
saveCanvas(canvas,'COSCUP'+varX+displayName, 'jpg');
varX++;
}
}
Loading

0 comments on commit 6d5f16c

Please sign in to comment.