michaelpiro1 commited on
Commit
d073e7b
·
verified ·
1 Parent(s): 5e2ec54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -1
app.py CHANGED
@@ -20,6 +20,13 @@ text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
20
  color: #ffffff;
21
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
22
  }}
 
 
 
 
 
 
 
23
  </style>
24
  """
25
 
@@ -81,5 +88,20 @@ links = [
81
  {"url": "https://colab.research.google.com", "type": "Google Colab", "text": "This is a Google Colab link"}
82
  ]
83
 
 
 
 
 
 
 
 
84
  for link in links:
85
- st.markdown(f"[{link['text']}]({link['url']}) - *{link['type']}*")
 
 
 
 
 
 
 
 
 
20
  color: #ffffff;
21
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
22
  }}
23
+ .link-icon {{
24
+ display: flex;
25
+ align-items: center;
26
+ }}
27
+ .link-icon img {{
28
+ margin-right: 10px;
29
+ }}
30
  </style>
31
  """
32
 
 
88
  {"url": "https://colab.research.google.com", "type": "Google Colab", "text": "This is a Google Colab link"}
89
  ]
90
 
91
+ # Dictionary to hold logo URLs
92
+ logo_urls = {
93
+ "GitHub": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
94
+ "Google Colab": "https://colab.research.google.com/img/colab_favicon_256px.png"
95
+ }
96
+
97
+ # Render links with icons
98
  for link in links:
99
+ if link["type"] in logo_urls:
100
+ st.markdown(f"""
101
+ <div class="link-icon">
102
+ <img src="{logo_urls[link['type']]}" alt="{link['type']} logo" width="24">
103
+ <a href="{link['url']}" target="_blank">{link['text']}</a> - *{link['type']}*
104
+ </div>
105
+ """, unsafe_allow_html=True)
106
+ else:
107
+ st.markdown(f"[{link['text']}]({link['url']}) - *{link['type']}*")