You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
3.7 KiB
HTML

<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--css-->
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Wheel of Fortune</title>
<!--P5.MIN.JS-->
<script src="p5.min.js" ></script>
<script>
var allQuestions=[];
var questions = new XMLHttpRequest();
questions.open('GET', './list.txt');
questions.onreadystatechange = function() {
allQuestions=questions.responseText.split("\n");
}
questions.send();
function preload(){
img=loadImage('wheel.svg');
}
function setup() {
var canvas = createCanvas(windowWidth/2, windowHeight/2);
canvas.parent("wheel");
}
var spinning = 2000;
var currentSpinning = 0;
var spinonoff = false;
function spin(){
spinning = 1800 + random(0,500);
currentSpinning = 0;
spinonoff = true;
}
function card(){
// rect(0, 0, 55, 55);
var popup=document.getElementById("popup");
popup.style.display="block";
var popuptext=document.getElementById("popuptext");
popuptext.innerHTML=allQuestions[Math.floor(Math.random()*allQuestions.length)];
console.log(popup);
currentSpinning = 0;
spinonoff=false;
}
function closepopup(){
var popup=document.getElementById("popup");
popup.style.display="none";
console.log("closing");
}
function draw() {
clear();
// background(220);
imageMode(CENTER);
angleMode(DEGREES);
translate (windowWidth/4, windowHeight/4);
if (spinonoff==true){
rotate(currentSpinning);
currentSpinning = currentSpinning+10;
console.log(spinning,currentSpinning);
if (currentSpinning > spinning){
currentSpinning = spinning;
card();
}
}
image (img,0,0,250,250);
}
</script>
</head>
<body>
<div class="bg-image"></div>
<div class="bg-text-top">
<h1>Wheel of Fortune</h1>
<h2>Welcome, my dear!</h2>>
<p>This exercise you are about to start revolves around healing, in a sense of reconnecting to what is essential and authentic about yourself. As we understand the true nature of our suffering, we can evoke compassion for ourselves as we move through our uncomfortable feelings on the path to healing and peace.
<br>
<br>I will be guiding you through a series of carefully collected questions written by different authors, some well-known and others unknown. You begin the exercise by spinning the Wheel of Fortune. After a few seconds, a question appears on the screen. Then, you take a photo slide from the deck and try to think of an answer to that question by looking at it and the tiny film simultaneously.</p>
</div>
<button class="spin-wheel" onclick="spin()" > Spin</button>
<div id="wheel"></div>
<div id="popup">
<h3 id="popuptext"></h3>
<img src="photo-slide.jpg">
<button class="close" onclick="closepopup()" > Close</button>
</div>
<div class="bg-text-bottom">
<h2>Here are a few things I prepared for you before you begin:</h2>
<p>1. Have a strong sense of intention to commit to this exercise for some time.
<br>2. Find a quiet room, free of distraction.
<br>3. Get a notebook and a pen. Handwriting will engage your mind more actively and profoundly, help you connect with yourself, and enable the tracing of your progress over time.</p>
</div>
<img class="top-left-corner" src="crystals.svg">
<img class="top-right-corner" src="crystals.svg">
<img class="bottom-left-corner" src="crystals.svg">
<img class="bottom-right-corner" src="crystals.svg">
</body>