From 9be480d52963ab313e5c85eb828ca55051498bf4 Mon Sep 17 00:00:00 2001 From: adistya13 Date: Sat, 13 Jun 2026 15:50:29 +0700 Subject: [PATCH] flash page --- app.py | 11 +- nrt_activation.json | 2 +- page_modules/crawling_page.py | 6 +- splash_page.py | 406 ++++++++++++++++++++++ tweets-data/Error-02-06-2026_12-07-02.png | Bin 0 -> 4254 bytes tweets-data/Error-02-06-2026_12-13-31.png | Bin 0 -> 4254 bytes tweets-data/Error-02-06-2026_12-13-44.png | Bin 0 -> 4254 bytes tweets-data/hasil_top.csv | 10 - tweets-data/hasil_top.old.csv | 11 +- 9 files changed, 418 insertions(+), 28 deletions(-) create mode 100644 splash_page.py create mode 100644 tweets-data/Error-02-06-2026_12-07-02.png create mode 100644 tweets-data/Error-02-06-2026_12-13-31.png create mode 100644 tweets-data/Error-02-06-2026_12-13-44.png delete mode 100644 tweets-data/hasil_top.csv diff --git a/app.py b/app.py index d538e08..5c97287 100644 --- a/app.py +++ b/app.py @@ -3,6 +3,9 @@ from html import escape import os import time +# ── Splash screen ───────────────────────────────────────────────────────── +from splash_page import maybe_show_splash + import pandas as pd import streamlit as st from streamlit_autorefresh import st_autorefresh @@ -38,6 +41,10 @@ st.set_page_config( initial_sidebar_state="expanded" ) +# ── Tampilkan splash saat pertama akses ─────────────────────────────────── +if maybe_show_splash(): + st.stop() + # Initialize timezone selection in session state if "user_timezone" not in st.session_state: st.session_state.user_timezone = get_default_timezone() @@ -906,10 +913,10 @@ with st.sidebar: ">📊
- SentimenX + SentiTrack
- Twitter Analytics Dashboard + Dashboard Monitoring Sentimen Netizen terhadap Kebijakan Pembatasan Gratis Ongkir
diff --git a/nrt_activation.json b/nrt_activation.json index 858d112..60f5e54 100644 --- a/nrt_activation.json +++ b/nrt_activation.json @@ -1 +1 @@ -{"activated": true, "updated_at": "2026-05-31T01:21:56.067731+00:00"} \ No newline at end of file +{"activated": true, "updated_at": "2026-06-13T08:45:55.522176+00:00"} \ No newline at end of file diff --git a/page_modules/crawling_page.py b/page_modules/crawling_page.py index 7d51a88..dfeb941 100644 --- a/page_modules/crawling_page.py +++ b/page_modules/crawling_page.py @@ -496,11 +496,7 @@ def _render_page_header():
-🔍 Query -komdigi -gratis ongkir -free ongkir -pembatasan ongkir +
⚙ Alur kerja diff --git a/splash_page.py b/splash_page.py new file mode 100644 index 0000000..8426ca6 --- /dev/null +++ b/splash_page.py @@ -0,0 +1,406 @@ +""" +splash_page.py +────────────── +Splash screen modern, full-viewport centered, tampil sekali per sesi. +Menggunakan st.components.v1.html (iframe isolated). + +🕐 PENGATURAN DURASI: + _SPLASH_DURATION = 10 ← ganti angka ini (satuan: detik) + Rekomendasi: 4–8 detik + +📐 PENGATURAN TINGGI IFRAME: + components.html(..., height=700 ...) ← sesuaikan jika konten terpotong +""" + +import time +import streamlit as st +import streamlit.components.v1 as components + +_APP_NAME = "SentiTrack" + +# ┌─────────────────────────────────────────┐ +# │ ⏱ GANTI ANGKA INI UNTUK UBAH DURASI │ +# │ Satuan: detik | Rekomendasi: 4–8 │ +_SPLASH_DURATION = 10 +# └─────────────────────────────────────────┘ + + +def _build_splash_html(duration: int) -> str: + return f""" + + + + + + + + + +
+
+
+
+ +
+ + +
+ +
+
{_APP_NAME}
+
Dashboard Monitoring Sentimen Netizen terhadap Kebijakan Pembatasan Gratis Ongkir
+
+
+ +
+ + +
+
📌 Topik Penelitian
+
Perancangan dan Implementasi Dashboard Sentimen Netizen X terhadap Kebijakan Pembatasan Gratis Ongkir dengan Naive Bayes
+
Komdigi · Analisis Opini Publik di Platform X (Twitter)
+
+ + +
+
+
🤖
+
+
Model
+
Naive Bayes
+
+
+
+
📡
+
+
Sumber Data
+
X Data Historis via Tweet Harvest & Realtime
+
+
+
+
🔤
+
+
Preprocessing
+
Case Folding · Cleaning · Normalisasi · Stopword · Stemming
+
+
+
+
📊
+
+
Output
+
Positif · Netral · Negatif
+
+
+
+ + +
+
+ Nurizzati Adistya Putri · E31232465
+ Politeknik Negeri Jember · Manajemen Informatika +
+
Tugas Akhir 2026
+
+ + +
+
+
+ + +
+ + +""" + + +def maybe_show_splash() -> bool: + """ + Tampilkan splash jika belum tampil di sesi ini. + Kembalikan True jika splash baru saja ditampilkan, False jika dilewati. + """ + if st.session_state.get("splash_done", False): + return False + + # Sembunyikan semua elemen Streamlit selama splash + st.markdown(""" + + """, unsafe_allow_html=True) + + # ┌───────────────────────────────────────────────────────┐ + # │ 📐 TINGGI IFRAME (px) │ + # │ Naikkan jika card terpotong di layar kecil. │ + # │ Rekomendasi: 650–750 │ + components.html(_build_splash_html(_SPLASH_DURATION), height=700, scrolling=False) + # └───────────────────────────────────────────────────────┘ + + # Tunggu sesuai durasi splash sebelum lanjut ke halaman utama + time.sleep(_SPLASH_DURATION + 0.3) + + st.session_state["splash_done"] = True + st.rerun() + + return True \ No newline at end of file diff --git a/tweets-data/Error-02-06-2026_12-07-02.png b/tweets-data/Error-02-06-2026_12-07-02.png new file mode 100644 index 0000000000000000000000000000000000000000..3ddab50b98da0d74381bd9f7089dc0c99ac14baf GIT binary patch literal 4254 zcmeAS@N?(olHy`uVBq!ia0y~yU#KiDjWttl9P!CsJDrMnSo)#sPJf*j3$WD+%Q@c zj24fhb;D@IINB;0Z4!+(6S23Efi38O(f0CadwI0IJlb9!bnWG?%4I8oO;~r(SOCQZ p_y?d#|NkF7qH+kxU;`P+%<#gUW5K!N4KhFx22WQ%mvv4FO#o+H0uulL literal 0 HcmV?d00001 diff --git a/tweets-data/Error-02-06-2026_12-13-31.png b/tweets-data/Error-02-06-2026_12-13-31.png new file mode 100644 index 0000000000000000000000000000000000000000..3ddab50b98da0d74381bd9f7089dc0c99ac14baf GIT binary patch literal 4254 zcmeAS@N?(olHy`uVBq!ia0y~yU#KiDjWttl9P!CsJDrMnSo)#sPJf*j3$WD+%Q@c zj24fhb;D@IINB;0Z4!+(6S23Efi38O(f0CadwI0IJlb9!bnWG?%4I8oO;~r(SOCQZ p_y?d#|NkF7qH+kxU;`P+%<#gUW5K!N4KhFx22WQ%mvv4FO#o+H0uulL literal 0 HcmV?d00001 diff --git a/tweets-data/Error-02-06-2026_12-13-44.png b/tweets-data/Error-02-06-2026_12-13-44.png new file mode 100644 index 0000000000000000000000000000000000000000..3ddab50b98da0d74381bd9f7089dc0c99ac14baf GIT binary patch literal 4254 zcmeAS@N?(olHy`uVBq!ia0y~yU#KiDjWttl9P!CsJDrMnSo)#sPJf*j3$WD+%Q@c zj24fhb;D@IINB;0Z4!+(6S23Efi38O(f0CadwI0IJlb9!bnWG?%4I8oO;~r(SOCQZ p_y?d#|NkF7qH+kxU;`P+%<#gUW5K!N4KhFx22WQ%mvv4FO#o+H0uulL literal 0 HcmV?d00001 diff --git a/tweets-data/hasil_top.csv b/tweets-data/hasil_top.csv deleted file mode 100644 index 73b8803..0000000 --- a/tweets-data/hasil_top.csv +++ /dev/null @@ -1,10 +0,0 @@ -"conversation_id_str","created_at","favorite_count","full_text","id_str","image_url","in_reply_to_screen_name","lang","location","quote_count","reply_count","retweet_count","tweet_url","user_id_str","username" -"2058950559856832819","Mon May 25 16:37:21 +0000 2026","0","setuju bgt komdigi ngeluarin kebijakan gratis ongkir gini","2058950559856832819","","","in","","0","0","0","https://x.com/undefined/status/2058950559856832819","2046458899843170304", -"2058829602865451445","Mon May 25 08:36:43 +0000 2026","0","komdigi mending ngurusin aja tuh judol daripada ngurusin pembatasan gratis ongkir","2058829602865451445","","","in","","0","0","0","https://x.com/undefined/status/2058829602865451445","2046458899843170304", -"2060580175084204231","Sat May 30 04:32:52 +0000 2026","0","komdigi gratis ongkir sangat banyak yang tidak setuju","2060580175084204231","","","in","","0","0","0","https://x.com/undefined/status/2060580175084204231","1814143201718247424", -"2059619299309011403","Wed May 27 12:54:41 +0000 2026","0","komdigi ngeluarin kebijakan ongkir kaya gini ngapain dah","2059619299309011403","","","in","","0","0","0","https://x.com/undefined/status/2059619299309011403","1814143201718247424", -"2058950111976386607","Mon May 25 16:35:34 +0000 2026","0","komdigi bagus sih ngeluarin kebijakan gratis ongkir kaya ini setuju","2058950111976386607","","","in","","0","0","0","https://x.com/undefined/status/2058950111976386607","2046458899843170304", -"2060641816647790635","Sat May 30 08:37:48 +0000 2026","0","komdigi gk penting deh ngeluarin kebijakan ongkir begini mending tu urusin yang lebih penting!!","2060641816647790635","","","in","","0","0","0","https://x.com/undefined/status/2060641816647790635","1814143201718247424", -"2058816188659192179","Mon May 25 07:43:24 +0000 2026","0","komdigi gajelas bikin kebijakan ongkir!","2058816188659192179","","","in","","0","0","0","https://x.com/undefined/status/2058816188659192179","1814143201718247424", -"2058816239112446387","Mon May 25 07:43:37 +0000 2026","0","komdigi gk penting buat kebijakan ongkir kaya gini","2058816239112446387","","","in","","0","0","0","https://x.com/undefined/status/2058816239112446387","1814143201718247424", -"2060234400777064942","Fri May 29 05:38:53 +0000 2026","0","tadi pagi saya melihat berita mengenai pembatasan gratis ongkir oleh komdigi","2060234400777064942","","","in","","0","0","0","https://x.com/undefined/status/2060234400777064942","1814143201718247424", diff --git a/tweets-data/hasil_top.old.csv b/tweets-data/hasil_top.old.csv index 004324b..d3f5a12 100644 --- a/tweets-data/hasil_top.old.csv +++ b/tweets-data/hasil_top.old.csv @@ -1,10 +1 @@ -"conversation_id_str","created_at","favorite_count","full_text","id_str","image_url","in_reply_to_screen_name","lang","location","quote_count","reply_count","retweet_count","tweet_url","user_id_str","username" -"2058950559856832819","Mon May 25 16:37:21 +0000 2026","0","setuju bgt komdigi ngeluarin kebijakan gratis ongkir gini","2058950559856832819","","","in","","0","0","0","https://x.com/undefined/status/2058950559856832819","2046458899843170304", -"2058829602865451445","Mon May 25 08:36:43 +0000 2026","0","komdigi mending ngurusin aja tuh judol daripada ngurusin pembatasan gratis ongkir","2058829602865451445","","","in","","0","0","0","https://x.com/undefined/status/2058829602865451445","2046458899843170304", -"2058950111976386607","Mon May 25 16:35:34 +0000 2026","0","komdigi bagus sih ngeluarin kebijakan gratis ongkir kaya ini setuju","2058950111976386607","","","in","","0","0","0","https://x.com/undefined/status/2058950111976386607","2046458899843170304", -"2059619299309011403","Wed May 27 12:54:41 +0000 2026","0","komdigi ngeluarin kebijakan ongkir kaya gini ngapain dah","2059619299309011403","","","in","","0","0","0","https://x.com/undefined/status/2059619299309011403","1814143201718247424", -"2060641816647790635","Sat May 30 08:37:48 +0000 2026","0","komdigi gk penting deh ngeluarin kebijakan ongkir begini mending tu urusin yang lebih penting!!","2060641816647790635","","","in","","0","0","0","https://x.com/undefined/status/2060641816647790635","1814143201718247424", -"2060580175084204231","Sat May 30 04:32:52 +0000 2026","0","komdigi gratis ongkir sangat banyak yang tidak setuju","2060580175084204231","","","in","","0","0","0","https://x.com/undefined/status/2060580175084204231","1814143201718247424", -"2058816188659192179","Mon May 25 07:43:24 +0000 2026","0","komdigi gajelas bikin kebijakan ongkir!","2058816188659192179","","","in","","0","0","0","https://x.com/undefined/status/2058816188659192179","1814143201718247424", -"2058816239112446387","Mon May 25 07:43:37 +0000 2026","0","komdigi gk penting buat kebijakan ongkir kaya gini","2058816239112446387","","","in","","0","0","0","https://x.com/undefined/status/2058816239112446387","1814143201718247424", -"2060234400777064942","Fri May 29 05:38:53 +0000 2026","0","tadi pagi saya melihat berita mengenai pembatasan gratis ongkir oleh komdigi","2060234400777064942","","","in","","0","0","0","https://x.com/undefined/status/2060234400777064942","1814143201718247424", +