spin wheel folder (outside web)

main
Boyana 1 year ago
parent 16377c8fd6
commit 4352c2e376

@ -0,0 +1,120 @@
<!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('wheel1.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 is all about healing, about reconnecting with what is essential and authentic within yourself. By understanding the true nature of our suffering, we can evoke compassion for ourselves as we move through uncomfortable feelings on the path to healing and peace.
<br>
<br>I will be guiding you through a series of carefully selected questions written by different authors, some are well-known, and others will remain unknown. To begin the exercise, spin the Wheel of Fortune. After a few seconds, a question will appear on the screen. Then, take a photo slide from the deck and hold it to the screen. Think about that question by looking at it and the tiny film together like friends.
<br>
<br>If you feel like writing your thoughts, you can use the tiny notepad made just for you. These photo slides are there to help you dive deeper into your inner world. Use them to explore moments in your life that you may not have fully processed or understood. As you reflect on these images and answer the questions, you may gain new insights and perspectives about yourself and your life.</p>
</div>
<div id="wheel"></div>
<div id="popup">
<h3 id="popuptext"></h3>
<img class="slide" src="photohere.svg">
<button class="close" onclick="closepopup()" > Close</button>
</div>
<button class="spin-wheel" onclick="spin()" > Spin</button>
<div class="bg-text-bottom">
<h2>Here are a few things I prepared for you before you begin:</h2>
<p>1. Have a strong intention to commit to this exercise for some time.
<br>2. Find a quiet room free of distractions.
<br>3. Get a notebook and 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>
<div class="credits">
<p>Photo by Guillermo Ferla on Unsplash</p>
</div>
<img class="top-left-corner" src="/spin-wheel/svg/spiral.svg">
<img class="top-right-corner" src="/spin-wheel/svg/moon-stars.svg">
<img class="bottom-left-corner" src="/spin-wheel/svg/crystals.svg">
<img class="bottom-right-corner" src="/spin-wheel/svg/crystals.svg">
</body>

@ -0,0 +1,147 @@
html {
position: relative; /* Make the html element a positioned parent */
}
html::before { /* Add a pseudo-element to the html element */
content: "";
position: fixed;
width: 200vw;
height: 200vh;
top: -50vh;
left: -50vw;
right: 0;
bottom: 0;
z-index: -1; /* Set a negative z-index to move the pseudo-element below the content */
background: url(bg-images/bg4.jpg) no-repeat center center fixed;
background-size: cover;
/* Add animation properties */
-webkit-animation: spin 100s linear infinite;
-moz-animation: spin 100s linear infinite;
-ms-animation: spin 100s linear infinite;
-o-animation: spin 100s linear infinite;
animation: spin 100s linear infinite;
}
/* Define the spin animation */
@keyframes spin {
from {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.top-left-corner{
position: fixed;
top: 0px;
left: 0px;
transform: translate(0%,0%);
width: 12vw;
filter: hue-rotate(0deg);
}
.top-right-corner {
position: fixed;
top: 0px;
right: 0px;
transform: translate(0%,0%);
width: 12vw;
filter: hue-rotate(0deg);
}
.bottom-left-corner {
position: fixed;
bottom: 0px;
left: 0px;
transform: translate(-16%,40%);
width: 25vw;
filter: hue-rotate(-68deg);
}
.bottom-right-corner{
position: fixed;
bottom: 0px;
right: 0px;
transform: translate(0%,30%);
width: 25vw;
filter: hue-rotate(-68deg);
}
.slide {
width: 350px;
margin: 3%;
}
#wheel{
text-align: center;
filter: hue-rotate(0deg);
}
button{
color:black;
background-color:cyan;
position: center;
top:6%;
left:50%;
transform: translate(-50%,0);
width: 100px;
height:40px;
position: relative;
z-index: 2;
font-family: monospace;
}
#popup{
position: fixed;
top: 50%;
left: 50%;
width: fit-content;
height: fit-content;
padding: 5%;
background-color: azure;
z-index: 3;
transform: translate(-50%,-50%);
display: none;
}
h1{
position: relative;
margin-top: 5%;
margin-bottom: 0;
text-align: center;
font-family: fantasy;
font-size:5em;
color:antiquewhite;
}
h2 {
text-align: center;
font-family: fantasy;
color:antiquewhite;
}
h3 {
text-align: center;
font-family: fantasy;
color:antiquewhite;
}
p {
text-align: center;
font-family: monospace;
color:antiquewhite;
font-size: 1.2em;
padding-right: 15%;
padding-left: 15%;
padding-bottom: 5%;
}
Loading…
Cancel
Save