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

Commit 8b1b9de

Browse files
committed
プロ画部分追加
1 parent cdf1513 commit 8b1b9de

6 files changed

Lines changed: 113 additions & 57 deletions

File tree

libraries/common/common.css

Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,6 @@ Body {
3131
Background: URL("/SimpleThread/images/Back.jpg");
3232
}
3333

34-
35-
36-
Div[Data-Component="Frame-Content"] {
37-
Display: Flex;
38-
Flex-Direction: Column;
39-
}
40-
41-
Main {
42-
Position: Relative;
43-
Top: 1rem;
44-
45-
Flex: 1;
46-
47-
Margin: 0 17.5%;
48-
Padding: 4vmin;
49-
Background-Color: White;
50-
}
51-
52-
@media (Max-Width: 480px) {
53-
Main {
54-
Margin: 0.5rem;
55-
}
56-
}
57-
5834
A:Not([Href]) {
5935
Cursor: Pointer;
6036
}
@@ -63,6 +39,8 @@ A:Not([Href]) {
6339
White-Space: Pre-Line;
6440
}
6541

42+
43+
6644
.mdc-typography--headline {
6745
Border-Bottom: Thin Solid LightSeagreen;
6846
}
@@ -77,4 +55,45 @@ A:Not([Href]) {
7755
Border-Color: Transparent LightSeagreen LightSeagreen Transparent;
7856

7957
Vertical-Align: Bottom;
58+
}
59+
60+
.profilePhoto.disabled {
61+
Display: None;
62+
}
63+
64+
.profilePhoto.mdc-tab {
65+
Min-Width: Auto;
66+
}
67+
68+
.profilePhoto::Before {
69+
Content: "";
70+
71+
Display: Block;
72+
Width: 2.5em;
73+
Height: 2.5em;
74+
75+
Background: var(--photoUrl, RGBA(0, 0, 0, 0.2)) Center / Cover;
76+
Border-Radius: 100%;
77+
}
78+
79+
Div[Data-Component="Frame-Content"] {
80+
Display: Flex;
81+
Flex-Direction: Column;
82+
}
83+
84+
Main {
85+
Position: Relative;
86+
Top: 1rem;
87+
88+
Flex: 1;
89+
90+
Margin: 0 17.5%;
91+
Padding: 4vmin;
92+
Background-Color: White;
93+
}
94+
95+
@media (Max-Width: 480px) {
96+
Main {
97+
Margin: 0.5rem;
98+
}
8099
}

libraries/common/common.js

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,31 @@ window.addEventListener("DOMContentLoaded", () => {
88
let menuContainer = new DOM.ComponentLoader("/SimpleThread/libraries/common/").doc.querySelector("Body");
99
menuContainer.childNodes.forEach(component => document.body.appendChild(component));
1010

11-
new DOM('$*[Data-Component="Frame-Content_Toolbar_Title"]').textContent = new DOM("$Title").textContent;
11+
new DOM("#Frame-Content-Toolbar-Title").textContent = new DOM("$Title").textContent;
1212

13-
new DOM('$*[Data-Component="Frame-Content"]').appendChild(new DOM("$Main"));
14-
new mdc.toolbar.MDCToolbar(new DOM('$Header[Data-Component="Frame-Content_Toolbar"]'));
13+
new DOM("#Frame-Content").appendChild(new DOM("$Main"));
14+
new mdc.toolbar.MDCToolbar(new DOM("#Frame-Content-Toolbar"));
1515

16-
new DOM('$*[Data-Component="Frame-Content_Toolbar_DrawerBtn"]').addEventListener("click", () => {
17-
let drawer = new mdc.drawer.MDCTemporaryDrawer(new DOM('$*[Data-Component="Frame-Drawer"]'));
16+
new DOM("#Frame-Content-Toolbar-DrawerBtn").addEventListener("click", () => {
17+
let drawer = new mdc.drawer.MDCTemporaryDrawer(new DOM("#Frame-Drawer"));
1818
drawer.open = !drawer.open;
1919
});
20+
21+
new DOM("#Frame-Content-Toolbar-SignInOut").addEventListener("click", () => {
22+
switch (new DOM("#Frame-Content-Toolbar-SignInOut").dataset.locales) {
23+
case "common.signIn":
24+
base.signInWithRedirect(base.SIGNINTYPE.GOOGLE, base.option.scope);
25+
break;
26+
27+
case "common.signOut":
28+
base.signOut();
29+
break;
30+
31+
default:
32+
alert("Got to Default.");
33+
break;
34+
}
35+
});
2036

2137
window.mdc.autoInit();
2238

@@ -101,18 +117,19 @@ window.addEventListener("DOMContentLoaded", () => {
101117
this.picker.setVisible(false);
102118
}
103119
}
104-
});
120+
});*/
105121

106122

107123

108124
if (user) {
109-
new DOM("#Header_SignInOut").dataset.locales = "main.signOut";
125+
new DOM("#Frame-Content-Toolbar-SignInOut").dataset.locales = "common.signOut";
126+
127+
new DOM("@.profilePhoto").forEach(photo => {
128+
photo.style.setProperty("--photoUrl", `URL("${user.photoURL}")`);
129+
photo.classList.remove("disabled");
130+
});
110131

111132
base.Database.getInfo(base.Database.ONCE, `users/${user.uid}`, (res) => {
112-
new DOM('@A[UUID="ProfilePhoto-Btn"]').forEach((btn) => {
113-
btn.dataset.uid = user.uid;
114-
});
115-
116133
if (!res.exists()) {
117134
base.Database.set(`users/${user.uid}`, {
118135
gplusName: user.providerData[0].displayName,
@@ -122,7 +139,7 @@ window.addEventListener("DOMContentLoaded", () => {
122139
links: []
123140
});
124141

125-
new DOM("#Dialogs_Account_CreateNotify").showModal();
142+
//new DOM("#Dialogs_Account_CreateNotify").showModal();
126143
} else {
127144
base.Database.update(`users/${user.uid}`, {
128145
gplusName: user.providerData[0].displayName,
@@ -131,35 +148,29 @@ window.addEventListener("DOMContentLoaded", () => {
131148
}
132149
});
133150

134-
base.Database.get(base.Database.ONCE, `users/${base.user.uid}`, (res) => {
151+
/*base.Database.get(base.Database.ONCE, `users/${base.user.uid}`, (res) => {
135152
new DOM("#Dialogs_Thread_Poster_Header_ActorPhoto").dataset.uid = base.user.uid;
136153
new DOM("#Dialogs_Thread_Poster_Header_Actor").textContent = res.userName;
137-
});
154+
});*/
138155
} else {
139-
window.addEventListener("DOMContentLoaded", () => {
156+
/*window.addEventListener("DOMContentLoaded", () => {
140157
new DOM('@*[UUID="ProfilePhoto-Btn"]').forEach((btn) => {
141158
btn.setAttribute("Disabled", "");
142159
});
143-
});
160+
});*/
144161
}
145162

146-
locales.applyToElement(new DOM("#Header_SignInOut"));
163+
locales.applyToElement(new DOM("#Frame-Content-Toolbar-SignInOut"));
147164

148-
base.Database.get(base.Database.ONCE, "users", (res) => {
165+
/*base.Database.get(base.Database.ONCE, "users", (res) => {
149166
for (let uid in res) {
150167
let photoStyle = new Component.Styles.ProfilePhotoManager(uid, res[uid].gplusPhoto);
151168
152169
document.head.appendChild(photoStyle);
153170
}
154-
});
155-
156-
157-
158-
let querys = location.querySort();
159-
160-
if (querys.TID) {
161-
new DOM("$IFrame.mdl-layout__content").src = `Thread/Viewer/?tid=${querys.TID}`;
162-
}*/
171+
});*/
172+
173+
163174

164175
terminal.postMessage({ code: "DBConnected" });
165176
});

libraries/common/index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Aside Data-Component = "Frame-Drawer" Class = "mdc-temporary-drawer">
1+
<Aside ID = "Frame-Drawer" Class = "mdc-temporary-drawer">
22
<Nav Class = "mdc-temporary-drawer__drawer">
33
<Div Class = "mdc-temporary-drawer__toolbar-spacer"></Div>
44

@@ -21,23 +21,25 @@
2121
</Nav>
2222
</Aside>
2323

24-
<Div Data-Component = "Frame-Content">
24+
<Div ID = "Frame-Content">
2525
<Link Rel = "StyleSheet" Href = "/SimpleThread/libraries/Material Icons/material-icons.css" />
2626
<Link Rel = "StyleSheet" Href = "/SimpleThread/libraries/Material Icons Extended/material-icons-extended.css" />
2727

2828

2929

30-
<Header Data-Component = "Frame-Content_Toolbar" Class = "mdc-toolbar mdc-toolbar--fixed mdc-toolbar--waterfall mdc-elevation--z4">
30+
<Header ID = "Frame-Content-Toolbar" Class = "mdc-toolbar mdc-toolbar--fixed mdc-toolbar--waterfall mdc-elevation--z4">
3131
<Div Class = "mdc-toolbar__row">
3232
<Section Class = "mdc-toolbar__section mdc-toolbar__section--align-start">
33-
<A Data-Component = "Frame-Content_Toolbar_DrawerBtn" Class = "mdc-toolbar__menu-icon material-icons" Href = "javascript:void(0)">menu</A>
34-
<Span Data-Component = "Frame-Content_Toolbar_Title" Class = "mdc-toolbar__title"></Span>
33+
<A ID = "Frame-Content-Toolbar-DrawerBtn" Class = "mdc-toolbar__menu-icon material-icons" Href = "javascript:void(0)">menu</A>
34+
<Span ID = "Frame-Content-Toolbar-Title" Class = "mdc-toolbar__title"></Span>
3535
</Section>
3636

3737
<Section Class = "mdc-toolbar__section mdc-toolbar__section--align-end mdc-toolbar__section--shrink-to-fit">
3838
<Nav Class = "mdc-tab-bar">
3939
<A Class = "mdc-tab" Href = "/SimpleThread/" Data-Locales = "common.top">Top</A>
40-
<A Class = "mdc-tab" Href = "#" Data-Locales = "common.signIn">Sign In</A>
40+
<A ID = "Frame-Content-Toolbar-SignInOut" Class = "mdc-tab" Href = "#" Data-Locales = "common.signIn">Sign In</A>
41+
42+
<A Class = "mdc-tab profilePhoto disabled" Href = "/SimpleThread/profile/"></A>
4143
</Nav>
4244
</Section>
4345
</Div>

profile/index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DocType HTML>
2+
3+
<HTML>
4+
<Head>
5+
<Meta Charset = "UTF-8" />
6+
<Meta Name = "Viewport" Content = "Width=Device-Width, Initial-Scale=1, User-Scalable=No" />
7+
<Title>プロフィール | Simple Thread</Title>
8+
9+
<Script Src = "/SimpleThread/libraries/material-components-web.min.js"></Script>
10+
<Link Rel = "StyleSheet" Href = "/SimpleThread/libraries/material-components-web.min.css" />
11+
12+
<Script Src = "/SimpleThread/libraries/DOM Extender v3.4.js"></Script>
13+
<Script Src = "/SimpleThread/libraries/common/common.js"></Script>
14+
<Link Rel = "StyleSheet" Href = "/SimpleThread/libraries/common/common.css" />
15+
16+
<Script Src = "profile.js"></Script>
17+
<Link Rel = "StyleSheet" Href = "profile.css" />
18+
</Head>
19+
20+
<Body>
21+
<Main ID = "Profile">
22+
</Main>
23+
</Body>
24+
</HTML>

profile/profile.css

Whitespace-only changes.

profile/profile.js

Whitespace-only changes.

0 commit comments

Comments
 (0)