Skip to content

Commit 08fac35

Browse files
committed
Added new petrel version
1 parent f84dd7d commit 08fac35

File tree

5 files changed

+98
-8
lines changed

5 files changed

+98
-8
lines changed

bun.lockb

0 Bytes
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"highlight.js": "^11.9.0",
1717
"hono": "^4.0.10",
1818
"jdomjs": "3.1.11",
19-
"petrel": "1.0.8",
19+
"petrel": "1.1.0",
2020
"sass": "^1.71.1"
2121
}
2222
}

public/petrel/base.css

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
margin: 0px;
1414
line-height: inherit;
1515
background: transparent;
16-
min-height: 100%;
16+
/* min-height: 100%; */
1717
overflow: hidden;
1818
border: none;
1919
outline: none;
@@ -24,12 +24,14 @@
2424
caret-color: #989898;
2525
overflow-wrap: normal;
2626
white-space: pre;
27-
min-width: 100%;
27+
/*min-width: 100%;*/
2828
padding-left: 0;
2929
position: absolute;
3030
top: 0;
3131
font-size: inherit;
3232
left: 0px;
33+
34+
opacity: 0;
3335
}
3436

3537
.petrel-code-editor textarea::-moz-selection, .petrel-code-editor textarea::selection {
@@ -49,6 +51,69 @@
4951
pointer-events: none;
5052
font-family: inherit;
5153
font-size: inherit;
54+
z-index: 3;
55+
}
56+
57+
58+
59+
.petrel-code-editor .petrel-code-editor-overlay {
60+
position: absolute;
61+
pointer-events: none;
62+
top: 15px;
63+
left: 20px;
64+
}
65+
66+
.petrel-code-editor .petrel-code-editor-overlay-line-indicator {
67+
position: absolute;
68+
background: #FFFFFF11;
69+
z-index: 1;
70+
}
71+
72+
.petrel-code-editor .petrel-code-editor-overlay-bracket-indicator {
73+
position: absolute;
74+
background: #FFFFFF11;
75+
border: #FFFFFF22 1px solid;
76+
box-sizing: border-box;
77+
z-index: 4;
78+
}
79+
80+
.petrel-code-editor .petrel-code-editor-overlay-cursor {
81+
position: absolute;
82+
background: #FFFFFF;
83+
animation: 1s cursor infinite linear;
84+
width: 2px;
85+
z-index: 10;
86+
}
87+
88+
.petrel-code-editor .petrel-code-editor-selection {
89+
position: absolute;
90+
background: #3B74F133;
91+
z-index: 2;
92+
}
93+
.petrel-code-editor .petrel-code-editor-selection-single {
94+
border-radius: 4px;
95+
}
96+
.petrel-code-editor .petrel-code-editor-selection-first {
97+
border-radius: 4px 0 0 0;
98+
}
99+
.petrel-code-editor .petrel-code-editor-selection-last {
100+
border-radius: 0 0 4px 0;
101+
}
102+
103+
@keyframes cursor {
104+
0% {
105+
opacity: 1;
106+
}
107+
108+
50% {
109+
opacity: 1;
110+
}
111+
51% {
112+
opacity: 0;
113+
}
114+
100% {
115+
opacity: 0;
116+
}
52117
}
53118

54119
.petrel-code-editor .petrel-code-editor-line-numbering {
@@ -73,7 +138,7 @@
73138

74139

75140
.petrel-code-editor .petrel-code-editor-line-numbering span div {
76-
height: 22px;
141+
height: 23px;
77142
width: 100%;
78143
left: 0px;
79144
position: absolute;
@@ -90,12 +155,14 @@
90155
position: absolute;
91156
left: 92px;
92157
background: #FFF;
158+
z-index: 11;
93159
}
94160

95161

96162
.petrel-code-editor .petrel-code-editor-autocompletion a {
97163
cursor: pointer;
98164
display: block;
165+
font-size: 12px;
99166
}
100167

101168
.petrel-code-editor .petrel-code-editor-autocompletion a.selected {

public/petrel/dark.css

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import url('./base.css');
2+
@import url(https://fonts.intera.dev/_/dm+mono);
23

34
.petrel-code-editor {
45
background: #212531;
@@ -9,6 +10,7 @@
910
resize: vertical;
1011
min-height: 140px;
1112
border-radius: 10px;
13+
font-family: 'DM Mono';
1214
}
1315

1416
.petrel-code-editor::-webkit-resizer {
@@ -59,11 +61,32 @@
5961
overflow: auto;
6062
}
6163
.petrel-code-editor .petrel-code-editor-autocompletion a {
62-
padding: 4px 6px;
63-
margin: 5px;
64+
padding: 3px 5px;
65+
margin: 0 5px;
6466
border-radius: 6px;
65-
font-size: 16px;
6667
}
6768
.petrel-code-editor .petrel-code-editor-autocompletion a:hover {
6869
background: #FFFFFF21;
70+
}
71+
72+
73+
.petrel-code-editor .petrel-code-editor-overlay-bracket-indicator {
74+
background: #FFFFFF11;
75+
border-color: #FFFFFF22;
76+
}
77+
78+
.petrel-code-editor .petrel-code-editor-line-numbering span div {
79+
background: #FFFFFF11;
80+
}
81+
82+
.petrel-code-editor .petrel-code-editor-overlay-line-indicator {
83+
background: #FFFFFF11;
84+
}
85+
86+
.petrel-code-editor .petrel-code-editor-overlay-cursor {
87+
background: #FFFFFF;
88+
}
89+
90+
.petrel-code-editor .petrel-code-editor-selection {
91+
background: #3B74F166;
6992
}

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ api.promiseInterceptor = r => r.json()
2020
initUser()
2121

2222
html`<${App} router=${router} />`
23-
.appendTo(document);
23+
.appendTo(document)
2424

2525
router.init();

0 commit comments

Comments
 (0)