Skip to content

Commit

Permalink
Update detector.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jmt-genius authored Nov 3, 2023
1 parent b1a8025 commit c4df84c
Showing 1 changed file with 43 additions and 9 deletions.
52 changes: 43 additions & 9 deletions web/detector.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
import streamlit as st
import subprocess
import pandas as pd
import plotly.graph_objects as go
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash import Input, Output

df=pd.read_csv("./dataset.csv")
df.drop(df.columns[df.columns.str.contains('unnamed',case = False)],axis = 1, inplace = True)
df2=df[['Address', 'Sent tnx','Received Tnx','Number of Created Contracts','total Ether sent','total ether received','total ether balance','FLAG']]

# Set the page title and favicon

st.set_page_config(
page_title="DMD",
page_icon=":bar_chart:",
layout="wide",
layout="wide"
)
app = dash.Dash(__name__)



# Create a container for the header with a black background
header_container = st.container()
header_container.markdown(
"""
<style>
@import url('https://fonts.googleapis.com/css?family=Fira+Code:400,500,600,700&display=swap');
.fira-code-font {
font-family: 'Fira Code', monospace;
}
.header-container {
background-color: #000000;
color: #ffffff;
Expand Down Expand Up @@ -48,19 +60,30 @@
color: #ffffff;
font-size: 18px;
margin-bottom: 10px;
}
.dirt-score {
color: #ffffff;
font-size: 18px;
margin-bottom: 10px;
}
.center-content {
text-align: center;
font-size: 24px;
margin-bottom: 20px;
}
</style>
""",
unsafe_allow_html=True,
)


# Add the navigation links with white text to the right side

with header_container:
# Create a row

col1,col2,col3,col4=st.columns([1,1,1,1])

# Add a button to the row

with col1:
button1 = st.button("../")

Expand All @@ -77,15 +100,26 @@



# Input text box with custom style

wallet_address = st.text_input("Wallet Address", key="wallet_input", value="")
percentage = 95 # You can change this percentage value

# Set the text color based on the percentage
if percentage > 65:
text_color = 'red'
else:
text_color = 'green'



if wallet_address:
if wallet_address in df2['Address'].unique():
st.write(f"Entered Wallet Address: {wallet_address}")

st.markdown('<div class="fira-code-font" style="text-align: center; font-size: 20px;">Dirt Score</div>', unsafe_allow_html=True)
st.write(f"<div class='center-content fira-code-font' style='color: {text_color}; font-size: 36px;'><b>{percentage}</b></div>", unsafe_allow_html=True)


df3 = df2.loc[df2['Address'] == wallet_address]
st.write(df3)
else:
st.write(df2)
st.write(df2)

0 comments on commit c4df84c

Please sign in to comment.