Skip to content

Commit

Permalink
Merge pull request #12 from Koala3353/fdvv
Browse files Browse the repository at this point in the history
Fdvv
  • Loading branch information
Koala3353 authored Feb 8, 2024
2 parents faf1da8 + 2409e39 commit 8b3d2fb
Show file tree
Hide file tree
Showing 12 changed files with 3,565 additions and 465 deletions.
33 changes: 20 additions & 13 deletions assets/js/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
var codes = localStorage.getItem('codes');
if (!codes) {
// If not, initialize it
codes = ["code1", "code2", "code3"];
codes = [
{ codes: ["code1", "code4"], divId: "hiddenDiv1" },
{ codes: ["code2", "code5"], divId: "hiddenDiv2" }
];
localStorage.setItem('codes', JSON.stringify(codes));
} else {
// If it does, parse it
Expand All @@ -14,13 +17,15 @@ document.querySelector('form').addEventListener('submit', function(e) {

var enteredCode = document.getElementById('inputPassword2').value;

var codeIndex = codes.indexOf(enteredCode);
if (codeIndex !== -1) {
var codeObject = codes.find(obj => obj.codes.includes(enteredCode));
if (codeObject) {
var reflowAuth = localStorage.getItem('reflowAuth');
var parsedReflowAuth = JSON.parse(reflowAuth);
var email = parsedReflowAuth.profile.email;
localStorage.setItem('resourceAccess', email);
codes.splice(codeIndex, 1); // Remove the used code from the array
var resourceAccess = JSON.parse(localStorage.getItem('resourceAccess')) || [];
resourceAccess.push({ email: email, divId: codeObject.divId });
localStorage.setItem('resourceAccess', JSON.stringify(resourceAccess));
codeObject.codes = codeObject.codes.filter(code => code !== enteredCode); // Remove the used code from the array
// Update codes in localStorage
localStorage.setItem('codes', JSON.stringify(codes));
alert('Access granted!');
Expand All @@ -32,20 +37,22 @@ document.querySelector('form').addEventListener('submit', function(e) {

window.onload = function() {
console.log('Page has loaded');
var resourceAccess = localStorage.getItem('resourceAccess');
var resourceAccess = JSON.parse(localStorage.getItem('resourceAccess')) || [];
var reflowAuth = localStorage.getItem('reflowAuth');
var parsedReflowAuth = JSON.parse(reflowAuth);

if (parsedReflowAuth) {
var email = parsedReflowAuth.profile.email;
// Rest of your code...
if (resourceAccess && resourceAccess === email) {
console.log('Access granted');
// Assuming the div has an id of 'hiddenDiv'
var hiddenDiv = document.getElementById('hiddenDiv');
console.log(hiddenDiv);
hiddenDiv.hidden = false; // Unhide the div
}
resourceAccess.forEach(function(access) {
if (access.email === email) {
console.log('Access granted');
// Assuming the div has an id of 'hiddenDiv'
var hiddenDiv = document.getElementById(access.divId);
console.log(hiddenDiv);
hiddenDiv.hidden = false; // Unhide the div
}
});
} else {
console.log('parsedReflowAuth is null');
}
Expand Down
22 changes: 5 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
autoplay=""
loop=""
>
<source src="./bgvideo.mp4" type="video/mp4" />
<source src="./assets/img/test-vid-2.mp4" type="video/mp4" />
</video>
<div class="text">
<h2
Expand Down Expand Up @@ -414,7 +414,7 @@
class="text-center text-light card-title fw-bold"
style="font-family: 'Prosa GT Demo'"
>
OVER AND UNDER SUTURE
OVER & UNDER SUTURE
</h2>
<h3
class="text-center text-light card-title"
Expand Down Expand Up @@ -848,11 +848,7 @@
margin-top: 13px;
"
>
I recently purchased the Arduino Hobby Kit, and it has exceeded
my expectations as a beginner in electronics and programming.
The kit comes with all the essential components, including an
Arduino Uno board, sensors, LEDs, and more, making it a perfect
starting point for hobbyists like me.
The suture hobby kit has been an invaluable addition to my medical training repertoire. With its lifelike suturing pad and assorted surgical instruments, I've been able to practice various suturing techniques with realistic precision. Whether you're a medical student honing your skills or a healthcare professional looking to refine your expertise, this kit offers an excellent platform for hands-on learning.<br /><br />
</p>
</div>
</div>
Expand Down Expand Up @@ -962,11 +958,7 @@
color: white !important;
"
>
SPARK's Nail Art Starter Kit is perfect for beginners like me.
The compact size and straightforward tools make it easy to
experiment with basic designs. The included guide is a helpful
bonus, making my first steps into nail art enjoyable and
fuss-free<br /><br />
The Unsolved Case Files hobby kit is an absolute must-have for mystery lovers and puzzle enthusiasts alike. From analyzing evidence to unraveling complex storylines, each case presents a unique challenge that keeps you engaged and eager to uncover the truth. With its immersive storytelling and attention to detail, this kit offers an unforgettable experience that will leave you craving more mysteries to solve.<br /><br />
</p>
</div>
</div>
Expand Down Expand Up @@ -1076,11 +1068,7 @@
color: white !important;
"
>
This wood carving hobby kit is a joy to use, featuring
high-quality tools with ergonomic handles that make intricate
detailing a breeze. Whether you're a seasoned woodworker or a
beginner, this kit transforms any piece of wood into a true work
of art.<br /><br />
Aspiring to become a fashion designer, the blouse-making kit has been an absolute game-changer for me. With its versatile array of fabrics, patterns, and embellishments, I've been able to experiment and bring my design visions to life with ease. Whether you're a budding designer like myself or simply enjoy crafting your own wardrobe, this kit is an indispensable tool for unleashing your creativity and mastering the art of blouse making.
</p>
</div>
</div>
Expand Down
Loading

0 comments on commit 8b3d2fb

Please sign in to comment.