Skip to content

Commit

Permalink
Merge pull request #2 from harshsinghcs/feature
Browse files Browse the repository at this point in the history
added song play & footer
  • Loading branch information
harshsinghcs authored Oct 15, 2023
2 parents cad8e5e + ec8dd86 commit 663cf99
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
36 changes: 36 additions & 0 deletions footer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* Footer styles */
footer {
background-color: #333;
color: #fff;
padding: 10px;
text-align: center;
position: absolute;
bottom: 0;
width: 100%;
}

.footer-content {
max-width: 800px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}

.footer-content p {
margin: 0;
}

.footer-content ul {
list-style: none;
padding: 0;
}

.footer-content ul li {
display: inline;
margin-right: 20px;
}

.footer-content ul li:last-child {
margin-right: 0;
}
24 changes: 22 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Productivity Dashboard</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
<link rel="stylesheet" href="styles.css"> <!-- Add custom CSS if needed -->
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="footer.css">
</head>
<body>
<div class="w-full container mx-auto p-4">
Expand All @@ -29,7 +30,7 @@ <h2 class="text-xl mb-4">Pomodoro Timer</h2>
<button onclick="pauseTimer()" class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 mr-2 rounded-md"><i class="fa-solid fa-pause"></i></button>
<button onclick="resetTimer()" class="bg-gray-500 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded-md"><i class="fa-solid fa-arrows-rotate"></i></button>
<button onclick="setShortBreak()" class="bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 mr-2 rounded-md"><i class="fa-solid fa-shield-halved" style="color: #0fd7c9;"></i></button>
<button onclick="setLongBreak()" class="bg-yellow-500 hover:bg-yellow-700 text-white font-bold py-2 px-4 rounded-md">Long Break</button>
<button onclick="setLongBreak()" class="bg-yellow-500 hover:bg-yellow-700 text-white font-bold py-2 px-4 rounded-md"><i class="fa-solid fa-stopwatch-20"></i></button>
</div>
</div>

Expand All @@ -54,8 +55,27 @@ <h2 class="text-xl mb-4">To-Do List</h2>
</div>
</div>
</div>
<div>
<h1>Play a Song</h1>
<div class="music-player">
<input type="text" id="musicLink" placeholder="Paste the music link here">
<button id="playButton">Play</button>
</div>
<audio id="music" controls></audio>
</div>

<footer>
<div class="footer-content">
<p>&copy; 2023 WorkZenith. All rights reserved.</p>
<ul>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Terms of Service</a></li>
</ul>
</div>
</footer>

<script src="script.js"></script>
<script src="https://kit.fontawesome.com/0ddc63a6de.js" crossorigin="anonymous"></script>
<script src="https://sdk.scdn.co/spotify-player.js"></script>
</body>
</html>
15 changes: 15 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,18 @@ function unassignPrimaryTask() {

// Spotify Music Player
// Add JavaScript code for Spotify music player here

const musicLink = document.getElementById('musicLink');
const playButton = document.getElementById('playButton');
const music = document.getElementById('music');

playButton.addEventListener('click', () => {
const link = musicLink.value.trim();

if (link) {
music.src = link;
music.play();
} else {
alert('Please enter a valid music link.');
}
});
31 changes: 31 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
body {
font-family: Arial, sans-serif;
text-align: center;
}

.music-player {
margin: 20px;
}

input[type="text"] {
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
}

#playButton {
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
padding: 8px 16px;
cursor: pointer;
}

#playButton:hover {
background-color: #45a049;
}

#playButton:active {
background-color: #3e8741;
}

0 comments on commit 663cf99

Please sign in to comment.