Skip to content

Commit

Permalink
Add QR Code page
Browse files Browse the repository at this point in the history
Add QR Code Page
Change links to the pages
  • Loading branch information
AlexandreBobis committed Oct 19, 2023
1 parent 4309867 commit 6ec7c57
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 120 deletions.
2 changes: 1 addition & 1 deletion my_game/You are the last of them/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</head>
<body>
<div class="outerContainer">
<h3 class="written-in-ink"><a href="https://alexandrebobis.github.io">ALEXANDRE BOBIS</a></h3>
<h3 class="written-in-ink"><a href="https://alexshadow.github.io">ALEXSHADOW</a></h3>
<div id="controls" class="buttons">
<a id="rewind" title="Restart story from beginning">Recommencer</a>
<a id="save" title="Save progress">Sauvegarder</a>
Expand Down
2 changes: 1 addition & 1 deletion oralta/oralta.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<a href="../my_game/You are the last of them/index.html" class="nav-link">Mon jeu</a>
</li>
<li>
<a href="#" class="nav-link">123</a>
<a href="../qrcode/qrcode.html" class="nav-link">QR Codes</a>
</li>
<li>
<a href="#" class="nav-link">123</a>
Expand Down
131 changes: 48 additions & 83 deletions qrcode/qrcode.css
Original file line number Diff line number Diff line change
@@ -1,73 +1,40 @@
/* html {
html {
background-color: rgb(109, 35, 35);
background-image:url(../images/Background.jpeg);
background-size: 100%;
background-size: cover;
background-repeat: no-repeat;
} */
background-attachment: fixed;
}

body {
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
margin: 0;
background-color: #f0f0f0;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
padding-top: 30%;
position: relative;
min-height: 100vh;
}

/* * {
* {
margin: 0;
padding: 0;
box-sizing: border-box;
} */

.main {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
}

.main .box {
background-color: #f4f4f4;
padding: 20px;
border-radius: 20px;
color: #1e7fb0;
box-shadow: 10px 10px rgba(0, 0, 0, 0.2);
footer {
color: #fff;
padding: 60px;
text-align: center;
position: absolute;
bottom: 0;
right: 0;
width: 200px;
}

.main .box hr {
border-top: 2px solid #a2a2a2;
margin: 3px;
}

.main .box input {
width: 100%;
margin-bottom: 3px;
height: 50px;
padding: 3px;
resize: vertical;
}

.main .box .qrcode {
padding: 3px;
}

.main .box .sqrcode {
padding: 3px;
margin-left: 15px;
}

.main .box button {
width: 100%;
height: 35px;
background-color: #1e7fb0;
font-weight: 700;
font-family: 'Unbutu', sans-serif;
border-radius: 5px;
border: none;
cursor: pointer;
}

footer {
color: whitesmoke;
.content-container {
padding: 20px;
}

/* NAVBAR */
Expand Down Expand Up @@ -170,45 +137,43 @@ header.active .translate:hover {
background-color: #151515;
}

/* QR Code */
/* QR Code Generator */

.app-container {
text-align: center;
margin: 50px auto;
.qr_code_gene {
background-color: #e3e3e3;
width: 350px;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
flex-direction: column;
padding: 20px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
max-width: 400px;
}

.app-title {
color: #333;
border-radius: 6px;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
transition: box-shadow 0.3s;
margin-bottom: 20px;
}

.input-container {
margin-bottom: 20px;
display: flex;
align-items: center;
.qr_code_gene:hover {
transition: box-shadow 0.4s;
box-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.input-label {
font-size: 16px;
color: #555;
width: 80px;
label {
padding-bottom: 10px;
font-weight: bold;
font-size: 18px;
}

.input-field {
flex: 1;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
input {
width: 308px;
font-size: 16px;
padding: 5px;
margin-bottom: 25px;
}

.gr-image {
max-width: 100%;
height: auto;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
.qr_code {
padding: 25px;
width: fit-content;
display: none;
}
27 changes: 25 additions & 2 deletions qrcode/qrcode.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<title>QR Codes</title>
<link href="../images/alexshadow91_qr.png" rel="icon"/>
<link href="qrcode.css" rel="stylesheet">
<script src="qrcode.js" type="module" defer></script>
<script src="../index.js" type="module" defer></script>
</head>
<body>
<div class="content-container">
<header class="primary-header">
<nav class="navbar container">
<a href="qrcode.html" class="logo">QR Codes</a>
Expand All @@ -32,10 +32,33 @@
<button class="translate" id="en-gb">English</button>
</nav>
</header>

<section class="qr_code_gene">
<label>Entrez un texte ou un lien.</label>
<input type="text" class="qr_texte" placeholder="https://alexshadow.github.io" onchange="generateur()">
<div class="qr_code"></div>
</section>
<footer>
<p>© 2023 AlexShadow3</p>
</footer>
</div>

<!-- JavaScript Code-->
<script src="qrcode.min.js"></script>
<script type="text/javascript">
var qr_texte = document.querySelector(".qr_texte");

function generateur() {
var qrcode = document.querySelector(".qr_code");
qrcode.style.display = "flex";
qrcode.innerHTML = "";
new QRCode(qrcode, qr_texte.value);
qr_texte.value = "";

var footer = document.querySelector("footer");
footer.style.marginTop = qrcode.clientHeight + "px";
}

</script>
</body>
</html>
<!-- http://alexshadow3.github.io/-->
40 changes: 7 additions & 33 deletions qrcode/qrcode.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,7 @@
import React, { useState } from 'react';
import {generateQRCode} from './api';

function App() {
const [qrDate, setQrData] = useState('example.com');
const [qrSize, setQrSize] = useState('200x200');

return (
<div className='app-container'>
<h1 className='app-title'>QR Code Generator</h1>
<div className='input-container'>
<label className="input-label">QR URL:</label>
<input className='input-field' type="text" value={qrDate} onChange={(e) => setQrData(e.target.value)} />
</div>
<div className='input-container'>
<label className="input-label">QR Size:</label>
<input className='input-field' type="text" value={qrSize} onChange={(e) => setQrSize(e.target.value)} />
</div>
<div className='qr-code'>
<img className='qr-image' src={generateQRCode(qrDate, qrSize)} alt='QR Code' />
</div>
</div>
);
}

export default App;

const qrServerBaseUrl = "https://api.qrserver.com/v1/create-qr-code/"

export const generateQRCode = (qrData, qrSize) => {
const qrImageUrl = `${qrServerBaseUrl}?data=${qrData}&size=${qrSize}`;
return qrImageUrl;
};
const background = document.querySelector('html');
const contentContainer = document.querySelector('.content-container');
const parallaxSpeed = 0.5;
window.addEventListener('scroll', function () {
const scrollPosition = window.scrollY;
background.style.backgroundPositionY = -scrollPosition * parallaxSpeed + 'px';
});
Loading

0 comments on commit 6ec7c57

Please sign in to comment.