mirror of
https://github.com/tavo-wasd-gh/conex-builder.git
synced 2025-06-07 12:13:30 -06:00
init
This commit is contained in:
parent
536cae2451
commit
233b7fe659
11 changed files with 325 additions and 93 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
public/submit/*
|
93
README.md
93
README.md
|
@ -1,93 +0,0 @@
|
|||
# conexiones-builder
|
||||
|
||||
|
||||
|
||||
## Getting started
|
||||
|
||||
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
||||
|
||||
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
||||
|
||||
## Add your files
|
||||
|
||||
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
||||
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
||||
|
||||
```
|
||||
cd existing_repo
|
||||
git remote add origin https://gitlab.com/tavo-wasd/conexiones-builder.git
|
||||
git branch -M main
|
||||
git push -uf origin main
|
||||
```
|
||||
|
||||
## Integrate with your tools
|
||||
|
||||
- [ ] [Set up project integrations](https://gitlab.com/tavo-wasd/conexiones-builder/-/settings/integrations)
|
||||
|
||||
## Collaborate with your team
|
||||
|
||||
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
||||
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
||||
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
||||
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
||||
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
||||
|
||||
## Test and Deploy
|
||||
|
||||
Use the built-in continuous integration in GitLab.
|
||||
|
||||
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
||||
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
||||
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
||||
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
||||
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
||||
|
||||
***
|
||||
|
||||
# Editing this README
|
||||
|
||||
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
||||
|
||||
## Suggestions for a good README
|
||||
|
||||
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
||||
|
||||
## Name
|
||||
Choose a self-explaining name for your project.
|
||||
|
||||
## Description
|
||||
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
||||
|
||||
## Badges
|
||||
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
||||
|
||||
## Visuals
|
||||
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
||||
|
||||
## Installation
|
||||
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
||||
|
||||
## Usage
|
||||
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
||||
|
||||
## Support
|
||||
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
||||
|
||||
## Roadmap
|
||||
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
||||
|
||||
## Contributing
|
||||
State if you are open to contributions and what your requirements are for accepting them.
|
||||
|
||||
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
||||
|
||||
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
||||
|
||||
## Authors and acknowledgment
|
||||
Show your appreciation to those who have contributed to the project.
|
||||
|
||||
## License
|
||||
For open source projects, say how it is licensed.
|
||||
|
||||
## Project status
|
||||
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
43
public/form.js
Normal file
43
public/form.js
Normal file
|
@ -0,0 +1,43 @@
|
|||
// Handle form submission after filling out the dialog
|
||||
document.getElementById('openDialogButton').addEventListener('click', () => {
|
||||
document.getElementById('dialog').style.display = 'block';
|
||||
});
|
||||
|
||||
document.getElementById('submitDialogButton').addEventListener('click', () => {
|
||||
const form = document.getElementById('mainForm');
|
||||
const name = document.getElementById('name').value;
|
||||
const email = document.getElementById('email').value;
|
||||
const phone = document.getElementById('phone').value;
|
||||
|
||||
// Append additional fields to the form
|
||||
const nameInput = document.createElement('input');
|
||||
nameInput.type = 'hidden';
|
||||
nameInput.name = 'name';
|
||||
nameInput.value = name;
|
||||
form.appendChild(nameInput);
|
||||
|
||||
const emailInput = document.createElement('input');
|
||||
emailInput.type = 'hidden';
|
||||
emailInput.name = 'email';
|
||||
emailInput.value = email;
|
||||
form.appendChild(emailInput);
|
||||
|
||||
const phoneInput = document.createElement('input');
|
||||
phoneInput.type = 'hidden';
|
||||
phoneInput.name = 'phone';
|
||||
phoneInput.value = phone;
|
||||
form.appendChild(phoneInput);
|
||||
|
||||
// Submit
|
||||
form.submit();
|
||||
});
|
||||
|
||||
// Cancel button
|
||||
document.getElementById('cancelDialogButton').addEventListener('click', () => {
|
||||
// Clear values
|
||||
document.getElementById('name').value = '';
|
||||
document.getElementById('email').value = '';
|
||||
document.getElementById('phone').value = '';
|
||||
// Hide dialog
|
||||
document.getElementById('dialog').style.display = 'none';
|
||||
});
|
54
public/index.html
Normal file
54
public/index.html
Normal file
|
@ -0,0 +1,54 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<title>Builder | CONEX.one </title>
|
||||
<link rel="canonical" href="https://builder.conex.one">
|
||||
<link rel='stylesheet' type='text/css' href='/style.css'>
|
||||
<link rel="icon" href="favicon.png">
|
||||
<meta name="description" content="Constructor de sitios web de CONEX.one">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="index, follow">
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="/static/css/simplemde.min.css">
|
||||
<link rel="stylesheet" href="/static/css/simplemde-dark.min.css">
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
</head>
|
||||
<form action="submit.php" method="post">
|
||||
<div class="banner" style="background-image: url(/static/banner.jpg);">
|
||||
<div class="desc">
|
||||
<input type="text" name="title" class="input-title" placeholder="[Nombre Ejemplo]">
|
||||
<input type="text" name="slogan" class="input-slogan" placeholder="[Slogan llamativo o breve descripción]">
|
||||
<button type="button" id="openDialogButton">Solicitar sitio web</button>
|
||||
</div>
|
||||
</div>
|
||||
<body>
|
||||
<div id="content" class="content">
|
||||
<div id="editor-container">
|
||||
<textarea id="editor" name="editor" lang="es"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<div id="dialog">
|
||||
<h2>Ingrese sus detalles</h2>
|
||||
<p>Utilizaremos esta información para contactarle acerca de la publicación del sitio.</p>
|
||||
<input type="text" id="name" name="name" placeholder="Nombre completo" required>
|
||||
<input type="tel" id="phone" name="phone" placeholder="Número de teléfono" required>
|
||||
<input type="email" id="email" name="email" placeholder="Correo electrónico" required>
|
||||
<button id="submitDialogButton">Enviar solicitud</button>
|
||||
<button id="cancelDialogButton">Cancelar</button>
|
||||
</div>
|
||||
</form>
|
||||
<script src="/static/js/simplemde.min.js"></script>
|
||||
<script>
|
||||
var simplemde = new SimpleMDE({
|
||||
element: document.getElementById("editor"),
|
||||
toolbar: ["preview", "|", "heading", "bold", "italic", "unordered-list", "ordered-list", "|", "link", "image", "table"],
|
||||
spellChecker: false,
|
||||
});
|
||||
simplemde.value("# Bienvenido a [Empresa]\n\nUbicados en [Dirección de la Empresa]\n\n✉️ contacto@empresa.com\n☎️ +506 8888 8888\n\n# Servicios\n\n| Servicio | Descripción | Monto |\n| -------- | ----------- | --------- |\n| Uno | Una | 1.000,00 |\n| Dos | Breve | 10.000,00 |\n| Tres | Explicación | 7.500,00 |\n\n\n\n# Acerca de Nosotros\n\nEn [Empresa], nos especializamos en [breve descripción de tus servicios/productos]. Nuestro equipo está dedicado a ofrecer [propuesta de valor o punto de venta único].\n\n# Síguenos\n\n[Facebook](https://facebook.com) | [Instagram](https://instagram.com)\n");
|
||||
document.getElementById('openDialogButton').addEventListener('click', () => {
|
||||
document.getElementById('dialog').style.display = 'block';
|
||||
});
|
||||
</script>
|
||||
<script src="/form.js"></script>
|
||||
</html>
|
BIN
public/static/banner.jpg
Normal file
BIN
public/static/banner.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
1
public/static/css/simplemde-dark.min.css
vendored
Normal file
1
public/static/css/simplemde-dark.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
7
public/static/css/simplemde.min.css
vendored
Normal file
7
public/static/css/simplemde.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
162
public/static/css/style.css
Normal file
162
public/static/css/style.css
Normal file
|
@ -0,0 +1,162 @@
|
|||
:root {
|
||||
--background-color: white;
|
||||
--color: black;
|
||||
--page-width: 768px;
|
||||
--navbar-width: 50%;
|
||||
--font-family: sans-serif;
|
||||
--logo: url('logo.png');
|
||||
--unemph-color: #505050;
|
||||
--hover-background: #dcdcdc;
|
||||
--hover-border: #aaa;
|
||||
--line-height: 1.7;
|
||||
--smaller-font: 0.75em;
|
||||
--hyper-color: #0f82af;
|
||||
text-align: justify;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--background-color: #1d2021;
|
||||
--color: white;
|
||||
--hover-background: #282c2d;
|
||||
--unemph-color: #909090;
|
||||
--hover-border: #505050;
|
||||
--hyper-color: #00b4db;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
:root {
|
||||
--page-width: 90%;
|
||||
--navbar-width: 50vh;
|
||||
}
|
||||
}
|
||||
|
||||
html {
|
||||
background-color: var(--background-color);
|
||||
color: var(--color);
|
||||
font-family: var(--font-family);
|
||||
line-height: var(--line-height);
|
||||
}
|
||||
|
||||
html, body {
|
||||
margin: 0 auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--hyper-color);
|
||||
}
|
||||
|
||||
.banner {
|
||||
padding: 6vh;
|
||||
box-shadow: 0 15vh 30vh black inset;
|
||||
background-position: 50%;
|
||||
background-size: cover;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.input-title {
|
||||
font-size: 2em;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
background-color: #00000000;
|
||||
border-color: #00000000;
|
||||
color: white;
|
||||
margin-bottom: -0.2em;
|
||||
}
|
||||
|
||||
.input-slogan {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
background-color: #00000000;
|
||||
border-color: #00000000;
|
||||
color: white;
|
||||
line-height: 1em;
|
||||
margin: 0.5em auto 0em auto;
|
||||
}
|
||||
|
||||
div.profilepicture img {
|
||||
display: flex;
|
||||
margin: 0 auto;
|
||||
margin-top: 2em;
|
||||
width: 50%;
|
||||
max-width: 250px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1 0 auto;
|
||||
margin: 0 auto;
|
||||
max-width: 800px;
|
||||
width: 90%;
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
.content li {
|
||||
line-height: 1.4em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.content p {
|
||||
line-height: 1.4em;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
.content img {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
footer {
|
||||
background-color: var(--hover-background);
|
||||
color: var(--unemph-color);
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
margin: 1em auto 0 auto;
|
||||
padding-top: 1em;
|
||||
padding-bottom: 1em;
|
||||
}
|
||||
|
||||
/* Hidden dialog styles */
|
||||
#dialog {
|
||||
max-width: 400px;
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 15%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
padding: 20px;
|
||||
background: white;
|
||||
border: 1px solid #ccc;
|
||||
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
||||
}
|
||||
#dialog input {
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
#dialog button {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/* Custom SimpleMDE styling */
|
||||
.CodeMirror {
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
font-size: 1.2em;
|
||||
font-family: monospace;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.editor-preview {
|
||||
font-size: 1em;
|
||||
font-family: sans-serif;
|
||||
}
|
15
public/static/js/simplemde.min.js
vendored
Normal file
15
public/static/js/simplemde.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
public/static/sample.jpg
Normal file
BIN
public/static/sample.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 114 KiB |
42
public/submit.php
Normal file
42
public/submit.php
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$date = new DateTime();
|
||||
$isoDate = $date->format(DateTime::ISO8601);
|
||||
|
||||
$directory = "submit/";
|
||||
$filename = "$isoDate.md";
|
||||
$filePath = $directory . $filename;
|
||||
|
||||
if (!is_dir($directory)) {
|
||||
mkdir($directory, 0755, true);
|
||||
}
|
||||
|
||||
$title = isset($_POST["title"]) ? $_POST["title"] : "";
|
||||
$slogan = isset($_POST["slogan"]) ? $_POST["slogan"] : "";
|
||||
$name = isset($_POST["name"]) ? $_POST["name"] : "";
|
||||
$email = isset($_POST["email"]) ? $_POST["email"] : "";
|
||||
$phone = isset($_POST["phone"]) ? $_POST["phone"] : "";
|
||||
|
||||
$editorContent = isset($_POST["editor"]) ? $_POST["editor"] : "";
|
||||
$editorContent = str_replace("\r\n", "\n", $editorContent); // Convert CRLF to LF
|
||||
$editorContent = str_replace("\r", "\n", $editorContent); // Convert CR to LF
|
||||
|
||||
$content = <<<EOD
|
||||
---
|
||||
date: $isoDate
|
||||
author: "$name <$email> <$phone>"
|
||||
title: "$title"
|
||||
description: "$slogan"
|
||||
layout: single
|
||||
---
|
||||
|
||||
$editorContent
|
||||
EOD;
|
||||
|
||||
$file = "$isoDate.md";
|
||||
file_put_contents($filePath, $content);
|
||||
echo "Done";
|
||||
} else {
|
||||
echo "Error";
|
||||
}
|
||||
?>
|
Loading…
Reference in a new issue