-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
319 additions
and
94 deletions.
There are no files selected for viewing
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} */ | ||
|
||
|
||
|
Oops, something went wrong.