Skip to content

Commit

Permalink
page update
Browse files Browse the repository at this point in the history
  • Loading branch information
abfipes12 committed Jun 8, 2023
1 parent 565ca07 commit a47cb49
Show file tree
Hide file tree
Showing 12 changed files with 319 additions and 94 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
76 changes: 76 additions & 0 deletions Other/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
function readGitHubFile() {
let fileUrl = 'https://raw.githubusercontent.com/abfipes12/7-Billion-Humans-Solutions/main/README.MD';

fetch(fileUrl)
.then(response => response.text())
.then(text => {
parse_page(text);
})
.catch(error => {
console.error('Error:', error);
});
}

class Solution {
category;
authors;

year;

size;
speed;
glitches = false;
s_rate = 99;

link;

constructor(solution_txt) {

let lines = solution_txt.split('\n');

const category_re = /\">(.+)<\/a/;
lines[1].match()

const autors_re = />(.+?)</g;
lines[2].match()

const year_re = /Year (.*) -/;
lines[1].match()

const size_re = /[0-9]+/;
lines[3].match()

const speed_re = /[0-9]+/g;
lines[4].match()

glitches = lines[1].includes('WithGliches');

if (lines[1].includes('+50')) {
s_rate = 50;
}

const link_re = /href=\"(.+)\"/;
lines[1].match()
let link = 'https://raw.githubusercontent.com/abfipes12/7-Billion-Humans-Solutions/main/README.MD';
}
//najbardziej efektywna programista
}

function parse_page(raw_page_text) {
let solutions_md = raw_page_text.split('---', 2)[1];

let years_arr = solutions_md.split('###').slice(1);

const re = /<tr>(.*?)<\/tr>/gs;

let year_solutions = years_arr[21].match(re);
let year_year = years_arr[21].match(/Year (.*) -/);

let lines = year_solutions[2].split('\n');
// lines.pop();
// lines.shift();

console.log(lines);
// document.querySelector("body").innerText = year_solutions;
// porządny pierdolec podczas poprawiania pisma programu
}
97 changes: 97 additions & 0 deletions Other/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
body {
max-width: 750px;
margin-right: auto;
margin-left: auto;

font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
font-weight: 300;

color: rgb(209, 205, 199);
background-color: rgb(24, 26, 27);
}

h1 {
font-size: 3rem;
font-weight: 400;
}

h2 {
font-size: 1rem;
}

table {
border-collapse: collapse;
width: 100%;
font-family: Arial, sans-serif;
}

th,
td {
border-top: 1px solid #555555;
padding: 8px;
text-align: center;
}

td:nth-child(-n + 1) {
text-align: left;
}


.options{
display: flex;
justify-content: space-between;
width: 90%;
max-width: 700px;
padding: 5px 20px;
/* border: 1px dotted white; */
border-radius: 30px;
}

.options > div {
display: flex;
justify-content: space-between;
padding: 0 10px;
gap: 10px;
}

.options label{
background-color: black;
color: white;
border: 1px solid;
padding: 2px 10px;
gap: 10px;
border-radius: 30px;
cursor: pointer;
}

.options input{
display: none;
}

.options input:checked + label{
font-weight: bolder;
background-color: white;
color: black;
}

/* th,
td {
border: 1px solid #ddd;
padding: 8px;
}
th {
background-color: #f2f2f2;
text-align: left;
}
tr:nth-child(-n + 1) {
background-color: #f9f9f9;
}
tr:hover {
background-color: #eaf6ff;
} */



Loading

0 comments on commit a47cb49

Please sign in to comment.