Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c46c094
Update oembed.js
benhatsor Oct 25, 2022
6683d16
Update bottomfloat.js
benhatsor Oct 25, 2022
e2d3964
Update codedrop.js
benhatsor Oct 25, 2022
f1c064b
Update dark-theme.css
benhatsor Oct 25, 2022
ae7b18e
Update filebrowser.js
benhatsor Oct 25, 2022
ed1698e
Update filebrowser.js
benhatsor Oct 25, 2022
aa95209
Update full.css
benhatsor Oct 25, 2022
9491f68
Update markdown-dark.css
benhatsor Oct 25, 2022
023872d
Update 404.html
benhatsor Oct 25, 2022
db7bc80
Update markdown-light.css
benhatsor Oct 25, 2022
416625e
Update markdown-dark.css
benhatsor Oct 25, 2022
d5636bd
Update redirect.html
benhatsor Oct 25, 2022
d40ddec
Update homepage.css
benhatsor Oct 25, 2022
35c54dc
Update codeit-autocomplete.js
benhatsor Oct 25, 2022
c58ee8c
Update codeit-autocomplete.js
benhatsor Oct 25, 2022
aecfb8e
Update markdown-dark.css
benhatsor Oct 25, 2022
4e7044c
Rename markdown-light.css to markdown-light-alt.css
benhatsor Oct 25, 2022
bcfa7c3
Update service-worker.js
benhatsor Oct 25, 2022
61c9380
Update spotlightsearch.js
benhatsor Oct 25, 2022
703b053
Update tests.js
benhatsor Oct 25, 2022
5f8c5bb
Update utils.js
benhatsor Oct 25, 2022
d754496
Update client-channel.js
benhatsor Oct 25, 2022
51468c9
Update codedrop.js
benhatsor Oct 25, 2022
6b6d276
Update codeit-autocomplete.js
benhatsor Oct 25, 2022
441345f
Update utils.js
benhatsor Oct 25, 2022
41d8279
Update utils.js
benhatsor Oct 25, 2022
bcb0165
Update client-channel.js
benhatsor Oct 25, 2022
48b5a61
Update codedrop.js
benhatsor Oct 25, 2022
4969c0d
Update client-channel.js
benhatsor Oct 25, 2022
936d83f
Update codedrop.js
benhatsor Oct 25, 2022
57ea3de
Update codedrop.js
benhatsor Oct 25, 2022
9dec76c
Update utils.js
benhatsor Oct 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
text-rendering: optimizeLegibility;
font-feature-settings: "kern";
-webkit-font-feature-settings: "kern";
touch-action: manipulation;
font-synthesis: none;
overscroll-behavior: none;
user-select: none;
-webkit-user-select: none;
Expand Down
2 changes: 1 addition & 1 deletion api/oembed.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function handler(request, response) {
"width": 700,
"height": 480,
"html": embedHTML,
"version": "1.0",
"version": "2.0",
"cache_age": 3600,
"provider_name": "Codeit",
"provider_url": "https://codeit.codes/"
Expand Down
4 changes: 2 additions & 2 deletions bottomfloat.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ function checkBottomFloat() {
bottomWrapper.classList.add('hidden');

// if scrolled to bottom of codeit
if ((st + cd.offsetHeight) >= cd.scrollHeight) {
if (cd.scrollTop >= (cd.scrollHeight - cd.offsetHeight)) {

// set timeout
window.setTimeout(() => {

// if still on bottom of codeit
if ((cd.scrollTop + cd.offsetHeight) >= cd.scrollHeight) {
if (cd.scrollTop >= (cd.scrollHeight - cd.offsetHeight)) {

// show bottom float
bottomWrapper.classList.remove('hidden');
Expand Down
136 changes: 106 additions & 30 deletions codedrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,71 @@ function processFile(file) {

showMessage('Opening file...', -1);


cd.style.display = 'none';

if (liveToggle.classList.contains('visible')) {

liveToggle.classList.remove('visible');

}

if (liveView.classList.contains('file-open')) {

liveView.classList.add('notransition');
liveView.classList.remove('file-open');

onNextFrame(() => {
liveView.classList.remove('notransition');
});

}

// clear existing selections in HTML
if (fileWrapper.querySelector('.selected')) {
fileWrapper.querySelector('.selected').classList.remove('selected');
}

// if adding a new file, remove it
if (fileWrapper.querySelector('.focused')) {

fileWrapper.querySelector('.focused').classList.add('hidden');

window.setTimeout(() => {
fileWrapper.querySelector('.focused').remove();
}, 180);

}


// show all files in HTML
let files = fileWrapper.querySelectorAll('.item[style="display: none;"]');
files.forEach(file => {
file.style.display = ''
});

header.classList.remove('searching');


// if previous file selection exists
if (selectedFile.sha) {

// get previous selection in modifiedFiles array
let selectedItem = modifiedFiles[selectedFile.sha];

// if previous selection was modified
if (selectedItem) {

// save previous selection in localStorage
updateModFileContent(selectedFile.sha, selectedFile.content);
updateModFileCaretPos(selectedFile.sha, selectedFile.caretPos);
updateModFileScrollPos(selectedFile.sha, selectedFile.scrollPos);

}

}


const reader = new FileReader();

reader.addEventListener('load', (event) => {
Expand Down Expand Up @@ -188,11 +253,11 @@ function processFile(file) {
updateLineNumbersHTML();

if (liveToggle.classList.contains('visible')) {

liveToggle.classList.remove('visible');

}

if (liveView.classList.contains('file-open')) {

liveView.classList.add('notransition');
Expand All @@ -201,9 +266,11 @@ function processFile(file) {
onNextFrame(() => {
liveView.classList.remove('notransition');
});

}

cd.style.display = '';


hideMessage();

Expand Down Expand Up @@ -233,28 +300,31 @@ body.addEventListener('drop', (ev) => {


if (ev.dataTransfer.items) {

// if dropped item isn't a file, reject it
if (ev.dataTransfer.items[0] &&
ev.dataTransfer.items[0].kind === 'file') {

// use DataTransferItemList interface to access the file(s)
for (var i = 0; i < ev.dataTransfer.items.length; i++) {

// if dropped items aren't files, reject them
if (ev.dataTransfer.items[i].kind === 'file') {

var file = ev.dataTransfer.items[i].getAsFile();
processFile(file);

}
// process file
const file = ev.dataTransfer.items[0].getAsFile();
processFile(file);

}

/*
// run on all files
for (let i = 0; i < ev.dataTransfer.items.length; i++) {
*/

} else {

// use DataTransfer interface to access the file(s)
for (var i = 0; i < ev.dataTransfer.files.length; i++) {

processFile(ev.dataTransfer.files[i]);

}

// process file
processFile(ev.dataTransfer.files[0]);

/*
// run on all files
for (let i = 0; i < ev.dataTransfer.files.length; i++) {
*/

}

Expand All @@ -264,19 +334,25 @@ body.addEventListener('dragover', (ev) => {

// prevent default behavior (prevent file from being opened)
ev.preventDefault();

// if dropping a file
if (ev.dataTransfer.items[0] &&
ev.dataTransfer.items[0].kind === 'file') {

// show drop indication
// show drop indication

if (!liveView.classList.contains('file-open')) {

cd.classList.add('focus');

} else {

liveView.classList.add('focus');
if (!liveView.classList.contains('file-open')) {

cd.classList.add('focus');

} else {

liveView.classList.add('focus');

}

}

})

body.addEventListener('dragleave', (ev) => {
Expand Down
24 changes: 16 additions & 8 deletions dark-theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,27 @@ body:not(.mobile) ::-webkit-scrollbar-thumb:active {
.cd-wrapper .autocomplete {
background: hsl(218deg 23% 35%);
color: #a6c3d4;
margin-top: 22.5px;
margin-top: 23px;
margin-top: 21px;
margin-left: -3px;
font-family: 'Mono Sans', 'Roboto Mono', consolas, lucida console, courier new, monospace;
line-height: 1.5;
padding: 0;
box-shadow: none;
position: fixed;
z-index: 1000;
border-radius: 7px;
border-radius: 8px;
border-radius: 7.5px;
border: 1px solid hsl(219deg 22% 38%);
border: 2.5px solid transparent;
pointer-events: none;
overflow-y: overlay;
min-width: 62px;
/* max-width: 190px; */
max-height: 252px;
/* max-width: 190px;
max-height: 224px;
max-height: 129px; */
max-height: 140px;
/* box-shadow: 0px 3px 6px 1px hsl(221deg 16% 20%); */
box-shadow: 0px 3px 6px 1px hsl(221deg 16% 21%);
display: none;
}

Expand All @@ -72,7 +77,7 @@ body:not(.mobile) ::-webkit-scrollbar-thumb:active {

.cd-wrapper .autocomplete .icon {
padding: 2px;
border-radius: 4px;
border-radius: 5px;
white-space: nowrap;
overflow-x: overlay;
}
Expand All @@ -94,9 +99,11 @@ body:not(.mobile) .autocomplete::-webkit-scrollbar-track {
}

body:not(.mobile) .autocomplete::-webkit-scrollbar-thumb {
border-top-width: 9px;
border-bottom-width: 9px;
background-color: rgb(249 249 249 / 15%);
border-top-width: 5px;
border-bottom-width: 5px;
border-left-width: 5px;
border-right-width: 3px;
}

.cd-wrapper .top-hit {
Expand Down Expand Up @@ -351,3 +358,4 @@ span.inline-color::after {
span.inline-color-wrapper:hover span.inline-color::after {
box-shadow: 0 0 0 1px hsl(221deg 12% 67%), inset 0 0 0 1px #313744;
}

14 changes: 12 additions & 2 deletions filebrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ async function renderSidebarHTML() {
// stop loading
stopLoading();

showMessage('Whoops, your Github login expired.', 5000);
showMessage('Whoops, your Git login expired.', 5000);

sidebar.classList.add('intro');

Expand Down Expand Up @@ -2648,10 +2648,20 @@ if (isDev) {
// load git token from clipboard
async function loadGitToken() {

gitToken = await readClipboard();
const clipboardText = (await readClipboard()).split(',');

if (clipboardText.length !== 2) return;

gitToken = clipboardText[0];

// save git token in local storage
saveGitTokenLS(gitToken);

loggedUser = clipboardText[1];

// save logged user in local storage
setStorage('loggedUser', loggedUser);

hideDialog();

// close intro and learn pages
Expand Down
5 changes: 3 additions & 2 deletions full.css
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ body.expanded .sidebar-toggle svg .left {
transform: none;
overflow-x: hidden;
overflow-y: overlay;
overscroll-behavior-y: contain;
pointer-events: none;
box-shadow: inset -1px 0 0 0 #ffffff3d;
padding-left: env(safe-area-inset-left);
Expand Down Expand Up @@ -1559,7 +1560,7 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {

body.mobile .sidebar .button {
transition: .1s var(--ease-function);
transition-property: background, color;
transition-property: background, color, box-shadow;
}

.sidebar .button.secondary {
Expand Down Expand Up @@ -2532,7 +2533,7 @@ html, body {
text-rendering: optimizeLegibility;
font-feature-settings: "kern";
-webkit-font-feature-settings: "kern";
touch-action: none;
font-synthesis: none;
overscroll-behavior: none;
user-select: none;
-webkit-user-select: none;
Expand Down
11 changes: 8 additions & 3 deletions homepage/homepage.css
Original file line number Diff line number Diff line change
Expand Up @@ -4896,16 +4896,21 @@ body {

}

body {
html, body {
text-rendering: optimizeLegibility;
font-feature-settings: "kern";
-webkit-font-feature-settings: "kern";
touch-action: none;
font-synthesis: none;
overscroll-behavior: none;
user-select: text;
-webkit-user-select: text;
-webkit-touch-callout: none;
-webkit-font-smoothing: antialiased;
-webkit-tap-highlight-color: transparent;
-webkit-text-size-adjust: 100%;
-webkit-overflow-scrolling: touch;
overscroll-behavior: none;
overscroll-behavior-y: contain;
-webkit-text-size-adjust: none;
}

::selection {
Expand Down
Loading