-
Notifications
You must be signed in to change notification settings - Fork 895
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
9 changed files
with
985 additions
and
196 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,33 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<title>Brave stops ads from following you</title> | ||
|
||
<style> | ||
video { | ||
width: 90%; | ||
height: auto; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<h1>Yeah, Brave blocks that</h1> | ||
|
||
<script> | ||
document.addEventListener('DOMContentLoaded', function () { | ||
const video = document.createElement('video'); | ||
video.src = '/brave_ads/video.mp4'; | ||
video.autoplay = true; | ||
video.controls = true; | ||
video.onerror = function (event) { | ||
console.error('An error occurred while trying to load the video: ', event); | ||
}; | ||
|
||
document.body.appendChild(video); | ||
}); | ||
</script> | ||
</body> | ||
|
||
</html> |
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<title>Adventure Awaits</title> | ||
</head> | ||
|
||
<body> | ||
<h1>Welcome to Your Adventure</h1> | ||
<p> | ||
Embark on a journey of learning and discovery. Each step you take brings you closer to mastering new skills and | ||
achieving your goals. | ||
</p> | ||
<ul> | ||
<li><a href="rust.html" target="_self">Explore new programming languages</a></li> | ||
<li><a href="open_source.html" target="_self">Contribute to open-source projects</a></li> | ||
<li><a href="develop.html" target="_self">Develop innovative applications</a></li> | ||
</ul> | ||
<blockquote> | ||
"The only limit to our realization of tomorrow is our doubts of today." - Franklin D. Roosevelt | ||
</blockquote> | ||
<table border="1"> | ||
<tr> | ||
<th>Task</th> | ||
<th>Status</th> | ||
</tr> | ||
<tr> | ||
<td>Learn Rust</td> | ||
<td>Completed</td> | ||
</tr> | ||
<tr> | ||
<td>Contribute to a GitHub repository</td> | ||
<td>In Progress</td> | ||
</tr> | ||
<tr> | ||
<td>Build a mobile app</td> | ||
<td>Pending</td> | ||
</tr> | ||
</table> | ||
</body> | ||
|
||
</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 |
---|---|---|
@@ -1,48 +1,56 @@ | ||
<html> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<title>Single Page Application</title> | ||
<script> | ||
// Function to update the page header. | ||
function displayContent(state) { | ||
const pageHeader = document.querySelector("#pageHeader"); | ||
pageHeader.textContent = state.header; | ||
} | ||
|
||
// Event listener for clicks on the document. | ||
document.addEventListener("click", async (event) => { | ||
const creature = event.target.getAttribute("data-creature"); | ||
if (creature) { | ||
event.preventDefault(); | ||
try { | ||
displayContent(creature); | ||
// Add a new entry to the history. | ||
// This simulates loading a new page. | ||
const newState = { header: creature }; | ||
history.pushState(json, "", newState); | ||
} catch (err) { | ||
console.error(err); | ||
const navigationType = event.target.getAttribute("data-navigation-type"); | ||
if (navigationType) { | ||
event.preventDefault(); // Stop the default link behavior. | ||
if (navigationType === "same_document") { | ||
try { | ||
// Update the header. | ||
displayContent({ header: navigationType }); | ||
|
||
// Change the URL without reloading. | ||
const newState = { header: navigationType }; | ||
history.pushState(newState, "", navigationType); | ||
} catch (err) { | ||
// Log any errors. | ||
console.error(err); | ||
} | ||
} | ||
} | ||
}); | ||
|
||
// Handle forward/back buttons | ||
// Event listener for browser navigation (back/forward). | ||
window.addEventListener("popstate", (event) => { | ||
// If a state has been provided, we have a "simulated" page | ||
// and we update the current page. | ||
if (event.state) { | ||
// Simulate the loading of the previous page | ||
// Update the header based on the state. | ||
displayContent(event.state); | ||
} | ||
}); | ||
|
||
// Create state on page load and replace the current history with it | ||
// Set the initial state of the page. | ||
const initialState = { header: "Home" }; | ||
history.replaceState(initialState, "", document.location.href); | ||
</script> | ||
</head> | ||
<body> | ||
<h1 id="pageHeader">Header</h1> | ||
|
||
<li><a href="/brave_ads/history_api_spa.html">Home</a></li> | ||
<li><a href="eagle" data-creature="eagle">Eagle</a></li> | ||
<li><a href="vulture" data-creature="vulture">Vulture</a></li> | ||
<body> | ||
<h1 id="pageHeader">Home</h1> | ||
<ul> | ||
<li><a href="/" data-navigation-type="home">Home</a></li> | ||
<li><a href="same_document" data-navigation-type="same_document">Same Document</a></li> | ||
</ul> | ||
</body> | ||
|
||
</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,33 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<title>Brave stops ads from following you</title> | ||
|
||
<style> | ||
video { | ||
width: 90%; | ||
height: auto; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<h1>Yeah, Brave blocks that</h1> | ||
|
||
<script> | ||
document.addEventListener('DOMContentLoaded', function () { | ||
const video = document.createElement('video'); | ||
video.src = '/brave_ads/video.mp4'; | ||
video.autoplay = false; | ||
video.controls = true; | ||
video.onerror = function (event) { | ||
console.error('An error occurred while trying to load the video: ', event); | ||
}; | ||
|
||
document.body.appendChild(video); | ||
}); | ||
</script> | ||
</body> | ||
|
||
</html> |
Binary file not shown.