feat: implement dynamic social links in Footer and add random code line data for Home component

This commit is contained in:
2025-05-21 23:49:34 +02:00
parent 29b9dd93e2
commit 3b86302a6e
5 changed files with 144 additions and 14 deletions
+14 -8
View File
@@ -1,16 +1,22 @@
export const Footer = () => {
const currentYear = new Date().getFullYear()
import {socialLinkData} from '../data/socialLinkData'
export interface socialLink {
icon: string;
url: string;
}
export const Footer = () => {
const socialLinks: socialLink[] = socialLinkData;
const currentYear = new Date().getFullYear()
return (
<footer className="footer">
<div className="container">
<div className="social-links">
<a href="#" className="social-icon"><i className="fab fa-github"></i></a>
<a href="#" className="social-icon"><i className="fab fa-linkedin"></i></a>
<a href="#" className="social-icon"><i className="fab fa-twitter"></i></a>
<a href="#" className="social-icon"><i className="fab fa-discord"></i></a>
<a href="#" className="social-icon"><i className="fas fa-envelope"></i></a>
<a href="#" className="social-icon"><i className="fab fa-hackerrank"></i></a>
{socialLinks.map((link, index) => (
<a key={index} href={link.url} className="social-icon">
<i className={link.icon}></i>
</a>
))}
</div>
<p className="copyright">&copy; {currentYear} SecCodeSmith. All rights forged in digital fire.</p>
</div>
View File
+102
View File
@@ -0,0 +1,102 @@
export const randomCodeLineData :string[] = [
'print("Hello, world!")',
'int main() { return 0; }',
'std::vector<int> v{1, 2, 3, 4};',
'Console.WriteLine(\"Enter your name:\");',
'for i in range(10):',
'char* buffer = malloc(256);',
'using (var fs = new FileStream(path, FileMode.Open))',
'if (x > y) x = y;',
'def factorial(n):',
'double result = pow(x, y);',
'string greeting = \"Hi there\";',
'auto it = map.find(key);',
'List<string> names = new List<string>();',
'while (ptr != nullptr) {',
'with open(\"file.txt\", \"r\") as f:',
'int *arr = new int[10];',
'var dict = new Dictionary<string, int>();',
'std::cout << \"Value: \" << value << std::endl;',
'await Task.Delay(1000);',
'lambda x: x * x',
'float pi = 3.14159f;',
'bool success = TryParse(input, out result);',
'try { /* ... */ } catch (Exception ex) { }',
'def hello(name=\"User\"):',
'constexpr int MAX = 100;',
'public class Person { }',
'if __name__ == \"__main__\":',
'switch(choice) { case 1: break; }',
'var json = JsonConvert.DeserializeObject(data);',
'std::sort(v.begin(), v.end());',
'Console.ReadKey();',
'for (int i = 0; i < n; i++)',
'x = x[::-1]',
'char c = getchar();',
'[Obsolete(\"Use NewMethod instead\")]',
'str_list = [s.upper() for s in strings]',
'uint64_t id = generate_id();',
'public interface IService { }',
'import os',
'static void Helper() { }',
'client.SendAsync(request);',
'matrix[i][j] = i * j;',
'def merge(a, b): return a + b',
'std::unique_ptr<Foo> p = std::make_unique<Foo>();',
'Task.Run(() => DoWork());',
'with lock(mutex):',
'vector.push_back(elem);',
'string.Join(\", \", list)',
'if (obj is MyClass mc) { }',
'os.remove(\"temp.txt\")',
'char16_t ch = u\'A\';',
'public static readonly string ID = Guid.NewGuid().ToString();',
'def fib(n): return fib(n-1) + fib(n-2)',
'memcpy(dest, src, size);',
'foreach (var item in collection) { }',
'assert(x != null);',
'std::thread t([](){ doWork(); });',
'[Serializable]',
'lst.append(item)',
'GC.Collect();',
'auto lambda = [](int x){ return x+1; };',
'public override string ToString() => Name;',
'if (!File.Exists(path)) File.Create(path);',
'double average = accumulate(v.begin(), v.end(), 0.0) / v.size();',
'using System.Text;',
'def decorator(func):',
'for (auto &p : pairs) { }',
'var query = from x in db.Items select x;',
'bytes_data = b\"\\x00\\xFF\"',
'cout << std::hex << n;',
'string.Format(\"{0}, {1}\", a, b);',
'import sys, json',
'bool isEmpty = list.Count == 0;',
'std::map<string,int> mp;',
'Console.ForegroundColor = ConsoleColor.Green;',
'def prime(n):',
'int score = Random().Next(0, 100);',
'var path = Path.Combine(dir, file);',
'auto now = std::chrono::system_clock::now();',
'if (val?.Length > 0) { }',
'with session.begin():',
'list<int> primes;',
'public event EventHandler Clicked;',
'x, y = y, x',
'char16_t* wstr = L\"wide\";',
'dynamic obj = new ExpandoObject();',
'assert(sizeof(int) == 4);',
'Console.Write($\"Count: {count}\");',
'std::tie(a, b) = getPair();',
'byte[] buffer = new byte[1024];',
'def async_func():',
'virtual void Render() override;',
'os.getcwd()',
'for k, v in dict.items():',
'std::shared_ptr<Foo> sp = ptr;',
'public bool Equals(Person other) => Id==other.Id;',
'return x is not None',
'size_t len = strlen(str);',
'var enumerable = Enumerable.Range(1,10);',
'float angle = atan2(y, x);',
]
+24
View File
@@ -0,0 +1,24 @@
import {type socialLink} from "../components/Footer";
export const socialLinkData: socialLink[] = [
{
icon: "fab fa-github",
url: ""
},
{
icon: "fab fa-linkedin",
url: ""
},
{
icon: "fab fa-twitter",
url: ""
},
{
icon: "fab fa-discord",
url: ""
},
{
icon: "fas fa-envelope",
url: ""
},
]
+5 -7
View File
@@ -4,30 +4,28 @@ import { Link } from 'react-router-dom';
import styles from '@styles/Home.module.scss';
import SkillCard from '../components/SkillCard'
import { skillCardData } from '../data/skillCardData';
import { randomCodeLineData } from '../data/randomCodeLineData';
export const Home = () => {
const skills = skillCardData;
const randomCodeLines = randomCodeLineData;
useEffect(() => {
const createBinaryBg = () => {
const binaryBg = document.getElementById('binary-bg');
if (!binaryBg) return;
const chars = '01';
const linesCount = 20;
binaryBg.innerHTML = '';
for (let i = 0; i < linesCount; i++) {
const line = document.createElement('div');
line.className = styles.binaryLine;
line.style.left = `${Math.random() * 100}%`;
line.style.animationDuration = `${Math.random() * 10 + 15}s`;
let binaryString = '';
for (let j = 0; j < 100; j++) {
binaryString += chars.charAt(Math.floor(Math.random() * chars.length));
}
let lineNumber = Math.floor(Math.random() * randomCodeLines.length);
let binaryString = randomCodeLines[lineNumber];
line.textContent = binaryString;
binaryBg.appendChild(line);