lafclient / lafclient.github.io Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://laf.tokyo
License: MIT License
Home Page: https://laf.tokyo
License: MIT License
Came up with an idea for the site background; have a scroll animation that shows all the client source code. Wrote a quick snippet for the general idea. It's possible but I won't work on it unless I get a green light for it.
const repo = 'LaFClient/LaF';
// Get all files in LaF repository
fetch(`https://api.github.com/repos/${ repo }/git/trees/master?recursive=1`)
.then(res => res.json())
.then(async (data) => {
const tasks = [];
data.tree.forEach(function(treefile) {
const path = treefile.path;
const size = treefile.size;
const isFile = treefile.type === 'blob';
// Is file in app folder and is it a js, svg, css or html file
if (isFile && path.startsWith('app/') && /(js|svg|css|html)(\?.+)?$/.test(path)) {
// Is the file reasonably small
if (size > 0 && size < 30_000) {
// Plaintext file url
const url = `https://raw.githubusercontent.com/${ repo }/master/${ path }`;
tasks.push(fetch(url)
.then(file => file.text())
.then(text => {
const name = url.split('/');
return {
file: name[name.length - 1].replace(/\?.+$/, ''),
text: text
};
})
);
}
}
});
const docs = await Promise.all(tasks);
// Create div with file title and contents, syntax highlight the item and have background scroll animation with them
});
Get the javascript, css, html and svg files in the app
folder and make an opaque scrolling background with them. The snippet gets the file contents and file name, the rest should be a piece of cake :)
PS: I already have a super fast syntax highlighter for css, html and javascript.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.