Skip to content

Commit cfb25f9

Browse files
committed
1
1 parent f1110a7 commit cfb25f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1283
-1653
lines changed

web/core.css

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,38 @@ body {
3232
text-align : left;
3333
}
3434

35-
#information {
36-
float: left;
37-
width: 420px;
38-
min-height: max(100%, 100vh);
35+
#page-container {
36+
display: flex;
37+
width: 100vw;
38+
height: 100vh;
39+
40+
margin-top: 0px;
41+
margin-bottom: 0px;
42+
margin-left: 0px;
43+
margin-right: 0px;
44+
45+
padding-top: 0px;
46+
padding-bottom: 0px;
47+
padding-left: 0px;
48+
padding-right: 0px;
49+
}
50+
51+
#page-resizer {
52+
width: 2px;
53+
height: 100%;
54+
background: #bdbdbd;
55+
cursor: ew-resize;
56+
transition: background 0.2s;
57+
}
58+
59+
#page-resizer:hover {
60+
background: #0d0deb;
61+
}
62+
63+
#page-information {
64+
width: 400px; /* 초기값 */
65+
min-width: 100px;
66+
max-width: 80vw;
3967

4068
margin-top: 0px;
4169
margin-bottom: 0px;
@@ -56,12 +84,12 @@ body {
5684
background: #fafafa;
5785
}
5886

59-
#contents {
60-
min-height: max(100%, 100vh);
87+
#page-contents {
88+
flex: 1;
6189

6290
margin-top: 0px;
6391
margin-bottom: 0px;
64-
margin-left: 420px;
92+
margin-left: 0px;
6593
margin-right: 0px;
6694

6795
box-sizing: border-box;

web/core.js

Lines changed: 90 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,81 @@ var _Core = null;
3333

3434

3535

36+
3637
/////////////////////////////////////////////////////////////////////////////
3738
//===========================================================================
38-
function coreInitialize() {
39+
function initializeCore() {
3940
_Core = new Core();
41+
}
42+
43+
44+
45+
46+
47+
/////////////////////////////////////////////////////////////////////////////
48+
//===========================================================================
49+
function initializePageResizer() {
50+
const resizer = document.getElementById("page-resizer");
51+
const left = document.getElementById("page-information");
52+
if (!resizer) {
53+
return;
54+
}
55+
if (!left) {
56+
return;
57+
}
58+
59+
60+
let isResizing = false;
61+
62+
63+
resizer.addEventListener('mousedown',
64+
function (e) {
65+
isResizing = true;
66+
document.body.style.cursor = 'ew-resize';
4067

41-
const information = document.createElement("div");
42-
information.id = "information";
43-
document.body.insertBefore(information, document.body.firstChild);
68+
document.body.style.userSelect = 'none'; // 텍스트 선택 방지
69+
}
70+
);
4471

72+
document.addEventListener('mousemove',
73+
function (e) {
74+
const leftMinSize = 400;
75+
76+
if (!isResizing) return;
77+
const newWidth = e.clientX - left.getBoundingClientRect().left;
78+
if (newWidth > leftMinSize && newWidth < window.innerWidth * 0.8) {
79+
left.style.width = newWidth + 'px';
80+
}
81+
}
82+
);
83+
84+
document.addEventListener('mouseup',
85+
function () {
86+
if (isResizing) {
87+
document.body.style.cursor = '';
88+
89+
document.body.style.userSelect = ''; // 텍스트 선택 방지 원래대로 복원
90+
}
91+
92+
isResizing = false;
93+
}
94+
);
95+
}
96+
97+
98+
99+
100+
101+
/////////////////////////////////////////////////////////////////////////////
102+
//===========================================================================
103+
function setupPageInformationInnerHtml() {
104+
const information = document.getElementById("page-information");
105+
if (!information) {
106+
return;
107+
}
45108

46109
information.innerHTML =
47-
`
110+
`
48111
<p style="text-align: center;"><img src="../logo.png" style="border:2px solid #bdbdbd; border-radius:120px;" /></p>
49112
<br />
50113
@@ -77,17 +140,36 @@ function coreInitialize() {
77140
</svg>
78141
<a href="https://github.com/code1009"><b>https://github.com/code1009/</b></a><br />
79142
80-
`
143+
`
81144
;
82-
145+
}
146+
147+
function setPageInformationHeight() {
148+
const information = document.getElementById("page-information");
149+
if (!information) {
150+
return;
151+
}
152+
83153
const documentHeight = Math.max(
84154
document.body.scrollHeight,
85155
document.documentElement.scrollHeight,
86156
document.body.offsetHeight,
87157
document.documentElement.offsetHeight,
88158
document.body.clientHeight,
89159
document.documentElement.clientHeight
90-
);
160+
);
91161

92162
information.style.minHeight = documentHeight + 'px';
93163
}
164+
165+
function initializePageInformation() {
166+
const information = document.getElementById("page-information");
167+
if (!information) {
168+
return;
169+
}
170+
171+
setupPageInformationInnerHtml();
172+
setPageInformationHeight();
173+
}
174+
175+

web/example/page.html

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
5+
<meta charset="utf-8" />
6+
<title>code1009</title>
7+
<link rel="stylesheet" type="text/css" href="../core.css" />
8+
<link rel="stylesheet" type="text/css" href="../menu.css" />
9+
<link rel="stylesheet" type="text/css" href="./page.css" />
10+
<script type="text/javascript" src="../core.js"></script>
11+
<script type="text/javascript" src="../menu.js"></script>
12+
<script type="text/javascript" src="../mainmenu.js"></script>
13+
<script type="text/javascript" src="./submenu.js"></script>
14+
<script type="text/javascript" src="./page.js"></script>
15+
16+
</head>
17+
<body>
18+
19+
<div id="page-container">
20+
21+
<div id="page-information"></div>
22+
23+
<div id="page-resizer"></div>
24+
25+
<div id="page-contents">
26+
27+
<div id="subMenu" class="menu"></div>
28+
<br />
29+
30+
<!-- menu icon -->
31+
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
32+
<path d="M0 0h7v7H0V0zm2 2v3h3V2H2zM0 9h7v7H0V9zm9-9h7v7H9V0zm2 2v3h3V2h-3zM9 9h7v7H9V9zm2 2v3h3v-3h-3zm-9 0v3h3v-3H2z" fill-rule="evenodd" />
33+
</svg>
34+
35+
<!-- root icon -->
36+
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
37+
<path d="M10.956 1.27994L6.06418 14.7201L5 14.7201L9.89181 1.27994L10.956 1.27994Z" fill="currentcolor" />
38+
</svg>
39+
40+
<!-- folder icon -->
41+
<svg viewBox="0 0 16 16" width="16" height="16" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="#bdbdff">
42+
<path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z">
43+
</path>
44+
</svg>
45+
46+
<!-- folder open icon -->
47+
<svg viewBox="0 0 16 16" width="16" height="16" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="#bdbdff">
48+
<path d="M.513 1.513A1.75 1.75 0 0 1 1.75 1h3.5c.55 0 1.07.26 1.4.7l.9 1.2a.25.25 0 0 0 .2.1H13a1 1 0 0 1 1 1v.5H2.75a.75.75 0 0 0 0 1.5h11.978a1 1 0 0 1 .994 1.117L15 13.25A1.75 1.75 0 0 1 13.25 15H1.75A1.75 1.75 0 0 1 0 13.25V2.75c0-.464.184-.91.513-1.237Z">
49+
</path>
50+
</svg>
51+
52+
<!-- file icon -->
53+
<svg viewBox="0 0 16 16" width="16" height="16" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="#bdbdff">
54+
<path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z">
55+
</path>
56+
</svg>
57+
58+
59+
<h1>제목1</h1>
60+
<h2>제목2</h2>
61+
<h3>제목3</h3>
62+
<h4>제목4</h4>
63+
<h5>제목5</h5>
64+
<p>페이지 내용</p>
65+
66+
</div>
67+
68+
</div>
69+
70+
</body>
71+
</html>
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class Page {
1212

1313
#Context = null;
14-
14+
1515
constructor() {
1616
this.#Context = null;
1717
}
@@ -31,7 +31,7 @@ var _Page = null;
3131

3232
/////////////////////////////////////////////////////////////////////////////
3333
//===========================================================================
34-
function pageInitialize() {
34+
function initializePage() {
3535
_Page = new Page();
3636
}
3737

@@ -42,10 +42,17 @@ function pageInitialize() {
4242
/////////////////////////////////////////////////////////////////////////////
4343
//===========================================================================
4444
window.onload = function () {
45-
coreInitialize();
46-
mainMenuInitialize();
47-
pageInitialize();
45+
initializeCore();
46+
initializePage();
47+
48+
initializePageInformation();
49+
initializePageResizer();
50+
51+
initializeMainMenu();
52+
53+
initializeMarkdwonView();
4854

55+
initializeSubMenu();
4956
}
5057

5158

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ class SubMenu {
3232

3333
/////////////////////////////////////////////////////////////////////////////
3434
//===========================================================================
35-
var _subMenu = null;
35+
var _SubMenu = null;
3636

3737

3838

3939

4040

4141
/////////////////////////////////////////////////////////////////////////////
4242
//===========================================================================
43-
function subMenuInitialize() {
44-
_subMenu = new SubMenu();
43+
function initializeSubMenu() {
44+
_SubMenu = new SubMenu();
4545
}
File renamed without changes.

0 commit comments

Comments
 (0)