From 3a82baec9d793edf81ac2b151b0f4d4159641375 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Mon, 1 Apr 2024 11:09:25 -0400 Subject: login and register, liking on homepage --- src/web/config/aesthetic.php | 64 ++++++++++++++++++++++++++++++++++++++++++++ src/web/config/routes.php | 8 ++++++ 2 files changed, 72 insertions(+) create mode 100644 src/web/config/aesthetic.php create mode 100644 src/web/config/routes.php (limited to 'src/web/config') diff --git a/src/web/config/aesthetic.php b/src/web/config/aesthetic.php new file mode 100644 index 0000000..304baec --- /dev/null +++ b/src/web/config/aesthetic.php @@ -0,0 +1,64 @@ +config = array( + '_common' => array( + 'js' => [ + 'js/thirdparty/jquery.min.js', + 'js/lib.js', + 'js/modal.js', + ], + 'css' => [ + 'css/common.css' + ], + ), + 'error' => array( + 'css' => [ + 'css/error.css' + ], + ), + 'home' => array( + 'js' => [ + 'js/routes/home.js', + 'js/post.js', + ], + 'css' => [ + 'css/home.css', + 'css/post.css' + ], + ), + 'auth' => array( + 'css' => [ + 'css/auth.css' + ], + ), + ); + } + /** + * @param mixed $route + * @return array + */ + function get_files($route): array { + $js_files = $this->config['_common']['js']; + $css_files = $this->config['_common']['css']; + + if (array_key_exists($route, $this->config)) { + $config = $this->config[$route]; + if (array_key_exists('js', $config)) { + $js_files = array_merge($js_files, $config['js']); + } + if (array_key_exists('css', $config)) { + $css_files = array_merge($css_files, $config['css']); + } + } + + return array( + 'js_files' => $js_files, + 'css_files' => $css_files, + ); + } + +} diff --git a/src/web/config/routes.php b/src/web/config/routes.php new file mode 100644 index 0000000..33c871b --- /dev/null +++ b/src/web/config/routes.php @@ -0,0 +1,8 @@ +