Skip to content

Commit c2ea730

Browse files
Merge pull request #22 from hack-rpi/Anagha-Notes
Create Intro_to_typescript.txt
2 parents 9d4e751 + 3ff7e15 commit c2ea730

File tree

1 file changed

+166
-0
lines changed

1 file changed

+166
-0
lines changed
+166
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
Introduction to TypeScript:
2+
TypeScript is a superset of JavaScript that adds static typing. It helps catch errors during development and makes your code
3+
more predictable and maintainable.
4+
5+
Key Features:
6+
- Static Typing: Define variable types explicitly
7+
- Interfaces: Define the shape of objects
8+
- Classes and Inheritance: Write object-oriented code
9+
- Type Inference: Automatically infer types when possible
10+
11+
Task Tool
12+
Structure/header layout HTML
13+
Fonts, colors, alignment CSS
14+
Dynamic text (optional) TypeScript
15+
16+
17+
Basic Syntax:
18+
19+
let username: string = "hackRPI";
20+
let year: number = 2025;
21+
let isEventLive: boolean = true;
22+
let name = "hackRPI"; // inferred as string
23+
24+
Basic Footer Code w/ CSS, HTML, and TypeScript:
25+
<footer id="site-footer">
26+
<div class="footer-content">
27+
<p id="footer-text"></p>
28+
<nav class="footer-nav">
29+
<a href="/about">About Us</a>
30+
<a href="/contact">Contact</a>
31+
<a href="/privacy">Privacy Policy</a>
32+
</nav>
33+
</div>
34+
</footer>
35+
36+
The <> are HTML tags, used to define the structure and elements of a webpage. Tags usually come in pairs:
37+
- <tagname> — the opening tag
38+
- </tagname> — the closing tag
39+
40+
<footer>: A semantic HTML tag that represents the footer section of the webpage
41+
<div class="footer-content">: <div>: A generic container used to group other HTML elements
42+
<a href="...">...</a>: These are anchor tags used for hyperlinks
43+
- href="/about" means clicking the “About Us” link will take you to the /about page of the site.
44+
- The text inside (About Us, Contact, etc.) is what the user sees and clicks on.
45+
46+
Tag Purpose
47+
<footer> Marks the page's footer area
48+
<div> Groups and organizes content
49+
<p> Displays paragraph text
50+
<nav> Groups navigation links
51+
<a> Creates a clickable hyperlink
52+
53+
Stylistic Components of Footer:
54+
55+
/* Footer background and base font color */
56+
#site-footer {
57+
background-color: #1a1a1a; /* dark background */
58+
color: white; /* text color */
59+
padding: 20px 0;
60+
text-align: center;
61+
font-family: 'Segoe UI', sans-serif; /* font type */
62+
}
63+
64+
/* Heading inside footer */
65+
.footer-heading {
66+
font-size: 24px;
67+
font-weight: bold;
68+
color: #ffd700; /* golden yellow */
69+
margin-bottom: 10px;
70+
}
71+
72+
/* Footer paragraph text */
73+
#footer-text {
74+
font-size: 14px;
75+
color: #cccccc;
76+
margin-top: 5px;
77+
}
78+
79+
/* Footer nav links */
80+
.footer-nav a {
81+
color: #bbbbbb;
82+
margin: 0 15px;
83+
text-decoration: none; /* removes underline */
84+
}
85+
86+
/* Link hover effect */
87+
.footer-nav a:hover {
88+
color: white;
89+
text-decoration: underline; /* adds underline on hover */
90+
}
91+
92+
Style Type Where it's Defined
93+
Text color CSS (e.g., color: white)
94+
Font type CSS (e.g., font-family)
95+
Underline links CSS (text-decoration)
96+
97+
98+
Basic Header Code w/ CSS< HTML, TypeScript:
99+
<header id="site-header">
100+
<div class="header-content">
101+
<h1 class="logo">HackRPI</h1>
102+
<nav class="header-nav">
103+
<a href="/">Home</a>
104+
<a href="/schedule">Schedule</a>
105+
<a href="/sponsors">Sponsors</a>
106+
<a href="/faq">FAQ</a>
107+
</nav>
108+
</div>
109+
</header>
110+
111+
<header>: A semantic HTML5 tag that defines the top section of the page — usually contains logo, title, and nav links
112+
id="site-header": Used to uniquely identify this header in the page
113+
class="header-content": The class name lets you apply CSS styling to everything inside
114+
<h1>: Represents the main heading of this section or page
115+
- class="logo":
116+
- Identifies this heading for styling (e.g., larger font, bold)
117+
"HackRPI":
118+
- The text inside the heading. This is what users see
119+
<nav>: Another semantic HTML tag, used to group navigation links
120+
- class="header-nav": For styling all the nav links together
121+
<a>: An anchor tag, which creates a hyperlink.
122+
- href="/": The path the link goes to when clicked.
123+
124+
Element Purpose
125+
<header> Defines the top of the website
126+
<div> Organizes content inside the header
127+
<h1> Displays the logo/title
128+
<nav> Contains all navigation links
129+
<a href="..."> Defines each clickable link
130+
131+
132+
Stylistic Components of Header Code:
133+
#site-header {
134+
background-color: #000000;
135+
color: white;
136+
padding: 15px 0;
137+
text-align: center;
138+
font-family: 'Segoe UI', sans-serif;
139+
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
140+
}
141+
142+
.header-content {
143+
display: flex;
144+
justify-content: space-between;
145+
align-items: center;
146+
max-width: 1000px;
147+
margin: 0 auto;
148+
padding: 0 20px;
149+
}
150+
151+
.logo {
152+
font-size: 28px;
153+
font-weight: bold;
154+
color: #ffffff;
155+
}
156+
157+
.header-nav a {
158+
color: #bbbbbb;
159+
margin: 0 10px;
160+
text-decoration: none;
161+
}
162+
163+
.header-nav a:hover {
164+
color: white;
165+
text-decoration: underline;
166+
}

0 commit comments

Comments
 (0)