Code
<script>
document.addEventListener("DOMContentLoaded", () => {
function openRulesModal() {
if (document.getElementById("rulesModal")) return;
const modal = document.createElement("div");
Object.assign(modal.style, {
position: "fixed", top: 0, left: 0, width: "100%", height: "100%",
background: "rgba(0,0,0,0.5)", display: "flex",
justifyContent: "center", alignItems: "center", zIndex: 9999
});
modal.id = "rulesModal";
const box = document.createElement("div");
Object.assign(box.style, {
background: "#fff", width: "480px", maxWidth: "90%",
borderRadius: "0px", boxShadow: "0 4px 12px rgba(0,0,0,0.4)",
fontFamily: "sans-serif", overflow: "hidden",
});
const header = document.createElement("div");
Object.assign(header.style, {
background: "#1a1a1a", color: "#fff", padding: "10px",
display: "flex", justifyContent: "space-between", alignItems: "center",
fontWeight: "bold", fontSize: "14px"
});
header.textContent = "რეგისტრაციის წესები";
const closeBtn = document.createElement("button");
closeBtn.textContent = "დახურვა";
Object.assign(closeBtn.style, {
background: "#c00", color: "#fff", border: "none",
padding: "5px 10px", cursor: "pointer",
borderRadius: "0px", fontWeight: "bold",
fontSize: "12px"
});
closeBtn.onmouseenter = () => closeBtn.style.background = "#900";
closeBtn.onmouseleave = () => closeBtn.style.background = "#c00";
closeBtn.onclick = closeModal;
header.appendChild(closeBtn);
const content = document.createElement("div");
Object.assign(content.style, { padding: "12px", fontSize: "12px" });
// გაფრთხილება – შავი dashed ჩარჩო
const warning = document.createElement("div");
Object.assign(warning.style, {
background: "#f8f8f8", border: "2px solid red",
color: "#000", fontWeight: "bold", fontSize: "12px",
textAlign: "center", padding: "6px", marginBottom: "6px",
borderRadius: "0px"
});
warning.textContent = "⚠️ წინა შემთხვევაში დაგედებათ ბანი საიტზე !";
content.appendChild(warning);
// შავი dashed ხაზი გაფრთხილების ქვემოთ
const hr = document.createElement("div");
Object.assign(hr.style, {
borderBottom: "1px dashed black",
margin: "4px 0"
});
content.appendChild(hr);
// წესების სია – შავი dashed ხაზებით
const rulesBox = document.createElement("ol");
Object.assign(rulesBox.style, {
margin: 0, paddingLeft: "22px", color: "red",
fontWeight: "bold", fontSize: "12px", listStyle: "decimal"
});
const rules = [
"არ გამოიყენოთ შეურაცხმყოფელი სიტყვები",
"არ დაწეროთ სპამი ან რეკლამა",
"არ გაავრცელოთ ვირუსები/ფიშინგი",
"არ დადგათ მუქარა ან ძალადობის მოწოდება",
"დაიცავით თემატიკა და პატივი ეცით სხვებს"
];
rules.forEach((rule, i) => {
const li = document.createElement("li");
li.textContent = rule;
Object.assign(li.style, {
padding: "4px 0",
borderBottom: "1px dashed black", // ყველა პუნქტს შავი dashed
marginBottom: "2px"
});
rulesBox.appendChild(li);
});
content.appendChild(rulesBox);
// ქვედა ორმაგი სისქის dashed ხაზი
const bottomHr = document.createElement("div");
Object.assign(bottomHr.style, {
});
content.appendChild(bottomHr);
box.appendChild(header);
box.appendChild(content);
modal.appendChild(box);
document.body.appendChild(modal);
function closeModal() {
modal.remove();
}
}
openRulesModal();
});
</script>