This commit is contained in:
edsea
2024-12-25 17:05:50 +01:00
commit 1f76a04566
43 changed files with 2542 additions and 0 deletions

1127
rss/css/main.css Normal file

File diff suppressed because it is too large Load Diff

1
rss/css/main.css.map Normal file

File diff suppressed because one or more lines are too long

657
rss/css/main.scss Normal file
View File

@@ -0,0 +1,657 @@
@import url('https://fonts.googleapis.com/css2?family=Arima:wght@100..700&display=swap');
*,
*::before,
*::after {
box-sizing: border-box;
font-family: "Arima", system-ui;
}
body {
margin: 0;
padding: 0;
}
$gutter-width: 30px;
$breakpoints: (
"s": 320px,
"sm": 576px,
"md": 768px,
"lg": 992px,
"xl": 1200px,
"xxl": 1400px
);
// Define max-width for each breakpoint
$max-widths: (
"sm": 540px, // Set a specific max-width for small screens
"md": 720px, // Set a specific max-width for medium screens
"lg": 960px, // Set a specific max-width for large screens
"xl": 1140px, // Existing value for extra large screens
"xxl": 1320px // Existing value for extra large screens
);
.container {
width: 100%;
padding-right: $gutter-width / 2;
padding-left: $gutter-width / 2;
margin-right: auto;
margin-left: auto;
@each $breakpoint, $value in $breakpoints {
@media (min-width: #{$value}) {
max-width: map-get($max-widths, $breakpoint); // Use the defined max-widths
}
}
}
/**
Margins
**/
.mt-10{
margin-top:100px;
}
// Padding
.p-0{
padding: 0;
}
.p-20{
padding:20px;
}
// Text
.text-center{
text-align: center;
}
.row {
display: flex;
flex-wrap: wrap;
margin-right: -$gutter-width / 2;
margin-left: -$gutter-width / 2;
}
// Default column classes (no media queries)
@for $i from 1 through 12 {
.col-#{$i} {
flex: 0 0 #{(100% / 12) * $i};
max-width: #{(100% / 12) * $i};
padding-right: $gutter-width / 2;
padding-left: $gutter-width / 2;
}
}
.col-auto {
flex: 0 0 auto;
width: auto;
}
// Media queries for specific breakpoints
@each $breakpoint, $value in $breakpoints {
@media (min-width: #{$value}) {
.col-#{$breakpoint}-auto {
flex: 0 0 auto;
width: auto;
}
@for $i from 1 through 12 {
.col-#{$breakpoint}-#{$i} {
flex: 0 0 #{(100% / 12) * $i};
max-width: #{(100% / 12) * $i};
padding-right: $gutter-width / 2;
padding-left: $gutter-width / 2;
}
}
}
}
.blue-banner{
background-color: #5a7489;
color: #fff;
}
.col {
flex: 1;
padding-right: $gutter-width / 2;
padding-left: $gutter-width / 2;
}
.justify-content-center{
justify-content: center;
}
.align-items-center{
align-items: center;
}
.align-self-center{
align-self: center;
}
.d-flex{
display:flex;
}
.h-auto{
height:auto !important;
min-height: auto !important;
max-height: auto !important;
}
.image-container{
width: 100%;
position: relative;
@media(max-width:768px){
padding:10px;
}
img{
width: 100%;
border-radius: 12px;
.shadow{
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
}
}
// Menu
.navbar {
background-color: #fff;
padding: 5px 10px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
position: relative;
z-index: 10;
.container {
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 auto;
}
.logo {
img {
width: 125px;
}
}
.nav-links {
list-style: none;
display: flex;
gap: 1.5rem;
li {
a {
text-decoration: none;
color: #333;
font-size: 1rem;
font-weight: 500;
padding: 0.3rem 0.8rem;
border-radius: 4px;
transition: background-color 0.3s ease, color 0.3s ease;
&:hover {
background-color: #f0f0f0;
color: #6d6d6d;
}
}
}
}
.burger {
display: none;
cursor: pointer;
flex-direction: column;
gap: 0.3rem;
span {
width: 28px;
height: 2px;
background-color: #333;
border-radius: 2px;
transition: transform 0.3s ease, opacity 0.3s ease;
}
}
@media screen and (max-width: 768px) {
.nav-links {
display: none;
flex-direction: column;
position: absolute;
top: 100%;
right: 0;
background-color: #fff;
width: 100%;
padding: 0rem 0.5rem;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
opacity: 0;
transform: translateY(-10px);
transition: opacity 0.3s ease, transform 0.3s ease;
border-radius: 0px 0px 8px 8px;
margin: 0;
gap: 15px;
padding: 10px 0px;
li {
// margin-bottom: 0.1rem;
text-align: left;
a {
font-size: 1.1rem;
font-weight: 500;
color: #333;
// padding: 0.8rem;
text-align: center;
border-radius: 4px;
display: block;
margin: 0;
padding:0;
text-align: left;
padding: 0px 20px;
&:hover {
background-color: #f0f0f0;
}
}
}
&.nav-active {
display: flex;
opacity: 1;
transform: translateY(0);
}
}
.burger {
display: flex;
&.toggle span:nth-child(1) {
transform: rotate(-45deg) translate(-5px, 6px);
}
&.toggle span:nth-child(2) {
opacity: 0;
}
&.toggle span:nth-child(3) {
transform: rotate(45deg) translate(-5px, -6px);
}
}
}
}
// Home banner
.landing-banner {
background: url('/rss/img/people.jpg') no-repeat center center/cover;
background-attachment: fixed;
min-height: 100vh;
position: relative;
color: #fff;
.overlay {
background-color: rgba(0, 0, 0, 0.5);
height: 100%;
display: flex;
align-items: flex-start;
justify-content: center;
text-align: center;
padding: 1.5rem;
position: absolute;
top:0;
left: 0;
width: 100%;
min-height:100vh;
@media(max-width: 768px){
padding-bottom:150px;
}
@media(max-width:768px){
height:unset;
position: relative;
}
@media(max-width:768px) {
padding: 0.5rem;
}
&.login{
padding-top:100px;
@media(max-width:768px){
padding: 0;
}
}
.container {
@media(max-width:768px) {
max-width: unset;
}
h1 {
font-size: 2.5rem;
margin-bottom: 0.5rem;
line-height: 1.2;
}
p {
font-size: 1.2rem;
margin-bottom: 2rem;
line-height: 1.5;
}
.home-container {
background: #fff; // Added missing semicolon
padding: 2rem;
border-radius: 8px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
h2 {
margin-bottom: 1rem;
font-size: 1.5rem; // Size for the signup heading
color: #333; // Dark text color for contrast
}
form {
display: flex;
flex-direction: column;
.form-field {
margin-bottom: 1rem; // Space between fields
display: flex;
flex-direction: column;
justify-content: flex-start;
text-align: left;
@media(max-width:768px) {
margin-bottom: 0.5rem;
}
label {
margin-bottom: 0.5rem; // Space between label and input/select
color: #333; // Dark text color for labels
}
input[type="text"],
input[type="date"],
input[type="email"],
input[type="password"],
select {
padding: 0.75rem;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1rem;
color: #333; // Dark text color for inputs/selects
background-color: #fff; // White background for inputs/selects
&:focus {
border-color: #007bff; // Focus effect
outline: none;
}
&.invalid{
border: 1px solid #ef3c3c
}
}
}
.form-row {
display: flex; // Display the selects in a row
justify-content: space-between; // Space between selects
margin-bottom: 1rem; // Space below the row
@media(max-width:768px) {
flex-direction: column;
}
.gender-select,
.country-select {
width: 48%; // Set width to 48% for two select elements side by side
@media(max-width:768px) {
width: 100%;
}
}
}
.checkbox-container {
display: flex;
flex-direction: column;
margin-bottom: 1rem;
label {
font-size: 0.9rem; // Slightly smaller font for checkboxes
display: flex;
align-items: center; // Align checkbox and text
color: #333; // Dark text color for checkbox labels
input[type="checkbox"] {
margin-right: 0.5rem; // Space between checkbox and label text
}
}
}
button {
padding: 0.75rem;
border: none;
border-radius: 4px;
background-color: #007bff; // Primary button color
color: #fff;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.3s ease;
&:hover {
background-color: #0056b3; // Darker on hover
}
}
.link{
font-weight: bold;
color: inherit;
margin-left: 3px;
}
}
}
}
}
.errors{
background-color: rgba(239, 60, 60, 0.93);
border-radius: 4px;
color: #fff;
margin-top: 5px;
}
@media screen and (max-width: 768px) {
h1 {
font-size: 2rem;
}
p {
font-size: 1rem;
}
.home-container {
padding: 1.5rem;
h2 {
font-size: 1.3rem;
}
}
}
}
.login-page {
width: 100%;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: #E7E7E7;
.login {
width: 400px;
padding: 4rem 2rem;
background-color: #fff;
border-radius: 8px;
text-align: center;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1), 0 12px 24px rgba(0, 0, 0, 0.2);
@media(max-width:768px){
width: calc(100% - 40px);
}
@media(min-width:769px){
margin-top: -125px;
}
.logo {
width: 84px;
margin-bottom: 1.5rem;
}
form {
display: flex;
flex-direction: column;
align-items: center;
.input {
width: 100%;
padding: 0.75rem;
margin: 0.5rem 0;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 1rem;
}
.login-button {
width: 100%;
padding: 0.75rem;
margin-top: 1rem;
background-color: #0073aa;
color: #fff;
border: none;
border-radius: 4px;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.3s ease;
&:hover {
background-color: #006799;
}
}
}
.forgot-password {
display: block;
margin-top: 1rem;
font-size: 0.875rem;
color: #0073aa;
text-decoration: none;
transition: color 0.3s ease;
&:hover {
text-decoration: underline;
}
}
}
}
footer{
width: 100%;
background-color:#333;
display: flex;
justify-content: center;
margin-top: 45px;
.footer-inner{
width: 80%;
padding: 20px 40px;
display:flex;
flex-direction: row;
color:#fff;
margin: 0 -20px;
@media(max-width:768px){
padding: 5px;
flex-direction: column;
width: 100%;
}
.footer-col{
width: 20%;
max-width: 20%;
padding: 0 20px;
@media(max-width:768px){
width: 100%;
max-width: unset;
padding: 10px;
}
.image-container{
width: 180px;
}
&.img{
display: flex;
align-items: center;
justify-self: flex-end;
margin-left: auto;
@media(max-width: 768px){
justify-content: center;
}
}
}
}
}
.footer-menu{
.link-title{
margin:5px 0px;
padding:0;
line-height: 1;
}
ul{
list-style: none;
padding: 0;
margin: 0;
}
a{
color:inherit;
text-decoration: none;
}
}
.mdi{
color:#0056b3;
font-size: 1.8rem;
&.mdi-loading{
animation: rotate 1s linear infinite;
display: none;
&.show{
display:block
}
}
}
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
rss/favicon/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

3
rss/favicon/favicon.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 49 KiB

View File

@@ -0,0 +1,21 @@
{
"name": "MyWebSite",
"short_name": "MySite",
"icons": [
{
"src": "/rss/favicon/web-app-manifest-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/rss/favicon/web-app-manifest-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

BIN
rss/img/couple.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 KiB

BIN
rss/img/logo-light.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
rss/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
rss/img/logo_old.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

BIN
rss/img/people.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

BIN
rss/img/save.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

BIN
rss/img/search.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

BIN
rss/img/sunset.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 KiB

128
rss/js/home.js Normal file
View File

@@ -0,0 +1,128 @@
document.addEventListener('DOMContentLoaded', async (v) => {
let countries = await fetchCountries();
// Handlers
let countrySelector = document.getElementById('userCountry');
for(country of countries){
countrySelector.innerHTML += `<option value="${country.text}">${country.text}</option>`;
}
let signupForm = document.getElementById('signup');
signupForm.addEventListener('submit', (e) => {
e.preventDefault();
document.getElementById('spinner').classList.add('show');
// Extract form data
let username = signupForm.querySelector('#username').value;
let dob = signupForm.querySelector('#u_dob').value;
let country = signupForm.querySelector('#userCountry').value;
let gender = signupForm.querySelector('#gender').value;
let email = signupForm.querySelector('#email').value;
let password = signupForm.querySelector('#password').value;
let password2 = signupForm.querySelector('#password2').value;
let tosInput = signupForm.querySelector('#tos');
let tos = tosInput.checked;
// Remove errors
document.getElementById('usernameError').innerText = null;
document.getElementById('countryError').innerText = null;
document.getElementById('emailError').innerText = null;
document.getElementById('dobError').innerText = null;
document.getElementById('genderError').innerText = null;
document.getElementById('passwordError').innerText = null;
document.getElementById('password2Error').innerText = null;
let userData = {
username: username,
country: country,
gender: gender,
email: email,
dob: dob,
password: password,
password2: password2,
acceptTerms: tos
};
let action = 'signup';
let formData = JSON.stringify({
action: action,
userData: userData
});
// Send request
fetch('https://api.stellaamor.com/users.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: formData
})
.then(response => {
if(response && response.length){
return response.json();
}else{
return null;
}
})
.then(msg => {
console.log(msg);
// If we have a JSON response, process it; otherwise, assume success
document.getElementById('spinner').classList.remove('show');
if (msg && msg.status === 'fail') {
let errorArea = msg.fail_status;
if (errorArea === 'username') {
document.getElementById('usernameError').innerText = msg.message;
}
if (errorArea === 'country') {
document.getElementById('countryError').innerText = msg.message;
}
if (errorArea === 'email') {
document.getElementById('emailError').innerText = msg.message;
}
if (errorArea === 'dob') {
document.getElementById('dobError').innerText = msg.message;
}
if (errorArea === 'gender') {
document.getElementById('genderError').innerText = msg.message;
}
if (errorArea === 'password') {
document.getElementById('passwordError').innerText = msg.message;
}
if (errorArea === 'password2' || errorArea === 'passwords') {
document.getElementById('password2Error').innerText = msg.message;
}
} else {
// Success: Redirect to signin page
setTimeout(() => {
window.location.href = '/signin';
}, 2000);
}
})
.catch(error => {
console.error('Error during signup:', error);
document.getElementById('errors').innerText = 'An error occurred. Please try again later.';
});
});
// Call init functions
});
async function fetchCountries() {
try {
const response = await fetch('https://restcountries.com/v3.1/all?fields=name');
const data = await response.json();
const countries = data.map(country => ({
text: country.name.common,
val: country.cca2,
})).sort((a, b) => a.text.localeCompare(b.text));
return countries;
} catch (error) {
console.error('Error fetching countries:', error);
return [];
}
}

83
rss/js/login.js Normal file
View File

@@ -0,0 +1,83 @@
document.addEventListener('DOMContentLoaded', async (v) =>{
await isAuth();
let loginForm = document.getElementById('loginForm');
loginForm.addEventListener('submit', async (e) =>{
e.preventDefault();
login();
})
})
// Async login function in vanilla JS
async function login() {
// Set login running state
let loginRunning = true;
let loginError = false;
// Get form data
let username = document.getElementById('username').value;
let password = document.getElementById('password').value;
let postFields = {
userData: {
username: username,
password: password
},
action: 'login'
};
try {
// Send request
const response = await fetch('https://api.stellaamor.com/users.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include', // To handle cookies
body: JSON.stringify(postFields)
});
const data = await response.json();
if (data.status === 'fail') {
// Display error if login fails
loginError = true;
document.getElementById('loginError').innerText = data.message;
loginRunning = false;
} else {
// Successful login, redirect to /home
loginRunning = false;
setTimeout(() => {
window.location.href = '/home';
// Reset form fields and errors after login
document.getElementById('username').value = '';
document.getElementById('password').value = '';
document.getElementById('loginError').innerText = '';
loginRunning = false;
}, 1500);
}
} catch (error) {
console.error('Login error:', error);
loginError = true;
loginRunning = false;
}
}
// Async authentication check function in vanilla JS
async function isAuth() {
try {
const response = await fetch('https://api.stellaamor.com/users.php?isAuth=true', {
method: 'GET',
credentials: 'include'
});
const data = await response.json();
if (data.status === true) {
window.location.href = '/home';
} else {
return false;
}
} catch (error) {
return false;
}
}

4
rss/js/main.js Normal file
View File

@@ -0,0 +1,4 @@
// Global functions
async function mainFetch(fdata){
}

7
rss/js/menu.js Normal file
View File

@@ -0,0 +1,7 @@
const burger = document.querySelector('.burger');
const navLinks = document.querySelector('.nav-links');
burger.addEventListener('click', () => {
navLinks.classList.toggle('nav-active');
burger.classList.toggle('toggle');
});

1
rss/json/countries.json Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,45 @@
<script src="/rss/js/menu.js"></script>
<?php
$pre_page = $_SERVER['PHP_SELF'];
$page = str_replace('/', '', $pre_page);
$page = str_replace('.php', '', $page);
if($page == 'index'){
echo '<script src="/rss/js/home.js"></script>';
}
if($page == 'signin'){
echo '<script src="/rss/js/login.js"></script>';
}
?>
<footer>
<div class="footer-inner">
<div class="footer-col">
<div class="footer-menu">
<h3 class="link-title">Links</h3>
<ul>
<li><a href="/">Home</li>
<li><a href="/signin">Sign in</a></li>
<li><a href="/about">About</a></li>
</ul>
</div>
</div>
<div class="footer-col">
<div class="footer-menu">
<h3 class="link-title">Contact</h3>
<ul>
<li>Support: <a href="mailto:support@stellaamor.com">support@stellaamor.com</li>
<li>Contact: <a href="mailto:info@stellaamor.com">info@stellaamor.com</a></li>
</ul>
</div>
</div>
<div class="footer-col img">
<div class="image-container">
<img src="/rss/img/logo-light.png">
</div>
</div>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Basic Meta Tags -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Stella Amor | <?php echo $page_title;?></title>
<!-- Meta Description -->
<meta name="description" content="<?php echo $page_description;?> ">
<meta name="keywords" content="dating">
<!-- Open Graph Tags for Social Media -->
<meta property="og:title" content="Stella Amor | <?php echo $page_title;?>">
<meta property="og:description" content="<?php echo $page_description;?>">
<meta property="og:image" content="https://stellaamor.com/rss/img/logo.png">
<meta property="og:url" content="https://stellaamor.com<?php echo $_SERVER['REQUEST_URI'];?>">
<meta property="og:type" content="website">
<!-- Twitter Card Meta Tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Stella Amor | <?php echo $page_title;?>">
<meta name="twitter:description" content="<?php echo $page_description;?>">
<meta name="twitter:image" content="https://stellaamor.com/rss/img/logo.png">
<link rel="icon" type="image/png" href="/rss/favicon/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/rss/favicon/favicon.svg" />
<link rel="shortcut icon" href="/rss/favicon/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/rss/favicon/apple-touch-icon.png" />
<link rel="manifest" href="/rss/favicon/site.webmanifest" />
<!-- Canonical Link (for duplicate pages) -->
<link rel="canonical" href="https://stellaamor.com<?php echo $_SERVER['REQUEST_URI'];?>">
<!-- Favicon -->
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<!-- Robots Meta Tag (for search engine crawling control) -->
<meta name="robots" content="index, follow">
<!-- Include css and JS -->
<link href="https://cdn.jsdelivr.net/npm/@mdi/font/css/materialdesignicons.min.css" rel="stylesheet">
<link href="/rss/css/main.css" rel="stylesheet">
<body>
<!-- Begin menu -->
<nav class="navbar">
<div class="container">
<a href="/" class="logo"><img src="/rss/img/logo.png"></a>
<ul class="nav-links">
<li><a href="/">Home</a></li>
<li><a href="signin">Login</a></li>
<li><a href="/about">About us</a></li>
</ul>
<div class="burger">
<span></span>
<span></span>
<span></span>
</div>
</div>
</nav>