Skip to content

Commit b352cce

Browse files
authored
1.8.5
Codeit 1.8.5
2 parents 3147187 + 4cda2cd commit b352cce

25 files changed

+631
-216
lines changed

bottomfloat.js

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -89,45 +89,58 @@ pushWrapper.addEventListener('click', () => {
8989
})
9090

9191

92-
// if on mobile device
92+
// if on mobile
9393
if (isMobile) {
9494

95-
// show bottom float when scrolled up
95+
cd.on('scroll', checkBottomFloat, false);
9696

97-
let lastScrollTop = 0;
97+
}
98+
99+
100+
// show bottom float when scrolled up
98101

99-
cd.on('scroll', () => {
102+
let lastScrollTop = 0;
100103

101-
let st = cd.scrollTop;
104+
function checkBottomFloat() {
102105

103-
// if scrolled down
104-
if (st > lastScrollTop) {
106+
let st = cd.scrollTop;
105107

106-
// hide bottom float
107-
bottomWrapper.classList.add('hidden');
108+
// if scrolled down
109+
if (st > lastScrollTop) {
108110

109-
// if scrolled to bottom of codeit
110-
if ((st + cd.offsetHeight) >= cd.scrollHeight) {
111+
// hide bottom float
112+
bottomWrapper.classList.add('hidden');
111113

112-
// show bottom float
113-
bottomWrapper.classList.remove('hidden');
114+
// if scrolled to bottom of codeit
115+
if ((st + cd.offsetHeight) >= cd.scrollHeight) {
114116

115-
}
117+
// set timeout
118+
window.setTimeout(() => {
116119

117-
} else { // if scrolled up
120+
// if still on bottom of codeit
121+
if ((st + cd.offsetHeight) >= cd.scrollHeight) {
118122

119-
// if passed threshold
120-
if ((lastScrollTop - st) > 20) {
123+
// show bottom float
124+
bottomFloat.classList.remove('hidden');
121125

122-
// show bottom float
123-
bottomWrapper.classList.remove('hidden');
126+
}
124127

125-
}
128+
}, 400);
126129

127130
}
128131

129-
lastScrollTop = st <= 0 ? 0 : st; // for mobile or negative scrolling
132+
} else { // if scrolled up
133+
134+
// if passed threshold
135+
if ((lastScrollTop - st) > 20) {
136+
137+
// show bottom float
138+
bottomWrapper.classList.remove('hidden');
139+
140+
}
141+
142+
}
130143

131-
}, false);
144+
lastScrollTop = st <= 0 ? 0 : st; // for mobile or negative scrolling
132145

133146
}

codedrop.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ cd.on('drop', (ev) => {
6060
// prevent default behavior (prevent file from being opened)
6161
ev.preventDefault();
6262

63-
// if not logged into Github
64-
if (githubToken == null) {
63+
// if not logged into git
64+
if (gitToken == null) {
6565

6666
// remove drop indication
6767
document.body.classList.remove('focus');
@@ -101,8 +101,8 @@ cd.on('dragover', (ev) => {
101101
// prevent default behavior (prevent file from being opened)
102102
ev.preventDefault();
103103

104-
// if not logged into Github
105-
if (githubToken == null) {
104+
// if not logged into git
105+
if (gitToken == null) {
106106

107107
// show drop indication
108108
document.body.classList.add('focus');
@@ -113,8 +113,8 @@ cd.on('dragover', (ev) => {
113113

114114
cd.on('dragleave', (ev) => {
115115

116-
// if not logged into Github
117-
if (githubToken == null) {
116+
// if not logged into git
117+
if (gitToken == null) {
118118

119119
// remove drop indication
120120
document.body.classList.remove('focus');
@@ -127,8 +127,8 @@ if ('launchQueue' in window) {
127127

128128
launchQueue.setConsumer(async (launchParams) => {
129129

130-
// if not logged into Github
131-
if (githubToken == null) {
130+
// if not logged into git
131+
if (gitToken == null) {
132132

133133
// nothing to do when the queue is empty
134134
if (!launchParams.files.length) {

dark.css

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
* Colors based on Base16 Ocean Dark
44
*/
55

6-
@import url('/fonts/fonts.css');
7-
8-
96
body:not(.mobile) ::-webkit-scrollbar {
107
width: 16px;
118
height: 16px;
@@ -50,7 +47,7 @@ cd-el {
5047
color: #a6c3d4;
5148
caret-color: #fff;
5249

53-
font-family: 'Google Sans Mono', 'Roboto Mono', monospace;
50+
font-family: 'Mono Sans', 'Roboto Mono', monospace;
5451

5552
font-size: 14px;
5653
line-height: 1.5;
@@ -127,11 +124,6 @@ cd-el {
127124
color: #75bfff;
128125
}
129126

130-
.token.important,
131-
.token.bold {
132-
font-weight: 400;
133-
}
134-
135127
.token.italic {
136128
font-style: normal;
137129
}

0 commit comments

Comments
 (0)