/* Last-Modified: Sat, 1 Jan 2000 10:00:30 GMT [ver: ] */
/* Current-Time:Fri, 23 Oct 2026 17:49:56 -0500*/
[HTML]<!DOCTYPE html>

<html lang=htmlquoteenhtmlquote>
    <head>
      <meta http-equiv='X-UA-Compatible' content='IE=edge'>
        <meta charset=htmlquoteutf-8htmlquote />
        <title >JavaScript for Beginners</title>
        <link href=htmlquotestyle.csshtmlquote type=htmlquotetext/csshtmlquote
rel=htmlquotestylesheethtmlquote>
<script src=htmlquotehttps://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.jshtmlquote></script>
<script src=htmlquotehttps://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.jshtmlquote></script>
<script type=htmlquotetext/javascripthtmlquote></script>

<style>
    body {
    background: rgb(175, 126, 126);
}

#yellowrosebutton{
    width: 400px;
    background: rgb(181, 193, 226);
    padding: 20px;
    padding-top: 20px;
    font-family: calibri;
    font-size: 18px;
    color: #444;
    margin: 350 px;
    text-align: center;
    position:absolute;
    top:41px;
    left:550px;
    
}

#pavillion{
    width: 400px;
    background: rgb(181, 193, 226);
    padding: 20px;
    padding-top: 20px;
    font-family: calibri;
    font-size: 18px;
    color: #444;
    margin: 0 auto;

    max-height: 80px;
    overflow: hidden;

    /* Set transitions up. */
    -webkit-transition: max-height 2s;
    -moz-transition: max-height 2s;
    transition: max—height 2s;
}

#pavillion.open{
    max-height: 1000px;

    /* Set transitions up. */
    -webkit-transition: max-height 5s;
    -moz-transition: max-height 5s;
    transition: max-height 5s;
}

#show-more{
    background: #6699cc;
    color: #fff;
    font-family: calibri;
    display: block;
    width: 140px;
    font-size: 24px;
    text-transform: uppercase;
    padding: 10px;
    text-align: center;
    margin: 20px auto;
    cursor: pointer;
}
</style>
    </head>

    <body>


    <button id=htmlquoteinspecthtmlquotestyle=htmlquotevisibility:hiddenhtmlquote>Do you wish to collect the rose?</button>
    <button onclick=htmlquotepurchase();htmlquote id=htmlquoteyeshtmlquotestyle=htmlquotevisibility:hiddenhtmlquote>yes</button>
    <button id=htmlquotenohtmlquotestyle=htmlquotevisibility:hiddenhtmlquote>I'm not sure, I need to learn more about this adventure.</button>
	<button onclick=htmlquotebalanceOf();htmlquote>This Balance</button>
      

        <div id=htmlquotepavillionhtmlquote><img src=htmlquotehttps://i.imgur.com/xbiTfUS.jpghtmlquote></div>

        <a id=htmlquoteshow-morehtmlquote>Continue to the Sunlit Pavillion?</a>
        
        
        <img src=htmlquotehttps://i.imgur.com/ppfhZa6.jpghtmlquote style=htmlquotevisibility:hiddenhtmlquoteid=htmlquoteyellowrosebuttonhtmlquote onclick=htmlquotebutClick();htmlquote>

        
         <script>
            var pavillion = document.getElementById("pavillion");
var buttonx = document.getElementById("show-more");
let yellowrosebutton = document.getElementById("yellowrosebutton");
var inspect = document.getElementById("inspect");
var yes = document.getElementById("yes");
var no = document.getElementById("no");
          
         
async function loadWeb3() {
            if (window.ethereum) {
                window.web3 = new Web3(window.ethereum);
                window.ethereum.enable();
              web3 = new Web3(web3.currentProvider);
            }
        }
  
   



    
    async function loadContract() {
        return await new window.web3.eth.Contract([
            {
                "anonymous": false,
		"inputs": [
			{
				"indexed": true,
				"internalType": "address",
				"name": "tokenOwner",
				"type": "address"
			},
			{
				"indexed": true,
				"internalType": "address",
				"name": "spender",
				"type": "address"
			},
			{
				"indexed": false,
				"internalType": "uint256",
				"name": "tokens",
				"type": "uint256"
			}
		],
		"name": "Approval",
		"type": "event"
	},
	{
		"anonymous": false,
		"inputs": [
			{
				"indexed": true,
				"internalType": "address",
				"name": "from",
				"type": "address"
			},
			{
				"indexed": true,
				"internalType": "address",
				"name": "to",
				"type": "address"
			},
			{
				"indexed": false,
				"internalType": "uint256",
				"name": "tokens",
				"type": "uint256"
			}
		],
		"name": "Transfer",
		"type": "event"
	},
	{
		"constant": false,
		"inputs": [
			{
				"internalType": "address",
				"name": "spender",
				"type": "address"
			},
			{
				"internalType": "uint256",
				"name": "tokens",
				"type": "uint256"
			}
		],
		"name": "approve",
		"outputs": [
			{
				"internalType": "bool",
				"name": "success",
				"type": "bool"
			}
		],
		"payable": false,
		"stateMutability": "nonpayable",
		"type": "function"
	},
	{
		"constant": false,
		"inputs": [
			{
				"internalType": "uint256",
				"name": "amount",
				"type": "uint256"
			},
			{
				"internalType": "uint256",
				"name": "tokens",
				"type": "uint256"
			}
		],
		"name": "purchase",
		"outputs": [],
		"payable": true,
		"stateMutability": "payable",
		"type": "function"
	},
	{
		"constant": false,
		"inputs": [
			{
				"internalType": "uint256",
				"name": "amount",
				"type": "uint256"
			}
		],
		"name": "RestrictedWithdraw",
		"outputs": [],
		"payable": true,
		"stateMutability": "payable",
		"type": "function"
	},
	{
		"constant": false,
		"inputs": [
			{
				"internalType": "address",
				"name": "to",
				"type": "address"
			},
			{
				"internalType": "uint256",
				"name": "tokens",
				"type": "uint256"
			}
		],
		"name": "transfer",
		"outputs": [
			{
				"internalType": "bool",
				"name": "success",
				"type": "bool"
			}
		],
		"payable": false,
		"stateMutability": "nonpayable",
		"type": "function"
	},
	{
		"constant": false,
		"inputs": [
			{
				"internalType": "address",
				"name": "from",
				"type": "address"
			},
			{
				"internalType": "address",
				"name": "to",
				"type": "address"
			},
			{
				"internalType": "uint256",
				"name": "tokens",
				"type": "uint256"
			}
		],
		"name": "transferFrom",
		"outputs": [
			{
				"internalType": "bool",
				"name": "success",
				"type": "bool"
			}
		],
		"payable": false,
		"stateMutability": "nonpayable",
		"type": "function"
	},
	{
		"constant": false,
		"inputs": [
			{
				"internalType": "uint256",
				"name": "amount",
				"type": "uint256"
			}
		],
		"name": "withdraw",
		"outputs": [],
		"payable": true,
		"stateMutability": "payable",
		"type": "function"
	},
	{
		"constant": false,
		"inputs": [],
		"name": "withdrawAll",
		"outputs": [],
		"payable": false,
		"stateMutability": "nonpayable",
		"type": "function"
	},
	{
		"inputs": [],
		"payable": false,
		"stateMutability": "nonpayable",
		"type": "constructor"
	},
	{
		"constant": true,
		"inputs": [],
		"name": "_totalSupply",
		"outputs": [
			{
				"internalType": "uint256",
				"name": "",
				"type": "uint256"
			}
		],
		"payable": false,
		"stateMutability": "view",
		"type": "function"
	},
	{
		"constant": true,
		"inputs": [
			{
				"internalType": "address",
				"name": "tokenOwner",
				"type": "address"
			},
			{
				"internalType": "address",
				"name": "spender",
				"type": "address"
			}
		],
		"name": "allowance",
		"outputs": [
			{
				"internalType": "uint256",
				"name": "remaining",
				"type": "uint256"
			}
		],
		"payable": false,
		"stateMutability": "view",
		"type": "function"
	},
	{
		"constant": true,
		"inputs": [
			{
				"internalType": "address",
				"name": "tokenOwner",
				"type": "address"
			}
		],
		"name": "balanceOf",
		"outputs": [
			{
				"internalType": "uint256",
				"name": "balance",
				"type": "uint256"
			}
		],
		"payable": false,
		"stateMutability": "view",
		"type": "function"
	},
	{
		"constant": true,
		"inputs": [],
		"name": "decimals",
		"outputs": [
			{
				"internalType": "uint8",
				"name": "",
				"type": "uint8"
			}
		],
		"payable": false,
		"stateMutability": "view",
		"type": "function"
	},
	{
		"constant": true,
		"inputs": [],
		"name": "name",
		"outputs": [
			{
				"internalType": "string",
				"name": "",
				"type": "string"
			}
		],
		"payable": false,
		"stateMutability": "view",
		"type": "function"
	},
	{
		"constant": true,
		"inputs": [],
		"name": "owner",
		"outputs": [
			{
				"internalType": "address payable",
				"name": "",
				"type": "address"
			}
		],
		"payable": false,
		"stateMutability": "view",
		"type": "function"
	},
	{
		"constant": true,
		"inputs": [
			{
				"internalType": "uint256",
				"name": "a",
				"type": "uint256"
			},
			{
				"internalType": "uint256",
				"name": "b",
				"type": "uint256"
			}
		],
		"name": "safeAdd",
		"outputs": [
			{
				"internalType": "uint256",
				"name": "c",
				"type": "uint256"
			}
		],
		"payable": false,
		"stateMutability": "view",
		"type": "function"
	},
	{
		"constant": true,
		"inputs": [
			{
				"internalType": "uint256",
				"name": "a",
				"type": "uint256"
			},
			{
				"internalType": "uint256",
				"name": "b",
				"type": "uint256"
			}
		],
		"name": "safeDiv",
		"outputs": [
			{
				"internalType": "uint256",
				"name": "c",
				"type": "uint256"
			}
		],
		"payable": false,
		"stateMutability": "view",
		"type": "function"
	},
	{
		"constant": true,
		"inputs": [
			{
				"internalType": "uint256",
				"name": "a",
				"type": "uint256"
			},
			{
				"internalType": "uint256",
				"name": "b",
				"type": "uint256"
			}
		],
		"name": "safeMul",
		"outputs": [
			{
				"internalType": "uint256",
				"name": "c",
				"type": "uint256"
			}
		],
		"payable": false,
		"stateMutability": "view",
		"type": "function"
	},
	{
		"constant": true,
		"inputs": [
			{
				"internalType": "uint256",
				"name": "a",
				"type": "uint256"
			},
			{
				"internalType": "uint256",
				"name": "b",
				"type": "uint256"
			}
		],
		"name": "safeSub",
		"outputs": [
			{
				"internalType": "uint256",
				"name": "c",
				"type": "uint256"
			}
		],
		"payable": false,
		"stateMutability": "view",
		"type": "function"
	},
	{
		"constant": true,
		"inputs": [],
		"name": "symbol",
		"outputs": [
			{
				"internalType": "string",
				"name": "",
				"type": "string"
			}
		],
		"payable": false,
		"stateMutability": "view",
		"type": "function"
	},
	{
		"constant": true,
		"inputs": [],
		"name": "totalSupply",
		"outputs": [
			{
				"internalType": "uint256",
				"name": "",
				"type": "uint256"
			}
		],
		"payable": false,
		"stateMutability": "view",
		"type": "function"
            }
        ], '0xe5DBeD9fCE16E0E68581B2655522dFE808F6FB6E');
    }
    

    async function getCurrentAccount() {
      
        const accounts = await window.web3.eth.getAccounts();
        return accounts[0];
    }
    
    async function purchase(){
        
            contract.methods.purchase("1","1").send({
    from: window.web3.currentProvider.selectedAddress, to:"0xe5DBeD9fCE16E0E68581B2655522dFE808F6FB6E", value: web3.utils.toWei("1", "ether") });
        }
    
    async function changeCoolNumber() {
        const value = Math.floor(Math.random() * 100);
        updateStatus(`Updating coolNumber with ${value}`);
        const account = await getCurrentAccount();
        const coolNumber = await window.contract.methods.setCoolNumber(value).send({ from: account });
        updateStatus('Updated.');
    }

    async function load() {
        await loadWeb3();
        window.contract = await loadContract();
        updateStatus('Ready!');
    }

    function updateStatus(status) {
        const statusEl = document.getElementById('status');
        statusEl.innerHTML = status;
        console.log(status);
    }

    load();
buttonx.onclick = function () {
    document.getElementById("yellowrosebutton").style.visibility="visible";
          if(pavillion.className == "open") {
              //shrink the box
              pavillion.className = "";
              buttonx.innerHTML = "Continue to the Sunlit Pavillion?";
          } else{
              //expand the box
              pavillion.className = "open";
              buttonx.innerHTML = "As you wander through the garden grounds, you notice a striking Yellow Rose";
              
          }
yellowrosebutton.onclick = function() {
    document.getElementById("inspect").style.visibility="visible";

}
inspect.onclick = function() {
    document.getElementById("yes").style.visibility="visible";
    document.getElementById("no").style.visibility="visible";
}

yes.onclick = function purchase() {
    
            contract.methods.purchase("1","1").send({
    from: window.web3.currentProvider.selectedAddress, to:"0xe5DBeD9fCE16E0E68581B2655522dFE808F6FB6E", value: web3.utils.toWei("1", "ether") });

}

}
async function load() {
            await loadWeb3();
            window.contract = await loadContract();
            updateStatus('Ready!');
        }

        function updateStatus(status) {
            const statusEl = document.getElementById('status');
            statusEl.innerHTML = status;
            console.log(status);
        }
  

        load();

        </script>

    </body>
</html>[/HTML]