crossroderick commited on
Commit
a1a6d46
·
1 Parent(s): d310c5d

Layout update

Browse files
Files changed (1) hide show
  1. app.py +27 -10
app.py CHANGED
@@ -46,13 +46,23 @@ flip_card_html = """
46
  <br>
47
 
48
  <div style="text-align: center; font-size: 1rem;">
49
- <p>🧠 <a href="https://huggingface.co/crossroderick/dalat5" target="_blank">Model page</a><br>
50
- 🔤 <a href="https://astanatimes.com/2021/02/kazakhstan-presents-new-latin-alphabet-plans-gradual-transition-through-2031/" target="_blank">Kazakhstan 2021 alphabet reform</a></p>
51
 
52
  <br>
53
 
54
  <p>Егер сіз үлес қосқыңыз, бірлесіп жұмыс жасағыңыз немесе жай ғана пікір бөліскіңіз келсе – байланысыңыз / If you'd like to contribute, collaborate, or just share feedback – feel free to connect with <a href="https://www.linkedin.com/in/rpereiracruz/" target="_blank">Rodrigo Pereira Cruz</a>. 🇧🇷🇰🇿</p>
55
  </div>
 
 
 
 
 
 
 
 
 
 
 
56
  """
57
 
58
  # Custom CSS for flip card
@@ -64,6 +74,7 @@ flip_card_css = """
64
  height: 250px;
65
  perspective: 1000px;
66
  margin: 0 auto 2rem auto;
 
67
  }
68
 
69
  .flip-card-inner {
@@ -73,11 +84,10 @@ flip_card_css = """
73
  text-align: center;
74
  transition: transform 0.8s;
75
  transform-style: preserve-3d;
76
- box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
77
  border-radius: 15px;
78
  }
79
 
80
- .flip-card:hover .flip-card-inner {
81
  transform: rotateY(180deg);
82
  }
83
 
@@ -86,7 +96,9 @@ flip_card_css = """
86
  width: 100%;
87
  height: 100%;
88
  backface-visibility: hidden;
89
- background-color: #fefefe;
 
 
90
  border-radius: 15px;
91
  padding: 20px;
92
  display: flex;
@@ -94,14 +106,18 @@ flip_card_css = """
94
  justify-content: center;
95
  }
96
 
97
- .flip-card-front {
98
- background-color: #f0f8ff;
99
- }
100
-
101
  .flip-card-back {
102
- background-color: #e6f7ff;
103
  transform: rotateY(180deg);
104
  }
 
 
 
 
 
 
 
 
 
105
  """
106
 
107
  # Interface
@@ -115,6 +131,7 @@ with gr.Blocks(css = flip_card_css) as demo:
115
  placeholder = "Мен қазақ тілінде сөйлеймін.",
116
  lines = 6
117
  ),
 
118
  outputs = gr.Textbox(
119
  label = "Латын графикасының шығуы / Latin script output",
120
  ),
 
46
  <br>
47
 
48
  <div style="text-align: center; font-size: 1rem;">
49
+ <p>🧠 <a href="https://huggingface.co/crossroderick/dalat5" target="_blank">Model page</a> | 🔤 <a href="https://astanatimes.com/2021/02/kazakhstan-presents-new-latin-alphabet-plans-gradual-transition-through-2031/" target="_blank">Kazakhstan 2021 alphabet reform</a></p>
 
50
 
51
  <br>
52
 
53
  <p>Егер сіз үлес қосқыңыз, бірлесіп жұмыс жасағыңыз немесе жай ғана пікір бөліскіңіз келсе – байланысыңыз / If you'd like to contribute, collaborate, or just share feedback – feel free to connect with <a href="https://www.linkedin.com/in/rpereiracruz/" target="_blank">Rodrigo Pereira Cruz</a>. 🇧🇷🇰🇿</p>
54
  </div>
55
+
56
+ <script>
57
+ document.addEventListener("DOMContentLoaded", function() {
58
+ const card = document.querySelector(".flip-card");
59
+ const inner = document.querySelector(".flip-card-inner");
60
+
61
+ card.addEventListener("click", function() {
62
+ inner.classList.toggle("flipped");
63
+ });
64
+ });
65
+ </script>
66
  """
67
 
68
  # Custom CSS for flip card
 
74
  height: 250px;
75
  perspective: 1000px;
76
  margin: 0 auto 2rem auto;
77
+ cursor: pointer; /* Makes it obvious it's clickable */
78
  }
79
 
80
  .flip-card-inner {
 
84
  text-align: center;
85
  transition: transform 0.8s;
86
  transform-style: preserve-3d;
 
87
  border-radius: 15px;
88
  }
89
 
90
+ .flip-card-inner.flipped {
91
  transform: rotateY(180deg);
92
  }
93
 
 
96
  width: 100%;
97
  height: 100%;
98
  backface-visibility: hidden;
99
+ background-color: transparent;
100
+ color: inherit;
101
+ border: 1px solid rgba(255, 255, 255, 0.2);
102
  border-radius: 15px;
103
  padding: 20px;
104
  display: flex;
 
106
  justify-content: center;
107
  }
108
 
 
 
 
 
109
  .flip-card-back {
 
110
  transform: rotateY(180deg);
111
  }
112
+
113
+ a {
114
+ color: inherit;
115
+ text-decoration: underline;
116
+ }
117
+
118
+ a:hover {
119
+ opacity: 0.8;
120
+ }
121
  """
122
 
123
  # Interface
 
131
  placeholder = "Мен қазақ тілінде сөйлеймін.",
132
  lines = 6
133
  ),
134
+
135
  outputs = gr.Textbox(
136
  label = "Латын графикасының шығуы / Latin script output",
137
  ),