Я попытался выяснить, как это сделать, и сдаюсь. Я пытаюсь кодировать что -то, что позволяет пользователям посещать мой веб -сайт GitHub и ввести в текстовое поле, затем веб -сайт хранит их вывод в текстовый файл, расположенный на веб -сайте. Я узнал, что вы можете использовать модуль Node.js «FS» для добавления текста в этот файл, поэтому я попытался его реализовать. Но это просто не работает, независимо от того, что я пытаюсь. Прямо сейчас это дает мне ошибку «require () не функция», и я серьезно не понимаю, в чем проблема. Любая помощь будет оценена.
OTFT: The Videogame
h1 {
font-size: 50px;
font-family: FlamingHope;
}
h2 {
font-size: 40px;
font-family: Blackentina;
}
body {
padding:0;
margin:0;
width:100%;
height:100%;
background-image: url("../images/WebsiteBackground02.png");
background-size: cover;
background-repeat: repeat-y;
background-position: center;
background-color: rgba(0,0,0,0.6);
}
p {
font-family: Tomorrow;
font-size:25px;
}
text {
font-family: Blackentina;
font-size:70px;
color:red;
offset-position:50px;
}
a {
font-family: Blackentina;
font-size: 30px;
color:red;
}
div {
display: block;
unicode-bidi: isolate;
}
@font-face {
font-family: FlamingHope;
src: url("../FlamingHope.ttf") format("opentype");
}
@font-face {
font-family: AnotherDanger;
src: url("../another danger.otf") format("opentype");
}
@font-face {
font-family: AnotherDanger;
font-weight: italics;
src: url("../another danger italics.otf") format("opentype");
}
@font-face {
font-family: Blackentina;
src: url("../Blackentina 4F.ttf") format("opentype");
}
@font-face {
font-family: Blackentina;
font-weight: italics;
src: url("../Blackentina 4F-Italic.ttf") format("opentype");
}
@font-face {
font-family: Tomorrow;
src: url("../Tomorrow.ttf") format("opentype");
}
@font-face {
font-family: Tomorrow;
font-weight: italics;
src: url("../Tomorrow-Italic.ttf") format("opentype");
}
@font-face {
font-family: Tomorrow;
font-weight: bold;
src: url("../Tomorrow-Bold.ttf") format("opentype");
}
OTFT: The Videogame
FAQ
For now, the FAQ will be stored in a file that I will check for new entries! Later on, I will update the website to display the questions.
ⓒ OTFT Studios 2024
window.submitData = submitData();
import * as require from 'https://requirejs.org/docs/release/2.3. ... require.js';
function submitData() {
var fs = require('node:fs');
let newData = "\n" + document.getElementById("inputQuestion").value;
fs.appendFile('storeduserdata.txt', newData, (err) => {
if (err) throw err;
})
}
< /code>
Я попробовал пару вещей, например, двойная проверка орфографии, или мои полуколоны, или реорганизация туда, куда все идет. Я также посоветовался с Google, чтобы попытаться найти свой путь по кодирую это, но теперь я застрял здесь.
Подробнее здесь: https://stackoverflow.com/questions/790 ... ml-website