Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d62e16f
Starting tutorial 01
braughtg Jun 29, 2026
b31b371
adds FarmData2 logo
braughtg Jun 29, 2026
85654a8
adds title and paragraph
braughtg Jun 29, 2026
410970f
adds unordered list of features
braughtg Jun 29, 2026
45582d5
adds a link to the FarmData2 repo on GitHub
braughtg Jun 29, 2026
48b8928
adds missing heading and changes title
braughtg Jun 29, 2026
57e6e67
adds css style sheet to index.html
braughtg Jun 29, 2026
3719341
added a different font to the page
braughtg Jun 29, 2026
c54f1fb
adds background color and styles body
braughtg Jun 29, 2026
8d7bf79
styles the heading
braughtg Jun 29, 2026
e83b2a5
centers the FarmData2 logo
braughtg Jun 29, 2026
bc7e506
Merge branch 'main' into tutorial-01-html-css
braughtg Jun 30, 2026
dbdcba1
Merge branch 'main' into tutorial-01-html-css
braughtg Jul 1, 2026
0008572
adds script/main.js and links in index.html
braughtg Jul 9, 2026
cf30a8e
adds the image changer
braughtg Jul 9, 2026
2cdda2f
adds the custom greeting
braughtg Jul 9, 2026
71bca3e
fixes null username issue
braughtg Jul 9, 2026
226cafa
Merge branch 'main' into t01-html-css-js
braughtg Jul 12, 2026
3a48c82
adds flashword directory and starter code
braughtg Jul 12, 2026
e07b31b
fixes broken cdn link
braughtg Jul 12, 2026
8b84a40
add answer input field
braughtg Jul 12, 2026
8bf3d63
adds answer checking
braughtg Jul 12, 2026
bca1ec9
refactors feedback into a div
braughtg Jul 12, 2026
7974445
factors out checkAnswer method
braughtg Jul 12, 2026
1b6b6a4
adds cloaking to remove raw code flash
braughtg Jul 12, 2026
06c65af
adds the reset button
braughtg Jul 12, 2026
632d18e
uses template element in place of div
braughtg Jul 13, 2026
41cdee8
adds array of words examples to data
braughtg Jul 13, 2026
e8f5de0
adds examples of the use of v-for
braughtg Jul 13, 2026
0cbc6f3
removes v-for examples
braughtg Jul 13, 2026
4f5f0dd
add event example code
braughtg Jul 13, 2026
3fca5c0
adds v-on for enter key to check answer
braughtg Jul 13, 2026
d167a4c
adds images for correct/incorrect answers
braughtg Jul 13, 2026
9f012ca
refactor img binding and add alt text
braughtg Jul 13, 2026
c754245
create error and indicator when empty word is checked
braughtg Jul 13, 2026
52a2c0e
refactor validation coloring to bind style
braughtg Jul 13, 2026
840903a
adds show hint checkbox
braughtg Jul 13, 2026
6264b91
adds difficulty level inputs
braughtg Jul 13, 2026
477ad64
add textarea example
braughtg Jul 13, 2026
58c7c12
adds fullname computed property example
braughtg Jul 24, 2026
c42763d
adds method example and cleans formatting
braughtg Jul 24, 2026
9f98fca
adds the shortSpanishWords computed property
braughtg Jul 24, 2026
063d6ef
adding the watch example
braughtg Jul 24, 2026
263cc96
Merge branch 'main' into t03-vue2
braughtg Aug 28, 2026
9435efd
adds the error css class
braughtg Aug 29, 2026
dfc686c
removes class binding for text input
braughtg Aug 29, 2026
f1dc9df
finish merge of main
braughtg Aug 29, 2026
957ee68
Merge branch 'main' into t03-vue2
braughtg Sep 4, 2026
515bdd4
sets clean starting point for e03
braughtg Sep 4, 2026
bbe0fc0
disables reset button when input is empty
braughtg Sep 4, 2026
24b00d2
adds CSS classes for input field error styling
braughtg Sep 4, 2026
cfd0958
adds computed property for text input style
braughtg Sep 4, 2026
71cc001
styles input using computed property
braughtg Sep 4, 2026
c2bc27f
removes explicit management of background color
braughtg Sep 4, 2026
150d8db
resets error styling when answer is not empty
braughtg Sep 4, 2026
0baeb52
added badge feature
braughtg Sep 4, 2026
dcee1ff
Merge branch 'main' into e03-vue2
braughtg Sep 4, 2026
55d662b
adding trailer
braughtg Sep 4, 2026
646ca7c
Merge branch 'main' into e03-vue2
braughtg Sep 4, 2026
3d8049a
Merge branch 'main' into e03-vue2
braughtg Sep 4, 2026
4b7df54
Merge branch 'main' into e03-vue2
braughtg Sep 4, 2026
db46da3
Merge branch 'main' into e03-vue2
braughtg Sep 4, 2026
d7ea485
Merge branch 'main' into e03-vue2
braughtg Sep 4, 2026
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
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"eslint",
"flashword",
"husky",
"lightpink",
"keyup",
"linkcheck",
"lintstaged",
Expand Down
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 web-projects/first-website/images/fd2-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions web-projects/first-website/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<link href="styles/style.css" rel="stylesheet" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap"
rel="stylesheet"
/>
<script async src="scripts/main.js"></script>
<title>The FarmData2 Project</title>
</head>
<body>
<h1>The FarmData2 Project</h1>

<img
src="images/fd2-logo.png"
alt="The FarmData2 Logo showing a carrot on a mobile phone screen."
/>

<p>
<a href="https://github.com/FarmData2/FarmData2">FarmData2</a> aims to
extend farmOS by adding data input forms, reporting, and analytics that
support the day-to-day operation of diversified vegetable farms, while
also facilitating the keeping of records necessary for organic
certification and for the study of sustainable farming practices.
</p>

<p>
FarmData2 contains features for recording the following activities that
are likely to occur on a small diversified vegetable farm.
</p>
<ul>
<li>Tray seeding</li>
<li>Direct seeding</li>
<li>Cover crop seeding</li>
<li>Transplanting</li>
<li>Soil disturbance</li>
</ul>

<button>Change user</button>
</body>
</html>
34 changes: 34 additions & 0 deletions web-projects/first-website/scripts/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const myImage = document.querySelector('img')

myImage.addEventListener('click', () => {
const mySrc = myImage.getAttribute('src')
if (mySrc === 'images/fd2-logo.png') {
myImage.setAttribute('src', 'images/fd2-logo-orange.png')
} else {
myImage.setAttribute('src', 'images/fd2-logo.png')
}
})

let myButton = document.querySelector('button')
let myHeading = document.querySelector('h1')

function setUserName() {
const myName = prompt('Please enter your name.')
if (!myName) {
setUserName()
} else {
localStorage.setItem('name', myName)
myHeading.textContent = `Mozilla is cool, ${myName}`
}
}

if (!localStorage.getItem('name')) {
setUserName()
} else {
const storedName = localStorage.getItem('name')
myHeading.textContent = `FarmData2 is cool, ${storedName}`
}

myButton.addEventListener('click', () => {
setUserName()
})
37 changes: 37 additions & 0 deletions web-projects/first-website/styles/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
html {
/* px means "pixels". The base font size is now 10 pixels high */
font-size: 10px;
/* Replace PLACEHOLDER with the font-family property value you got from Google Fonts */
font-family: 'Roboto', sans-serif;
background-color: #b8fdb1;
}

h1 {
font-size: 60px;
text-align: center;
margin: 0;
padding: 20px 0;
color: #12601b;
text-shadow: 3px 3px 1px #b8fdb1;
}

p,
li {
font-size: 16px;
line-height: 2;
letter-spacing: 1px;
}

body {
width: 600px;
margin: 0 auto;
background-color: #ff9500;
padding: 0 20px 20px 20px;
border: 5px solid black;
}

img {
display: block;
margin: 0 auto;
max-width: 100%;
}
77 changes: 77 additions & 0 deletions web-projects/flashword/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
const Flashword = {
data() {
return {
wordA: 'hola',
wordB: 'hello',
answer: '',
correct: null,
showFeedback: false,
hasError: false,
correctAnswers: 0,
totalAnswers: 0,

// Array of objects example
words: [
{ wordA: 'hola', wordB: 'hello' },
{ wordA: 'adios', wordB: 'goodbye' },
{ wordA: 'uno', wordB: 'one' },
{ wordA: 'dos', wordB: 'two' },
],
};
},
watch: {
answer(newAnswer) {
if (newAnswer !== '') {
this.hasError = false;
}
},
},
computed: {
inputCSSClass() {
return this.hasError ? 'error' : 'no-error';
},
correctPercentage() {
if (this.totalAnswers === 0) {
return 0;
}

return (this.correctAnswers / this.totalAnswers) * 100;
},
earnedBadge() {
return this.correctPercentage >= 80;
},
},
methods: {
checkAnswer() {
if (this.answer == '') {
this.hasError = true;
return;
}

this.hasError = false;
this.correct = this.wordB == this.answer;

this.totalAnswers++;

if (this.correct) {
this.correctAnswers++;
}

this.showFeedback = true;
},
reset() {
this.answer = '';
this.showFeedback = false;
this.correct = null;
this.hasError = false;

// Reset to a new random word
const randomIndex = Math.floor(Math.random() * this.words.length);
this.wordA = this.words[randomIndex].wordA;
this.wordB = this.words[randomIndex].wordB;
},
},
};

// eslint-disable-next-line no-unused-vars, no-undef
const app = Vue.createApp(Flashword).mount('#app');
Binary file added web-projects/flashword/images/badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions web-projects/flashword/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<!doctype html>
<html lang="en">
<head>
<title>FlashWord</title>
<meta charset="utf-8" />

<script src="https://unpkg.com/vue@3/dist/vue.global.js" defer></script>
<script src="app.js" defer></script>

<style>
label {
display: block;
}

input,
button {
display: block;
margin: 10px 0px;
}

.correct {
color: green;
}

.incorrect {
color: red;
}

.error {
background-color: lightpink;
}

.no-error {
background-color: white;
}

[v-cloak] {
display: none;
}
</style>
</head>

<body>
<h1>FlashWord</h1>

<p>
This is a simple flashcard app that will show you a word in Spanish and
ask you to enter the translation in English.
</p>

<div id="app" v-cloak>
What is the English translation of the word <strong>{{ wordA }}</strong>?

<label for="translation-input">Translation:</label>
<input
type="text"
id="translation-input"
v-model="answer"
placeholder="Enter translation"
v-bind:class="inputCSSClass"
/>

<p v-show="answer != ''">You answered: {{ answer }}</p>

<button v-on:click="checkAnswer()">Check answer</button>

<p v-show="showFeedback && correct" class="correct">You got it!</p>
<p v-show="showFeedback && !correct" class="incorrect">
Sorry, please try again.
</p>

<button v-on:click="reset()" v-bind:disabled="answer == ''">Reset</button>

<div v-show="earnedBadge">
<p>Badge earned!</p>
<img
src="images/badge.png"
alt="Badge earned for answering at least 80 percent correctly"
/>
</div>
</div>
</body>
</html>