Skip to content

Commit

Permalink
wrapped html+css
Browse files Browse the repository at this point in the history
  • Loading branch information
nunocoracao committed Feb 24, 2023
1 parent dbc532a commit 14aba37
Show file tree
Hide file tree
Showing 13 changed files with 663 additions and 80 deletions.
431 changes: 431 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-particles": "^2.9.3",
"react-scripts": "5.0.1",
"tsparticles": "^2.9.3",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
30 changes: 3 additions & 27 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,13 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
content="Your first Docker container"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<title>Welcome to Docker</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions public/manifest.json

This file was deleted.

46 changes: 32 additions & 14 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
background-color: #003f8c;
min-height: 100vh;
display: flex;
flex-direction: column;
Expand All @@ -28,11 +22,35 @@
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}

.fa {
padding: 20px;
font-size: 30px;
width: 50px;
margin: 10px;
text-align: center;
text-decoration: none;
}

.fa:hover {
opacity: 0.7;
}


/* Twitter */
.fa-twitter {
background: #55ACEE;
color: white;
}

/* Linkedin */
.fa-linkedin {
background: #55ACEE;
color: white;
}

/* Reddit */
.fa-reddit {
background: #55ACEE;
color: white;
}
29 changes: 17 additions & 12 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import logo from './logo.svg';
import logo from './baby_moby.png';
import './App.css';
import Confetti from './Confetti';

function App() {
const shareMessage = 'I just published an article on how you can share content to Twitter from the client website'
const shareLink = 'https://docker.com/'

const App = () => {
return (
<div className="App">
<Confetti/>
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
<h1 style={{ marginBottom: "0px" }}>
Congratulations!!!
</h1>
<p style={{ marginTop: "10px", marginBottom: "50px" }}>
You just run your first container.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
<div>
<a target="_blank" href={"https://twitter.com/intent/tweet?text=" + shareMessage + "&url=" + shareLink} class="fa fa-twitter" rel="noopener noreferrer"></a>
<a target="_blank" href={"https://www.linkedin.com/sharing/share-offsite/?url=" + shareLink} class="fa fa-linkedin" rel="noopener noreferrer"></a>
<a target="_blank" href={"https://reddit.com/submit?title=" + shareMessage + "&url=" + shareLink} class="fa fa-reddit" rel="noopener noreferrer"></a>
</div>
</header>
</div>
);
Expand Down
177 changes: 177 additions & 0 deletions src/Confetti.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
import Particles from "react-particles";
import { useCallback } from "react";
import { loadFull } from "tsparticles";

const Confetti = () => {

const particlesInit = useCallback(async engine => {
console.log(engine);
// you can initiate the tsParticles instance (engine) here, adding custom shapes or presets
// this loads the tsparticles package bundle, it's the easiest method for getting everything ready
// starting from v2 you can add only the features you need reducing the bundle size
await loadFull(engine);
}, []);

const particlesLoaded = useCallback(async container => {
await console.log(container);
}, []);

return (
<Particles
id="tsparticles"
init={particlesInit}
loaded={particlesLoaded}
options={{
fullScreen: {
zIndex: 1
},
emitters: [
{
position: {
x: 0,
y: 30
},
rate: {
quantity: 5,
delay: 0.15
},
particles: {
move: {
direction: "top-right",
outModes: {
top: "none",
left: "none",
default: "destroy"
}
}
}
},
{
position: {
x: 100,
y: 30
},
rate: {
quantity: 5,
delay: 0.15
},
particles: {
move: {
direction: "top-left",
outModes: {
top: "none",
right: "none",
default: "destroy"
}
}
}
}
],
particles: {
color: {
value: [
"#ffffff",
"#FF0000"
]
},
move: {
decay: 0.05,
direction: "top",
enable: true,
gravity: {
"enable": true
},
outModes: {
top: "none",
default: "destroy"
},
speed: {
min: 10,
max: 50
}
},
number: {
value: 0
},
opacity: {
value: 1
},
rotate: {
value: {
min: 0,
max: 360
},
direction: "random",
animation: {
enable: true,
speed: 30
}
},
tilt: {
direction: "random",
enable: true,
value: {
min: 0,
max: 360
},
animation: {
enable: true,
speed: 30
}
},
size: {
value: {
min: 0,
max: 7
},
animation: {
enable: true,
startValue: "min",
count: 1,
speed: 16,
sync: true
}
},
roll: {
darken: {
enable: true,
value: 25
},
enable: true,
speed: {
min: 5,
max: 15
}
},
wobble: {
distance: 30,
enable: true,
speed: {
min: -7,
max: 7
}
},
shape: {
type: [
"square",
"triangle",
"polygon"
],
options: {
polygon: [
{
sides: 5
},
{
sides: 6
}
]
}
}
}
}}
/>
);
}

export default Confetti;
Binary file added src/baby_moby.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ body {
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Roboto',
monospace;
}
1 change: 0 additions & 1 deletion src/logo.svg

This file was deleted.

0 comments on commit 14aba37

Please sign in to comment.