2023-03-06 13:35:09 -06:00
<!DOCTYPE html>
< html >
2023-04-23 17:14:32 -05:00
< head >
< title > Caleb Fontenot's Web Server< / title >
2023-09-11 11:32:44 -05:00
< link rel = "icon" type = "image/x-icon" href = "https://files.calebfontenot.com/C%5C%26H%20Spin.gif" >
2023-09-11 10:44:47 -05:00
< link rel = "icon" href = "https://files.calebfontenot.com/C%5C%26H%20Spin.gif" type = "image/gif" / >
2023-04-23 17:23:17 -05:00
< meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8" / >
2023-04-23 17:14:32 -05:00
< meta content = "Caleb Fontenot's Web Server" property = "og:title" / >
< meta content = "Home Page of Caleb Fontenot's Web Server" property = "og:description" / >
< meta content = "https://calebfontenot.com" property = "og:url" / >
2023-09-11 10:34:18 -05:00
< meta content = "https://files.calebfontenot.com/C%5C%26H%20Spin.gif" property = "og:image" / >
2023-04-23 17:14:32 -05:00
< meta content = "#FF0000" data-react-helmet = "true" name = "theme-color" / >
<!meta name="viewport" content="width=device-width, initial-scale=1.0">
< link href = "root.css" rel = "stylesheet" >
<!-- Google tag (gtag.js) -->
< script async src = "https://www.googletagmanager.com/gtag/js?id=G-L9QF12JY74" > < / script >
< script >
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-L9QF12JY74');
< / script >
< / head >
2023-03-06 13:35:09 -06:00
2023-03-06 14:36:22 -06:00
< body class = "center" >
2023-04-23 17:14:32 -05:00
< div id = "wrapper" >
< nav >
< h1 > Hi! Welcome to my Web Server!< / h1 >
< div class = "navborder" >
< a class = "button" href = "index.html" > Home< / a >
< a class = "button" href = "https://gitea.calebfontenot.com" > Gitea< / a >
< a class = "button" href = "https://search.calebfontenot.com" > SearXNG Instance< / a >
< a class = "button" href = "dynmap.html" > Minecraft Server Dynamic Maps< / a >
< a class = "button" href = "mario" > Mario< / a >
< / div >
< / nav >
< h2 class = "aboutme" > About me< img class = "aboutme" src = "Caleb.jpg" alt = "Caleb" height = "5%" width = "5%" > < / h2 >
2023-08-23 11:02:04 -05:00
< p > Hi! My name is < mark > Caleb Fontenot.< / mark > I am a software developer in my third semester at South Lousiana Community College. < br > I love writing code! 😁< / p >
2023-04-23 17:14:32 -05:00
< p > Pick a design!< / p >
< div id = "selectDesign" >
< input id = inputText >
< select id = "designSelections" name = "designSelections" >
< option value = "design1" > Design 1< / option >
< option value = "design2" > Design 2 (Triangle)< / option >
< option value = "design3" > Design 3 (Triangle, varient 2)< / option >
< option value = "design4" > Design 4 (Circle)< / option >
< option value = "design5" > Design 5 (Circle, varient 2)< / option >
< / select >
< input class = "button" type = "button" onclick = "drawDesign();" value = "Draw design" >
< / div >
< script >
function drawDesign() {
let event = document.getElementById('designSelections');
let value = event.options[event.selectedIndex].value;
//alert(value);
let inputText = document.getElementById("inputText").value;
let designText;
switch (value) {
case "design1":
designText = design1(inputText);
break;
case "design2":
designText = design2(inputText);
break;
case "design3":
designText = design3(inputText);
break;
case "design4":
designText = design4(inputText);
break;
case "design5":
designText = design5(inputText);
break;
}
document.getElementById("jsOutput").innerHTML = designText;
}
function design1(input) {
console.log("Running design1...");
let outputString;
let startEnd = "";
for (let i = 0; i < input.length + 2 ; i + + ) {
startEnd += "*";
}
outputString = startEnd + "< br > ";
outputString += "*" + "< br > ";
outputString += "* " + input + "< br > ";
outputString += "*" + "< br > ";
outputString += startEnd;
return outputString;
}
function design2(input) {
console.log("Running design2...");
let outputString;
let height = (input.length * 2) + 6;
let mid = Math.trunc(height / 2) + 1;
if (height % 2 == 0) {
height++;
}
outputString = "";
for (let i = 0; i < height ; i + + ) {
if (mid == i) { //Determine if we're in the middle of the triangle
outputString += "**" + input + "**";
} else {
for (let j = 0; j < i ; j + + ) {
outputString += "*";
}
}
outputString += "< br > ";
}
return outputString;
}
function design3(input) {
console.log("Running design3...");
let outputString;
let height = (input.length * 2) + 6;
let mid = Math.trunc(height / 2) + 1;
if (height % 2 == 0) {
height++;
}
outputString = "";
if (mid % 2 == 1) { // Skip a line if odd
var subOffset = 1;
var addOffset = 0;
} else {
var subOffset = 0;
var addOffset = 1;
}
for (let i = 0; i < mid - addOffset ; i + + ) {
for (let j = 0; j < i ; j + + ) {
if (i % 2 == 1) {
if (i != (mid - 1)) {
if (i == 0 || (j == 0 || j == (i - 1))) { // Check if we're at the beginning or end of the line
outputString += "*";
} else {
outputString += " ";
}
}
}
}
outputString += "< br > ";
}
outputString += "* " + input + " *< br > ";
for (let i = mid - subOffset; i > 0; i--) {
for (let j = 0; j < i ; j + + ) {
if (i % 2 == 1) {
if (j != (mid - 1) || (j != mid)) {
if ((i == 0 || (j == 0 || j == (i - 1)))) { // Check if we're at the beginning or end of the line
outputString += "*";
} else {
outputString += " ";
}
}
}
}
outputString += "< br > ";
}
return outputString;
}
function design4(input) {
let outputString = "";
let outputLine = "";
let radius = (input.length + 1);
let mid = radius;
if (mid % 2 == 1) {
var spaceOffset = " ";
} else {
var spaceOffset = "";
}
console.log(radius, mid);
// dist represents distance to the center
let dist = parseFloat(0);
let space = ""
for (let i = 0; i < (input.length / 2); ++i) {
space += " ";
}
// for horizontal movement
var i;
var j;
let lineHasInput = false;
for (i = 0; i < = 2 * radius; i++) {
lineHasInput = false;
if (Math.trunc(i) != mid) {
// for vertical movement
for (j = 0; j < = 2 * radius; j++) {
dist = Math.sqrt(
((i - radius) * (i - radius) * 4) + // (* 4) accounts for the offset between lines
(j - radius) * (j - radius)
);
//console.log(i, j, radius, dist);
// dist should be in the range (radius - 0.5)
// and (radius + 0.5) to print stars(*)
if (dist > radius - 1 & & dist < radius + 1 ) { / / & & dist > radius - 1
lineHasInput = true;
outputLine += "·"; //zero-width space
} else {
outputLine += " ";
}
}
} else {
lineHasInput = true;
outputLine += "·" + space + input + space + spaceOffset + "·"; //zero-width space
}
//console.log(i, j, outputLine);
if (lineHasInput) {
2023-04-23 17:19:19 -05:00
console.log("outputLine", outputLine);
2023-04-23 17:14:32 -05:00
outputString += outputLine + "< br > ";
}
outputLine = "";
}
return outputString;
}
var charIterateState;
function charIterate(input) {
if (charIterateState == undefined) {
charIterateState = 0;
} else {
if (charIterateState < (input.length - 1)) {
charIterateState++;
} else {
charIterateState = 0;
}
}
console.log(charIterateState, input.charAt(charIterateState));
return charIterateState;
}
function design5(input) {
let outputString = "";
let outputLine = "";
let radius = (input.length);
let mid = radius;
if (mid % 2 == 1) {
var spaceOffset = " ";
} else {
var spaceOffset = "";
}
console.log(radius, mid);
// dist represents distance to the center
let dist = parseFloat(0);
let space = ""
for (let i = 0; i < (input.length / 2); ++i) {
space += " ";
}
// for horizontal movement
var i;
var j;
let lineHasInput = false;
for (i = 0; i < = 2 * radius; i++) {
lineHasInput = false;
if (Math.trunc(i) != mid) {
// for vertical movement
for (j = 0; j < = 2 * radius; j++) {
dist = Math.sqrt(
((i - radius) * (i - radius) * 4) + // (* 4) accounts for the offset between lines
(j - radius) * (j - radius)
);
//console.log(i, j, radius, dist);
// dist should be in the range (radius - 0.5)
// and (radius + 0.5) to print stars(*)
if (dist > radius - 1 & & dist < radius + 1 ) { / / & & dist > radius - 1
lineHasInput = true;
2023-04-23 17:22:12 -05:00
outputLine += input.charAt(charIterate(input));
2023-04-23 17:14:32 -05:00
} else {
outputLine += " ";
}
}
} else {
lineHasInput = true;
outputLine += input.charAt(charIterate(input)) + space + input + space + spaceOffset + input.charAt(charIterate(input));
}
//console.log(i, j, outputLine);
if (lineHasInput) {
2023-04-23 17:19:19 -05:00
console.log("outputLine", outputLine);
2023-04-23 17:14:32 -05:00
outputString += outputLine + "< br > ";
}
outputLine = "";
}
return outputString;
}
< / script >
< p id = "jsOutput" > < / p >
2023-12-17 21:33:23 -06:00
< img id = riitag src = "https://tag.rc24.xyz/294976590658666497/tag.max.png" alt = "My RiiTag" width = 1024 >
2023-04-23 17:14:32 -05:00
< p >
< a href = "https://jigsaw.w3.org/css-validator/check/referer" >
< img style = "border:0;width:88px;height:31px" src = "https://jigsaw.w3.org/css-validator/images/vcss"
alt="Valid CSS!" />
< / a >
< / p >
< footer >
< a href = https://gitea.calebfontenot.com/CCF_100/frontpage class = button > Caleb Fontenot, 2023< / a >
< / footer >
< / div >
2023-03-06 16:28:32 -06:00
< / body >
2023-03-06 13:35:09 -06:00
2023-07-31 08:07:48 -05:00
< / html >