Skip to content
This repository was archived by the owner on May 13, 2018. It is now read-only.

Commit 9771250

Browse files
committed
プロフィール編集ページを追加
1 parent 8b1b9de commit 9771250

4 files changed

Lines changed: 85 additions & 29 deletions

File tree

libraries/common/common.css

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
Line-Height: 1.75;
2323
}
2424

25-
HTML, Body {
26-
Height: 100%;
27-
}
28-
2925
Body {
3026
Margin: 0;
3127
Background: URL("/SimpleThread/images/Back.jpg");
@@ -41,6 +37,28 @@ A:Not([Href]) {
4137

4238

4339

40+
Div[Data-Component="Frame-Content"] {
41+
Display: Flex;
42+
Flex-Direction: Column;
43+
}
44+
45+
Main {
46+
Position: Relative;
47+
Top: 1rem;
48+
49+
Flex: 1;
50+
51+
Margin: 0 17.5%;
52+
Padding: 4vmin;
53+
Background-Color: White;
54+
}
55+
56+
@media (Max-Width: 480px) {
57+
Main {
58+
Margin: 0.5rem;
59+
}
60+
}
61+
4462
.mdc-typography--headline {
4563
Border-Bottom: Thin Solid LightSeagreen;
4664
}
@@ -57,43 +75,31 @@ A:Not([Href]) {
5775
Vertical-Align: Bottom;
5876
}
5977

60-
.profilePhoto.disabled {
61-
Display: None;
62-
}
63-
64-
.profilePhoto.mdc-tab {
65-
Min-Width: Auto;
66-
}
67-
6878
.profilePhoto::Before {
6979
Content: "";
7080

7181
Display: Block;
72-
Width: 2.5em;
73-
Height: 2.5em;
82+
Padding-Top: 100%;
7483

7584
Background: var(--photoUrl, RGBA(0, 0, 0, 0.2)) Center / Cover;
7685
Border-Radius: 100%;
7786
}
7887

79-
Div[Data-Component="Frame-Content"] {
80-
Display: Flex;
81-
Flex-Direction: Column;
88+
A.profilePhoto.mdc-tab::Before {
89+
Width: 2.5em;
90+
Height: 2.5em;
91+
92+
Padding-Top: 0;
8293
}
8394

84-
Main {
85-
Position: Relative;
86-
Top: 1rem;
95+
A.profilePhoto.mdc-tab {
96+
Min-Width: Auto;
97+
}
8798

88-
Flex: 1;
89-
90-
Margin: 0 17.5%;
91-
Padding: 4vmin;
92-
Background-Color: White;
99+
.profilePhoto.disabled {
100+
Display: None;
93101
}
94102

95-
@media (Max-Width: 480px) {
96-
Main {
97-
Margin: 0.5rem;
98-
}
103+
.mdc-text-field > Textarea {
104+
Resize: None;
99105
}

profile/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,24 @@
1919

2020
<Body>
2121
<Main ID = "Profile">
22+
<Div ID = "Profile-Photo" Class = "profilePhoto"></Div>
23+
24+
<Div ID = "Profile-Info">
25+
<Div Class = "mdc-text-field">
26+
<Input ID = "Profile-Info-Name" Type = "Text" Class = "mdc-text-field__input">
27+
<Label Class = "mdc-text-field__label" For = "Profile-Info-Name" Data-Locales = "profile.name">ユーザー名...</Label>
28+
<Div Class = "mdc-text-field__bottom-line"></Div>
29+
</Div>
30+
31+
<Div Class = "mdc-text-field mdc-text-field--textarea">
32+
<Textarea ID = "Profile-Info-Detail" Class = "mdc-text-field__input" Rows = "8"></Textarea>
33+
<Label Class = "mdc-text-field__label" For = "Profile-Info-Detail" Data-Locales = "profile.detail">自己紹介...</Label>
34+
</Div>
35+
36+
<Div>
37+
38+
</Div>
39+
</Div>
2240
</Main>
2341
</Body>
2442
</HTML>

profile/profile.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#Profile {
2+
Display: Flex;
3+
Flex-Direction: Row;
4+
Align-Items: Flex-Start;
5+
}
6+
7+
#Profile-Photo {
8+
Width: 20%;
9+
Margin-Right: 5%;
10+
}
11+
12+
#Profile-Info {
13+
Display: Flex;
14+
Flex-Direction: Column;
15+
16+
Flex: 1;
17+
}

profile/profile.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
terminal.addEventListener("message", event => {
2+
if (event.data.code == "Loaded") {
3+
base.Database.get(base.Database.INTERVAL, `users/${base.user.uid}`, res => {
4+
new DOM("#Profile-Info-Name").value = res.userName,
5+
new DOM("#Profile-Info-Name").parentNode.querySelector("Label").classList.add("mdc-text-field__label--float-above");
6+
7+
new DOM("#Profile-Info-Detail").value = res.detail,
8+
new DOM("#Profile-Info-Detail").parentNode.querySelector("Label").classList.add("mdc-text-field__label--float-above");
9+
});
10+
}
11+
});
12+
13+
window.addEventListener("DOMContentLoaded", () => {
14+
new DOM("@.mdc-text-field").forEach(textField => new mdc.textField.MDCTextField(textField));
15+
});

0 commit comments

Comments
 (0)