Initial transfer of larger repo from git. IF full history and branches are needed must go to github at https://github.com/DulcisL/CCUCoding.git
This commit is contained in:
commit
c09ce40be0
4048 files changed
+603256
No files matched your search
@@ -0,0 +1,35 @@
|
||||
body
|
||||
{
|
||||
font: normal 16px Helvetica, Arial, sans-serif;
|
||||
margin: 15px;
|
||||
}
|
||||
|
||||
h1{text-align: center;}
|
||||
|
||||
nav span, nav a
|
||||
{
|
||||
margin: 5px;
|
||||
font-size: 20px;
|
||||
margin-right: 10px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
label{font-weight: bold;}
|
||||
|
||||
select, textarea {margin: 5px;}
|
||||
|
||||
footer
|
||||
{
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.hidden{display: none;}
|
||||
|
||||
#label_yes, #label_no{font-weight: normal;}
|
||||
#color
|
||||
{
|
||||
padding: 1px 3px;
|
||||
text-align: right;
|
||||
float: right;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
:root
|
||||
{
|
||||
--light-teal: #ABEADB;
|
||||
--dark-teal: #003D2B;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<footer>
|
||||
<hr>
|
||||
<p>Copyright © Lucas Wedge, Alim Aminev,
|
||||
Jamal Wilson, Serkan Yildirim, Lakota Dolce @ Coastal Computing</p>
|
||||
<p>This project is for academic purposes only.</p>
|
||||
</footer>
|
||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI"
|
||||
crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" src="modeChange.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
// allows me to see all the errors so they can be fixed
|
||||
// will be turned off in a prouction environment
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', "1");
|
||||
|
||||
$currentFile = basename($_SERVER['SCRIPT_FILENAME']);
|
||||
$pageName = pathinfo($currentFile, PATHINFO_FILENAME);
|
||||
$needsMapAssets = ($pageName === 'parking');
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="author" content="Lucas Wedge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link
|
||||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet"
|
||||
integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB"
|
||||
crossorigin="anonymous"
|
||||
>
|
||||
<link id="base" rel="stylesheet" href="base.css">
|
||||
<link id="mode" rel="stylesheet" href="lightMode.css">
|
||||
<?php if ($needsMapAssets): ?>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://unpkg.com/[email protected]/dist/leaflet.css"
|
||||
crossorigin=""
|
||||
>
|
||||
<style>
|
||||
#map {
|
||||
height: 70vh;
|
||||
min-height: 420px;
|
||||
width: 100%;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
|
||||
overflow: hidden;
|
||||
}
|
||||
.parking-map-wrapper {
|
||||
position: relative;
|
||||
margin-block: 1.5rem;
|
||||
}
|
||||
.parking-map-note {
|
||||
margin-top: 0.5rem;
|
||||
font-size: 0.95rem;
|
||||
color: #444;
|
||||
}
|
||||
</style>
|
||||
<?php endif; ?>
|
||||
<title><?php echo ucfirst($pageName), PHP_EOL; ?></title>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>CCU Commuting</h1>
|
||||
<nav>
|
||||
<span><?php echo ($currentFile === "parking.php") ? 'Parking' : '<a href="parking.php">Parking</a>'; ?></span>
|
||||
<span><?php echo ($currentFile === "stats.php") ? 'Stats' : '<a href="stats.php">Stats</a>'; ?></span>
|
||||
<button type="button" class="rounded" id="color">Change Color Mode</button>
|
||||
</nav>
|
||||
<hr>
|
||||
</header>
|
||||
@@ -0,0 +1,6 @@
|
||||
@import url("colorVariables.css");
|
||||
body
|
||||
{
|
||||
background-color: var(--dark-teal);
|
||||
color: var(--light-teal);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<select name="lots" id="lots">
|
||||
<option value="a">A Parking (circle by Wall Building)</option>
|
||||
<option value="aa">AA Parking (HTC Center)</option>
|
||||
<option value="b" class="fac_staff">B Parking (Penny Hall)</option>
|
||||
<option value="bb">BB Parking (Woods Residence Halls)</option>
|
||||
<option value="bbb">BBB Parking (Burroughs & Chapin Center)</option>
|
||||
<option value="c" class="fac_staff">C Parking (Penny Hall)</option>
|
||||
<option value="cc">CC Parking (road in front of Hicks Dining Hall)</option>
|
||||
<option value="ccc">CCC Parking (Burroughs & Chapin Center)</option>
|
||||
<option value="d" class="fac_staff">D Parking (Smith Building)</option>
|
||||
<option value="dd">DD Parking (behind Hicks Dining Hall)</option>
|
||||
<option value="ddd">DDD Parking (Coastal Science Center)</option>
|
||||
<option value="e">E Parking(LJSU/Spadoni Park)</option>
|
||||
<option value="ee">EE Parking (Woods Residence Halls)</option>
|
||||
<option value="fff">FFF Parking (Intermural Fields)</option>
|
||||
<option value="gg">GG Parking (across the way from LJSU)</option>
|
||||
<option value="ggg">GGG Parking (Atlantic Hall)</option>
|
||||
<option value="h">H Parking ()</option>
|
||||
<option value="hh" class="fac_staff">HH Parking (across road from Douglas and Swain)</option>
|
||||
<option value="hhh">HHH Parking (Soccer Stadium)</option>
|
||||
<option value="i">I Parking ()</option>
|
||||
<option value="ii">II Parking (Horry County Scholars Academy)</option>
|
||||
<option value="j">J Parking (by Atheneum Hall and Indigo Hall)</option>
|
||||
<option value="jjj">JJJ Parking</option>
|
||||
<option value="kk">KK Parking</option>
|
||||
<option value="ll">LL Parking</option>
|
||||
<option value="m">M Parking (Williams-Brice)</option>
|
||||
<option value="mm">MM Parking (Baxley Hall)</option>
|
||||
<option value="nn">NN Parking (Gardens Residence Halls)</option>
|
||||
<option value="o">O Parking (Hampton and Laurel Hall)</option>
|
||||
<option value="oo">OO Parking</option>
|
||||
<option value="p">P Parking (Edwards Building)</option>
|
||||
<option value="q">Q Parking (Edwards Building)</option>
|
||||
<option value="qq">QQ Parking (Brooks Stadium, Boni Belle Hitting Facility)</option>
|
||||
<option value="r">R Parking (Brittain Hall)</option>
|
||||
<option value="rr">RR Parking (University Place)</option>
|
||||
<option value="s">S Parking (Brittain Hall)</option>
|
||||
<option value="uu">UU Parking (near Arcadia Hall)</option>
|
||||
<option value="ww">WW Parking (Sands Hall)</option>
|
||||
<option value="yy">YY Parking (close to University Place)</option>
|
||||
</select>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
// Redirect root requests to the parking view so it behaves as the homepage.
|
||||
header('Location: parking.php');
|
||||
exit;
|
||||
@@ -0,0 +1,6 @@
|
||||
@import url("colorVariables.css");
|
||||
body
|
||||
{
|
||||
background-color: var(--light-teal);
|
||||
color: var(--dark-teal);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
let modeButton = document.getElementById("color");
|
||||
modeButton.addEventListener("click", changeMode);
|
||||
|
||||
function changeMode()
|
||||
{
|
||||
let colorCSS = document.getElementById("mode");
|
||||
if(colorCSS.href.endsWith("lightMode.css")){colorCSS.href = "darkMode.css";}
|
||||
else{colorCSS.href = "lightMode.css";}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php include "commheader.php"; ?>
|
||||
<main>
|
||||
<section class="parking-intro">
|
||||
<h2>Parking Statuses</h2>
|
||||
<p>
|
||||
Below you can see an interactive map showing the current status of each
|
||||
CCU parking lot.<br>Bus routes are included as well.
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section class="parking-map-wrapper" aria-label="Interactive parking availability map">
|
||||
<div id="map"></div>
|
||||
<p class="parking-map-note">
|
||||
Lot colors shift from green (available) toward red as they fill. Planned events force a solid red overlay.
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section class="parking-selector">
|
||||
<h2>Select A Parking Lot</h2>
|
||||
<p>
|
||||
Use the dropdown menu to see a specific parking lot's data.<br>
|
||||
To see a map of campus, click here:
|
||||
<a href="https://www.coastal.edu/map/" target="_blank" rel="noopener">Campus Map</a>
|
||||
</p>
|
||||
<?php include "dropdown.php"; ?>
|
||||
|
||||
<section class="hidden">
|
||||
<h3>A Parking Lot</h3>
|
||||
<ul>
|
||||
<li>Location: circle in front of the Wall College of Business</li>
|
||||
<li>Closest Shuttle Stop: (Brittain Hall)</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="hidden">
|
||||
<h3>AA Parking Lot</h3>
|
||||
<ul>
|
||||
<li>Location: Outside the HTC Center</li>
|
||||
<li>Closest Shuttle Stop: (Brittain Hall)</li>
|
||||
<li>Parking Type: Limited Time**</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="hidden">
|
||||
<h3>B Parking Lot</h3>
|
||||
<ul>
|
||||
<li>Location: Outside Penny Hall (formerly Academic Office 2)</li>
|
||||
<li>Closest Shuttle Stop: (Brittain Hall)</li>
|
||||
<li>Parking Type: </li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="hidden">
|
||||
<h3>BB Parking Lot</h3>
|
||||
<ul>
|
||||
<li>Location:</li>
|
||||
<li>Closest Shuttle Stop:</li>
|
||||
<li>Parking Type:</li>
|
||||
</ul>
|
||||
</section>
|
||||
</section>
|
||||
</main>
|
||||
<script
|
||||
src="https://unpkg.com/[email protected]/dist/leaflet.js"
|
||||
crossorigin=""
|
||||
></script>
|
||||
<script>
|
||||
window.ccuParkingApiBase = <?php echo json_encode(getenv('PARKING_API_BASE') ?: 'http://127.0.0.1:3000'); ?>;
|
||||
</script>
|
||||
<script>
|
||||
<?php include __DIR__ . '/../src/parkingStatus.js'; ?>
|
||||
</script>
|
||||
<?php include "commfooter.php"; ?>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php include "commheader.php"; ?>
|
||||
<main>
|
||||
<section>
|
||||
<h2>Submit Statistics</h2>
|
||||
<p>
|
||||
Use the form below to submit parking statistics.<br>
|
||||
This data might be used to continue developing this web app!
|
||||
</p>
|
||||
</section>
|
||||
<section>
|
||||
<p>Note: The values with an asterisk (*) are required.</p>
|
||||
<form name="stats" id="stats" target="_blank" method="POST">
|
||||
<p>
|
||||
<label>First Name</label>
|
||||
<input type="text" id="first" name="first" placeholder="Jane">
|
||||
</p>
|
||||
<p>
|
||||
<label>Last Name</label>
|
||||
<input type="text" id="last" name="last" placeholder="Dough">
|
||||
</p>
|
||||
<p>
|
||||
<label>Email</label>
|
||||
<input type="text" id="email" name="email" placeholder="[email protected]">
|
||||
</p>
|
||||
<p>*insert interactive calendar and clock here*</p>
|
||||
<p>
|
||||
<label>Select A Parking Lot*</label>
|
||||
<?php include "dropdown.php"; ?>
|
||||
</p>
|
||||
<p>
|
||||
<label>Further Explanation</label>
|
||||
<textarea name="explain" rows=10 cols=30>Blah blah blah blah blah...</textarea>
|
||||
</p>
|
||||
<p><input type="submit" name="submit" id="submit" value="Submit"></p>
|
||||
</form>
|
||||
</section>
|
||||
</main>
|
||||
<?php include "commfooter.php"; ?>
|
||||
@@ -0,0 +1,87 @@
|
||||
//user story 1
|
||||
|
||||
const SEMESTER_BASE_MIN = { Fall: 34, Spring: 30, Summer: 24 };
|
||||
const WEEK_FACTOR = { 1: 1.15, 2: 1.05, 3: 1.00, 4: 1.00, 5: 0.98 };
|
||||
const DAY_FACTOR = { Mon: 1.15, Tue: 1.10, Wed: 1.10, Thu: 1.08, Fri: 1.05, Sat: 0.80, Sun: 0.75 };
|
||||
const WEATHER_FACTOR = { clear: 1.00, rain: 1.10, storm: 1.20 };
|
||||
|
||||
|
||||
function todFactor(hhmm) {
|
||||
const [h, m] = hhmm.split(":").map(Number);
|
||||
const t = h + m / 60;
|
||||
if (t >= 6 && t < 9) return 1.25;
|
||||
if (t >= 9 && t < 15) return 1.00;
|
||||
if (t >= 15 && t < 18) return 1.30;
|
||||
if (t >= 18 && t < 21) return 1.05;
|
||||
return 0.90;
|
||||
}
|
||||
|
||||
function jitterMinutes(key, spread = 3) {
|
||||
let h = 2166136261;
|
||||
for (const c of key) h = Math.imul(h ^ c.charCodeAt(0), 16777619);
|
||||
return ((h >>> 0) % (2 * spread + 1)) - spread;
|
||||
}
|
||||
|
||||
function estimateDriveMinutes({ semester, weekOfMonth, day, departTime, weather = "clear" }) {
|
||||
const base = SEMESTER_BASE_MIN[semester] ?? 30;
|
||||
const wf = WEEK_FACTOR[weekOfMonth] ?? 1.0;
|
||||
const df = DAY_FACTOR[day] ?? 1.0;
|
||||
const tf = todFactor(departTime);
|
||||
const wfz = WEATHER_FACTOR[weather] ?? 1.0;
|
||||
|
||||
const raw = base * wf * df * tf * wfz;
|
||||
const noise = jitterMinutes(`${semester}|${weekOfMonth}|${day}|${departTime}|${weather}`, 3);
|
||||
return Math.max(8, Math.round(raw + noise));
|
||||
}
|
||||
|
||||
|
||||
for (let w = 1; w <= 5; w++) {
|
||||
const mins = estimateDriveMinutes({ semester: "Fall", weekOfMonth: w, day: "Mon", departTime: "08:00", weather: "clear" });
|
||||
console.log(`Fall, week ${w}, Mon 08:00 → ~${mins} min`);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//user story 2
|
||||
|
||||
function toMinutes(hhmm) {
|
||||
const [h, m] = hhmm.split(":").map(Number);
|
||||
return h * 60 + m;
|
||||
}
|
||||
function fromMinutes(total) {
|
||||
const t = ((total % (24 * 60)) + 24 * 60) % (24 * 60);
|
||||
const h = Math.floor(t / 60), m = t % 60;
|
||||
return `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}`;
|
||||
}
|
||||
|
||||
function whenToLeaveForClass({
|
||||
classStartHHMM,
|
||||
semester,
|
||||
weekOfMonth,
|
||||
day,
|
||||
weather = "clear",
|
||||
arriveEarlyMin = 20,
|
||||
parkingWalkBufferMin = 0,
|
||||
}) {
|
||||
const driveMin = estimateDriveMinutes({ semester, weekOfMonth, day, departTime: classStartHHMM, weather });
|
||||
const leaveAt = toMinutes(classStartHHMM) - arriveEarlyMin - parkingWalkBufferMin - driveMin;
|
||||
return {
|
||||
leaveHHMM: fromMinutes(leaveAt),
|
||||
driveMin,
|
||||
arriveBufferMin: arriveEarlyMin + parkingWalkBufferMin
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
const plan = whenToLeaveForClass({
|
||||
classStartHHMM: "09:30",
|
||||
semester: "Fall",
|
||||
weekOfMonth: 1,
|
||||
day: "Mon",
|
||||
weather: "rain",
|
||||
arriveEarlyMin: 20,
|
||||
parkingWalkBufferMin: 5
|
||||
});
|
||||
|
||||
console.log(`Drive ≈ ${plan.driveMin} min, arrive buffer = ${plan.arriveBufferMin} min`);
|
||||
console.log(`Leave home at: ${plan.leaveHHMM}`);
|
||||
Reference in new issue
Block a user