-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
130 lines (113 loc) · 3.41 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import streamlit as st
import streamlit.components.v1 as html
import numpy as np
import pandas as pd
import io
from PIL import Image
import base64
import streamlit as st
def main():
# Add navigation bar
st.markdown(
"""
<style>
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1px 60px;
backdrop-filter: blur(10px);
background-color: transparent;
color: white;
border-radius: 10px;
box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.1), -4px -4px 10px rgba(255, 255, 255, 0.5);
}
.navbar ul {
list-style: none;
display: flex;
gap: 20px;
}
.navbar ul li {
font-size: 15px;
}
.navbar ul li a {
text-decoration: none;
color: white;
padding: 10px;
border-radius: 20px;
transition: background-color 0.3s ease;
background-color: rgba(255, 255, 255, 0.5);
box-shadow: inset 4px 4px 6px rgba(0, 0, 0, 0.1), inset -4px -4px 6px rgba(255, 255, 255, 0.5);
}
.navbar ul li a:hover {
background-color: #f0f0f0;
color: #333;
box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.1), inset -2px -2px 4px rgba(255, 255, 255, 0.5);
}
.main-section {
display: flex;
justify-content: flex-start;
align-items: center;
height: calc(100vh - 100px); /* Subtracting the navbar height */
padding: 20px;
}
.url-uploader {
background-color: transparent;
padding: 1px 30px;
border-radius: 10px;
box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.1), -4px -4px 10px rgba(255, 255, 255, 0.5);
}
.url-uploader h2 {
color: white;
}
.image-section {
margin-right: 20px;
}
</style>
""",
unsafe_allow_html=True
)
# Create the page layout
st.markdown(
"""
<div class="navbar">
<h1 style="margin-right: auto;">Analysis</h1>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</div>
""",
unsafe_allow_html=True
)
first_section,main_section = st.columns(2)
with first_section:
image = Image.open("NFT-rafiki.png")
st.image(image, width=300)
# Create the main section layout
with main_section:
with st.container():
st.markdown("<h2>Upload Url of any NFT Collection</h2>", unsafe_allow_html=True)
url_input = st.text_input("Enter URL:")
submit_button = st.button("Submit")
if submit_button:
st.write("Entered URL:", url_input)
if __name__ == "__main__":
main()
#background image
def add_bg_from_local(image_file):
with open(image_file, "rb") as image_file:
encoded_string = base64.b64encode(image_file.read())
st.markdown(
f"""
<style>
.stApp {{
background-image: url(data:image/{"png"};base64,{encoded_string.decode()});
background-size: cover
}}
</style>
""",
unsafe_allow_html=True
)
add_bg_from_local('Untitled design (3).png')