Skip to content

Commit 2f21d2a

Browse files
jlystgitbook-bot
authored andcommitted
GitBook: [master] 28 pages modified
1 parent 129cafa commit 2f21d2a

17 files changed

+74
-110
lines changed

docs/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* [9. Visual Enhancement](code-template/template-build-tutorial/9.-visual-enhancement.md)
1818
* [Managing the Question DB](code-template/managing-the-question-db.md)
1919

20-
## More
20+
## More <a id="advanced"></a>
2121

2222
* [Code Mod Examples](advanced/code-mod-examples/README.md)
2323
* [Style Changes with CSS](advanced/code-mod-examples/style-changes-with-css.md)

docs/advanced/code-mod-examples/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22

33
**In the menu to the left you can find a list of example code modifications you could make to the trivia game.**
44

5+
{% embed url="https://www.loom.com/share/3dbe10f3f5964628a035524576821625" %}
6+
7+
\*\*\*\*
8+

docs/advanced/code-mod-examples/animation-spinning-block.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ The function below uses p5.js functions to create a spinning block that you can
88

99
**1 - Add the following function to the bottom of your JavaScript.**
1010

11-
{% code-tabs %}
12-
{% code-tabs-item title="JavaScript" %}
11+
{% code title="JavaScript" %}
1312
```javascript
1413
function spinningBlock() {
1514
background("gray");
@@ -18,13 +17,11 @@ function spinningBlock() {
1817
rect(-26, -26, 52, 52); //place the rectangle
1918
}
2019
```
21-
{% endcode-tabs-item %}
22-
{% endcode-tabs %}
20+
{% endcode %}
2321

2422
**2 - Now you simply need to** _**call**_ **this function when you want it to display in the background.** In the example below, `spinningBlock( )` is called in the `draw( )` function when the trivia game state is "welcome" on line 3. If you want, you can choose to call the function at a different point.
2523

26-
{% code-tabs %}
27-
{% code-tabs-item title="JavaScript" %}
24+
{% code title="JavaScript" %}
2825
```javascript
2926
//Loops continously for background effects and animations. (p5.js)
3027
function draw() {
@@ -35,8 +32,7 @@ function draw() {
3532
else if (trivia.state == "thankyou") background("orange");
3633
}
3734
```
38-
{% endcode-tabs-item %}
39-
{% endcode-tabs %}
35+
{% endcode %}
4036

4137
{% hint style="info" %}
4238
The _spinningBlock_ is a simple example of adding an animation to your background, but you can come up with your own animation and call it something different than `spinningBlock( )`.

docs/advanced/code-mod-examples/display-custom-feedback-text.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ This is an example of how you can provide special feedback for each trivia quest
1010

1111
**2 - Next, you want to use the trivia property `trivia.currentQuestion.feedback` to place the text in the HTML element having** _**id**_**="feedback".** Notice how this is done in lines 2 and 3 below. Make the same changes within your `onClickedAnswer` function in your JavaScript.
1212

13-
{% code-tabs %}
14-
{% code-tabs-item title="JavaScript" %}
13+
{% code title="JavaScript" %}
1514
```javascript
1615
function onClickedAnswer(isCorrect) {
1716
if (isCorrect) $("#feedback").html(trivia.currentQuestion.feedback).show();
@@ -20,8 +19,7 @@ function onClickedAnswer(isCorrect) {
2019
setTimeout(trivia.gotoNextQuestion, 3000); //wait 3 secs...next question
2120
}
2221
```
23-
{% endcode-tabs-item %}
24-
{% endcode-tabs %}
22+
{% endcode %}
2523

2624
That's it. Try it out.
2725

docs/advanced/code-mod-examples/display-question-count-at-welcome.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ In this simple mod we will let the player know at the welcome screen how many qu
44

55
**1 - Modify your** _**welcome screen**_ **HTML like on line 4 below, where the `id="question-count"` was added.**
66

7-
{% code-tabs %}
8-
{% code-tabs-item title="HTML" %}
7+
{% code title="HTML" %}
98
```markup
109
<!-------------- WELCOME SCREEN --------------->
1110
<div class='screen' id='welcome-screen'>
@@ -14,24 +13,21 @@ In this simple mod we will let the player know at the welcome screen how many qu
1413
<button class="start-btn">Start</button>
1514
</div>
1615
```
17-
{% endcode-tabs-item %}
18-
{% endcode-tabs %}
16+
{% endcode %}
1917

2018
Now we will insert the `trivia.totalQuestions` value into a sentence to be placed in the element with `id="question-count"`.
2119

2220
**2- Add the code on line 4 below to the end of your `displayWelcome()` function in your JavaScript.**
2321

24-
{% code-tabs %}
25-
{% code-tabs-item title="JavaScript" %}
22+
{% code title="JavaScript" %}
2623
```javascript
2724
function displayWelcome() {
2825
$(".screen").hide();
2926
$("#welcome-screen").show();
3027
$("#question-count").html(`You have ${trivia.totalQuestions} questions waiting for you.`);
3128
}
3229
```
33-
{% endcode-tabs-item %}
34-
{% endcode-tabs %}
30+
{% endcode %}
3531

3632
That's it. Try it out.
3733

docs/advanced/trivia-js-library-reference.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ var trivia = {
163163

164164
Copy the HTML/CSS/JavaScript below to get started immediately.
165165

166-
{% code-tabs %}
167-
{% code-tabs-item title="index.html" %}
166+
{% tabs %}
167+
{% tab title="index.html" %}
168168
```markup
169169
<!DOCTYPE html>
170170
<html>
@@ -213,9 +213,9 @@ Copy the HTML/CSS/JavaScript below to get started immediately.
213213
</body>
214214
</html>
215215
```
216-
{% endcode-tabs-item %}
216+
{% endtab %}
217217

218-
{% code-tabs-item title="style.css" %}
218+
{% tab title="style.css" %}
219219
```css
220220
body {
221221
margin: 0;
@@ -261,9 +261,9 @@ canvas {
261261
z-index: -1;
262262
}
263263
```
264-
{% endcode-tabs-item %}
264+
{% endtab %}
265265

266-
{% code-tabs-item title="code.js" %}
266+
{% tab title="code.js" %}
267267
```javascript
268268
//Runs once at the beginning
269269
function setup() {
@@ -311,6 +311,6 @@ function onClickedStart() {
311311
displayQuestion();
312312
}
313313
```
314-
{% endcode-tabs-item %}
315-
{% endcode-tabs %}
314+
{% endtab %}
315+
{% endtabs %}
316316

docs/code-template/managing-the-question-db.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Managing the Question DB
22

3+
{% embed url="https://www.loom.com/share/585749188d1d4799891d55c5718df244" %}
4+
35
## Using Google Sheet as Database \(Recommended\)
46

57
1. Login to Google Drive.

docs/code-template/template-build-tutorial/1.-screens-as-containers.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Below you see the HTML for the three screen "containers" as `<div>` elements. We
66

77
**Copy the HTML code and paste it into a new** _**index.html**_ **file, or use the CodePen version if you are starting with** [**CodePen's HTML**](https://codepen.io/pen/)**.** The browser page preview is not exciting, but it should contain text from all three screens.
88

9-
{% code-tabs %}
10-
{% code-tabs-item title="HTML - complete index.html file" %}
9+
{% tabs %}
10+
{% tab title="HTML - complete index.html file" %}
1111
```markup
1212
<!DOCTYPE html>
1313
<html>
@@ -35,14 +35,14 @@ Below you see the HTML for the three screen "containers" as `<div>` elements. We
3535
<h1>Thank you screen.</h1>
3636
</div>
3737
38-
<script src="code.js"></script>
38+
<script src="script.js"></script>
3939
</body>
4040
4141
</html>
4242
```
43-
{% endcode-tabs-item %}
43+
{% endtab %}
4444

45-
{% code-tabs-item title="HTML - CodePen version with body only" %}
45+
{% tab title="HTML - CodePen version with body only" %}
4646
```markup
4747
<!-------------- WELCOME SCREEN --------------->
4848
<div class='screen' id='welcome-screen'>
@@ -59,8 +59,8 @@ Below you see the HTML for the three screen "containers" as `<div>` elements. We
5959
<h1>Thank you screen.</h1>
6060
</div>
6161
```
62-
{% endcode-tabs-item %}
63-
{% endcode-tabs %}
62+
{% endtab %}
63+
{% endtabs %}
6464

6565
>
6666
@@ -84,8 +84,7 @@ Next you will see several styles being applied to screens, since `.screen` affec
8484

8585
**Copy the CSS code below into your** _**style.css**_ **file and notice the change. You will need to scroll down in the live preview to see all the screens now.**
8686

87-
{% code-tabs %}
88-
{% code-tabs-item title="CSS" %}
87+
{% code title="CSS" %}
8988
```css
9089
body {
9190
margin: 0;
@@ -102,8 +101,7 @@ body {
102101
height: calc(100vh - 30px);
103102
}
104103
```
105-
{% endcode-tabs-item %}
106-
{% endcode-tabs %}
104+
{% endcode %}
107105

108106
### **Save your Code before the next step!**
109107

docs/code-template/template-build-tutorial/2.-welcome-screen.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ Now you will update your welcome screen HTML slightly by adding a `<button>` ele
66

77
**Update your welcome screen HTML to match the code below. \(Don't add another welcome screen!\)**
88

9-
{% code-tabs %}
10-
{% code-tabs-item title="HTML" %}
9+
{% code title="HTML" %}
1110
```markup
1211
<!-------------- WELCOME SCREEN --------------->
1312
<div class='screen' id='welcome-screen'>
@@ -16,15 +15,13 @@ Now you will update your welcome screen HTML slightly by adding a `<button>` ele
1615
<button class="start-btn">Start</button>
1716
</div>
1817
```
19-
{% endcode-tabs-item %}
20-
{% endcode-tabs %}
18+
{% endcode %}
2119

2220
### CSS for More Style
2321

2422
**Add the following CSS styles to the bottom of your stylesheet for buttons and headings.** Modify styles as you wish, but be careful about the effects of changing `display`, `margin`, and `width` , which can be problematic sometimes.
2523

26-
{% code-tabs %}
27-
{% code-tabs-item title="CSS" %}
24+
{% code title="CSS" %}
2825
```css
2926
h1, h4 {
3027
text-align: center;
@@ -42,8 +39,7 @@ button {
4239
width: 100%;
4340
}
4441
```
45-
{% endcode-tabs-item %}
46-
{% endcode-tabs %}
42+
{% endcode %}
4743

4844

4945

docs/code-template/template-build-tutorial/3.-question-screen.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ Take a look at the code below and carefully review the nested elements in this b
66

77
**Update your question screen HTML to match the code below.**
88

9-
{% code-tabs %}
10-
{% code-tabs-item title="HTML" %}
9+
{% code title="HTML" %}
1110
```markup
1211
<!-------------- QUESTION SCREEN --------------->
1312
<div class='screen' id='question-screen'>
@@ -22,8 +21,7 @@ Take a look at the code below and carefully review the nested elements in this b
2221
<h1 id="feedback">Feedback will go here.</h1>
2322
</div>
2423
```
25-
{% endcode-tabs-item %}
26-
{% endcode-tabs %}
24+
{% endcode %}
2725

2826
No additional CSS needed for the question screen, since we already added style for _buttons_ and the _screen_ class. Yea!
2927

0 commit comments

Comments
 (0)