Add 4 files
Browse files- index.html +40 -18
- main.js +10 -0
- style.css +78 -17
index.html
CHANGED
@@ -1,19 +1,41 @@
|
|
1 |
-
<!DOCTYPE html>
|
2 |
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<html>
|
2 |
+
<head>
|
3 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/full.css" rel="stylesheet" type="text/css" />
|
4 |
+
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>
|
5 |
+
<script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"></script>
|
6 |
+
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/three.js/0.156.1/three.min.js"></script>
|
7 |
+
<script type="module" src="main.js"></script>
|
8 |
+
<title>Cookie Recipe</title>
|
9 |
+
</head>
|
10 |
+
<body>
|
11 |
+
<!-- Declare a new Alpine component and its data -->
|
12 |
+
<div x-data="cookieRecipe">
|
13 |
+
<!-- Display ingredients and instructions -->
|
14 |
+
<div class="container">
|
15 |
+
<h1>Cookie Recipe</h1>
|
16 |
+
<ul>
|
17 |
+
<li x-text="ingredients[0]"></li>
|
18 |
+
<li x-text="ingredients[1]"></li>
|
19 |
+
<li x-text="ingredients[2]"></li>
|
20 |
+
<li x-text="ingredients[3]"></li>
|
21 |
+
<li x-text="ingredients[4]"></li>
|
22 |
+
</ul>
|
23 |
+
<ol>
|
24 |
+
<li x-text="methodology[0]"></li>
|
25 |
+
<li x-text="methodology[1]"></li>
|
26 |
+
<li x-text="methodology[2]"></li>
|
27 |
+
<li x-text="methodology[3]"></li>
|
28 |
+
<li x-text="methodology[4]"></li>
|
29 |
+
<li x-text="methodology[5]"></li>
|
30 |
+
</ol>
|
31 |
+
</div>
|
32 |
+
<!-- Calculate progress and display progress bar -->
|
33 |
+
<div class="progressBox">
|
34 |
+
<progress class="progressbar" x-transition="progress.track" x-text="progress.value"></progress>
|
35 |
+
<div class="progress-value" x-text="progress.value"></div>
|
36 |
+
</div>
|
37 |
+
<!-- Completion message -->
|
38 |
+
<div class="completed-message" x-text="completed ? 'Congratulations, you have completed the cookie recipe!' : ''"></div>
|
39 |
+
</div>
|
40 |
+
</body>
|
41 |
+
</html>
|
main.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
document.once('DOMContentLoaded', () => {
|
2 |
+
// Declare a new Alpine component and its data
|
3 |
+
Alpine.data('cookieRecipe', {
|
4 |
+
ingredients: ['flour', 'butter', 'sugar', 'eggs', 'vanilla'],
|
5 |
+
methodology: ['Preheat oven to 350°F.', 'Mix dry ingredients in a bowl.', 'Add water and mix until dough forms.', 'Roll out dough on a floured surface.', 'Cut into desired shapes.', 'Bake for 10-15 minutes.'],
|
6 |
+
instructionimages: ['path/to/image1', 'path/to/image2', 'path/to/image3', 'path/to/image4', 'path/to/image5', 'path/to/image6'],
|
7 |
+
progress: 0,
|
8 |
+
completed: false,
|
9 |
+
});
|
10 |
+
})
|
style.css
CHANGED
@@ -1,28 +1,89 @@
|
|
1 |
body {
|
2 |
-
|
3 |
-
|
4 |
}
|
5 |
|
6 |
h1 {
|
7 |
-
|
8 |
-
margin-top: 0;
|
9 |
}
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
margin-top: 5px;
|
16 |
}
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
}
|
25 |
|
26 |
-
.
|
27 |
-
|
|
|
|
|
28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
body {
|
2 |
+
font-family: sans-serif;
|
3 |
+
background-color: #f0f0f0;
|
4 |
}
|
5 |
|
6 |
h1 {
|
7 |
+
font-size: 36px;
|
|
|
8 |
}
|
9 |
|
10 |
+
ul, ol {
|
11 |
+
padding: 0;
|
12 |
+
margin: 0;
|
13 |
+
list-style: none;
|
|
|
14 |
}
|
15 |
|
16 |
+
li {
|
17 |
+
padding: 10px;
|
18 |
+
margin: 10px;
|
19 |
+
background-color: #fff;
|
20 |
+
-webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
|
21 |
+
box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
|
22 |
}
|
23 |
|
24 |
+
.container {
|
25 |
+
background-color: #f0f0f0;
|
26 |
+
padding: 20px;
|
27 |
+
margin: 20px;
|
28 |
}
|
29 |
+
|
30 |
+
.progressbox {
|
31 |
+
background-color: #fff;
|
32 |
+
margin: 20px;
|
33 |
+
padding: 20px;
|
34 |
+
}
|
35 |
+
|
36 |
+
.progressBar {
|
37 |
+
height: 100%;
|
38 |
+
background-color: #f0f0f0;
|
39 |
+
-webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
|
40 |
+
box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
|
41 |
+
}
|
42 |
+
|
43 |
+
.progressBox {
|
44 |
+
position: absolute;
|
45 |
+
top: 50%;
|
46 |
+
left: 50%;
|
47 |
+
transform: translate(-50%, -50%);
|
48 |
+
width: 200px;
|
49 |
+
height: 200px;
|
50 |
+
background-color: #fff;
|
51 |
+
-webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
|
52 |
+
box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
|
53 |
+
}
|
54 |
+
|
55 |
+
.progressbar {
|
56 |
+
position: relative;
|
57 |
+
width: 200px;
|
58 |
+
height: 20px;
|
59 |
+
background-color: #fff;
|
60 |
+
border-radius: 5px;
|
61 |
+
-webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
|
62 |
+
box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
|
63 |
+
}
|
64 |
+
|
65 |
+
.progress-value {
|
66 |
+
position: absolute;
|
67 |
+
top: 50%;
|
68 |
+
left: 50%;
|
69 |
+
transform: translate(-50%, -50%);
|
70 |
+
font-size: 16px;
|
71 |
+
font-weight: bold;
|
72 |
+
color: #fff;
|
73 |
+
background-color: #f0f0f0;
|
74 |
+
-webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
|
75 |
+
box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
|
76 |
+
}
|
77 |
+
|
78 |
+
.completed-message {
|
79 |
+
position: absolute;
|
80 |
+
top: 50%;
|
81 |
+
left: 50%;
|
82 |
+
transform: translate(-50%, -50%);
|
83 |
+
font-size: 32px;
|
84 |
+
font-weight: bold;
|
85 |
+
color: #fff;
|
86 |
+
background-color: #009900;
|
87 |
+
-webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
|
88 |
+
box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
|
89 |
+
}
|