File size: 20,065 Bytes
64dd28a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Calculus Portfolio — Introduction to Calculus</title>
<!-- Google Font (single external resource) -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap" rel="stylesheet">
<style>
:root{
--bg:#0f1724;
--card:#0b1020;
--muted:#9aa7bf;
--accent:#7dd3fc;
--accent-2:#60a5fa;
--glass: rgba(255,255,255,0.04);
--success:#34d399;
--danger:#fb7185;
--radius:16px;
font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
margin:0;
background: linear-gradient(180deg, #071028 0%, #071a2e 65%);
color:#e6eef8;
-webkit-font-smoothing:antialiased;
-moz-osx-font-smoothing:grayscale;
padding:32px;
}
.wrap{
max-width:1100px;
margin:0 auto;
display:grid;
grid-template-columns: 380px 1fr;
gap:28px;
}
/* SIDEBAR */
aside{
background:linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
border-radius:var(--radius);
padding:22px;
box-shadow: 0 6px 30px rgba(2,6,23,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
min-height:520px;
position:sticky;
top:32px;
overflow:hidden;
}
.logo{
display:flex;
gap:14px;
align-items:center;
margin-bottom:12px;
}
.logo .mark{
width:62px;
height:62px;
border-radius:12px;
background:linear-gradient(135deg,var(--accent),var(--accent-2));
display:flex;
align-items:center;
justify-content:center;
font-weight:800;
color:#04263b;
font-size:20px;
box-shadow: 0 8px 20px rgba(96,165,250,0.14);
}
.logo h1{
font-size:16px;
margin:0;
line-height:1;
letter-spacing:0.2px;
}
.logo p{margin:0;margin-top:4px;color:var(--muted);font-size:13px}
.meta{
display:flex;
gap:12px;
flex-wrap:wrap;
margin:18px 0 12px;
}
.chip{
background:var(--glass);
padding:8px 10px;
border-radius:10px;
font-size:13px;
color:var(--muted);
box-shadow: 0 3px 10px rgba(2,6,23,0.45);
}
.summary{
color:var(--muted);
font-size:14px;
line-height:1.55;
margin-bottom:14px;
}
.objectives{
margin-top:12px;
}
.objectives h3{font-size:13px;margin:0 0 8px;color:var(--accent)}
.objectives ul{margin:0;padding-left:18px;color:var(--muted);line-height:1.6;font-size:14px}
/* MAIN */
main{
background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
border-radius:var(--radius);
padding:26px;
min-height:520px;
box-shadow: 0 6px 40px rgba(2,6,23,0.6);
}
header.port{
display:flex;
align-items:center;
justify-content:space-between;
gap:12px;
margin-bottom:20px;
}
.title{
display:flex;
gap:16px;
align-items:center;
}
.title h2{
margin:0;font-size:20px;
}
.title p{margin:0;color:var(--muted);font-size:13px}
.badge{
background:linear-gradient(90deg,var(--accent-2),var(--accent));
color:#04263b;
padding:10px 14px;
border-radius:12px;
font-weight:700;
box-shadow: 0 8px 30px rgba(96,165,250,0.08);
}
/* Sections */
section.block{
margin-bottom:20px;
padding:16px;
background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.015));
border-radius:12px;
}
.block h3{margin:0 0 10px;font-size:16px}
.block p{margin:0;color:var(--muted);line-height:1.6}
.outline-grid{
display:grid;
grid-template-columns:repeat(2,1fr);
gap:12px;
margin-top:10px;
}
.outline-item{
background:rgba(255,255,255,0.02);
padding:12px;border-radius:10px;
border:1px solid rgba(255,255,255,0.02);
color:var(--muted);
font-size:14px;
}
.outline-item strong{display:block;color:#e6eef8;margin-bottom:6px}
/* Accordion */
.accordion{
margin-top:10px;
}
.acco-item{
border-radius:10px;
overflow:hidden;
margin-bottom:8px;
border:1px solid rgba(255,255,255,0.03);
}
.acco-head{
display:flex;justify-content:space-between;align-items:center;
padding:12px;background:transparent;cursor:pointer;
}
.acco-head h4{margin:0;font-size:15px}
.acco-body{
padding:12px 14px 16px;
color:var(--muted);
font-size:14px;
display:none;
line-height:1.6;
border-top:1px solid rgba(255,255,255,0.02);
}
/* Interactive demo */
.demo{
display:grid;
grid-template-columns: 1fr 260px;
gap:16px;
align-items:center;
margin-top:12px;
}
.graph{
background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.015));
border-radius:12px;padding:14px;
min-height:260px;
}
.controls{
padding:14px;border-radius:12px;background:rgba(255,255,255,0.02);
}
.controls label{display:block;font-size:13px;color:var(--muted);margin-bottom:8px}
.controls input[type="range"]{width:100%}
.controls .val{font-weight:700;color:#e6eef8;margin-top:8px}
footer.note{
display:flex;justify-content:space-between;align-items:center;
gap:10px;margin-top:16px;color:var(--muted);font-size:13px;
}
/* small screens */
@media (max-width:980px){
.wrap{grid-template-columns:1fr; padding:0 12px}
aside{position:relative;top:0}
.demo{grid-template-columns:1fr}
}
/* small decorative details */
.sparkle{
width:100%;height:6px;margin-bottom:12px;
background: linear-gradient(90deg, rgba(125,211,252,0.06), rgba(96,165,250,0.06));
border-radius:6px;
}
.cta{
display:inline-flex;gap:10px;align-items:center;padding:10px 14px;border-radius:12px;background:linear-gradient(90deg,var(--accent),var(--accent-2));color:#04263b;font-weight:700;border:none;cursor:pointer;
}
/* tiny legend dots */
.legend{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:13px}
.dot{width:10px;height:10px;border-radius:50%}
.dot.sec{background:rgba(125,211,252,0.9)}
.dot.tan{background:rgba(96,165,250,0.9)}
</style>
</head>
<body>
<div class="wrap" role="main">
<!-- SIDEBAR -->
<aside aria-label="Course overview">
<div class="logo" role="banner">
<div class="mark">∫d</div>
<div>
<h1>Calculus Portfolio</h1>
<p>Introduction to Calculus — Differential & Integral</p>
</div>
</div>
<div class="sparkle" aria-hidden="true"></div>
<div class="meta" aria-hidden="true">
<div class="chip">Level: Introductory</div>
<div class="chip">Duration: 10–12 weeks</div>
<div class="chip">Format: Theory + Demo</div>
</div>
<p class="summary">
Calculus studies continuous change. This portfolio summarizes the course objectives, outline, key concepts (limits, derivatives, integrals), and includes a tiny interactive demo illustrating how a secant slope approaches a derivative (tangent slope).
</p>
<div class="objectives" aria-labelledby="obj">
<h3 id="obj">Course Objectives</h3>
<ul>
<li>Understand limits, derivatives & integrals</li>
<li>Apply techniques to physics, engineering & economics</li>
<li>Analyze & model real-world functions</li>
<li>Use derivatives to find maxima/minima</li>
</ul>
</div>
<div style="margin-top:14px">
<button class="cta" id="downloadBtn" title="Save as PDF (print)">
📄 Save / Print
</button>
</div>
<div style="margin-top:18px">
<small style="color:var(--muted)">Author: Calculus Instructor • Prepared as a student portfolio</small>
</div>
</aside>
<!-- MAIN -->
<main>
<header class="port">
<div class="title">
<div>
<h2>Introduction to Calculus</h2>
<p>Understanding differential & integral calculus — core ideas, examples, and applications.</p>
</div>
</div>
<div class="badge">Essentials</div>
</header>
<!-- Course Outline -->
<section class="block" aria-labelledby="outlineTitle">
<h3 id="outlineTitle">Course Outline</h3>
<div class="outline-grid" role="list">
<div class="outline-item" role="listitem">
<strong>Differential Calculus</strong>
Limits • Derivatives • Applications (tangent lines, rates, optimization)
</div>
<div class="outline-item" role="listitem">
<strong>Integral Calculus</strong>
Indefinite/Definite Integrals • Techniques • Area & accumulation problems
</div>
<div class="outline-item" role="listitem">
<strong>Foundations</strong>
Limits, continuity, algebra of functions
</div>
<div class="outline-item" role="listitem">
<strong>Applications</strong>
Physics (velocity/acceleration), engineering, economics & area computations
</div>
</div>
</section>
<!-- Definitions and Concepts -->
<section class="block" aria-labelledby="defs">
<h3 id="defs">What is Calculus?</h3>
<p>
Calculus is the study of continuous change. Historically developed by Newton and Leibniz, it focuses on two complementary ideas:
</p>
<div class="accordion" id="accordion">
<div class="acco-item">
<button class="acco-head" data-target="a1"><h4>Differential Calculus</h4><span>▸</span></button>
<div class="acco-body" id="a1">
Differential calculus studies rates of change (derivatives). The derivative f'(x) = dy/dx measures how the function y = f(x) changes as x changes. It arises from the limit of a quotient: the slope of the secant line approaches the slope of the tangent line.
</div>
</div>
<div class="acco-item">
<button class="acco-head" data-target="a2"><h4>Integral Calculus</h4><span>▸</span></button>
<div class="acco-body" id="a2">
Integral calculus reverses differentiation: integration accumulates small pieces to get a whole. Indefinite integrals include an arbitrary constant (C); definite integrals compute accumulated values like area under a curve.
</div>
</div>
<div class="acco-item">
<button class="acco-head" data-target="a3"><h4>Limits & Continuity</h4><span>▸</span></button>
<div class="acco-body" id="a3">
Limits describe the behavior of a function as the input approaches a certain value. Continuity means the limit equals the function value. Limits are the foundation on which both derivatives and integrals are built.
</div>
</div>
</div>
</section>
<!-- Interactive mini-demo -->
<section class="block" aria-labelledby="demoTitle">
<h3 id="demoTitle">Interactive Demo — Secant → Tangent (Derivative)</h3>
<p style="margin-bottom:12px;color:var(--muted)">Use the slider to move the second point (h). The slope of the secant line approaches the tangent slope as h → 0 for f(x) = x² at x = 1.</p>
<div class="demo" role="application" aria-label="Derivative demo">
<div class="graph" id="svgWrap" aria-hidden="false">
<!-- SVG will be injected by JS -->
<svg id="calcSVG" width="100%" height="260" viewBox="0 0 600 260" preserveAspectRatio="xMinYMin meet" aria-label="Graph area" role="img"></svg>
</div>
<div class="controls" aria-hidden="false">
<label for="hRange">h (distance between points): <span id="hVal">0.8</span></label>
<input id="hRange" type="range" min="0.01" max="2" step="0.01" value="0.8" />
<div style="margin-top:12px">
<label for="xInput">Point x (evaluation point):</label>
<input id="xInput" type="number" value="1" step="0.1" style="width:100%;padding:8px;border-radius:8px;border:1px solid rgba(255,255,255,0.04);background:transparent;color:#e6eef8" />
</div>
<div class="val" style="margin-top:12px">
Secant slope: <strong id="secSlope">2.6</strong>
</div>
<div class="val" style="margin-top:6px">
Tangent (derivative) at x: <strong id="tanSlope">2</strong>
</div>
<div style="height:10px"></div>
<div class="legend" style="margin-top:10px">
<div class="dot sec" aria-hidden="true"></div><span>Secant</span>
<div style="width:8px"></div>
<div class="dot tan" aria-hidden="true"></div><span>Tangent</span>
</div>
</div>
</div>
<footer class="note">
<span>Formula shown uses f(x)=x². Derivative f'(x)=2x (so at x=1, tangent slope = 2).</span>
<span style="opacity:0.9">Try h → 0 to see secant slope approach 2.</span>
</footer>
</section>
<!-- More content -->
<section class="block" aria-labelledby="addTitle">
<h3 id="addTitle">Key Formulas & Notes</h3>
<p style="margin-bottom:8px;color:var(--muted)">
<strong>Derivative:</strong> f'(x) = limₕ→0 (f(x+h) - f(x))/h<br>
<strong>Indefinite Integral:</strong> ∫ f(x) dx = F(x) + C<br>
<strong>Definite Integral:</strong> ∫ₐᵇ f(x) dx = F(b) - F(a)
</p>
<div style="display:flex;gap:12px;flex-wrap:wrap;margin-top:8px">
<div class="chip">Applications: Motion, Area, Optimization</div>
<div class="chip">Tools: Analytical techniques, substitution, parts</div>
<div class="chip">Prereqs: Functions, algebra, exponents</div>
</div>
</section>
<!-- Closing -->
<section style="display:flex;justify-content:space-between;align-items:center;margin-top:8px">
<small style="color:var(--muted)">Prepared as a student portfolio • Clean, shareable, printable</small>
<div>
<button class="cta" id="toggleTheme">🌙 Toggle Theme</button>
</div>
</section>
</main>
</div>
<script>
/* ---------- Accordion ---------- */
document.querySelectorAll('.acco-head').forEach(btn=>{
btn.addEventListener('click', ()=>{
const target = btn.getAttribute('data-target');
const body = document.getElementById(target);
const open = body.style.display === 'block';
// close all
document.querySelectorAll('.acco-body').forEach(b=>b.style.display='none');
// rotate arrows
document.querySelectorAll('.acco-head span').forEach(s=>s.textContent='▸');
if(!open){
body.style.display='block';
btn.querySelector('span').textContent='▾';
}
});
});
// default open first
document.querySelector('.acco-head')?.click();
/* ---------- Print / Download ---------- */
document.getElementById('downloadBtn').addEventListener('click', ()=> {
window.print();
});
/* ---------- Theme Toggle (simple) ---------- */
const toggle = document.getElementById('toggleTheme');
let dark = true;
toggle.addEventListener('click', ()=>{
dark = !dark;
if(!dark){
document.body.style.background = 'linear-gradient(180deg,#f8fafc,#e6eef8)';
document.body.style.color = '#02263b';
document.querySelectorAll('aside, main').forEach(el=>{
el.style.background = 'linear-gradient(180deg, rgba(2,38,59,0.02), rgba(2,38,59,0.01))';
el.style.boxShadow = '0 6px 20px rgba(2,6,23,0.04)';
});
} else {
location.reload(); // quick reset to original styling
}
});
/* ---------- Interactive derivative demo (f(x)=x^2) ---------- */
(function(){
const svg = document.getElementById('calcSVG');
const w = 600, h = 260;
svg.setAttribute('viewBox','0 0 '+w+' '+h);
// coordinate mapping (x from -1 to 3, y from -1 to 9)
const xMin = -1, xMax = 3, yMin = -1, yMax = 9;
const mapX = x => ( (x - xMin) / (xMax - xMin) ) * (w-60) + 40;
const mapY = y => h - ( (y - yMin) / (yMax - yMin) ) * (h-40) - 20;
// draw axes + grid
function drawAxes(){
svg.innerHTML = '';
const ns = 'http://www.w3.org/2000/svg';
// grid lines
for(let gx = Math.ceil(xMin); gx<=Math.floor(xMax); gx++){
const xPos = mapX(gx);
const line = document.createElementNS(ns,'line');
line.setAttribute('x1',xPos); line.setAttribute('x2',xPos);
line.setAttribute('y1',20); line.setAttribute('y2',h-20);
line.setAttribute('stroke','rgba(255,255,255,0.02)');
line.setAttribute('stroke-width','1');
svg.appendChild(line);
const txt = document.createElementNS(ns,'text');
txt.setAttribute('x', xPos);
txt.setAttribute('y', h-6);
txt.setAttribute('fill','rgba(230,238,248,0.45)');
txt.setAttribute('font-size','10');
txt.setAttribute('text-anchor','middle');
txt.textContent = gx;
svg.appendChild(txt);
}
for(let gy = 0; gy<=8; gy+=1){
const yPos = mapY(gy);
const line = document.createElementNS(ns,'line');
line.setAttribute('y1',yPos); line.setAttribute('y2',yPos);
line.setAttribute('x1',40); line.setAttribute('x2',w-20);
line.setAttribute('stroke','rgba(255,255,255,0.02)');
line.setAttribute('stroke-width','1');
svg.appendChild(line);
}
// axes
const axisX = document.createElementNS(ns,'line');
axisX.setAttribute('x1',mapX(xMin)); axisX.setAttribute('x2',mapX(xMax));
axisX.setAttribute('y1', mapY(0)); axisX.setAttribute('y2', mapY(0));
axisX.setAttribute('stroke','rgba(230,238,248,0.12)');
axisX.setAttribute('stroke-width','1.5');
svg.appendChild(axisX);
const axisY = document.createElementNS(ns,'line');
axisY.setAttribute('x1',mapX(0)); axisY.setAttribute('x2',mapX(0));
axisY.setAttribute('y1', mapY(yMin)); axisY.setAttribute('y2', mapY(yMax));
axisY.setAttribute('stroke','rgba(230,238,248,0.12)');
axisY.setAttribute('stroke-width','1.5');
svg.appendChild(axisY);
}
function plotFunction(){
const ns = 'http://www.w3.org/2000/svg';
const path = document.createElementNS(ns,'path');
let d = '';
const steps = 200;
for(let i=0;i<=steps;i++){
const t = i/steps;
const x = xMin + t*(xMax - xMin);
const y = x*x; // f(x)=x^2
const px = mapX(x), py = mapY(y);
d += (i===0? 'M':'L') + px + ' ' + py + ' ';
}
path.setAttribute('d', d);
path.setAttribute('stroke','rgba(125,211,252,0.95)');
path.setAttribute('stroke-width','2.2');
path.setAttribute('fill','none');
svg.appendChild(path);
}
function drawPoints(x, h){
const ns = 'http://www.w3.org/2000/svg';
const x1 = x;
const x2 = x + h;
const y1 = x1*x1;
const y2 = x2*x2;
const p1x = mapX(x1), p1y = mapY(y1);
const p2x = mapX(x2), p2y = mapY(y2);
// points
const c1 = document.createElementNS(ns,'circle');
c1.setAttribute('cx',p1x); c1.setAttribute('cy',p1y); c1.setAttribute. |