Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/icons/ggl.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/plus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions src/home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// load area from local storage
function loadBtn() {
document.getElementById("area").innerHTML = localStorage.getItem("area");
}

loadBtn();

function loadSidebar() {
// remove class "hidden" from preferences-box
document.getElementById("preferences-box").classList.remove("hidden");
}

function createBtn() {
// create a button in the div with id area
var btn = document.createElement("a");
btn.innerHTML = "Click me!";
btn.className = 'rounded-3xl bg-gray-900 text-white p-3';
// jquery create input with id name
var input = $("<input>").attr("id", "name").attr("type", "text").attr("placeholder", "Enter your name");
// append input to btn
btn.append(input);
// append btn to div with id area
document.getElementById("area").appendChild(btn);
}
// jquery stop function until the user presses enter in the input field
$(input).keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
// save the value of the input box to variable url
var url = $("#name").val();
}
});
btn.href = url;
document.getElementById("area").appendChild(btn);
// save the dom of area to local storage
localStorage.setItem("area", document.getElementById("area").innerHTML);
loadSidebar();
}
33 changes: 18 additions & 15 deletions src/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,25 @@
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" type="text/css" href="../output/tailwind.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Start - Catalyst</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="home.js" defer></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>

<body>
<div class="p-2 dark:bg-gray-700 min-w-full min-h-screen text-gray-900 dark:text-gray-50">
<h1 class="font-bold text-3xl">Catalyst</h1>
<p>Welcome to the new Catalyst browser!</p>
<p>Surf the web with an awesome browser by entering a URL in the search field above.</p>
<br>
<hr /><br />
<p>Report bugs <a class="text-green-500" href="https://github.com/JaydenDev/Catalyst/issues">here</a></p>
</div>
<body class="bg-gray-900">
<div class="flex justify-center">
<div id="area" class="rounded-3xl grid gap-1 grid-cols-6 w-1/3 my-[25%] h-26 bg-gray-800 m-auto p-3">
<button onClick="createBtn()" class="rounded-3xl disabled:hidden bg-gray-900 text-white p-3" disabled>
<img src="../assets/icons/plus.png">
</button>
<a href="https://google.com" class="rounded-3xl bg-gray-900 text-white p-3">
<img class="rounded-3xl w-30 h-30" src="../assets/icons/ggl.svg" alt="">
</a>
</div>
</div>
</body>

</html>
</html>