diff --git a/.gitignore b/.gitignore index 6b074f7..4459ebe 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ App/Config.php +node_modules diff --git a/App/Controllers/Api.php b/App/Controllers/Api.php index 8188315..ae299d9 100644 --- a/App/Controllers/Api.php +++ b/App/Controllers/Api.php @@ -16,7 +16,6 @@ class Api public function posts($args = ['id' => '1']) { $get = []; - $get['count'] = 0; if ($args['id'] == 3) { $get['data'] = $this->model->showJoin(); @@ -42,10 +41,6 @@ class Api $temp_data = []; } - if ($get['data'] != false) { - $get['count'] = count($get['data']); - } - header('Content-Type: application/json'); echo json_encode($get); } diff --git a/App/Controllers/Posts.php b/App/Controllers/Posts.php index a968daf..8b94b2a 100644 --- a/App/Controllers/Posts.php +++ b/App/Controllers/Posts.php @@ -291,6 +291,12 @@ class Posts Redirect::to('/posts/category'); } } else { + // Calculate delay by character + // 60 characters for 5 secs + // 1 character for 84 ms + $length = strlen($args['content']); + $args['delay'] = $length * 84; + if ($this->model->entry($args)) { Session::flash('info', 'Data berhasil diunggah'); Redirect::to('/'); @@ -348,6 +354,12 @@ class Posts } } + // Calculate delay by character + // 60 characters for 5 secs + // 1 character for 84 ms + $length = strlen($args['content']); + $args['delay'] = $length * 84; + if ($this->model->update($args, $id)) { Session::flash('info', 'Data berhasil diperbarui'); Redirect::to('/'); diff --git a/App/Models/Post.php b/App/Models/Post.php index ba729b2..a229274 100644 --- a/App/Models/Post.php +++ b/App/Models/Post.php @@ -122,7 +122,7 @@ class Post extends \Core\Model try { $db = static::connectDB(); - $sql = "SELECT pengumuman.id, kategori.category, kategori.background, kategori.foreground, date(pengumuman.valid_at) as valid_at, date(pengumuman.expired_at) as expired_at, pengumuman.creator, pengumuman.editor, pengumuman.content, pengumuman.status FROM pengumuman INNER JOIN kategori ON pengumuman.category=kategori.id"; + $sql = "SELECT pengumuman.id, kategori.category, kategori.background, kategori.foreground, date(pengumuman.valid_at) as valid_at, date(pengumuman.expired_at) as expired_at, pengumuman.creator, pengumuman.editor, pengumuman.content, pengumuman.status, pengumuman.delay FROM pengumuman INNER JOIN kategori ON pengumuman.category=kategori.id"; if ($conditions) { $sql .= " WHERE"; diff --git a/App/Views/Data/mithril.html b/App/Views/Data/mithril.html index 63076b6..5f2128f 100644 --- a/App/Views/Data/mithril.html +++ b/App/Views/Data/mithril.html @@ -23,7 +23,7 @@ {% block body %}
-
+
@@ -31,198 +31,4 @@
- -{% if user != false %} - -{% else %} - -{% endif %} - {% endblock %} diff --git a/App/Views/base.html b/App/Views/base.html index 7e20994..aa0736f 100644 --- a/App/Views/base.html +++ b/App/Views/base.html @@ -55,14 +55,6 @@ z-index: 10001; } - .fl { - float: left; - } - - .fr { - float: right; - } - td, th { padding: .3em .45em .3em .6em; } @@ -75,18 +67,21 @@ text-align: center; } - #slidr-div p { + #slidr-div p, + .fitty p { margin: 0; text-align: center; line-height: 1; } @media screen and (orientation: landscape) { - #slidr-div p { + #slidr-div p, + .fitty p { font-size: 8vw; } } @media screen and (orientation: portrait) { - #slidr-div p { + #slidr-div p, + .fitty p { font-size: 10vh; } } @@ -154,10 +149,6 @@ background-color: rgba(17, 17, 17, .05); } - .fitty > p { - margin: 0; - } - nav { max-width: 100vw; } @@ -200,6 +191,10 @@ bottom: 0; padding: .3em; } + + .swiper-container { + height: 100vh; + } @@ -209,14 +204,16 @@ {% block nav %}{% endblock %} - - - - - + {% block body %} {% endblock %} + {% if user %} + + {% else %} + + {% endif %} +