Tizenharmadik vizsga

This commit is contained in:
2024-12-11 19:33:24 +01:00
parent 43f8963bb3
commit b4fc743df4
7 changed files with 311 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -0,0 +1,210 @@
let font = {
m: [
" _____ ",
" / \\ ",
" / \\ / \\ ",
"/ Y \\",
"\\____|__ /",
" \\/ "
],
q: [
"________ ",
"\\_____ \\ ",
" / / \\ \\ ",
"/ \\_/. \\",
"\\_____\\ \\_/",
" \\__>"
],
w: [
" __ __ ",
"/ \\ / \\",
"\\ \\/\\/ /",
" \\ / ",
" \\__/\\ / ",
" \\/ "
],
e: [
"___________",
"\\_ _____/",
" | __)_ ",
" | \\",
"/_______ /",
" \\/ "
],
r: [
"__________ ",
"\\______ \\",
" | _/",
" | | \\",
" |____|_ /",
" \\/ "
],
t: [
"___________",
"\\__ ___/",
" | | ",
" | | ",
" |____| ",
" "
],
z: [
"__________",
"\\____ /",
" / / ",
" / /_ ",
"/_______ \\",
" \\/"
],
u: [
" ____ ___ ",
"| | \\",
"| | /",
"| | / ",
"|______/ ",
" "
],
i: [
".___ ",
"| |",
"| |",
"| |",
"|___|",
" "
],
o: [
"________ ",
"\\_____ \\ ",
" / | \\ ",
"/ | \\",
"\\_______ /",
" \\/ "
],
p: [
"__________ ",
"\\______ \\",
" | ___/",
" | | ",
" |____| ",
" "
],
a: [
" _____ ",
" / _ \\ ",
" / /_\\ \\ ",
"/ | \\",
"\\____|__ /",
" \\/ "
],
s: [
" _________",
" / _____/",
" \\_____ \\ ",
" / \\",
"/_______ /",
" \\/ "
],
d: [
"________ ",
"\\______ \\ ",
" | | \\ ",
" | ` \\",
"/_______ /",
" \\/ "
],
f: [
"___________",
"\\_ _____/",
" | __) ",
" | \\ ",
" \\___ / ",
" \\/ "
],
g: [
" ________ ",
" / _____/ ",
"/ \\ ___ ",
"\\ \\_\\ \\",
" \\______ /",
" \\/ "
],
h: [
" ___ ___ ",
" / | \\ ",
"/ ~ \\",
"\\ Y /",
" \\___|_ / ",
" \\/ "
],
j: [
" ____.",
" | |",
" | |",
"/\\__| |",
"\\________|",
" "
],
k: [
" ____ __.",
"| |/ _|",
"| < ",
"| | \\ ",
"|____|__ \\",
" \\/"
],
l: [
".____ ",
"| | ",
"| | ",
"| |___ ",
"|_______ \\",
" \\/"
],
y: [
"_____.___.",
"\\__ | |",
" / | |",
" \\____ |",
" / ______|",
" \\/ "
],
x: [
"____ ___",
"\\ \\/ /",
" \\ / ",
" / \\ ",
"/___/\\ \\",
" \\_/"
],
c: [
"_________ ",
"\\_ ___ \\ ",
"/ \\ \\/ ",
"\\ \\____",
" \\______ /",
" \\/ "
],
v: [
"____ ____",
"\\ \\ / /",
" \\ Y / ",
" \\ / ",
" \\___/ ",
" ",
],
b: [
"__________ ",
"\\______ \\",
" | | _/",
" | | \\",
" |______ /",
" \\/ "
],
n: [
" _______ ",
" \\ \\ ",
" / | \\ ",
"/ | \\",
"\\____|__ /",
" \\/ "
]
};

View File

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ASCII Art</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<h1><a href="https://en.wikipedia.org/wiki/ASCII_art">ASCII ART</a></h1>
<p>There is a bunch of randomtext here...</p>
<p>And here....</p>
<p>And here as well</p>
<h2>Types and styles</h2>
<ul>
<li>Typewriter style</li>
<li>Lite art</li>
<li>Solid art</li>
</ul>
<fieldset>
<legend>Generate your own ASCII art text!</legend>
<form action="">
<input type="text" name="" id="msg" placeholder="Enter your message">
<textarea name="" id="outdat" disabled></textarea>
<img src="./draw.png" alt="Draw" onclick="draw()">
</form>
</fieldset>
<script src="./font.js"></script>
<script src="./script.js"></script>
</body>
</html>

View File

@ -0,0 +1,36 @@
let dismissed = { 'á': 'a', 'é': 'e', 'í': 'i', 'ó': 'o', 'ö': 'o', 'ő': 'o', 'ú': 'u', 'ü': 'ű' }
function draw() {
let text = document.getElementById("msg").value.toString()
let out = document.getElementById("outdat");
let keys = [];
let lines = [];
text = text.toLowerCase();
text = formattext(text)
for (let i = 0; i < text.length; i++) {
keys.push(text[i]);
}
for (var i = 0; i < 6; i++) {
lines.push("");
for (var j = 0; j < keys.length; j++) {
lines[i] += font[text[j]][i];
}
}
out.textContent = "";
for (i in lines) {
out.textContent += lines[i] + "\n"
}
}
function formattext(text) {
let text2 = "";
for (i in text) {
if (text[i] in dismissed) {
text2 += dismissed[text[i]];
} else {
text2 += text[i]
}
}
return text2;
}

View File

@ -0,0 +1,30 @@
body {
max-width: 800px;
margin: auto;
padding: 1cm;
}
@font-face {
font-family: ThisWillBeMine;
src: url("./zilap.ttf");
}
h1 {
font-family: ThisWillBeMine;
}
p {
text-align: justify;
text-wrap: auto;
}
textarea {
width: 100%;
height: 10cm;
text-wrap: nowrap;
}
img {
width: calc(100%/4);
}

Binary file not shown.