From ebb5f46379dbd0d88ab83d3c230247e527ed9d42 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 28 May 2026 09:33:32 -0400 Subject: [PATCH] index.css --- protected/src/Configs/on_HTML.php | 3 +- .../src/Controllers/App/HomeController.php | 5 ++ protected/src/Templates/main.php | 45 ++++++++++++ protected/src/Views/Common/App/Home/Index.php | 69 ++----------------- public/assets/css/index.css | 44 ++++++++++++ public/index.php | 13 ++++ 6 files changed, 114 insertions(+), 65 deletions(-) create mode 100644 protected/src/Templates/main.php create mode 100644 public/assets/css/index.css diff --git a/protected/src/Configs/on_HTML.php b/protected/src/Configs/on_HTML.php index 82893be..1ab1a2a 100644 --- a/protected/src/Configs/on_HTML.php +++ b/protected/src/Configs/on_HTML.php @@ -13,7 +13,8 @@ use IOcornerstone\Framework\Configure; Configure::set('html', array( 'author' => 'Robert Strutts', 'title' => 'StickingToGoal.com', - 'javascript' => array(), //'js/analytics.js'=>'project' + // 'javascript' => ['js/analytics.js'=>'project''], + 'css' => ['css/index.css'=>'project'], 'robots' => 'noindex', 'keywords' => 'goal, setting', 'description' => 'Goals site', diff --git a/protected/src/Controllers/App/HomeController.php b/protected/src/Controllers/App/HomeController.php index b01f9b9..b2357e0 100644 --- a/protected/src/Controllers/App/HomeController.php +++ b/protected/src/Controllers/App/HomeController.php @@ -35,9 +35,14 @@ class HomeController extends BaseController { Security::initSessions(); + $this->html->addToJavascript("function filterTag(tag){ \r\n window.location='?tag='+encodeURIComponent(tag); \r\n }"); + $pdo = Configure::get('db'); $model = new HomeFetchModel($pdo); + $this->view->set('html', $this->html); + $this->view->setPhpTemplate('main'); + $this->view->setView("App/Home/Index"); $this->view->set("Model", $model); diff --git a/protected/src/Templates/main.php b/protected/src/Templates/main.php new file mode 100644 index 0000000..b3f7cc4 --- /dev/null +++ b/protected/src/Templates/main.php @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + <?= $html->getTitle(); ?> + + getHead(); ?> + getMainStyles(); ?> + getStyles(); ?> + getMainScripts(); ?> + + getBody(); ?>> + + pageOutput ?> + + getFooter(); ?> + + getScripts(); ?> + getJsOnReady(); ?> + + \ No newline at end of file diff --git a/protected/src/Views/Common/App/Home/Index.php b/protected/src/Views/Common/App/Home/Index.php index 810aa0e..a1550ee 100644 --- a/protected/src/Views/Common/App/Home/Index.php +++ b/protected/src/Views/Common/App/Home/Index.php @@ -11,69 +11,8 @@ declare(strict_types=1); function end_of_the_line(): void { echo "" . PHP_EOL . "" . PHP_EOL . ""; - exit; } - ?> - - - - - -StickingToGoals.com - - - - - @@ -102,9 +41,9 @@ if ($Tags !== true && $Tags !== false) { GetGoal($Uid); -if ($goal === false) { end_of_the_line(); } +if ($goal === false) { end_of_the_line(); } else { //

GOAL ID = $myuuid ?> @@ -135,4 +74,6 @@ foreach($comments as $c): ?> - \ No newline at end of file + + + \ No newline at end of file diff --git a/public/assets/css/index.css b/public/assets/css/index.css new file mode 100644 index 0000000..dfed5b3 --- /dev/null +++ b/public/assets/css/index.css @@ -0,0 +1,44 @@ +body {font-family:Arial;background:#f4f6f9;margin:0} +.container {max-width:900px;margin:30px auto;background:#fff;padding:20px;border-radius:10px;box-shadow:0 4px 12px rgba(0,0,0,.1)} +input,textarea{width:100%;padding:10px;margin:8px 0;border-radius:6px;border:1px solid #ccc} +button{background:#4CAF50;color:#fff;border:none;padding:10px;border-radius:6px;cursor:pointer} +button:hover{background:#45a049} +.goal-item{padding:10px;border-bottom:1px solid #eee} +.advice-box{border:1px solid #ddd;border-radius:8px;padding:15px;margin-top:15px;background:#fafafa} +.vote{background:#eee;padding:5px 10px;border-radius:6px;display:inline-block} +.comment{margin-left:20px;border-left:2px solid #ccc;padding-left:8px;margin-top:5px} +.tag{display:inline-block;background:#3498db;color:#fff;padding:3px 8px;border-radius:5px;margin:2px;font-size:12px;cursor:pointer} + +.auth-container { + display: flex; + gap: 20px; +} + +.btn { + padding: 12px 24px; + font-size: 16px; + border: none; + border-radius: 6px; + cursor: pointer; + transition: all 0.3s ease; + text-decoration: none; + color: white; +} + +.login-btn { + background: #3498db; +} + +.login-btn:hover { + background: #2980b9; + transform: translateY(-2px); +} + +.register-btn { + background: #2ecc71; +} + +.register-btn:hover { + background: #27ae60; + transform: translateY(-2px); +} diff --git a/public/index.php b/public/index.php index 9c7f890..cedf0bf 100644 --- a/public/index.php +++ b/public/index.php @@ -3,6 +3,19 @@ declare(strict_types=1); define("BaseDir", dirname(__DIR__)); // Project DIR +define("PROJECT_ASSETS_DIR", BaseDir . DIRECTORY_SEPARATOR . "public" . DIRECTORY_SEPARATOR . "assets" . DIRECTORY_SEPARATOR); + +$server_port = $_SERVER['SERVER_PORT'] ?? 80; +$secure_port_on = $_SERVER['HTTPS'] ?? "off"; +$use_secure = ($server_port == "443" || $secure_port_on == "on"); +$protocol = ($use_secure) ? "https://" : "http://"; +$domain_name = $_SERVER['HTTP_HOST'] ?? ""; + +define("HTTP_PROT", $protocol); +define("PROJECT_ASSETS_BASE_REF", $protocol . $domain_name ."/assets"); +define("ASSETS_DIR", PROJECT_ASSETS_DIR); +define('ASSETS_BASE_REF', $protocol . $domain_name . "/assets"); + const IO_CORNERSTONE_PROJECT = BaseDir . DIRECTORY_SEPARATOR . "protected". DIRECTORY_SEPARATOR. "src" . DIRECTORY_SEPARATOR; const IO_CORNERSTONE_FRAMEWORK = BaseDir . DIRECTORY_SEPARATOR . "protected" . DIRECTORY_SEPARATOR . "src" . DIRECTORY_SEPARATOR . "IOcornerstone" . DIRECTORY_SEPARATOR;