Skip to content
Open
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
141 changes: 104 additions & 37 deletions Clock/index.css
Original file line number Diff line number Diff line change
@@ -1,37 +1,104 @@
#clockContainer{
position: relative;
margin: auto;
height: 40vw;
width: 40vw;
background: url(clock.png) no-repeat;
background-size: 100%;
}

#hour, #minute, #second{
position: absolute;
background: black;
border-radius: 10px;
transform-origin: bottom;
}
#hour{
width: 1.8%;
height: 25%;
top: 25%;
left: 48.85%;
opacity: 0.8;
}
#minute{
width: 1.6%;
height: 30%;
top: 19%;
left: 48.9%;
opacity: 0.8;
}
#second{
width: 1%;
height: 40%;
top: 9%;
left: 49.25%;
opacity: 0.8;

}
/* Basic layout */
body {
margin: 0;
height: 100vh;
background: linear-gradient(135deg, #141e30, #243b55);
display: flex;
justify-content: center;
align-items: center;
font-family: "Poppins", sans-serif;
overflow: hidden;
}

/* Title */
.title {
color: #ffffff;
font-size: 2rem;
letter-spacing: 2px;
margin-bottom: 1rem;
text-align: center;
}

/* Clock container */
.wrapper {
text-align: center;
backdrop-filter: blur(20px);
background: rgba(255, 255, 255, 0.05);
padding: 30px 50px;
border-radius: 20px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.4);
}

/* Analog clock design */
#clockContainer {
position: relative;
height: 280px;
width: 280px;
margin: auto;
border: 10px solid rgba(255, 255, 255, 0.2);
border-radius: 50%;
background: radial-gradient(circle, #1f2933, #111);
box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.7), 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Clock hands */
#hour, #minute, #second {
position: absolute;
transform-origin: bottom center;
border-radius: 8px;
}

#hour {
width: 6px;
height: 70px;
background: #e0e0e0;
top: 65px;
left: calc(50% - 3px);
box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

#minute {
width: 4px;
height: 95px;
background: #b0b0b0;
top: 40px;
left: calc(50% - 2px);
box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

#second {
width: 2px;
height: 110px;
background: #ff5252;
top: 25px;
left: calc(50% - 1px);
box-shadow: 0 0 10px rgba(255, 82, 82, 0.8);
transition: transform 0.05s linear;
}

/* Center dot */
#centerDot {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 14px;
height: 14px;
background: #ff5252;
border-radius: 50%;
box-shadow: 0 0 10px rgba(255, 82, 82, 0.8);
}

/* Digital clock */
#digitalClock {
margin-top: 1.5rem;
font-size: 2rem;
color: #ffffff;
background: rgba(255, 255, 255, 0.1);
padding: 10px 20px;
border-radius: 12px;
display: inline-block;
box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
letter-spacing: 2px;
text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}
23 changes: 14 additions & 9 deletions Clock/index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Clock Using Pure JS</title>
<link rel="stylesheet" href="index.css">
<script src="index.js"></script>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Modern Analog & Digital Clock</title>
<link rel="stylesheet" href="index.css" />
<script src="index.js" defer></script>
</head>
<body>
<div class="wrapper">
<h1 class="title">PeerClock</h1>
<div id="clockContainer">
<div id="hour"></div>
<div id="minute"></div>
<div id="second"></div>
<div id="hour"></div>
<div id="minute"></div>
<div id="second"></div>
<div id="centerDot"></div>
</div>
<div id="digitalClock"></div>
</div>
</body>
</html>
</html>
44 changes: 31 additions & 13 deletions Clock/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
setInterval(() => {
d = new Date();
htime = d.getHours();
mtime = d.getMinutes();
stime = d.getSeconds();
hrotation = 30*htime + mtime/2;
mrotation = 6*mtime;
srotation = 6*stime;

hour.style.transform = `rotate(${hrotation}deg)`;
minute.style.transform = `rotate(${mrotation}deg)`;
second.style.transform = `rotate(${srotation}deg)`;
}, 1000);
function updateClock() {
const d = new Date();
const htime = d.getHours();
const mtime = d.getMinutes();
const stime = d.getSeconds();
const ms = d.getMilliseconds();

// continuous smooth second hand
const srotation = 6 * (stime + ms / 1000);
const mrotation = 6 * (mtime + stime / 60);
const hrotation = 30 * (htime % 12 + mtime / 60);

const hour = document.getElementById("hour");
const minute = document.getElementById("minute");
const second = document.getElementById("second");

hour.style.transform = `rotate(${hrotation}deg)`;
minute.style.transform = `rotate(${mrotation}deg)`;
second.style.transform = `rotate(${srotation}deg)`;

// Digital clock display
const digital = document.getElementById("digitalClock");
const formattedHours = htime.toString().padStart(2, "0");
const formattedMinutes = mtime.toString().padStart(2, "0");
const formattedSeconds = stime.toString().padStart(2, "0");

digital.textContent = `${formattedHours}:${formattedMinutes}:${formattedSeconds}`;
}

// Run every frame for smooth movement
setInterval(updateClock, 50);
147 changes: 101 additions & 46 deletions Temperature-Converter/CSS/style.css
Original file line number Diff line number Diff line change
@@ -1,49 +1,104 @@
@import url('https://fonts.googleapis.com/css2?family=Mulish:wght@300&display=swap');

*{
font-family: 'Mulish', sans-serif;
}

body{
width: 100%;
height: 85vh;
background-color: #eae2b7;
display: grid;
justify-content: center;
align-items: center;
place-items: center;
}

#fa{
font-size: 60px;
}

form{
background-color: #fab1a0;
padding: 50px;
body {
font-family: 'Segoe UI', sans-serif;
background: linear-gradient(135deg, #e8eaf6, #c5cae9);
display: flex;
flex-direction: column;
-webkit-box-shadow: 0 10px 6px -6px #777;
-moz-box-shadow: 0 10px 6px -6px #777;
box-shadow: 0 10px 6px -6px #777;
border-radius: 10px;
}

#tempCalc label{
font-size: 30px;
}

/* [type="submit"]{
height: 35px;
margin: 20px;
width: 100px;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
}

.converter {
background: white;
border-radius: 16px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
padding: 30px;
width: 340px;
text-align: center;
}

h2 {
color: #3f51b5;
margin-bottom: 15px;
}

input, select, button {
width: 90%;
padding: 10px;
margin: 8px 0;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 15px;
border: none;
border-radius: 4px;
background-color: black;
}

button {
background-color: #3f51b5;
color: white;
} */

#resultContainer{
font-size: 35px;
}
font-weight: bold;
cursor: pointer;
transition: 0.3s;
}

button:hover {
background-color: #283593;
}

#swapBtn {
background-color: #7986cb;
width: 45%;
}

#swapBtn:hover {
background-color: #5c6bc0;
}

.btn-group {
display: flex;
justify-content: space-between;
gap: 10px;
}

#result {
margin-top: 15px;
font-size: 18px;
color: #1a237e;
font-weight: 500;
}

h3 {
color: #303f9f;
margin-top: 20px;
margin-bottom: 8px;
}

#historyList {
list-style: none;
padding: 0;
max-height: 150px;
overflow-y: auto;
text-align: left;
border: 1px solid #ddd;
border-radius: 8px;
background: #f4f6fb;
}

#historyList li {
padding: 8px 10px;
border-bottom: 1px solid #ddd;
font-size: 14px;
}

#historyList li:last-child {
border-bottom: none;
}

#clearBtn {
background-color: #e53935;
width: 50%;
margin-top: 10px;
}

#clearBtn:hover {
background-color: #c62828;
}

Loading