Skip to content

Commit 3a6d31e

Browse files
authored
feat: add media query for small screens (#18)
* feat: make elements' width responsive to the viewport * refactor: move inline style to main.css file * refactor: change unit to rem, em * feat: add media query for small screens * fix: make dialog responsive * update: add contributor (박이준)
1 parent 07e61ad commit 3a6d31e

File tree

3 files changed

+121
-19
lines changed

3 files changed

+121
-19
lines changed

index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@
5757
</tr>
5858
</table>
5959
<div id="result" class="result">공백 제외 0자, 공백 포함 0자, 0바이트</div>
60-
<span style="font-size: 12pt; color:#aaa; font-family: 'Noto Sans KR'; letter-spacing: -1.25px; float: right; text-align: right;">영어, 숫자, 특수문자, 띄어쓰기 1바이트 / 엔터키 2바이트 / 한글 3바이트<br>해당 사이트 제작자가 20년도 졸업생인데, 생활기록부 입력 제한이 바뀐 것으로 알고 있어 지웠습니다.<br>PR 로 내용을 보내주시면 반영하겠습니다!<br>반영해주신 분들: <a href="https://github.com/Dongyeongkim" target="_blank">김동영</a>, <a href="https://github.com/rycont" target="_blank">정한(RyCont)</a>, <a href="https://github.com/cokia" target="_blank">한우영</a>, <a href="https://github.com/hajin-chung" target="_blank">정하진</a>, <a href="https://github.com/Otwooo" target="_blank">배송현</a>, <a href="https://github.com/mcgun1234" target="_blank">최수현</a>, <a href="https://github.com/b0u0b-0w0" target="_blank">김서진</a><br><br><a href="https://hjh010501.github.io/neis-counter/"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fhjh010501.github.io%2Fneis-counter%2F&count_bg=%23000000&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=%EB%B0%A9%EB%AC%B8%EC%9E%90+%EC%88%98&edge_flat=true"/></a></span>
60+
<span class="info">영어, 숫자, 특수문자, 띄어쓰기 1바이트 / 엔터키 2바이트 / 한글 3바이트<br>해당 사이트 제작자가 20년도 졸업생인데,<br class="small-screen"> 생활기록부 입력 제한이 바뀐 것으로 알고 있어 지웠습니다.<br>PR 로 내용을 보내주시면 반영하겠습니다!<br>반영해주신 분들: <a href="https://github.com/Dongyeongkim" target="_blank">김동영</a>, <a href="https://github.com/rycont" target="_blank">정한(RyCont)</a>, <a href="https://github.com/cokia" target="_blank">한우영</a>, <a href="https://github.com/hajin-chung" target="_blank">정하진</a>, <a href="https://github.com/Otwooo" target="_blank">배송현</a>, <a href="https://github.com/mcgun1234" target="_blank">최수현</a>, <a href="https://github.com/b0u0b-0w0" target="_blank">김서진</a>, <a href="https://github.com/jjoonleo" target="_blank">박이준</a><br><br><a href="https://hjh010501.github.io/neis-counter/"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fhjh010501.github.io%2Fneis-counter%2F&count_bg=%23000000&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=%EB%B0%A9%EB%AC%B8%EC%9E%90+%EC%88%98&edge_flat=true"/></a></span>
6161
</div>
6262
<div class="footbar">
6363
<div class="footbar_content">
64-
<span style="text-align: left;">👨‍💻 by <a href="https://github.com/hjh010501">kidevelop</a></span>
65-
<span style="float: right;"><a class="github-button" href="https://github.com/hjh010501/neis-counter" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star hjh010501/neis-counter on GitHub">Star</a></span>
64+
<span>👨‍💻 by <a href="https://github.com/hjh010501">kidevelop</a></span>
65+
<span><a class="github-button" href="https://github.com/hjh010501/neis-counter" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star hjh010501/neis-counter on GitHub">Star</a></span>
6666
</div>
6767
</div>
6868
<script type="module" src="./spellchecker/index.js"></script>

main.css

+107-16
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
format("opentype");
2525
}
2626

27+
html {
28+
font-size: 62.5%;
29+
}
30+
2731
a {
2832
text-decoration: none;
2933
font-family: "Noto Sans KR Bold";
@@ -41,7 +45,8 @@ body {
4145
}
4246

4347
.center {
44-
width: 800px;
48+
width: 80vw;
49+
max-width: 800px;
4550
display: flex;
4651
flex-direction: column;
4752
align-items: center;
@@ -66,7 +71,7 @@ header {
6671

6772
.title {
6873
font-family: "Noto Sans KR Bold";
69-
font-size: 20pt;
74+
font-size: 2.6rem;
7075
letter-spacing: -1.25px;
7176
color: #1d1a1a;
7277
}
@@ -75,35 +80,51 @@ header {
7580
width: 30px;
7681
height: 4px;
7782
background: #1d1d1d;
78-
margin-top: 20px;
79-
margin-bottom: 30px;
83+
margin-top: 2rem;
84+
margin-bottom: 3rem;
8085
}
8186

8287
.counter {
8388
font-family: "Noto Sans KR";
84-
font-size: 11pt;
89+
font-size: 1.5rem;
8590
border: 0;
8691
resize: none;
8792
border: 1px solid #ddd;
88-
width: 800px;
93+
width: 100%;
8994
height: 400px;
9095
outline: 0;
91-
line-height: 25px;
96+
line-height: 1.7em;
9297
box-sizing: border-box;
9398
}
9499

95100
.result {
96101
font-family: "Noto Sans KR Bold";
97-
font-size: 20pt;
102+
font-size: 2.6rem;
98103
letter-spacing: -1.25px;
99104
color: #1d1a1a;
100105
text-align: right;
101-
margin-top: 20px;
106+
margin-top: 2rem;
107+
}
108+
109+
.info {
110+
font-size: 1.6rem;
111+
color: #aaa;
112+
font-family: 'Noto Sans KR';
113+
letter-spacing: -1.25px;
114+
float: right;
115+
text-align: right;
116+
}
117+
118+
.footbar_content{
119+
display: flex;
120+
flex-direction: row;
121+
justify-content: space-between;
122+
font-size: 1.6rem;
102123
}
103124

104125
button {
105126
border: 1px solid rgba(0, 0, 0, 0.2);
106-
padding: 4px 12px;
127+
padding: 0.4rem 1.2rem;
107128
border-radius: 20px;
108129
font-family: "Noto Sans KR";
109130
background-color: #1d1d1d;
@@ -120,27 +141,97 @@ table {
120141
font-family: "Noto Sans KR";
121142
letter-spacing: -1.25px;
122143
border: 1px solid #fff;
123-
font-size: 14pt;
124-
margin-top: 20px;
144+
font-size: 1.8rem;
145+
margin-top: 2rem;
125146
}
126147

127148
th {
128149
background: #1d1d1d;
129150
font-weight: 400;
130151
color: #fff;
131-
padding: 10px;
152+
padding: 0.5em;
132153
}
154+
133155
td {
134156
background-color: #ededed;
135157
color: #1d1d1d;
136-
padding: 10px;
158+
padding: 0.5em;
137159
}
138160

139161
.footbar {
140-
margin-top: 45px;
162+
width: 80vw;
163+
max-width: 800px;
164+
margin-top: 4.5rem;
141165
}
142166

143167
.footbar_content {
144-
width: 800px;
168+
width: 100%;
145169
margin: 0 auto;
146170
}
171+
172+
173+
@media (max-width:768px) {
174+
.center {
175+
width: 85vw;
176+
}
177+
178+
.title {
179+
font-size: 2.3rem;
180+
}
181+
182+
table {
183+
font-size: 1.3rem;
184+
}
185+
186+
.result{
187+
font-size: 2.3rem
188+
}
189+
190+
.info{
191+
font-size: 1.3rem;
192+
}
193+
}
194+
195+
@media (max-width:480px) {
196+
header {
197+
flex-direction: column;
198+
align-items: start;
199+
margin-bottom: 2em;
200+
}
201+
202+
.title {
203+
font-size: 2rem;
204+
margin-bottom: 0.5em;
205+
}
206+
207+
.title_underbar_wrapper {
208+
display: none;
209+
}
210+
211+
tr {
212+
display: block;
213+
float: left;
214+
}
215+
216+
tbody>tr:first-child {
217+
width: 40%;
218+
}
219+
220+
tbody>tr:last-child {
221+
width: 60%;
222+
}
223+
224+
th,
225+
td {
226+
display: block;
227+
}
228+
229+
.result{
230+
font-size: 1.7rem;
231+
text-wrap:balance;
232+
}
233+
234+
.info{
235+
font-size: 1rem;
236+
}
237+
}

spellchecker/agreement.js

+11
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ class Agreement extends LitElement {
1818
h1 {
1919
font-size: 16px;
2020
}
21+
@media (max-width:768px) {
22+
dialog{
23+
width: 400px;
24+
}
25+
}
26+
@media (max-width:480px) {
27+
dialog{
28+
width: 90vw;
29+
margin: auto;
30+
}
31+
}
2132
`,
2233
];
2334

0 commit comments

Comments
 (0)