-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const pages = [ | ||
["<h1>Content page</h1>", "Here is a list of content"], | ||
["10.1: Introduction"], | ||
["10.2: Principle of Superposition"], | ||
["10.3: Interference"], | ||
["<h1>10.4: Interference of Two Wave Sources</h1>"], | ||
["10.5.1: Diffraction of water waves"], | ||
["10.5.2: Single Slit Diffraction Pattern"], | ||
["10.5.3: Resolving Power"], | ||
["10.6: Interference of Light Waves - Young's Double Slit Experiment"], | ||
["10.7: Diffraction Grating"], | ||
["10.8.1: Characteristics of Stationary Wave"], | ||
["10.8.2: Stationary Waves in Strings"], | ||
["10.8.3: Standing Waves in Air Columns"], | ||
["10.8.4: What about the pressure?"] | ||
]; | ||
|
||
let counter = 0; | ||
content = document.querySelector(".content"); | ||
next = document.getElementById("next"); | ||
back = document.getElementById("back"); | ||
|
||
function updateContent() { | ||
let htmlContent = ''; | ||
pages[counter].forEach(element => { | ||
htmlContent += element; | ||
}); | ||
content.innerHTML = htmlContent; | ||
} | ||
|
||
|
||
updateContent(); | ||
|
||
next.addEventListener("click", () => { | ||
if (counter < pages.length - 1) { | ||
counter++; | ||
updateContent(); | ||
} | ||
} | ||
); | ||
|
||
back.addEventListener("click", () => { | ||
if (counter > 0) { | ||
counter--; | ||
updateContent(); | ||
} else { | ||
window.location.href = "index.html"; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Superposition</title> | ||
</head> | ||
<body> | ||
<div class="content"> | ||
|
||
</div> | ||
<button id="next">Next</button> | ||
<button id="back">Back</button> | ||
<button id="sim" onclick="location.href='sim2.html'">Simulations</button> | ||
<script src="static/js/textbook.js"></script> | ||
</body> | ||
</html> |