Spaces:
Runtime error
Runtime error
File size: 5,514 Bytes
086a239 b9fc1e1 086a239 |
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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# Here created a Google - Clone design using Streamlit
# In streamlit you can use html and css
import streamlit as st
def main():
# Styling using Streamlit markdown
st.markdown(
"""
<style>
html {
height: 100%;
font-size: 100%;
}
body {
font: 13px arial, sans-serif;
}
nav {
display: flex;
justify-content: flex-end;
align-items: center;
padding: 10px;
background-color: #ffffff;
float: right;
margin-right: -44%;
margin-top: -6%;
}
.right_nav {
list-style: none;
display: flex;
align-items: center;
gap: 20px;
margin: 3rem;
}
.apps {
width: 16px;
height: 16px;
opacity: 0.75;
transition: opacity 0.2s;
}
.apps:hover {
opacity: 1;
}
.sign_in {
height: 60%;
background: #4285f4;
width: 86px;
height: 35px;
}
.sign_in a {
font-weight: bold;
color: #fff;
text-decoration: none;
padding-left: 10%;
}
.sign_in a:hover {
text-decoration: none;
}
.cntr_pg {
position: absolute;
top: 40%;
left: 50%;
margin-right: -40%;
transform: translate(-50%, -50%);
margin: 3rem;
}
.logo {
display: block;
margin: auto;
height: 92px;
width: 272px;
margin-top:40%;
}
.search_bar {
border-radius: 40px;
width: 585px;
margin: auto;
height: 39px;
border: .7px solid #E4E4E4;
background-color: #fff;
box-shadow: 0px 1px 4px #E4E4E4;
margin-bottom: 20px;
outline: none;
text-indent: 15px;
}
.search_bar:hover, .search_bar:active {
padding-bottom: 2px;
padding-top: 1px;
margin-top: -1px;
width: 585px;
box-shadow: 0px 3px 8px #E4E4E4;
outline: none;
}
.mic {
width: 14px;
height: 20px;
position: relative;
left: 555px;
top: 34px;
}
.submit_buttons {
display: inline-block;
height: 36px;
cursor: pointer;
line-height: 27px;
background-color: #f2f2f2;
border: 1px solid #f2f2f2;
border-radius: 2px;
color: #757575;
cursor: default;
font-family: arial, sans-serif;
font-size: 13px;
font-weight: bold;
margin: 11px 4px;
min-width: 54px;
padding: 0 16px;
text-align: center;
}
.submit_buttons {
position: relative;
left: 25%;
right: -50%;
cursor: pointer;
}
.submit_buttons:hover {
border: .7px solid #d0d0d0;
color: #000;
box-shadow: 0px 1px 4px #E4E4E4;
}
</style>
""",
unsafe_allow_html=True
)
# Navigation (navbar)
st.markdown(
"""
<nav>
<ul class="right_nav">
<li><a href="#" style="color: black;">Gmail</a></li>
<li><a href="#" style="color: black;">Images</a></li>
<li><a href="#"><img class="apps" src="https://thumb.ibb.co/gykLCw/grid_menu.png"></a></li>
<li class="sign_in" style="padding: 2%; margin-left: 2%"><a href="#">Sign in</a></li>
</ul>
</nav>
""",
unsafe_allow_html=True
)
# Center content
st.markdown(
"""
<section class="cntr_pg">
<img class="logo" src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" alt="Google logo" />
<img class="mic" src="https://upload.wikimedia.org/wikipedia/commons/2/22/Google_microphone_logo.png" alt="" />
<form action="#" method="#" name="searchquery" class="form">
<input type="text" name="searchfield" class="search_bar">
<div class="search_buttons">
<input class="submit_buttons" type="submit" value="Google Search" name="submit">
<input class="submit_buttons" type="submit" value="I'm Feeling Lucky" name="feelinglucky">
</div>
</form>
</section>
""",
unsafe_allow_html=True
)
if __name__ == "__main__":
main()
|