Gym Hours
1 year ago in Plain Text
<!DOCTYPE html>
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<style>
body {
font-family: "Roboto"; /* Updated font */
margin: 0; /* Remove default margin */
padding: 0; /* Remove default padding */
}
.red-banner {
background-color: #b92223; /* Updated color */
color: white;
padding: 10px;
display: flex;
justify-content: space-between;
align-items: center;
}
.back-button {
padding: 0 10px;
font-size: 30px;
background: #b92223; /* Updated color */
border: none;
cursor: pointer;
color: white;
}
.report-text {
font-size: 14px;
color: white;
}
.yellow-banner {
background-color: #faf159;
padding: 10px;
display: flex;
justify-content: space-between;
}
.toggle-option {
text-transform: uppercase;
padding: 10px;
border-radius: 10px;
cursor: pointer;
width: 49%; /* Updated width */
text-align: center;
font-size: 14px; /* Updated font size */
}
.monthly {
background-color: #222222;
color: #FFFF00;
}
.yearly {
background-color: rgba(169, 169, 169, 0.5);
}
.grey-banner {
background-color: #eeeeee;
color: #555555;
padding: 10px;
font-size: 16px;
}
.content {
padding: 20px;
border: 1px solid lightgray; /* Border added */
}
.content div {
margin-bottom: 10px;
}
.location {
font-weight: bold;
font-size: 22px; /* Updated font size */
}
.address {
color: grey;
font-size: 16px; /* Updated font size */
}
.date {
color: grey;
font-size: 16px; /* Updated font size */
}
#contentContainer {
display: none;
}
.form-container {
padding: 20px;
background-color: #f9f9f9;
margin: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
max-width: 400px; /* Limit form width */
margin: 20px auto; /* Center the form */
}
.form-input {
margin-bottom: 15px;
}
.form-input label {
display: block;
margin-bottom: 5px;
font-size: 16px;
font-weight: bold;
}
.form-input input {
width: calc(100% - 20px);
padding: 10px;
border-radius: 5px;
border: 1px solid #ccc;
box-sizing: border-box;
font-size: 16px;
}
.submit-button {
padding: 15px 30px;
font-size: 18px;
background-color: #b92223;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-weight: bold;
}
.submit-button:hover {
background-color: #ff4444;
}
</style>
</head>
<body>
<div class="red-banner">
<div class="back-button">‹</div>
<div style="flex: 1; text-align: center; font-size: 20px;">Check-in History</div> <!-- Updated font size -->
<div class="report-text">Report</div>
</div>
<div class="yellow-banner">
<div class="toggle-option monthly">MONTHLY</div>
<div class="toggle-option yearly">YEARLY</div>
</div>
<div class="grey-banner">&nbsp;SEP 2023</div>
<div id="contentContainer"></div>
<div class="form-container">
<h2>Enter Dates and Times</h2>
<form id="dateForm">
<div class="form-input">
<label for="date1">Date 1:</label>
<input type="date" id="date1">
<input type="time" id="time1">
</div>
<div class="form-input">
<label for="date2">Date 2:</label>
<input type="date" id="date2">
<input type="time" id="time2">
</div>
<div class="form-input">
<label for="date3">Date 3:</label>
<input type="date" id="date3">
<input type="time" id="time3">
</div>
<div class="form-input">
<label for="date4">Date 4:</label>
<input type="date" id="date4">
<input type="time" id="time4">
</div>
<div class="form-input">
<label for="date5">Date 5:</label>
<input type="date" id="date5">
<input type="time" id="time5">
</div>
<button type="submit" class="submit-button">Submit</button>
</form>
</div>
<script>
document.getElementById('dateForm').addEventListener('submit', function(event) {
event.preventDefault();
const dates = [
{ date: document.getElementById('date1').value, time: document.getElementById('time1').value },
{ date: document.getElementById('date2').value, time: document.getElementById('time2').value },
{ date: document.getElementById('date3').value, time: document.getElementById('time3').value },
{ date: document.getElementById('date4').value, time: document.getElementById('time4').value },
{ date: document.getElementById('date5').value, time: document.getElementById('time5').value }
];
const contentContainer = document.getElementById('contentContainer');
contentContainer.innerHTML = ''; // Clear existing content
// Update content with new dates and times
for (let i = 0; i < dates.length; i++) {
if (dates[i].date || dates[i].time) {
const newContentDiv = document.createElement('div');
newContentDiv.classList.add('content');
const locationDiv = document.createElement('div');
locationDiv.classList.add('location');
locationDiv.innerText = 'East Windsor (Rt 130 S), NJ';
const addressDiv = document.createElement('div');
addressDiv.classList.add('address');
addressDiv.innerText = '440 Rt 130 S';
const dateDiv = document.createElement('div');
dateDiv.classList.add('date');
let string = formatDate(dates[i].date, dates[i].time);
string = string.replace(","," ⋅ ")
dateDiv.innerText = string;
newContentDiv.appendChild(locationDiv);
newContentDiv.appendChild(addressDiv);
newContentDiv.appendChild(dateDiv);
contentContainer.appendChild(newContentDiv);
const line = document.createElement('br');
contentContainer.appendChild(line);
contentContainer.appendChild(line);
contentContainer.appendChild(line);
contentContainer.appendChild(line);
contentContainer.appendChild(line);
contentContainer.appendChild(line);
contentContainer.appendChild(line);
contentContainer.appendChild(line);
contentContainer.appendChild(line);
contentContainer.appendChild(line);
contentContainer.appendChild(line);
contentContainer.appendChild(line);
contentContainer.appendChild(line);
contentContainer.appendChild(line);
contentContainer.appendChild(line);
contentContainer.appendChild(line);
}
}
// Display the content container if there's content to show
if (contentContainer.children.length > 0) {
contentContainer.style.display = 'block';
} else {
contentContainer.style.display = 'none';
}
});
function formatDate(date, time) {
if (!date && !time) return '';
// Combine date and time and ensure it's in UTC
const combinedDateTime = `${date}T${time}:00Z`;
const formattedDateTime = new Date(combinedDateTime).toLocaleString('en-US', { timeZone: 'UTC' }).replace(":00","");
return formattedDateTime;
}
</script>
</body>
</html>