diff --git a/public/index.html b/public/index.html index a1794c1..d7244ba 100644 --- a/public/index.html +++ b/public/index.html @@ -2,7 +2,7 @@ diff --git a/src/App.js b/src/App.js index 475aa0d..815331f 100644 --- a/src/App.js +++ b/src/App.js @@ -1,7 +1,7 @@ /* PS Generator @author: PRV -@version: 1.1.1 +@version: 1.1.2 */ import React from 'react'; @@ -69,13 +69,18 @@ const styles = theme => ({ copy: { margin: theme.spacing(3, 6, 2), //width: '100pt', + }, + link: { + margin: theme.spacing(6, 6, 2), + color: theme.palette.secondary.light, } }); class PsGenerator extends React.Component { handleFocus = (event) => event.target.select(); placeholderText = 'Ceci est un texte random \nsans contenu particulier \npermettant d\'illustrer \ncomment ça marche \nen vrai...' - versionTxt = '1.1.1'; + versionTxt = '1.1.2'; + donate = 'https://www.leetchi.com/c/don-au-profit-des-blesses-de-guerre-miliste-2022' render() { const { classes } = this.props; @@ -94,6 +99,10 @@ class PsGenerator extends React.Component { For polyvalent engineers @ ENSTA Breton + + Sponsored by [votre nom de liste ici !] + +
- {navigator.clipboard.writeText(this.state.textToCopy)}} - edge="end" - /> - ), -*/ }} /> @@ -156,14 +155,15 @@ class PsGenerator extends React.Component { > Ça part !
-
Made with ☕️ by Gustave — version {this.versionTxt}
+
Made with ☕️ by Gustave — version {this.versionTxt} + Faire un don à la miliste +
diff --git a/src/index.js b/src/index.js index 6cdc5c5..bcfa60b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,13 @@ +/* +PS Generator +@author: PRV +@version: 1.1.2 + */ + import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; -import reportWebVitals from './reportWebVitals'; -import Button from '@mui/material/Button'; - ReactDOM.render( @@ -13,6 +16,7 @@ ReactDOM.render( document.getElementById('root') ); document.getElementById("btn").addEventListener("click", gen); +document.getElementById('copyBtn').addEventListener('click', cpText); function gen(){ let s = document.getElementById("usrinput").value.toString(); @@ -92,7 +96,13 @@ function chunkify(L, n, balanced) { return out; } - +function cpText(){ + let txt = document.getElementById('txtresult').value; + setTimeout(async()=>console.log( + await window.navigator.clipboard.writeText(txt)), 3000) + //navigator.clipboard.writeText(txt); + alert("Copié !"); +} // If you want to start measuring performance in your app, pass a function // to log results (for example: reportWebVitals(console.log)) // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals