Skip to content

Commit 3f4da42

Browse files
committed
astroimage
1 parent 93a323a commit 3f4da42

File tree

10 files changed

+549
-47
lines changed

10 files changed

+549
-47
lines changed

astro.config.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,8 @@
5353
// routes: true,
5454
// }),
5555

56-
// });
56+
// })
5757

58-
// astro.config.mjs
59-
// astro.config.mjs
6058
import { defineConfig } from "astro/config";
6159
import mdx from "@astrojs/mdx";
6260
import playformCompress from "@playform/compress";

src/components/Footer.astro

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
<!-- ---
22
import TwitterIcon from './icons/twitter-icon.astro'
33
import LinkedinIcon from './icons/linkedin-icon.astro'
44
import GithubIcon from './icons/github-icon.astro'
@@ -49,4 +49,47 @@ interface MenuItem {
4949
5050
5151
</footer>
52-
</div>
52+
</div> -->
53+
54+
---
55+
import TwitterIcon from './icons/twitter-icon.astro'
56+
import LinkedinIcon from './icons/linkedin-icon.astro'
57+
import GithubIcon from './icons/github-icon.astro'
58+
import MailIcon from './icons/mail-icon.astro'
59+
import style from '../styles/footer.module.css'
60+
61+
const { twitter, github, linkedin, mail } = Astro.props
62+
---
63+
64+
<div class={style.footerbg}>
65+
<footer id="footer" class={`${style.footer} animate`}>
66+
<div class={style.copyright}>
67+
<ul>
68+
&copy; 2024&mdash;{new Date().getFullYear()} <a href="https://xsh4n4.vercel.app">Suhana Shaik</a>. All Rights Reserved.
69+
</ul>
70+
</div>
71+
72+
<ul class={style.menuSocial}>
73+
<li>
74+
<a href="mailto:[email protected]" rel="nofollow">
75+
<MailIcon />
76+
</a>
77+
</li>
78+
<li>
79+
<a href={linkedin} rel="nofollow">
80+
<LinkedinIcon />
81+
</a>
82+
</li>
83+
<li>
84+
<a href={twitter} rel="nofollow">
85+
<TwitterIcon />
86+
</a>
87+
</li>
88+
<li>
89+
<a href={github} rel="nofollow">
90+
<GithubIcon />
91+
</a>
92+
</li>
93+
</ul>
94+
</footer>
95+
</div>

src/components/Head.astro

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,9 @@ const {
577577
</script>
578578

579579
<!-- Copy code button functionality - deferred for performance -->
580-
<script is:inline defer>
580+
<!-- <script is:inline defer>
581581
function addCopyCodeButtons() {
582-
let copyButtonLabel = "✂️ copy";
582+
let copyButtonLabel = "copy";
583583
let codeBlocks = Array.from(document.querySelectorAll("pre"));
584584
585585
async function copyCode(codeBlock, copyButton) {
@@ -588,7 +588,7 @@ const {
588588
const textToCopy = codeText.replace(buttonText, "");
589589
590590
await navigator.clipboard.writeText(textToCopy);
591-
copyButton.innerText = "copied!";
591+
copyButton.innerText = "copied!";
592592
593593
setTimeout(() => {
594594
copyButton.innerText = copyButtonLabel;
@@ -617,8 +617,47 @@ const {
617617
618618
document.addEventListener("DOMContentLoaded", () => addCopyCodeButtons());
619619
document.addEventListener("astro:after-swap", () => addCopyCodeButtons());
620+
</script> -->
621+
622+
<script is:inline defer>
623+
function addCopyCodeButtons() {
624+
const copyButtonLabel = "copy";
625+
const codeBlocks = Array.from(document.querySelectorAll("pre"));
626+
627+
async function copyCode(codeBlock, copyButton) {
628+
// Exclude the button text by cloning and removing button
629+
const clone = codeBlock.cloneNode(true);
630+
const button = clone.querySelector(".copy-code");
631+
if (button) button.remove();
632+
633+
const textToCopy = clone.innerText;
634+
await navigator.clipboard.writeText(textToCopy);
635+
636+
copyButton.innerText = "copied!";
637+
setTimeout(() => (copyButton.innerText = copyButtonLabel), 2000);
638+
}
639+
640+
for (let pre of codeBlocks) {
641+
if (pre.querySelector(".copy-code")) continue;
642+
643+
const copyButton = document.createElement("button");
644+
copyButton.className = "copy-code";
645+
copyButton.innerText = copyButtonLabel;
646+
647+
pre.style.position = "relative";
648+
pre.appendChild(copyButton);
649+
650+
copyButton.addEventListener("click", async () => {
651+
await copyCode(pre, copyButton);
652+
});
653+
}
654+
}
655+
656+
document.addEventListener("DOMContentLoaded", addCopyCodeButtons);
657+
document.addEventListener("astro:after-swap", addCopyCodeButtons);
620658
</script>
621659

660+
622661
<!-- Analytics Testing and Debugging (Development Only) -->
623662
{isDevelopment && (
624663
<script is:inline define:vars={{

src/components/menu.astro

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -114,32 +114,4 @@ setInterval(() => {
114114
updateMenuStyles();
115115
}
116116
}, 300);
117-
// // Add active class to the current menu item
118-
// function updateMenuStyles() {
119-
// const currentPath = window.location.pathname;
120-
// document.querySelectorAll('li[data-path]').forEach(li => {
121-
// if (li instanceof HTMLElement) {
122-
// // Reset style for all elements first to avoid multiple selections
123-
// li.style.fontWeight = 'normal';
124-
// // Apply style if the path matches
125-
// if (currentPath.includes(li.getAttribute('data-path') || '')) {
126-
// li.style.fontWeight = '700';
127-
// }
128-
// }
129-
// });
130-
// }
131-
132-
// // Run once when the page is fully loaded
133-
// document.addEventListener('DOMContentLoaded', updateMenuStyles);
134-
135-
// // Optional: Check for path changes periodically
136-
// // This is a simple but not the most efficient way to detect URL changes
137-
// let lastPath = window.location.pathname;
138-
// setInterval(() => {
139-
// const currentPath = window.location.pathname;
140-
// if (lastPath !== currentPath) {
141-
// lastPath = currentPath;
142-
// updateMenuStyles();
143-
// }
144-
// }, 300); // Check every second
145117
</script>

src/config/site.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ const site = {
44
titleAlt: "xsh4n4's", // Title for schema.org JSONLD
55
// eslint-disable-next-line prettier/prettier
66
description: 'Suhana Shaik is a Blockchain developer and cyber security enthusiast.',
7-
url: 'https://xsh4n4.vercel.app', // Domain of your site. No trailing slash!
7+
url: 'https://xsh4n4.github.io', // Domain of your site. No trailing slash!
88
siteLanguage: 'en', // Language Tag on <html> element
99
image: {
1010
// Used for SEO, relative to /static/ folder
11-
src: '/images/theme/oneko-logo.jpg',
11+
src: '/images/oneko-logo.jpg',
1212
width: 675,
1313
height: 675,
1414
},
1515
ogLanguage: 'en_US', // Facebook Language
1616

1717
// Site config
18-
copyrights: `&copy; 2024&mdash;${new Date().getFullYear()} <a href="https://xsh4n4.vercel.app">Suhana Shaik</a>. Some Rights Reserved.`,
18+
copyrights: `&copy; 2024&mdash;${new Date().getFullYear()} <a href="https://xsh4n4.vercel.app">Suhana Shaik</a>. All Rights Reserved.`,
1919
defaultTheme: 'light',
2020
postsPerPage: 10,
2121

2222
// JSONLD / Manifest
23-
favicon: '/images/theme/oneko-logo.jpg', // Used for manifest favicon generation
23+
favicon: '/images/oneko-logo.jpg', // Used for manifest favicon generation
2424
shortName: "xsh4n4's", // shortname for manifest. MUST be shorter than 12 characters
2525
author: {
2626
// Author for schema.org JSONLD

src/layouts/Layout.astro

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ type Props = {
2323
article?: boolean,
2424
authorname?: string,
2525
authorurl?: string,
26-
// pageType?: 'article' | 'notes' | 'home' | 'about' | 'contact' | 'default';
27-
pageType?: "default" | "about" | "article" | "service" | "faq" | "home" | "contact" | "campaign";
28-
26+
pageType?: 'article' | 'service' | 'faq' | 'home' | 'about' | 'contact' | 'campaign' | 'default';
2927
serviceData?: ServiceData;
3028
faqs?: FAQData[];
3129
campaignData?: CampaignData;
@@ -65,6 +63,9 @@ const {
6563
<link rel="preconnect" href="https://fonts.googleapis.com">
6664
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
6765
<link href="https://fonts.googleapis.com/css2?family=Sacramento&display=swap" rel="stylesheet">
66+
<link rel="icon" type="image/png" href="/images/oneko-logo.jpg" />
67+
<link rel="shortcut icon" href="/images/oneko-logo.jpg" />
68+
6869
<Head
6970
title={ title ? `${title} - ${site.title}` : `${site.title}` }
7071
description={description}
@@ -92,7 +93,7 @@ const {
9293
<!-- Service worker registration. -->
9394

9495
<script is:inline src="/registerSW.js"></script>
95-
<!-- <link rel="manifest" href="/manifest.webmanifest" /> -->
96+
<link rel="manifest" href="/manifest.webmanifest" />
9697
</head>
9798
<body data-theme="light">
9899
<!-- {Astro.props.preBodyComponents} -->

src/styles/footer.module.css

Lines changed: 130 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.footer {
1+
/* .footer {
22
display: flex;
33
justify-content: center;
44
align-items: center;
@@ -146,4 +146,132 @@
146146
147147
.footerbg{
148148
background-color: black;
149-
}
149+
} */
150+
151+
.footer {
152+
display: flex;
153+
justify-content: center;
154+
align-items: center;
155+
text-align: center;
156+
flex-wrap: wrap;
157+
width: calc(100% - 2rem);
158+
max-width: var(--container-width);
159+
margin: 1rem auto 2rem auto;
160+
padding-top: 1rem;
161+
color: white;
162+
font-size: var(--text-xs);
163+
border-top: 1px solid var(--border-color);
164+
165+
a {
166+
color: inherit;
167+
text-decoration: none;
168+
169+
&:hover {
170+
text-decoration: underline;
171+
}
172+
}
173+
}
174+
175+
.iconLabel {
176+
padding-left: 0.5em;
177+
178+
@media (--medium-up) {
179+
position: absolute;
180+
width: 1px;
181+
height: 1px;
182+
padding: 0;
183+
margin: -1px;
184+
overflow: hidden;
185+
clip: rect(0, 0, 0, 0);
186+
white-space: nowrap;
187+
border: 0;
188+
}
189+
}
190+
191+
.menu {
192+
margin: 0;
193+
padding: 0;
194+
list-style: none;
195+
font-family: var(--sans-serif-font);
196+
font-weight: 400;
197+
198+
@media (--medium-up) {
199+
display: flex;
200+
flex-flow: row wrap;
201+
}
202+
203+
li {
204+
flex-basis: 50%;
205+
margin: 0;
206+
207+
@media (--medium-up) {
208+
flex-basis: auto;
209+
210+
&:not(:last-child)::after {
211+
content: '·';
212+
padding-left: 1em;
213+
padding-right: 1em;
214+
}
215+
}
216+
217+
a {
218+
display: inline-block;
219+
margin-bottom: 0;
220+
padding: 0.5em 0;
221+
color: inherit;
222+
white-space: nowrap;
223+
224+
@media (--medium-down) {
225+
padding: 0.75em 0;
226+
}
227+
}
228+
}
229+
}
230+
231+
.menuSocial {
232+
margin: 0;
233+
padding: 0;
234+
list-style: none;
235+
font-family: var(--sans-serif-font);
236+
font-weight: 400;
237+
display: flex;
238+
flex-flow: row nowrap;
239+
justify-content: center;
240+
align-items: center;
241+
gap: 1rem;
242+
}
243+
244+
.menuSocial li {
245+
flex: none;
246+
margin: 0;
247+
}
248+
249+
.menuSocial a {
250+
display: flex;
251+
align-items: center;
252+
justify-content: center;
253+
color: inherit;
254+
padding: 0.25em;
255+
}
256+
257+
.menuSocial svg {
258+
font-size: 1rem;
259+
}
260+
261+
.copyright {
262+
margin-top: 2em;
263+
width: 100%;
264+
font-size: var(--text-sm);
265+
266+
p {
267+
margin-bottom: 0;
268+
}
269+
270+
a {
271+
text-decoration: underline;
272+
}
273+
}
274+
275+
.footerbg {
276+
background-color: black;
277+
}

src/styles/header.module.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,5 @@
7979
padding: 0;
8080
overflow: hidden;
8181
}
82+
83+

0 commit comments

Comments
 (0)