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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"python.formatting.provider": "black"
"python.formatting.provider": "black",
"liveServer.settings.port": 5501
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<title>Display Array Elements Using
concat() and join()</title>
</head>
<body>
<script language="Javascript" type="text/javascript">
<!--
var products = new Array()
products[0] = 'Soda '
products[1] = 'Water'
products[2] = 'Pizza'
products[3] = 'Beer'
var str = products.concat()
document.write(str)
document.write('<br>')
var str = products.join(' ')
document.write(str)
-->
</script>
<noscript>
<h1> JavaScript Required</h2>
</noscript>
</body>
<!DOCTYPE html>
<html>
<head>
<title>Display Array Elements Using
concat() and join()</title>
</head>
<body>
<script language="Javascript" type="text/javascript">
<!--
var products = new Array()
products[0] = 'Soda '
products[1] = 'Water'
products[2] = 'Pizza'
products[3] = 'Beer'
var str = products.concat()
document.write(str)
document.write('<br>')
var str = products.join(' ')
document.write(str)
-->
</script>
<noscript>
<h1> JavaScript Required</h2>
</noscript>
</body>
</html>
File renamed without changes.
7 changes: 0 additions & 7 deletions Coding/JavaScript/script.js

This file was deleted.

21 changes: 0 additions & 21 deletions Coding/style.css

This file was deleted.

File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
<link rel="stylesheet" href="style.css">
</head>
<body>
<p id="advice">Loading...</p>
<div id="container">
<button id="getAdviceButton">Get Advice</button>
<p id="advice">Click the button to get advice</p>
</div>
<script src="script.js"></script>
</body>
</html>
</html>
16 changes: 16 additions & 0 deletions Fronted Projects/Advice_Generator/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const adviceElement = document.getElementById('advice');
const getAdviceButton = document.getElementById('getAdviceButton');

getAdviceButton.addEventListener('click', () => {
adviceElement.innerHTML = 'Loading...';

fetch('https://api.adviceslip.com/advice')
.then(data => data.json())
.then(adviceData => {
const adviceText = adviceData.slip.advice;
adviceElement.innerHTML = adviceText;
})
.catch(error => {
adviceElement.innerHTML = 'Failed to fetch advice. Please try again later.';
});
});
40 changes: 40 additions & 0 deletions Fronted Projects/Advice_Generator/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: antiquewhite;
}

#container {
text-align: center;
}

button#getAdviceButton {
background-color: #007BFF;
color: white;
padding: 10px 20px;
border: none;
cursor: pointer;
font-size: 16px;
border-radius: 5px;
}

button#getAdviceButton:hover {
background-color: #0056b3;
}

p#advice {
background: rgb(211, 211, 211);
width: auto;
height: auto;
margin: auto;
display: flex;
align-items: center;
flex-direction: column;
border-radius: 25px;
padding: 2%;
box-shadow: 10px 10px;
font-size: medium;
margin-top: 10px;
}