Skip to content
Snippets Groups Projects
Commit 2a66b777 authored by DuckyDuck69's avatar DuckyDuck69
Browse files

structure

parent 001e7c39
No related branches found
No related tags found
1 merge request!1structure
......@@ -2,41 +2,43 @@
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
.page-container {
display: flex;
flex-direction: column; /* stack vertically */
align-items: center; /* center the Title horizontally */
margin-top: 2rem;
}
@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
.title-container {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
text-align: center;
padding: 2rem 2rem; /* add some breathing space inside */
border: 2px solid rgba(0, 0, 0, 0.1); /* soft, thin border */
border-radius: 1rem; /* rounded corners */
background-color: #ffffff; /* light semi-transparent white */
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); /* calm shadow */
width: fit-content; /* fit around the text nicely */
margin-top: 1rem; /* small push from top */
color: #475569;
}
@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
.time-duration-box {
margin-top: 2rem; /* space below the title */
margin-left: 40rem; /* push it right compared to center */
display: flex;
flex-direction: column;
align-items: flex-start; /* input boxes align nicely */
}
.card {
padding: 2em;
.time-boxes{
text-align: center;
}
.read-the-docs {
color: #888;
#title-description{
text-align: center;
}
import TimeDuration from "./components/TimeDuration"
import Title from "./components/Title"
function App() {
const [count, setCount] = useState(0)
return (
<>
<div className="page-container">
<Title/>
<TimeDuration/>
</div>
</>
)
}
......
......
import { convertInput, useTimeInput } from "../utils/timeUtils";
function TimeDuration(){
const {second} = convertInput();
return(
<div className="time-duration-box">
<h3>Time Duration</h3>
<div className="time-boxes">
<input type = "number" id = "hour-input" placeholder="Hour"/>
<input type = "number" id = "minute-input" placeholder="Minutes"/>
</div>
<button onClick={console.log(second)}>rereive time</button>
<button></button>
</div>
);
}
export default TimeDuration
\ No newline at end of file
function Title(){
return(
<h1 className="title-container">Productivity</h1>
);
}
export default Title
\ No newline at end of file
......@@ -3,9 +3,8 @@
line-height: 1.5;
font-weight: 400;
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
color: rgba(14, 2, 2, 0.87);
background-color: #e6f0f8;
font-synthesis: none;
text-rendering: optimizeLegibility;
......@@ -25,7 +24,6 @@ a:hover {
body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}
......@@ -35,25 +33,6 @@ h1 {
line-height: 1.1;
}
button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}
@media (prefers-color-scheme: light) {
:root {
color: #213547;
......
......
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import './App.css'
import App from './App.jsx'
createRoot(document.getElementById('root')).render(
......
......
export function useTimeInput(){
let hour = Number(document.getElementById("hour-input").value);
let minute = Number(document.getElementById("minute-input").value);
return {hour, minute}
}
export function convertInput(){
let {hour, minute} = useTimeInput();
if(minute > 60){
hour += Math.floor(minute/60)
minute = minute % 60
}
console.log(hour,minute)
const second = hour*3600 + minute*60
return second
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment