modified: Added name section

main
anthony 2 months ago
parent 214aef33ad
commit 8de3989f22

@ -30,6 +30,9 @@ def generate_html(links, social_media_data):
with open("./templates/template.html", "r") as file:
template = file.read()
# Replace the {name} placeholder with the user's name
template = template.replace("{name}", name)
# Generate button elements for each link
buttons = ""
for link in links:
@ -59,6 +62,9 @@ def generate_html(links, social_media_data):
print(f"Your Visicard '{output_file}' has been generated successfully!")
if __name__ == "__main__":
# Ask the user for their name
name = input("Please enter your name. This will be shown in the Header of the Page:")
# Load social media data
social_media_data = load_social_media_data()

@ -0,0 +1,52 @@
#!/bin/bash
conf_path="/etc/nginx/conf.d/$1.conf"
if [ -f "$conf_path" ]
then
conf_text=`cat $conf_path`
if [[ "$conf_text" == *"$2"* ]] || [[ "$conf_text" == *"localhost:$3"* ]]
then
echo "Proxy route or localhost port has been used, please manually reconfigure your Nginx configuration."
else
word="\n\n\tlocation \/$2\/ {\
\n\t\tproxy_pass http:\/\/localhost:$3\/;\
\n\t}"
match="# Insert here"
echo "$conf_text" | sed "s/$match/&$word/g" > "$conf_path"
fi
nginx -t
systemctl reload nginx
else
conf_text="server {
listen 420;
listen [::]:420;
server_name $1;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
# Insert here
location /$2/ {
proxy_pass http://localhost:$3/;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}"
echo "$conf_text" > "$conf_path"
chcon unconfined_u:object_r:httpd_config_t:s0 "$conf_path"
chown root:root "$conf_path"
nginx -t
systemctl reload nginx
fi

File diff suppressed because one or more lines are too long

@ -0,0 +1,100 @@
body {
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.button {
display: flex;
align-items: center;
padding: 15px 20px;
font-size: 18px;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s ease;
margin: 10px;
width: 200px;
text-align: center;
}
.button img {
width: 24px;
height: 24px;
margin-right: 10px;
}
@media (prefers-color-scheme: light) {
body {
color: #ff5a99;
background-color: #fff3f9;
}
.button{
color: #fff3f9;
background-color: #ffa7c7;
}
.button:hover{
background-color: #ff5a99;
}
footer{
color: #ffa7c7;
}
footer a:link{
color:#ff5a99
}
footer a:visited{
color: #ffa7c7;
}
footer a:hover{
color:#ff5a99
}
footer a:active{
color:#ff5a99
}
}
@media (prefers-color-scheme: dark) {
body {
color: #00d791;
background-color: #060606;
}
.button{
color: #060606;
background-color: #00d791;
}
.button:hover{
background-color: #00d791;
}
footer{
color: #55052c;
}
footer a:link{
color: #00d791;
}
footer a:visited{
color: #55052c;
}
footer a:hover{
color: #00d791;
}
footer a:active{
color: #00d791;
}
}

@ -4,42 +4,11 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Visicard</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f4f4f4;
}
.button {
display: flex;
align-items: center;
padding: 15px 30px;
font-size: 18px;
color: white;
background-color: #007BFF;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s ease;
margin: 10px;
width: 200px;
text-align: center;
}
.button:hover {
background-color: #0056b3;
}
.button img {
width: 24px;
height: 24px;
margin-right: 10px;
}
</style>
<link rel="stylesheet" href="style.css"
</head>
<body>
<h1>{name}'s Visicard</h1>
{links}
<footer>Powered by <a href="https://code.cif.su/anthony/visicard">Visicard</a></footer>
</body>
</html>
Loading…
Cancel
Save