Skip to content

Commit

Permalink
Update :- Publish.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
tohit09Fst committed Nov 6, 2024
1 parent 51a9494 commit bbd0118
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 13 deletions.
39 changes: 39 additions & 0 deletions generate-sitemap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { SitemapStream } from 'sitemap';
import { createWriteStream } from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const pages = [
{ url: '/', changefreq: 'daily', priority: 1.0 },
{ url: '/', changefreq: 'daily', priority: 1.0 }, // LandingPage
{ url: '/dashboard', changefreq: 'weekly', priority: 0.9 }, // Dashboard
{ url: '/posts', changefreq: 'weekly', priority: 0.8 }, // Publish
{ url: '/analytics', changefreq: 'weekly', priority: 0.8 }, // Analytics
{ url: '/contributors', changefreq: 'monthly', priority: 0.7 }, // Contributors
{ url: '/settings', changefreq: 'monthly', priority: 0.6 }, // Settings
{ url: '/signup', changefreq: 'monthly', priority: 0.5 }, // Signup
{ url: '/login', changefreq: 'monthly', priority: 0.5 }, // Login
{ url: '/newsletter', changefreq: 'monthly', priority: 0.5 } // Newsletter
];


async function generateSitemap() {
const writeStream = createWriteStream(path.resolve(__dirname, 'public', 'sitemap.xml'));

const sitemap = new SitemapStream({ hostname: 'https://social-media-management-djkz.vercel.app/' });

sitemap.pipe(writeStream).on('finish', () => {
console.log('Sitemap generated successfully');
});

pages.forEach(page => sitemap.write(page));

sitemap.end();
}

generateSitemap().catch(error => {
console.error('Error generating sitemap:', error);
});
4 changes: 4 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
User-agent: *
Disallow: /private
Allow: /
Sitemap: https://social-media-management-djkz.vercel.app/sitemap.xml
1 change: 1 addition & 0 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"><url><loc>https://social-media-management-djkz.vercel.app/</loc><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>https://social-media-management-djkz.vercel.app/</loc><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>https://social-media-management-djkz.vercel.app/dashboard</loc><changefreq>weekly</changefreq><priority>0.9</priority></url><url><loc>https://social-media-management-djkz.vercel.app/posts</loc><changefreq>weekly</changefreq><priority>0.8</priority></url><url><loc>https://social-media-management-djkz.vercel.app/analytics</loc><changefreq>weekly</changefreq><priority>0.8</priority></url><url><loc>https://social-media-management-djkz.vercel.app/contributors</loc><changefreq>monthly</changefreq><priority>0.7</priority></url><url><loc>https://social-media-management-djkz.vercel.app/settings</loc><changefreq>monthly</changefreq><priority>0.6</priority></url><url><loc>https://social-media-management-djkz.vercel.app/signup</loc><changefreq>monthly</changefreq><priority>0.5</priority></url><url><loc>https://social-media-management-djkz.vercel.app/login</loc><changefreq>monthly</changefreq><priority>0.5</priority></url><url><loc>https://social-media-management-djkz.vercel.app/newsletter</loc><changefreq>monthly</changefreq><priority>0.5</priority></url></urlset>
24 changes: 11 additions & 13 deletions src/pages/LandingPage.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import '@fortawesome/fontawesome-free/css/all.min.css';
import Footer from '../components/Footer';
import { Link } from 'react-router-dom';

import BasicNavbar from '../components/BasicNavbar';

const LandingPage = () => {
const stats = [
Expand Down Expand Up @@ -52,10 +51,7 @@ const LandingPage = () => {
const repeatedStats = Array(10).fill(stats).flat();

return (

<div>
<div className="h-screen ">

<div className="h-screen overflow-y-scroll ">
{/* Main Section */}
<div className="flex flex-col gap-6 md:flex-row items-center justify-between p-8 md:p-16 bg-white/20">
<div className="md:w-1/2">
Expand All @@ -65,13 +61,15 @@ const LandingPage = () => {
<p className="text-lg text-slate-500 dark:text-slate-400 mb-8">
Socialplus helps you build an audience organically. We’re a values-driven company that provides affordable, intuitive marketing tools for ambitious people and teams.
</p>
<div className="mb-4">

<Link to="/signup">
<button className="bg-blue-600 text-white px-4 py-2 rounded-full">
Do you want to Start
</button>
</Link>
<div className="flex gap-3 items-center mb-4">
<input
type="email"
placeholder="Enter your email..."
className="p-4 border border-gray-300 text-sm text-slate-500 rounded-full w-2/3 md:w-1/2 focus:outline-none"
/>
<button className="p-4 bg-blue-600 text-white rounded-full w-2/3 sm:w-1/2 md:w-1/3 lg:w-1/4">
Get started now
</button>

</div>
<div className="flex items-center text-sm text-slate-500 dark:text-slate-400">
Expand Down
120 changes: 120 additions & 0 deletions src/pages/NotFoundPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import React from 'react';

const NotFoundPage = () => {
const containerStyle = {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
height: 'auto',
minHeight: '500px',
flexGrow: 1,
backgroundColor: 'white',
textAlign: 'center',
color: '#333',
fontFamily: "'Roboto', sans-serif",
overflow: 'hidden',
};

const backgroundTextStyle = {
position: 'absolute',
fontSize: '12rem',
color: '#f0f0f0',
fontWeight: 'bold',
top: '15rem',
left: '50%',
transform: 'translateX(-50%)',
zIndex: 1,
};

const botContainerStyle = {
position: 'relative',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
zIndex: 2,
};

const botImageStyle = {
width: '150px',
filter: 'drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.2))',
};

const imageFlex = {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
};

const tearStyle = {
position: 'absolute',
top: '27%',
left: '46%',
width: '8px',
height: '15px',
backgroundColor: '#00aaff',
borderRadius: '50%',
animation: 'tear-fall 2s linear infinite',
};

const spiritImageStyle = {
transform: 'scale(3.5)',
width: '40px',
height: '40px',
animation: 'fade-in 1.5s ease-in-out forwards',
};

const textContainerStyle = {
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
color: '#666',
fontSize: '1.5rem',
fontWeight: '600',
marginTop: '10px',
};

return (
<div style={containerStyle}>
<div style={backgroundTextStyle}>404</div>
<div style={imageFlex}>
<div style={botContainerStyle}>
<img
src="https://cdni.iconscout.com/illustration/premium/thumb/robot-with-wrong-sign-illustration-download-in-svg-png-gif-file-formats--holding-cross-board-character-pack-science-technology-illustrations-7712790.png?f=webp"
alt="Sad bot"
style={botImageStyle}
/>
<div style={tearStyle}></div>
</div>
<div style={textContainerStyle}>
<img
src="https://cdn.dribbble.com/users/85756/screenshots/2540208/ghosty.gif"
alt="Spirit"
style={spiritImageStyle}
/>
<span style={{ zIndex: 9 }}>Oops! Page Not Found!!</span>
</div>
</div>

{/* Inline Keyframes for Animation */}
<style>
{`
@keyframes tear-fall {
0% { transform: translateY(0); opacity: 1; }
100% { transform: translateY(60px); opacity: 0; }
}
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
`}
</style>
</div>
);
};

export default NotFoundPage;

0 comments on commit bbd0118

Please sign in to comment.