mirror of
https://github.com/morten-olsen/morten-olsen.github.io.git
synced 2026-02-08 01:46:28 +01:00
Background
This commit is contained in:
@@ -38,7 +38,6 @@ const ItemWrapper = styled.a`
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
background: #fff;
|
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
width: 220px;
|
width: 220px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"next": "^11.1.0",
|
"next": "^11.1.0",
|
||||||
|
"particlesjs": "^2.2.3",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
"styled-components": "^5.3.1"
|
"styled-components": "^5.3.1"
|
||||||
|
|||||||
@@ -1,14 +1,40 @@
|
|||||||
import React from 'react';
|
import React, { useEffect } from 'react';
|
||||||
|
import styled from 'styled-components';
|
||||||
import Head from 'next/head';
|
import Head from 'next/head';
|
||||||
import Me from '../components/Me';
|
import Me from '../components/Me';
|
||||||
import Social from '../components/Social';
|
import Social from '../components/Social';
|
||||||
|
|
||||||
const Frontpage: React.FC<{}> = () => (
|
const Canvas = styled.canvas`
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
widht: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: -1;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const Frontpage: React.FC<{}> = () => {
|
||||||
|
useEffect(() => {
|
||||||
|
const run = async () => {
|
||||||
|
const { default: Particles } = await import('particlesjs');
|
||||||
|
Particles.init({
|
||||||
|
selector: '.background',
|
||||||
|
connectParticles: true,
|
||||||
|
color: '#dddddd',
|
||||||
|
maxParticles: 200,
|
||||||
|
});
|
||||||
|
console.log(Particles);
|
||||||
|
};
|
||||||
|
run();
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
<title>Morten Olsen</title>
|
<title>Morten Olsen</title>
|
||||||
</Head>
|
</Head>
|
||||||
<Me />
|
<Me />
|
||||||
|
<Canvas className="background" />
|
||||||
<Social
|
<Social
|
||||||
sites={[{
|
sites={[{
|
||||||
title: 'Github',
|
title: 'Github',
|
||||||
@@ -29,6 +55,7 @@ const Frontpage: React.FC<{}> = () => (
|
|||||||
}]}
|
}]}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export default Frontpage;
|
export default Frontpage;
|
||||||
|
|||||||
@@ -1501,6 +1501,11 @@ parse-asn1@^5.0.0, parse-asn1@^5.1.5:
|
|||||||
pbkdf2 "^3.0.3"
|
pbkdf2 "^3.0.3"
|
||||||
safe-buffer "^5.1.1"
|
safe-buffer "^5.1.1"
|
||||||
|
|
||||||
|
particlesjs@^2.2.3:
|
||||||
|
version "2.2.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/particlesjs/-/particlesjs-2.2.3.tgz#4d213ca740679fc1ccc772e8d864b884a091f37e"
|
||||||
|
integrity sha512-f0rL80Agqdsrnv/uhlLewv+LMdiXHu9MYPzMv0ZLPM06nLx3zmAXMH882fxqO6Uzb91csli8WlWaYd2XPN0d/Q==
|
||||||
|
|
||||||
path-browserify@0.0.1:
|
path-browserify@0.0.1:
|
||||||
version "0.0.1"
|
version "0.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a"
|
resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a"
|
||||||
|
|||||||
Reference in New Issue
Block a user