diff options
| author | grothedev <grothedev@gmail.com> | 2025-10-27 23:01:26 -0400 |
|---|---|---|
| committer | grothedev <grothedev@gmail.com> | 2025-10-27 23:01:26 -0400 |
| commit | 2090ba0fb434b51e3958a5d8654c22bd04ec8301 (patch) | |
| tree | d484328cfaa1044815b8ebf573cb6cdd2e291315 | |
| parent | fe59d936a7dbb32a95a4236bcdf286f540dd8fae (diff) | |
| parent | 82f580bda6b60710223e3dbca1284c0b552cba9a (diff) | |
Merge branch 'fwtmp'
| -rw-r--r-- | public/css/home.css | 53 | ||||
| -rw-r--r-- | public/js/main.js | 23 | ||||
| -rw-r--r-- | resources/views/f_cursor_0221.blade.php | 136 | ||||
| -rwxr-xr-x | resources/views/home.blade.php | 1 | ||||
| -rw-r--r-- | resources/views/home_new.blade.php | 47 | ||||
| -rwxr-xr-x | resources/views/template.blade.php | 8 | ||||
| -rw-r--r-- | resources/views/template_new.blade.php | 34 | ||||
| -rwxr-xr-x | routes/web.php | 2 |
8 files changed, 153 insertions, 151 deletions
diff --git a/public/css/home.css b/public/css/home.css new file mode 100644 index 0000000..37949f6 --- /dev/null +++ b/public/css/home.css @@ -0,0 +1,53 @@ +#bg { + position: fixed; + top: 0; + left: 0; + z-index: -1; +} +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + background-color: #505050; +} +header { + background-color: #333; + color: #dfdfdf; + padding: 1rem; + text-align: center; +} +main { + max-width: 800px; + margin: 2rem auto; + padding: 1rem; + background-color: #cecece; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + z-index: 1; +} +section { + margin-bottom: 2rem; + z-index: 1; + position: relative; +} +section h2 { + margin-top: 0; +} +section p { + margin: 0.5rem 0; +} +section a { + color: #3f6d87; + text-decoration: none; +} +section li { + list-style-type: none; + margin: 1rem 1rem; +} +section a:hover { + text-decoration: underline; +} +.status { + max-width: 800px; + margin: 0 auto; +} + diff --git a/public/js/main.js b/public/js/main.js index 0d68a6c..2f21122 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -51,7 +51,7 @@ $(document).ready(async function() { await getServerEnvVars(); log('connect ws'); - connectWebSocket(); + //connectWebSocket(); //setup canvas stuff if (cnv != null) { @@ -67,7 +67,7 @@ $(document).ready(async function() { setInterval(() => { draw(); }, 20); - + resizeCanvas(); } else { console.error('Canvas element not found'); } @@ -109,24 +109,29 @@ function initDOM(){ domElems.numConnected = $('#numFriendsConnected')[0]; domElems.inputFile = $('#f')[0]; domElems.debugInfo = $('#infolog')[0]; - domElems.debugInfo.style.display = env.MODE == 'local' ? 'block' : 'none'; + if (domElems.debugInfo) { + domElems.debugInfo.style.display = env.MODE == 'local' ? 'block' : 'none'; + } domElems.fileUploadResult = $('#fileupload_result')[0]; domElems.inputFile.onchange = prepareFileInput; domElems.buttonFileUpload = $('#button_fileupload')[0]; domElems.body = $('body')[0]; domElems.cnv = $('#bg')[0]; domElems.statusWS = $('#statusWS')[0]; - domElems.statusWS.innerHTML = 'Connecting...'; - domElems.statusWS.style.color = 'yellow'; + if (domElems.statusWS){ + domElems.statusWS.innerHTML = 'Connecting...'; + domElems.statusWS.style.color = 'yellow'; + } cnv = domElems.cnv; //for convenience //domElems.buttonFileUpload.enabled = false; - domElems.buttonFileUpload.onclick = uploadFile; - domElems.inputWho = $('#input_who')[0]; - domElems.inputWho.onchange = ()=> { myNickname = domElems.inputWho.value; }; - + //domElems.buttonFileUpload.onclick = uploadFile; + //domElems.inputWho = $('#input_who')[0]; + //domElems.inputWho.onchange = ()=> { myNickname = domElems.inputWho.value; }; + } function resizeCanvas() { + if (cnv == null) return; W = window.outerWidth; H = window.outerHeight; domElems.cnv.width = W; diff --git a/resources/views/f_cursor_0221.blade.php b/resources/views/f_cursor_0221.blade.php deleted file mode 100644 index fe9c9f0..0000000 --- a/resources/views/f_cursor_0221.blade.php +++ /dev/null @@ -1,136 +0,0 @@ -@extends('template') -<?php - $baseDir = 'storage/uploads/'; - $currentDir = $baseDir; - - //use this if want to require auth - /*$valid_username = 'admin'; // Set your username - $valid_password = 'password'; // Set your password - if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || - $_SERVER['PHP_AUTH_USER'] != $valid_username || $_SERVER['PHP_AUTH_PW'] != $valid_password) { - header('WWW-Authenticate: Basic realm="Secure Directory"'); - header('HTTP/1.0 401 Unauthorized'); - echo 'Authentication required'; - exit; - }*/ - - // check if requested file or directory - if (isset($_GET['file'])) { - $fileRequested = $_GET['file']; - $filePath = realpath($fileRequested); - - if (file_exists($filePath) && is_file($filePath)) { - // Set headers to force download - header('Content-Description: File Transfer'); - header('Content-Type: application/octet-stream'); - header('Content-Disposition: attachment; filename="' . basename($filePath) . '"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - header('Content-Length: ' . filesize($filePath)); - readfile($filePath); - exit; - } else { - echo "File not found."; - exit; - } - } else if (isset($_GET['dir'])) { - $dir = $_GET['dir']; - if (strpos($dir, '..') !== false || strpos($dir, '/') !== false || strpos($dir, '\\') !== false) { - echo 'Access Denied'; - exit; - } - $dir= basename($dir); // Ensuring the folder name is isolated - if (!is_dir("${baseDir}/${dir}")) { - echo 'Directory not found'; - exit; - } - $currentDir = "${baseDir}/${dir}"; - } - - // Extracting the name of the current directory - $currentDirName = basename($currentDir); - - // Determine the depth of the current directory relative to the base directory - $depth = substr_count(str_replace($baseDir, '', $currentDir), '/'); - - $contents = scandir($currentDir); - - $files = []; // Array to hold file details -?> - @foreach ($contents as $item) - @if ($item !== "." && $item !== "..") - @php - $filePath = $currentDir . '/' . $item; - $fileInfo = [ - 'name' => htmlspecialchars($item), - 'size' => is_file($filePath) ? filesize($filePath) : 0, - 'date' => is_file($filePath) ? date("F d Y H:i:s.", filemtime($filePath)) : '', - 'is_dir' => is_dir($filePath) - ]; - $files[] = $fileInfo; // Add file info to the array - @endphp - <li> - @if ($fileInfo['is_dir']) - <strong>Directory:</strong> <a href="?dir={{ $item }}">{{ $fileInfo['name'] }}</a> - @else - <a href="/f/{{ $fileInfo['name'] }}">{{ $fileInfo['name'] }}</a> - <span>(Size: {{ $fileInfo['size'] }} bytes, Date: {{ $fileInfo['date'] }})</span> - @endif - </li> - @endif - @endforeach - - // Add sorting functionality - @if (isset($_GET['sort'])) - @php - $sort = $_GET['sort']; - usort($files, function($a, $b) use ($sort) { - if ($sort === 'size') { - return $a['size'] <=> $b['size']; - } elseif ($sort === 'date') { - return $a['date'] <=> $b['date']; - } else { // Default to sorting by name - return strcmp($a['name'], $b['name']); - } - }); - @endphp - @endif - - <ul> - @foreach ($files as $fileInfo) - <li> - @if ($fileInfo['is_dir']) - <strong>Directory:</strong> <a href="?dir={{ $fileInfo['name'] }}">{{ $fileInfo['name'] }}</a> - @else - <a href="/f/{{ $fileInfo['name'] }}">{{ $fileInfo['name'] }}</a> - <span>(Size: {{ $fileInfo['size'] }} bytes, Date: {{ $fileInfo['date'] }})</span> - @endif - </li> - @endforeach - @if ($currentDir != $baseDir) - <li><a href="/f?dir={{ $currentDirName }}">Go Up</a></li> - @endif - </ul> - -@section('body') -<main> - <!--<p><b>Contents of:</b> <em> {{ $currentDir }}</em></p>--> - <p><b>{{ htmlspecialchars(ucfirst($currentDirName)) }}</b></p> - <ul> - @foreach ($files as $fileInfo) - <li> - @if ($fileInfo['is_dir']) - <strong>Directory:</strong> <a href="?dir={{ $fileInfo['name'] }}">{{ $fileInfo['name'] }}</a> - @else - <a href="/f/{{ $fileInfo['name'] }}">{{ $fileInfo['name'] }}</a> - <span>(Size: {{ $fileInfo['size'] }} bytes, Date: {{ $fileInfo['date'] }})</span> - @endif - </li> - @endforeach - @if ($currentDir != $baseDir) - <li><a href="/f?dir={{ $currentDirName }}">Go Up</a></li> - @endif - </ul> -</main> -@endsection
\ No newline at end of file diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index c99d1c6..a29462a 100755 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -7,7 +7,6 @@ </canvas> <main> <header> - <h1>A friendly webserver</h1> <h2></h2> <p> diff --git a/resources/views/home_new.blade.php b/resources/views/home_new.blade.php new file mode 100644 index 0000000..cb9a784 --- /dev/null +++ b/resources/views/home_new.blade.php @@ -0,0 +1,47 @@ +@extends('template_new') +@section('content') +<canvas id = "bg"> +</canvas> + +<section> + <h5>August 2025</h5> + <p>Currently I am living in Virginia. Outside of my job I have some side projects to work on, involving WebSockets, filesystem management (e.g. deduplication, redundancy, synchronization), web development, graphics, GPGPU, and more. I also play drums, sometimes piano, and try to figure out how I should best contribute positively towards the future of humanity (and beyond). </p> + <center> . . . </center> + <ul> + <li><a href = "resume/grothe_resume_20250809.pdf">Resume</a></li> + <li><a href = "https://github.com/grothedev/randomscripts">Some random useful scripts and tools</a></li> + </ul> +</section> +<section id = "fileupload-nojs"> + <h4>File Upload</h4> + <h6><a href = "/f">Browse Uploaded Files</a></h6> + <form action="/f" method="POST" enctype="multipart/form-data"> + @csrf + @error('f') {{ $message }} @enderror + <input multiple name="f[]" type="file"> + <input hidden name = "response_format" value = "html" /> + <button type = "submit">Upload</button> + </form> +</section> +<!--</noscript>--> +<section id = "fileupload" hidden="true"> + <h4>File Upload</h4> + <h6><a href = "/f">Browse Uploaded Files</a></h6> + <!--<form action="/f" method="POST" enctype="multipart/form-data">--> + @error('f') {{ $message }} @enderror + <input id = "f" multiple name="f[]" type="file" > + <br> + <button id = "button_fileupload" enabled="false" type = "submit">Upload</button> + <!--</form>--> + <div id = "fileupload_result"></div> +</section> +<section id = "dunechapterexcerpts" hx-get = "/dq" hx-trigger = "load,click" hx-swap = "innerHTML"> + <h4>random dune pre-chapter quote goes here (under construction)</h4> +</section> +<footer> + <p>Last updated October 27th, 2025</p> +</footer> +@endsection +<script type = "module" src = "/js/main.js"></script> +</html> + diff --git a/resources/views/template.blade.php b/resources/views/template.blade.php index 9f8b6a6..5b1c8c3 100755 --- a/resources/views/template.blade.php +++ b/resources/views/template.blade.php @@ -23,11 +23,12 @@ <title>Belthelziquor</title> @yield('head') </head> - <header> + <!--<header>--> + <body> + <main><section> <a href = "/" class = "form-button" style = "marin-right: auto; margin-left: 1rem;"> Home </a> - @yield('nav') <a href = "/settings" /><small>Settings, Info</small></a><!-- auth-agnostic settings --> <div id = "database-info">Checking connection to database...</div> @if (Auth::user() == null) @@ -43,8 +44,7 @@ </button> </form> @endif - </header> - <body> + </section></main> @yield('body') </body> <footer> diff --git a/resources/views/template_new.blade.php b/resources/views/template_new.blade.php new file mode 100644 index 0000000..ead01ac --- /dev/null +++ b/resources/views/template_new.blade.php @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>TG</title> + <link rel="stylesheet" href="css/home.css"> + <script src="https://unpkg.com/htmx.org@2.0.1"></script> + <script src="https://unpkg.com/axios/dist/axios.min.js"></script> + <script src = "https://code.jquery.com/jquery-3.7.1.min.js"></script> +</head> +<body> + <header> + <h2>.</h2> + <section class = "status"> + <p> </p> + </section> + </header> + <main> + <nav> + <a href = "/">Home</a> + <a href = "/f">Files</a> + <a href = "/notes">Notes</a> + <small><a id = "buttonSettings">Settings</a></small> + <!-- login ? --> + </nav> + <center>- - -</center> + @yield('content') + <center>- - -</center> + <footer> + </footer> + </main> +</body> +</html>
\ No newline at end of file diff --git a/routes/web.php b/routes/web.php index b0d36e8..067cd8c 100755 --- a/routes/web.php +++ b/routes/web.php @@ -9,7 +9,7 @@ use App\Http\Controllers\DashboardController; use Illuminate\Http\Request; Route::get('/', function () { - return view('home'); + return view('home_new'); }); Route::get('/env', [SiteController::class, 'env']); |
