Skip to content

Commit

Permalink
update StageOne_task
Browse files Browse the repository at this point in the history
  • Loading branch information
oge-dev committed Jul 3, 2024
0 parents commit a1188d5
Show file tree
Hide file tree
Showing 5 changed files with 247 additions and 0 deletions.
Binary file added README.md
Binary file not shown.
Binary file not shown.
87 changes: 87 additions & 0 deletions css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/* reset the default styling */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* styling for display section(body) of the web page */
body {
font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
line-height: 1.6;
background-image: linear-gradient(
to bottom,
rgba(0, 0, 0, 0.829),
rgba(13, 13, 13, 0.582),
rgba(0, 0, 0, 0.706)
),
url("../assets/img/dark-room-with-light-background_1409-1809.avif");
background-repeat: no-repeat;
background-size: cover;
background-position: center;
max-width: 100%;
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
}
main {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 8px;
max-width: 400px;
width: 90%;
padding: 20px;
margin: 12px 0;
background-color: #fff;
z-index: 1;
}
/* setting the margin top and bottom of time-info, profile, goals,and links to 20 pixel */
.time-info,
.profile,
.goals,
.links {
margin: 20px 0;
}
/* styling for current Time and Day in UTC */
.time-info {
font-size: 12px;
font-weight: 400;
text-align: right;
}
/* styling for the Slack Profile Picture, ID and email, My Tech goals and useful links */
.profile {
font-weight: 400;
font-size: 14px;
}
.profile,
.links {
text-align: center;
}
.goals h2,
.links h2 {
font-weight: 600;
font-size: 18px;
}
.goals ul {
font-weight: 400;
font-size: 14px;
padding-left: 20px;
}

.links a {
display: block;
color: #007bff;
text-decoration: none;
font-weight: 400;
font-size: 14px;
}

.links a:hover {
text-decoration: underline;
}
/* styling for the footer */
footer {
padding: 1rem 0;
color: #fff;
font-weight: 400;
font-size: 12px;
}
104 changes: 104 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- title of the website which is being displayed at the tab bar -->
<title>My Teach Goals</title>
<!-- link to external css -->
<link rel="stylesheet" href="./css/styles.css" />
</head>
<!-- display section(body) of the web page -->
<body>
<main>
<section>
<!-- html structure of current Time and Day in UTC -->
<div class="time-info">
<div>
<strong>Time:</strong>
<span data-testid="currentTimeUTC">Fetching...</span>
</div>
<div>
<strong>Day of the Week:</strong>
<span data-testid="currentDay">Fetching...</span>
</div>
</div>
<!-- profile section of the page where the Slack Profile Picture, ID and email displayed -->
<div class="profile">
<img
src=""
alt="Slack Profile Picture"
data-testid="slackProfilePicture"
width="48"
height="48"
/>
<div>
<strong>Slack ID:</strong>
<span data-testid="slackDisplayName">Fetching...</span>
</div>
<div>
<strong>Slack Email:</strong>
<span data-testid="slackEmail">Fetching...</span>
</div>
</div>
</section>
<!-- My Tech goals for the Next 2years -->
<section class="goals">
<h2>My Tech goals for the Next 2years:</h2>
<ul>
<li>
Enhance proficiency in JavaScript and modern frameworks like React
and Vue.js
</li>
<li>
Contribute to open-source projects and collaborate with the
developer community
</li>
<li>
Obtain certifications in cloud computing, Software Engineering and
cybersecurity
</li>
<li>
Work on advanced real-world projects to boost my robust portfolio
</li>
<li>Learn and implement best practices in frontend development</li>
<li>
Stay updated with the latest trends and technologies in the tech
industry
</li>
</ul>
</section>
<!-- Links section for hng.tech/learn, keyword.dog, scrapeanyweb.site -->
<section class="links">
<h2>Useful Links</h2>
<a
data-testid="hngLink"
href="http://hng.tech/learn"
target="_blank"
rel="noopener noreferrer"
>hng.tech/learn</a
>
<a
data-testid="keywordLink"
href="http://keyword.dog/"
target="_blank"
rel="noopener noreferrer"
>keyword.dog</a
>
<a
data-testid="scrapeanywebLink"
href="http://scrapeanyweb.site/"
target="_blank"
rel="noopener noreferrer"
>scrapeanyweb.site</a
>
</section>
</main>
<!-- footer section -->
<footer>
<p>&copy;2024 Stage One Project by oge-dev</p>
</footer>
<script src="./js/script.js"></script>
</body>
</html>
56 changes: 56 additions & 0 deletions js/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
document.addEventListener("DOMContentLoaded", () => {
// declaration of variables and assigning values to it
const currentTimeUTC = document.querySelector(
'[data-testid="currentTimeUTC"]'
);
const currentDay = document.querySelector('[data-testid="currentDay"]');
const slackDisplayName = document.querySelector(
'[data-testid="slackDisplayName"]'
);
const slackEmail = document.querySelector('[data-testid="slackEmail"]');
const profilePicture = document.querySelector(
'[data-testid="slackProfilePicture"]'
);

// Function to update time and day
function updateTimeAndDay() {
const now = new Date();
const utcTime =
now.toLocaleTimeString("en-US", {
hour: "numeric",
minute: "numeric",
second: "numeric",
timeZone: "UTC",
hour12: true,
}) + " (UTC)";

const dayOfWeek = now.toLocaleString("en-US", {
weekday: "long",
timeZone: "UTC",
});

currentTimeUTC.textContent = utcTime;
currentDay.textContent = dayOfWeek;
}

// Function to fetch Slack information (simulated)
function fetchSlackInfo() {
// Simulated data fetch
const slackData = {
displayName: "oge-dev",
email: "julietogechi27@gmail.com",
profilePicture:
"https://ca.slack-edge.com/T07466B189M-U07ARKG3PC0-499960a28945-48",
};
slackDisplayName.textContent = slackData.displayName;
slackEmail.textContent = slackData.email;
profilePicture.src = slackData.profilePicture;
}

// Call the time function initially
updateTimeAndDay();
// Fetch Slack information
fetchSlackInfo();
// Update the time every sec
setInterval(updateTimeAndDay, 1000);
});

0 comments on commit a1188d5

Please sign in to comment.