Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 186 additions & 0 deletions woof/code/woof-libs-code.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
<head>
<script src="https://cdn.rawgit.com/stevekrouse/WoofJS/cb6d0621/dist/woof.js"></script>
<script>
setBackdropColor("white")

var noun1 = "___________"
var adverb1 = "___________ "
var adjective1 = "___________ "
var noun2 = "___________"
var verb1 = "___________"
var noun3 = "___________"
var noun4 = "___________"
var verb2 = "___________"
var exclamation1 = "___________"
var number1 = "___________"
var verb3 = "___________"
var noun5 = "___________"
var topLine = maxY - 100
var fontSize = 20

var buttonFront = new Rectangle({
width: 200,
height: 55,
color: "pink",
y: topLine + 50,
x: minX + 120
})

var buttonBack = new Rectangle({
width: 210,
height: 65,
color: "black",
y: topLine + 50,
x: minX + 120
})
buttonBack.sendToBack()

var buttonText = new Text({
text: () => "Press Me!",
size: 30,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
y: topLine + 52,
x: minX + 50
})

function askQuestions() {
noun1 = prompt("Enter a year.")
noun2 = prompt("Enter a plural noun.")
adverb1 = prompt("Enter an adverb.")
verb1 = prompt("Enter a past tense verb.")
noun3 = prompt("Enter a plural noun.")
noun4 = prompt("Enter a feeling.")
verb2 = prompt("Enter a present tense verb.")
exclamation1 = prompt("Enter an exclamation.")
number1 = prompt("Enter a number.")
verb3 = prompt("Enter a past tense verb.")
noun5 = prompt("Enter a place.")
adjective1 = prompt("Enter an adjective.")
}

var firstLine = new Text({
text: () => "I was born in " + noun1 +" in a small town.",
size: fontSize,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
x: minX + 20,
y: topLine
})

var secondLine = new Text({
text: () => "As I child, I ate " + noun2 +".",
size: fontSize,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
x: minX + 20,
y: firstLine.y - 30
})

var thirdLine = new Text({
text: () => "Living " + adverb1 + ", I began to be " + verb1 + ".",
size: fontSize,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
x: minX + 20,
y: secondLine.y - 30
})

var fourthLine = new Text({
text: () => "It's crazy: " + noun2 + " weren't as popular as " + noun3 +".",
size: fontSize,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
x: minX + 20,
y: thirdLine.y - 30
})

var fifthLine = new Text({
text: () => "So why did I feel " + noun4 +"?",
size: fontSize,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
x: minX + 20,
y: fourthLine.y - 30
})

var sixthLine = new Text({
text: () => "I know why. I couldn't " + verb2 + " without " + noun2 + ".",
size: fontSize,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
x: minX + 20,
y: fifthLine.y - 30
})

var seventhLine = new Text({
text: () => exclamation1 + "!",
size: fontSize,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
x: minX + 20,
y: sixthLine.y - 30
})

var eigthLine = new Text({
text: () => number1 + " years later, I returned to " + noun5 +".",
size: fontSize,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
x: minX + 20,
y: seventhLine.y - 30
})

var ninthLine = new Text({
text: () => "Can you believe that?",
size: fontSize,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
x: minX + 20,
y: eigthLine.y - 30
})

var tenthLine = new Text({
text: () => "It's such a " + adjective1 +" story, I know.",
size: fontSize,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
x: minX + 20,
y: ninthLine.y - 30
})

var book = new Image({
url: "../images/woof-libs-book.png",
})

var dancers = new Image({
url: "../images/woof-libs-dancers.png",
y: firstLine.y,
x: maxX - 100
})

var powerMan = new Image({
url: "../images/woof-libs-powerman.png",
y: sixthLine.y,
x: 200
})

buttonFront.onMouseDown(() => {
askQuestions();
})
</script>
</head>
<body>

</body>
Binary file added woof/images/woof-libs-book.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added woof/images/woof-libs-dancers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added woof/images/woof-libs-powerman.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added woof/images/woof-libs-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions woof/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ <h1>Level 1</h1>
<div>Fly Trap</div>
</a>
</div>
<div class="project-block">
<a href="./woof-libs.html">
<img class="project-image" src="./images/woof-libs-screenshot.png">
<div>Woof Libs</div>
</a>
</div>
</div>
</div>

Expand Down
43 changes: 43 additions & 0 deletions woof/snippets/woof-libs-step1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.rawgit.com/stevekrouse/WoofJS/cb6d0621/dist/woof.js"></script>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Woof Libs Step 1</title>
</head>
<body>

<script>
var topLine = maxY - 100

var buttonFront = new Rectangle({
width: 200,
height: 55,
color: "pink",
y: topLine + 50,
x: minX + 120
})

var buttonBack = new Rectangle({
width: 210,
height: 65,
color: "black",
y: topLine + 50,
x: minX + 120
})
buttonBack.sendToBack()

var buttonText = new Text({
text: () => "Press Me!",
size: 30,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
y: topLine + 52,
x: minX + 50
})
</script>
</body>
</html>
55 changes: 55 additions & 0 deletions woof/snippets/woof-libs-step2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.rawgit.com/stevekrouse/WoofJS/cb6d0621/dist/woof.js"></script>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Woof Libs Step 2</title>
</head>
<body>

<script>
var topLine = maxY - 100
var fontSize = 20
var noun1 = "___________"

var buttonFront = new Rectangle({
width: 200,
height: 55,
color: "pink",
y: topLine + 50,
x: minX + 120
})

var buttonBack = new Rectangle({
width: 210,
height: 65,
color: "black",
y: topLine + 50,
x: minX + 120
})
buttonBack.sendToBack()

var buttonText = new Text({
text: () => "Press Me!",
size: 30,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
y: topLine + 52,
x: minX + 50
})

var firstLine = new Text({
text: () => "I was born in " + noun1 +".",
size: fontSize,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
x: minX + 20,
y: topLine
})
</script>
</body>
</html>
62 changes: 62 additions & 0 deletions woof/snippets/woof-libs-step3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.rawgit.com/stevekrouse/WoofJS/cb6d0621/dist/woof.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Woof Libs Step 3</title>
</head>
<body>

<script>
var topLine = maxY - 100
var fontSize = 20
var noun1 = "___________"

var buttonFront = new Rectangle({
width: 200,
height: 55,
color: "pink",
y: topLine + 50,
x: minX + 120
})

var buttonBack = new Rectangle({
width: 210,
height: 65,
color: "black",
y: topLine + 50,
x: minX + 120
})
buttonBack.sendToBack()

var buttonText = new Text({
text: () => "Press Me!",
size: 30,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
y: topLine + 52,
x: minX + 50
})

var firstLine = new Text({
text: () => "I was born in " + noun1 +".",
size: fontSize,
color: "black",
fontFamily: "sans-serif",
textAlign: "left",
x: minX + 20,
y: topLine
})

function askQuestions() {
noun1 = prompt("Enter a year.")
}

buttonFront.onMouseDown(() => {
askQuestions();
})
</script>
</body>
</html>
Loading