Skip to content

Commit d6d1e63

Browse files
authored
Merge pull request #25 from lishengbo0907/master
fix: euler、gauss、mindspore年报登录背景更换,交互统一
2 parents b308d04 + 160c885 commit d6d1e63

File tree

12 files changed

+444
-394
lines changed

12 files changed

+444
-394
lines changed
Lines changed: 164 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -1,165 +1,183 @@
11
{{define "sign_in.html"}}
2-
<!DOCTYPE html>
3-
<html lang="en">
4-
<head>
5-
<meta charset="UTF-8">
6-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8-
<title>openEuler</title>
9-
<style>
10-
* {
11-
padding: 0;
12-
margin: 0;
13-
}
14-
15-
body {
16-
background: #002FA7;
17-
}
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>openEuler</title>
9+
<style>
10+
* {
11+
padding: 0;
12+
margin: 0;
13+
}
1814

19-
.wrap {
20-
height: 100vh;
21-
margin: 0 auto;
22-
display: flex;
23-
justify-content: center;
24-
align-items: center;
25-
background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/img/euler_pc.jpg) no-repeat center/cover;
26-
padding: 0 80px;
27-
}
15+
body {
16+
background: #002fa7;
17+
}
2818

29-
.wrap .box {
30-
margin-top: 30vh;
31-
display: flex;
32-
align-items: center;
33-
flex-direction: column;
34-
}
19+
.wrap {
20+
height: 100vh;
21+
margin: 0 auto;
22+
display: flex;
23+
justify-content: center;
24+
align-items: center;
25+
background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/img/euler_pc.jpg)
26+
no-repeat center/cover;
27+
padding: 0 80px;
28+
}
3529

36-
.wrap .button {
37-
width: 300px;
38-
line-height: 58px;
39-
border: 0 none;
40-
background: #002FA7;
41-
box-shadow: 0px 5px 0px 0px rgba(0, 0, 0, 0.11);
42-
border-radius: 8px;
43-
text-align: center;
44-
color: #fff;
45-
font-size: 20px;
46-
font-weight: bold;
47-
cursor: pointer;
48-
}
30+
.wrap .box {
31+
margin-top: 30vh;
32+
display: flex;
33+
align-items: center;
34+
flex-direction: column;
35+
}
4936

50-
.wrap .label {
51-
font-size: 14px;
52-
color: #fff;
53-
margin-top: 30px;
54-
display: flex;
55-
align-items: center;
56-
}
37+
.wrap .button {
38+
padding: 12px 32px;
39+
font-size: 16px;
40+
line-height: 24px;
41+
border: 0 none;
42+
background: #2a489e;
43+
border-radius: 26px;
44+
text-align: center;
45+
color: #fff;
46+
font-weight: bold;
47+
cursor: pointer;
48+
}
5749

50+
.wrap .label {
51+
font-size: 14px;
52+
color: #fff;
53+
margin-top: 30px;
54+
display: flex;
55+
align-items: center;
56+
}
5857

58+
.checkbox {
59+
cursor: pointer;
60+
}
5961

60-
.wrap .label a {
61-
color: #fff;
62-
display: inline-block;
63-
text-decoration: none;
64-
}
65-
.wrap .label a:hover {
66-
color: #002FA7;
67-
}
62+
.wrap .label a {
63+
color: #fff;
64+
display: inline-block;
65+
text-decoration: none;
66+
}
67+
.wrap .label a:hover {
68+
color: #002fa7;
69+
}
6870

69-
.wrap .label .info {
70-
padding-left: 10px;
71-
}
72-
.wrap .label .info p{
73-
display: none;
74-
}
71+
.wrap .label .info {
72+
padding-left: 10px;
73+
}
74+
.wrap .label .info p {
75+
display: none;
76+
}
7577

76-
.wrap .not-allowed {
77-
cursor: not-allowed;
78-
color: white;
79-
background: grey;
80-
}
78+
.wrap .not-allowed {
79+
cursor: not-allowed;
80+
color: white;
81+
background: grey;
82+
}
8183

82-
@media (max-width: 768px) {
83-
.wrap {
84-
padding: 0;
85-
box-sizing: border-box;
86-
background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/img/euler_h5.jpg) no-repeat left bottom /cover;
87-
}
88-
.wrap .box {
89-
margin-top: 6vh;
90-
}
91-
.wrap .box form,
92-
.wrap .button{
93-
width: 100%;
94-
}
95-
96-
.wrap .label {
97-
font-size: 14px;
98-
color: #fff;
99-
margin-top: 60px;
100-
}
101-
}
84+
@media (max-width: 768px) {
85+
.wrap {
86+
padding: 0;
87+
box-sizing: border-box;
88+
background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/img/euler_h5.jpg)
89+
no-repeat left bottom / cover;
90+
}
91+
.wrap .box {
92+
margin-top: 6vh;
93+
}
94+
.wrap .box form,
95+
.wrap .button {
96+
width: 100%;
97+
}
10298

103-
</style>
104-
</head>
105-
<body>
99+
.wrap .label {
100+
font-size: 14px;
101+
color: #fff;
102+
margin-top: 60px;
103+
}
104+
}
105+
</style>
106+
</head>
107+
<body>
106108
<div class="wrap">
107-
<div class="box">
108-
<form method="GET" action="{{.ProxyPrefix}}/start">
109-
<input type="hidden" name="rd" value="{{.Redirect}}">
110-
<button type="submit" class="button not-allowed block is-primary">Sign in with {{.ProviderName}}</button>
111-
</form>
112-
<div class="label">
113-
<input class="checkbox" type="checkbox">
114-
<div class="info">
115-
<p class="lang-zh">我已阅读并同意<a href="/agreement_ch.html" target="_blank">《用户授权协议》</a>和社区<a
116-
href='https://www.openeuler.org/zh/other/privacy/' target="_blank">《隐私政策》</a>
109+
<div class="box">
110+
<form method="GET" action="{{.ProxyPrefix}}/start">
111+
<input type="hidden" name="rd" value="{{.Redirect}}" />
112+
<button type="submit" class="button not-allowed block is-primary">
113+
Sign in with {{.ProviderName}}
114+
</button>
115+
</form>
116+
<div class="label">
117+
<input class="checkbox" type="checkbox" />
118+
<div class="info">
119+
<p class="lang-zh">
120+
我已阅读并同意<a href="/agreement_ch.html" target="_blank"
121+
>《用户授权协议》</a
122+
>和社区<a
123+
href="https://www.openeuler.org/zh/other/privacy/"
124+
target="_blank"
125+
>《隐私政策》</a
126+
>
117127
</p>
118-
<p class="lang-en">I have read and agree to the <a href="/agreement_en.html" target="_blank">User
119-
Agreement</a> and the <a href='https://www.openeuler.org/en/other/privacy/' target="_blank">Privacy Policy</a>
120-
</p>
121-
</div>
122-
</div>
128+
<p class="lang-en">
129+
I have read and agree to the
130+
<a href="/agreement_en.html" target="_blank">User Agreement</a>
131+
and the
132+
<a
133+
href="https://www.openeuler.org/en/other/privacy/"
134+
target="_blank"
135+
>Privacy Policy</a
136+
>
137+
</p>
138+
</div>
123139
</div>
140+
</div>
124141
</div>
125142
<script>
126-
let checkbox = document.querySelector('.checkbox');
127-
let btn = document.querySelector('.button');
128-
checkbox.addEventListener('click',function() {
129-
checkbox.checked ? btn.classList.remove('not-allowed') : btn.classList.add('not-allowed')
130-
})
131-
btn.addEventListener('click',function() {
132-
checkbox.checked ? '' : event.preventDefault()
133-
})
134-
if (window.location.hash) {
135-
(function () {
136-
var inputs = document.getElementsByName('rd');
137-
for (var i = 0; i < inputs.length; i++) {
138-
// Add hash, but make sure it is only added once
139-
var idx = inputs[i].value.indexOf('#');
140-
if (idx >= 0) {
141-
// Remove existing hash from URL
142-
inputs[i].value = inputs[i].value.substr(0, idx);
143-
}
144-
inputs[i].value += window.location.hash;
145-
}
146-
})();
147-
}
148-
149-
// 根据中英文显示文案
150-
let lang = 'zh-CN';
151-
if(window.location.pathname.includes('en')){
152-
document.querySelector('.lang-en').style.display='block';
153-
document.querySelector('.lang-zh').remove();
154-
lang = 'en';
155-
}else{
156-
document.querySelector('.lang-zh').style.display='block';
157-
document.querySelector('.lang-en').remove();
158-
lang = 'zh-CN';
159-
}
160-
document.documentElement.setAttribute('lang',lang)
143+
let checkbox = document.querySelector(".checkbox");
144+
let btn = document.querySelector(".button");
145+
checkbox.addEventListener("click", function () {
146+
checkbox.checked
147+
? btn.classList.remove("not-allowed")
148+
: btn.classList.add("not-allowed");
149+
});
150+
btn.addEventListener("click", function () {
151+
checkbox.checked ? "" : event.preventDefault();
152+
});
153+
if (window.location.hash) {
154+
(function () {
155+
var inputs = document.getElementsByName("rd");
156+
for (var i = 0; i < inputs.length; i++) {
157+
// Add hash, but make sure it is only added once
158+
var idx = inputs[i].value.indexOf("#");
159+
if (idx >= 0) {
160+
// Remove existing hash from URL
161+
inputs[i].value = inputs[i].value.substr(0, idx);
162+
}
163+
inputs[i].value += window.location.hash;
164+
}
165+
})();
166+
}
161167

168+
// 根据中英文显示文案
169+
let lang = "zh-CN";
170+
if (window.location.pathname.includes("en")) {
171+
document.querySelector(".lang-en").style.display = "block";
172+
document.querySelector(".lang-zh").remove();
173+
lang = "en";
174+
} else {
175+
document.querySelector(".lang-zh").style.display = "block";
176+
document.querySelector(".lang-en").remove();
177+
lang = "zh-CN";
178+
}
179+
document.documentElement.setAttribute("lang", lang);
162180
</script>
163-
</body>
164-
</html>
165-
{{end}}
181+
</body>
182+
</html>
183+
{{end}}

pkg/app/pagewriter/login/euler.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@
3535
}
3636

3737
.wrap .button {
38-
width: 300px;
39-
line-height: 58px;
38+
padding: 12px 32px;
39+
font-size: 16px;
40+
line-height: 24px;
4041
border: 0 none;
41-
background: #002fa7;
42-
box-shadow: 0px 5px 0px 0px rgba(0, 0, 0, 0.11);
43-
border-radius: 8px;
42+
background: #2a489e;
43+
border-radius: 26px;
4444
text-align: center;
4545
color: #fff;
46-
font-size: 20px;
4746
font-weight: bold;
47+
cursor: pointer;
4848
}
4949

5050
.wrap .label {
@@ -53,6 +53,9 @@
5353
margin-top: 30px;
5454
display: flex;
5555
align-items: center;
56+
}
57+
58+
.checkbox {
5659
cursor: pointer;
5760
}
5861

0 commit comments

Comments
 (0)