Skip to content

Commit

Permalink
reorganization of files and folders
Browse files Browse the repository at this point in the history
  • Loading branch information
hkhaung committed Feb 14, 2024
1 parent efc4b09 commit 17c6f3f
Show file tree
Hide file tree
Showing 26 changed files with 140 additions and 82 deletions.
File renamed without changes
75 changes: 45 additions & 30 deletions hw1/index.html → homeworks/hw1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,58 @@ <h6 class="text-center mt-1"></h6>

<ul class="nav nav-tabs navbarmargins justify-content-center">
<li class="nav-item">
<a class="nav-link" href="#task-1">Task 1</a>
<button
type="button"
class="btn-transparent nav-link"
onclick="scrollToTask('#task-1')"
>
Task 1
</button>
</li>
<li class="nav-item">
<a class="nav-link" href="#task-2">Task 2</a>
<button
type="button"
class="btn-transparent nav-link"
onclick="scrollToTask('#task-2')"
>
Task 2
</button>
</li>
<li class="nav-item">
<a class="nav-link" href="#task-3">Task 3</a>
<button
type="button"
class="btn-transparent nav-link"
onclick="scrollToTask('#task-3')"
>
Task 3
</button>
</li>
<li class="nav-item">
<a class="nav-link" href="#task-4">Task 4</a>
<button
type="button"
class="btn-transparent nav-link"
onclick="scrollToTask('#task-4')"
>
Task 4
</button>
</li>
<li class="nav-item">
<a class="nav-link" href="#task-5">Task 5</a>
<button
type="button"
class="btn-transparent nav-link"
onclick="scrollToTask('#task-5')"
>
Task 5
</button>
</li>
<li class="nav-item">
<a class="nav-link" href="#task-6">Task 6</a>
<button
type="button"
class="btn-transparent nav-link"
onclick="scrollToTask('#task-6')"
>
Task 6
</button>
</li>
</ul>

Expand Down Expand Up @@ -726,7 +762,7 @@ <h3>Task 6: "Level sampling" with mipmaps for texture mapping</h3>

<hr class="breakline-bottom" />

<!-- ui -->
<!-- UI -->

<button class="btn btn-primary scroll-to-top" onclick="scrollToTop()">
Scroll to Top
Expand All @@ -739,28 +775,7 @@ <h3>Task 6: "Level sampling" with mipmaps for texture mapping</h3>
<!-- Bootstrap JS -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>

<script>
// Function to scroll to the top of the page
function scrollToTop() {
window.scrollTo({ top: 0, behavior: "smooth" });
if (history.replaceState) {
var urlWithoutHash = window.location.href.split("#")[0];
history.replaceState(null, null, urlWithoutHash);
}
}

// Show/Hide scroll-to-top button based on scroll position
window.onscroll = function () {
var scrollButton = document.querySelector(".scroll-to-top");
if (
document.body.scrollTop > 20 ||
document.documentElement.scrollTop > 20
) {
scrollButton.style.display = "block";
} else {
scrollButton.style.display = "none";
}
};
</script>
<!-- scroll functions -->
<script src="../template.js"></script>
</body>
</html>
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
51 changes: 27 additions & 24 deletions hw2/index.html → homeworks/hw2/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- CHANGE the link tags if you want to see template -->

<!DOCTYPE html>
<html lang="en">
<head>
Expand All @@ -15,7 +17,7 @@
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="template.css" />
<link rel="stylesheet" href="../template.css" />

<title>Template</title>
</head>
Expand All @@ -32,13 +34,31 @@ <h6 class="text-center mt-1"></h6>

<ul class="nav nav-tabs navbarmargins justify-content-center">
<li class="nav-item">
<a class="nav-link" href="#task-1">Task 1</a>
<button
type="button"
class="btn-transparent nav-link"
onclick="scrollToTask('#task-1')"
>
Task 1
</button>
</li>
<li class="nav-item">
<a class="nav-link" href="#task-2">Task 2</a>
<button
type="button"
class="btn-transparent nav-link"
onclick="scrollToTask('#task-2')"
>
Task 2
</button>
</li>
<li class="nav-item">
<a class="nav-link" href="#task-3">Task 3</a>
<button
type="button"
class="btn-transparent nav-link"
onclick="scrollToTask('#task-3')"
>
Task 3
</button>
</li>
</ul>

Expand Down Expand Up @@ -286,7 +306,7 @@ <h3>Task 3: ___</h3>

<hr class="breakline-bottom" />

<!-- ui -->
<!-- UI -->

<button class="btn btn-primary scroll-to-top" onclick="scrollToTop()">
Scroll to Top
Expand All @@ -299,24 +319,7 @@ <h3>Task 3: ___</h3>
<!-- Bootstrap JS -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>

<script>
// Function to scroll to the top of the page
function scrollToTop() {
window.scrollTo({ top: 0, behavior: "smooth" });
}

// Show/Hide scroll-to-top button based on scroll position
window.onscroll = function () {
var scrollButton = document.querySelector(".scroll-to-top");
if (
document.body.scrollTop > 20 ||
document.documentElement.scrollTop > 20
) {
scrollButton.style.display = "block";
} else {
scrollButton.style.display = "none";
}
};
</script>
<!-- scroll functions -->
<script src="../template.js"></script>
</body>
</html>
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions template.css → homeworks/template.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
margin-bottom: 2rem;
}

.btn-transparent {
background-color: transparent;
border: none;
color: #543dda;
}

.btn-transparent:hover {
border: 1px solid #007bff;
}

.btn-transparent:focus {
outline: none;
box-shadow: none;
}

.taskbox-outer {
margin-top: 5rem;
margin-bottom: 5rem;
Expand Down
55 changes: 27 additions & 28 deletions template.html → homeworks/template.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- CHANGE the link tags if you want to see template -->

<!DOCTYPE html>
<html lang="en">
<head>
Expand All @@ -15,7 +17,7 @@
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="template.css" />
<link rel="stylesheet" href="../template.css" />

<title>Template</title>
</head>
Expand All @@ -32,13 +34,31 @@ <h6 class="text-center mt-1"></h6>

<ul class="nav nav-tabs navbarmargins justify-content-center">
<li class="nav-item">
<a class="nav-link" href="#task-1">Task 1</a>
<button
type="button"
class="btn-transparent nav-link"
onclick="scrollToTask('#task-1')"
>
Task 1
</button>
</li>
<li class="nav-item">
<a class="nav-link" href="#task-2">Task 2</a>
<button
type="button"
class="btn-transparent nav-link"
onclick="scrollToTask('#task-2')"
>
Task 2
</button>
</li>
<li class="nav-item">
<a class="nav-link" href="#task-3">Task 3</a>
<button
type="button"
class="btn-transparent nav-link"
onclick="scrollToTask('#task-3')"
>
Task 3
</button>
</li>
</ul>

Expand Down Expand Up @@ -286,7 +306,7 @@ <h3>Task 3: ___</h3>

<hr class="breakline-bottom" />

<!-- ui -->
<!-- UI -->

<button class="btn btn-primary scroll-to-top" onclick="scrollToTop()">
Scroll to Top
Expand All @@ -299,28 +319,7 @@ <h3>Task 3: ___</h3>
<!-- Bootstrap JS -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>

<script>
// Function to scroll to the top of the page
function scrollToTop() {
window.scrollTo({ top: 0, behavior: "smooth" });
if (history.replaceState) {
var urlWithoutHash = window.location.href.split("#")[0];
history.replaceState(null, null, urlWithoutHash);
}
}

// Show/Hide scroll-to-top button based on scroll position
window.onscroll = function () {
var scrollButton = document.querySelector(".scroll-to-top");
if (
document.body.scrollTop > 20 ||
document.documentElement.scrollTop > 20
) {
scrollButton.style.display = "block";
} else {
scrollButton.style.display = "none";
}
};
</script>
<!-- scroll functions -->
<script src="../template.js"></script>
</body>
</html>
26 changes: 26 additions & 0 deletions homeworks/template.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Function to scroll to the top of the page
function scrollToTop() {
window.scrollTo({ top: 0, behavior: "smooth" });
if (history.replaceState) {
var urlWithoutHash = window.location.href.split("#")[0];
history.replaceState(null, null, urlWithoutHash);
}
}

// Show/Hide scroll-to-top button based on scroll position
window.onscroll = function () {
var scrollButton = document.querySelector(".scroll-to-top");
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
scrollButton.style.display = "block";
} else {
scrollButton.style.display = "none";
}
};

// Function to scroll to each task
function scrollToTask(taskId) {
var task = document.querySelector(taskId);
if (task) {
window.scrollTo({ top: task.offsetTop, behavior: "smooth" });
}
}

0 comments on commit 17c6f3f

Please sign in to comment.