Skip to content

Commit 0426331

Browse files
feat: adds Khayla's express web server implementation (#581)
* Feat: tiktok content creator system * feat: adds Express server with contact form and result display * Feat adding node modules and correcting file directory * Feat: adds server and contact page * Feat updates node modules * Feat implements contact page route correctly and displays message * chore: re-organizes files Signed-off-by: Anthony D. Mays <[email protected]> --------- Signed-off-by: Anthony D. Mays <[email protected]> Co-authored-by: Anthony D. Mays <[email protected]>
1 parent edd42b3 commit 0426331

File tree

9 files changed

+1130
-0
lines changed

9 files changed

+1130
-0
lines changed

lesson_24/khaylasaunders/package-lock.json

Lines changed: 823 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lesson_24/khaylasaunders/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "khaylasaunders",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"scripts": {
6+
"test": "echo \"Error: no test specified\" && exit 1"
7+
},
8+
"keywords": [],
9+
"author": "",
10+
"license": "ISC",
11+
"description": "",
12+
"dependencies": {
13+
"express": "^5.1.0",
14+
"lodash": "^4.17.21"
15+
}
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Contact Us</title>
5+
</head>
6+
<body>
7+
<h1>Contact Form</h1>
8+
<form action="/submit-form" method="POST">
9+
<label>Name: <input type="text" name="name" required></label><br>
10+
<label>Email: <input type="email" name="email" required></label><br>
11+
<label>Message:<br><textarea name="message" required></textarea></label><br>
12+
<button type="submit">Submit</button>
13+
</form>
14+
</body>
15+
</html>
329 KB
Loading
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<html>
2+
<head>
3+
<title>Homepage</title>
4+
<meta name="viewport" content="width=device-width, initial-scale=1" />
5+
<link rel="stylesheet" id="redux-google-fonts-salient_redux-css" href="https://fonts.googleapis.com/css?family=Poppins%3A600%2C400%7CMontserrat%3A800%2C900%2C700&amp;ver=1597678827" type="text/css" media="all">
6+
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Poppins%3A600%2C400%7CMontserrat%3A800%2C900%2C700&#038;ver=1597678827' type='text/css' media='all' />
7+
<link rel="stylesheet" type="text/css" href="style.css">
8+
</head>
9+
<body>
10+
<header class="header">
11+
<div class="header-logo">
12+
<a href="index.html">
13+
<img src="logo.png" alt="Code Differently Logo" />
14+
</a>
15+
</div>
16+
<ul class="header-top-menu">
17+
<li><a href="#">Home</a></li>
18+
<li><a href="#">About</a></li>
19+
<li><a href="/contact.html">Contact</a></li>
20+
</ul>
21+
<div class="header-cta">
22+
<a class="sign-up-button" href="#">Sign Up</a>
23+
</div>
24+
</header>
25+
<div class="main">
26+
<div class="content">
27+
<article>
28+
<section class="hero-section">
29+
<div class="hero-overlay"></div>
30+
<div class="hero-content">
31+
<h2 class="hero-title">Together we can move the needle of <em class="highlight">diversity in tech.</em></h2>
32+
<div class="hero-text"><span>Code Differently</span> provides hands on training and education through coding classes that gives participants the technical and cognitive skills they need to excel in technology-driven workplaces.</div>
33+
</div>
34+
</section>
35+
<section class="programs-section">
36+
<h2>Our <em class="highlight">Programs</em></h2>
37+
<ul class="programs">
38+
<li class="program">
39+
<h3>1000 Kids Coding</h3>
40+
<p>The Code Differently 1000 Kids Coding program was created to expose New Castle County students to computing and programming. The 1000 Kids Coding courses are designed for all experience levels, no experience required.</p>
41+
</li>
42+
<li class="program">
43+
<h3>Return Ready</h3>
44+
<p>The Code Differently Workforce Training Initiatives were created to help individuals underrepresented in tech reinvent their skills to align with the changing workforce market. If you are ready to start your tech journey, join our talent community today.</p>
45+
</li>
46+
<li class="program">
47+
<h3>Pipeline DevShops</h3>
48+
<p>Pipeline DevShop is a youth work-based learning program. Youth participants experience working in a real software development environment while sharpening their technology and soft skills.</p>
49+
</li>
50+
<li class="program">
51+
<h3>Platform Programs</h3>
52+
<p>Platform programs are designed for high school graduates, college students, career changers, or professionals looking to develop the technology job readiness skills for today’s workforce.</p>
53+
</li>
54+
</ul>
55+
</section>
56+
</article>
57+
</div>
58+
</div>
59+
<footer class="footer">
60+
&copy; 2024 Code Differently
61+
</footer>
62+
</body>
63+
</html>
29.2 KB
Loading
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
/* === Reset and Base === */
2+
* {
3+
margin: 0;
4+
padding: 0;
5+
box-sizing: border-box;
6+
}
7+
8+
body {
9+
font-family: 'Poppins', sans-serif;
10+
background-color: #fff; /* You can change this */
11+
color: #222; /
12+
p {
13+
line-height: 24px;
14+
}
15+
}
16+
17+
/* === Header === */
18+
.header {
19+
top: 0;
20+
position: sticky;
21+
display: flex;
22+
justify-content: space-between;
23+
align-items: center;
24+
padding: 20px;
25+
color: #3c3c3c;
26+
}
27+
28+
.header-logo img {
29+
max-width: 150px;
30+
}
31+
32+
.header-top-menu {
33+
list-style: none;
34+
display: flex;
35+
}
36+
37+
.header-top-menu li {
38+
margin: 0 15px;
39+
}
40+
41+
42+
43+
.header-top-menu a {
44+
color: #3c3c3c;
45+
text-decoration: none;
46+
font-weight: 600;
47+
}
48+
49+
.header-top-menu li::after {
50+
content: "";
51+
position: relative;
52+
display: block;
53+
width: 100%;
54+
height: 2px;
55+
background-color: #f47d26;
56+
transform: scaleX(0);
57+
transition: transform 0.3s ease;
58+
}
59+
60+
.header-top-menu li:hover::after {
61+
transform: scaleX(1);
62+
}
63+
64+
.header-cta .sign-up-button {
65+
background-color: #f47d26; /* Secondary color */
66+
color: #fff;
67+
padding: 10px 20px;
68+
text-decoration: none;
69+
border-radius: 5px;
70+
font-weight: bold;
71+
}
72+
73+
74+
.hero-section {
75+
background: url('hero.jpg') center/cover no-repeat;
76+
color: white;
77+
padding: 4rem 2rem;
78+
position: relative;
79+
min-height: 60vh;
80+
padding-left: 0;
81+
82+
}
83+
84+
.hero-overlay {
85+
position: absolute;
86+
top: 0;
87+
left: 0;
88+
right: 0;
89+
bottom: 0;
90+
background-color: rgba(0, 0, 0, 0.5);
91+
}
92+
93+
.hero-content {
94+
position: relative;
95+
z-index: 1;
96+
max-width: 800px;
97+
}
98+
99+
.hero-title {
100+
font-size: 2.5rem;
101+
margin-bottom: 1rem;
102+
}
103+
104+
.highlight {
105+
color: #f47d26;
106+
}
107+
108+
.hero-text {
109+
font-size: 20px;
110+
font-family: 'poppins';
111+
background-color: #243e90;
112+
padding-top: 3%;
113+
padding-bottom: 3%;
114+
padding-right: 8%;
115+
padding-left: 8%;
116+
}
117+
118+
/* === Programs Section === */
119+
/* Programs section styles */
120+
121+
.programs {
122+
display: grid;
123+
grid-template-columns: 1fr 1fr;
124+
/* Two columns */
125+
gap: 20px;
126+
max-width: fit-content;
127+
}
128+
129+
.programs-section {
130+
padding: 160px;
131+
margin-left: 60px;
132+
font-size: 25px;
133+
color: #444;
134+
}
135+
136+
.programs-section h2 {
137+
font-weight: 900;
138+
margin-bottom: 70px;
139+
}
140+
141+
.programs-section h2 .highlight {
142+
font-style: normal;
143+
}
144+
145+
.programs-section li {
146+
list-style: none;
147+
}
148+
149+
.programs li h3 {
150+
margin-bottom: 40px;
151+
font-size: 22px;
152+
}
153+
154+
.programs li p {
155+
font-weight: lighter;
156+
font-family: 'Poppins';
157+
color: #676767;
158+
font-size: small;
159+
font-weight: 400;
160+
}

lesson_24/khaylasaunders/server.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const express = require('express');
2+
const bodyParser = require('body-parser');
3+
const path = require('path');
4+
5+
const app = express();
6+
const PORT = 3000; // Change if needed
7+
8+
// Middleware
9+
app.use(bodyParser.urlencoded({ extended: true }));
10+
app.use(express.static('.'));
11+
12+
app.use(express.static(path.join(__dirname, 'public')));
13+
14+
// Routes
15+
16+
app.post('/submit-form', (req, res) => {
17+
const { name, email, message } = req.body;
18+
res.send(`
19+
<h1>Thank You!</h1>
20+
<p>Name: ${name}</p>
21+
<p>Email: ${email}</p>
22+
<p>Message: ${message}</p>
23+
<a href="/contact">Go Back</a>
24+
`);
25+
});
26+
27+
// Start server
28+
app.listen(PORT, () => {
29+
console.log(`Server is running at http://localhost:${PORT}`);
30+
});

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "code-differently-25-q1",
3+
"version": "1.0.0",
4+
"description": "[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/code-differently/code-differently-25-q1) [![Check Push](https://github.com/code-differently/code-differently-25-q1/actions/workflows/check_push.yml/badge.svg)](https://github.com/code-differently/code-differently-25-q1/actions/workflows/check_push.yml)",
5+
"main": "index.js",
6+
"directories": {
7+
"lib": "lib"
8+
},
9+
"scripts": {
10+
"test": "echo \"Error: no test specified\" && exit 1"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "git+https://github.com/kksaunders251/code-differently-25-q1.git"
15+
},
16+
"keywords": [],
17+
"author": "",
18+
"license": "ISC",
19+
"bugs": {
20+
"url": "https://github.com/kksaunders251/code-differently-25-q1/issues"
21+
},
22+
"homepage": "https://github.com/kksaunders251/code-differently-25-q1#readme"
23+
}

0 commit comments

Comments
 (0)