Skip to content

Commit

Permalink
form font functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
owsko committed Jul 7, 2024
1 parent eb0eaf4 commit 59a2d2b
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
20 changes: 18 additions & 2 deletions pages/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@

<link rel="icon" href="media/favicons/favicon-32x32.png" />

<!-- Yarndings (font)-->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Yarndings+20&display=swap"
rel="stylesheet"
/>

<title>sertcoat.xyz \ CONTACT</title>
</head>

Expand Down Expand Up @@ -44,7 +52,7 @@ <h1 class="prevent" id="header-h1">&gt;.&lt;</h1>
</header>

<div class="prevent" id="form">
<form action="https://formsubmit.co/9e62680af5003eec1d00872224ed336d" method="POST">
<form action="https://formsubmit.co/9e62680af5003eec1d00872224ed336d" method="POST" class="form">

<!-- Honeypot -->
<input type="text" name="_honey" style="display: none;">
Expand All @@ -58,30 +66,36 @@ <h1 class="prevent" id="header-h1">&gt;.&lt;</h1>
<input
type="text"
name="name"
id="name"
placeholder="Name*"
autocomplete="off"
class="randomfont"
required
/>
<input
type="email"
name="email"
id="email"
placeholder="Email*"
autocomplete="off"
class="randomfont"
required
/>
<input
type="tel"
name="number"
placeholder="Number"
autocomplete="off"
style="appearance: textfield"
style="appearance: textfield;"
class="randomfont"
/>
<textarea
name="message"
id="messageValue"
rows="5"
cols="60"
placeholder="Message*"
class="randomfont"
required
></textarea>
<button type="submit">__φ(..)</button>
Expand All @@ -93,5 +107,7 @@ <h1 class="prevent" id="header-h1">&gt;.&lt;</h1>
<script src="../scripts/script_eraseText.js"></script>
<script src="../scripts/script_menuIcon.js"></script>

<script src="../scripts/script_randomFonts.js"></script>

</body>
</html>
10 changes: 9 additions & 1 deletion pages/folders/sourcecode.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@
<link rel="stylesheet" href="../../stylesheets/common.css" />
<link rel="stylesheet" href="../../stylesheets/sourcecode.css" />

<!-- Yarndings (font)-->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Yarndings+20&display=swap"
rel="stylesheet"
/>

<title>folder2</title>
</head>

<body>
<div>
<textarea name="SOURCECODE" readonly>
<textarea name="SOURCECODE" id="randomfont" readonly>
<!DOCTYPE html>
<html lang="en">
<head>
Expand Down
12 changes: 12 additions & 0 deletions scripts/script_randomFonts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const fontType = ["'Yarndings 20'"];
const font_sub = document.querySelector(".form");

font_sub.addEventListener("submit", function randomizeFont() {
let fontEl = document.getElementsByClassName("randomfont");

var num;
num = Math.floor(Math.random() * fontType.length);
for (let i = 0; i < fontEl.length; i++) {
fontEl[i].style.fontFamily = fontType[num];
}
});
3 changes: 1 addition & 2 deletions scripts/script_randomHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ function randomEmoticon() {
headerEl.textContent = emoticon[i];
}

randomEmoticon();

randomEmoticon();
1 change: 1 addition & 0 deletions stylesheets/contact.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ input {
width: 70%;
margin-left: 12%;
font-size: 18px;
font-family: monospace;
padding: 9px 9px; /* remove?? */
border-radius: 4px;
border-left-width: 0px;
Expand Down

0 comments on commit 59a2d2b

Please sign in to comment.