Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
def func(percent, numBlocks):
|
4 |
-
filledSquares = "<div style='height:
|
5 |
-
emptySquares = "<div style='height:
|
6 |
numFilled = round((percent/100) * numBlocks)
|
7 |
print(f"numFilled: {numFilled}")
|
8 |
numEmpty = numBlocks - numFilled
|
@@ -11,7 +11,7 @@ def func(percent, numBlocks):
|
|
11 |
return HTMLstr
|
12 |
|
13 |
|
14 |
-
css_adds = ".tooltiptext {visibility: hidden;
|
15 |
#filled:hover .tooltiptext {visibility: visible;} \
|
16 |
#empty:hover .tooltiptext {visibility: visible;}"
|
17 |
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
def func(percent, numBlocks):
|
4 |
+
filledSquares = "<div style='height:20px;width:20px;background-color:#555;display:inline-block;position:relative' id='filled'><span class='tooltiptext' style='color:#FFF'>Here is a sentence that goes on for a really really really really really really really long time</span></div> "
|
5 |
+
emptySquares = "<div style='height:20px;width:20px;background-color:#999;display:inline-block;position:relative' id='empty'><span class='tooltiptext' style='color:#FFF'>Here is a sentence that goes on for a really really really really really really really long time</span></div> "
|
6 |
numFilled = round((percent/100) * numBlocks)
|
7 |
print(f"numFilled: {numFilled}")
|
8 |
numEmpty = numBlocks - numFilled
|
|
|
11 |
return HTMLstr
|
12 |
|
13 |
|
14 |
+
css_adds = ".tooltiptext {visibility: hidden;width:50ch;margin-left:-25ch;top: 100%;left: 50%;background-color: #222;text-align: center;border-radius: 6px;padding: 5px 0;position: absolute;z-index: 1;} \
|
15 |
#filled:hover .tooltiptext {visibility: visible;} \
|
16 |
#empty:hover .tooltiptext {visibility: visible;}"
|
17 |
|