fudii0921 commited on
Commit
66f476e
·
verified ·
1 Parent(s): ae062d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +40 -0
app.py CHANGED
@@ -50,6 +50,38 @@ class DoSwitch:
50
 
51
  my_switch = DoSwitch()
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  def clean_text(text):
54
  # 改行とタブを削除
55
  return text.replace('\n', '').replace('\t', '').replace(' ', '')
@@ -549,6 +581,14 @@ with gr.Blocks(title="Fund Manager Academic Buddy", css="""footer {visibility: h
549
  login_status = gr.Markdown("")
550
  login_btn = gr.Button("サインイン")
551
 
 
 
 
 
 
 
 
 
552
  login_btn.click(
553
  process_login,
554
  inputs=[login_username, login_password, current_user_info],
 
50
 
51
  my_switch = DoSwitch()
52
 
53
+
54
+ def open_signup_window():
55
+ """
56
+ gr.HTMLコンポーネントを使って、HTMLのリンクをボタンのように表示します。
57
+ """
58
+ # HTMLのaタグを生成し、target="_blank"で新しいタブを開くように指定します。
59
+ # このリンクをCSSでボタンのようにスタイルします。
60
+ # この文字列全体がHTMLとしてGradioにレンダリングされます。
61
+ html_content = """
62
+ <div style="text-align: center; padding: 20px;">
63
+ <a href="https://accounts.google.com/v3/signin/identifier?authuser=0&continue=https://www.google.com/&ec=futura_exp_og_si_72776762_e&hl=ja&flowName=GlifWebSignIn&flowEntry=AddSession&dsh=S-1088503595%3A1757031827842666" target="_blank"
64
+ style="
65
+ display: inline-block;
66
+ padding: 15px 30px;
67
+ background-color: #4CAF50;
68
+ color: white;
69
+ text-decoration: none;
70
+ font-weight: bold;
71
+ border-radius: 10px;
72
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
73
+ transition: all 0.3s ease;
74
+ "
75
+ onmouseover="this.style.backgroundColor='#45a049';"
76
+ onmouseout="this.style.backgroundColor='#4CAF50';"
77
+ onclick="this.style.display='none';"
78
+ >
79
+ サインアップページを開く
80
+ </a>
81
+ </div>
82
+ """
83
+ return gr.HTML(html_content)
84
+
85
  def clean_text(text):
86
  # 改行とタブを削除
87
  return text.replace('\n', '').replace('\t', '').replace(' ', '')
 
581
  login_status = gr.Markdown("")
582
  login_btn = gr.Button("サインイン")
583
 
584
+ output_html = gr.HTML()
585
+
586
+ signup_btn.click(
587
+ fn=open_signup_window,
588
+ inputs=[],
589
+ outputs=[output_html]
590
+ )
591
+
592
  login_btn.click(
593
  process_login,
594
  inputs=[login_username, login_password, current_user_info],