Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <!-- Add the title for the page here -->
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <!-- Add an icon for the page here -->
- <link rel="stylesheet" href="/style.css" />
- <!-- *** Script responsible for predicting the future *** -->
- <!--<script src="/script.js" defer></script>-->
- </head>
- <body>
- <div class="content" role="main">
- <!-- Add an h1 header with the content: "In the Land of the Future" here -->
- <!-- Add an h2 header with the content: "Ask the Crystal Ball <br> and Discover Your Future in 50 Years" here -->
- <div id="questions">
- <label>
- <input type="radio" class="option-input radio" name="questions" value="0" checked />
- What will be my profession?
- </label>
- <label>
- <input type="radio" class="option-input radio" name="questions" value="1" />
- What will my space home look like?
- </label>
- <label>
- <input type="radio" class="option-input radio" name="questions" value="2" />
- What will I use for accomodation?
- </label>
- </div>
- <div id="crystal-container">
- <div id="crystal">
- <!-- Add an image of the crystal ball here -->
- <!-- Add a button with id="button" and content: "Check" here -->
- </div>
- <!-- Add a default image for the crystal ball screen and set id="screen"-->
- </div>
- </div>
- </body>
- </html>
- @font-face {
- font-family: Tektur;
- src: url("https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/Czcionka_Tektur.ttf?v=1690043449282")
- format("opentype");
- }
- @font-face {
- font-family: Bungee;
- src: url("https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/Czcionka_BungeeHairline.ttf?v=1690044154180")
- format("opentype");
- }
- body {
- background: #1d294e;
- font-family: 'Bungee', sans-serif;
- font-weight: bold;
- color: white;
- text-align: center;
- }
- #crystal-container{
- background: #17254c no-repeat top;
- /* Set the background image here (background-image: url('') ) by pasting the image link */
- z-index: -10;
- height: 650px;
- padding-top: 35px;
- border: 2px outset #1d294e;
- border-top: 0px;
- }
- #questions{
- border: 0px outset #1d294e;
- /* Set the frame thickness (border-width) to 2px */
- border-bottom: 0px;
- padding-bottom: 15px;
- background: #192c61;
- }
- h1{
- font-family: 'Tektur', sans-serif;
- font-size: 40pt;
- background: linear-gradient(to top, #28c4f3 17%, #033bbf 59%);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- -webkit-text-stroke-width: 1px;
- -webkit-text-stroke-color: white;
- }
- #crystal {
- width: 600px;
- margin: 0px auto;
- position: relative;
- z-index: 10;
- }
- #screen {
- width: 280px;
- z-index: 0;
- position: relative;
- top: -560px;
- opacity: 0.8;
- border-radius: 100%;
- }
- #button {
- padding: 20px;
- border: none;
- cursor: pointer;
- /* Set the button text color (color) to white */
- background: rgb(40,196,243);
- background: radial-gradient(circle, rgba(40,196,243,1) 0%, rgba(3,59,191,1) 100%);
- border-radius: 100%;
- box-shadow: 0px 10px 0px 0px grey;
- z-index: 10;
- position: relative;
- top: -150px;
- font-family: 'Bungee', sans-serif;
- font-weight: bold;
- }
- #crystal:hover {
- animation: shake 0.5s infinite;
- }
- button:active {
- animation: puff 4s 1;
- }
- @keyframes shake {
- 0% { transform: translate(1px, 1px) rotate(0deg); }
- 10% { transform: translate(-1px, -2px) rotate(-1deg); }
- 20% { transform: translate(-3px, 0px) rotate(1deg); }
- 30% { transform: translate(3px, 2px) rotate(0deg); }
- 40% { transform: translate(1px, -1px) rotate(1deg); }
- 50% { transform: translate(-1px, 2px) rotate(-1deg); }
- 60% { transform: translate(-3px, 1px) rotate(0deg); }
- 70% { transform: translate(3px, 1px) rotate(-1deg); }
- 80% { transform: translate(-1px, -1px) rotate(1deg); }
- 90% { transform: translate(1px, 2px) rotate(0deg); }
- 100% { transform: translate(1px, -2px) rotate(-1deg); }
- }
- @keyframes puff {
- 0% { filter: brightness(0%); }
- 5% { filter: brightness(120%); }
- 100% { filter: brightness(1000%); }
- }
- .content{
- width: 900px;
- margin: 0px auto;
- }
- label{
- display: block;
- line-height: 40px;
- }
- .option-input {
- -webkit-appearance: none;
- -moz-appearance: none;
- -ms-appearance: none;
- -o-appearance: none;
- appearance: none;
- position: relative;
- top: 13.33333px;
- right: 0;
- bottom: 0;
- left: 0;
- height: 40px;
- width: 40px;
- transition: all 0.15s ease-out 0s;
- background: #cbd1d8;
- border: none;
- color: #ffffff;
- cursor: pointer;
- display: inline-block;
- margin-right: 0.5rem;
- outline: none;
- position: relative;
- z-index: 1000;
- }
- .option-input:hover {
- background: #9faab7;
- }
- .option-input:checked {
- background: #1fa4e6;
- }
- .option-input:checked::before {
- width: 40px;
- height: 40px;
- display: flex;
- content: '';
- font-size: 25px;
- font-weight: bold;
- position: absolute;
- align-items: center;
- justify-content: center;
- }
- .option-input:checked::after {
- -webkit-animation: click-wave 0.65s;
- -moz-animation: click-wave 0.65s;
- animation: click-wave 0.65s;
- background: #1fa4e6;
- content: '';
- display: block;
- position: relative;
- z-index: 100;
- }
- .option-input.radio {
- border-radius: 50%;
- }
- .option-input.radio::after {
- border-radius: 50%;
- }
- @keyframes click-wave {
- 0% {
- height: 40px;
- width: 40px;
- opacity: 0.35;
- position: relative;
- }
- 100% {
- height: 200px;
- width: 200px;
- margin-left: -80px;
- margin-top: -80px;
- opacity: 0;
- }
- }
- /* You can paste links to your house images here - replacing the existing ones.
- Important - there must always be 5 links */
- const houses = [
- "https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/dom%20(1).png?v=1690059355819",
- "https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/dom%20(2).jpg?v=1690059356483",
- "https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/dom%20(3).jpg?v=1690059356948",
- "https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/dom%20(4).jpg?v=1690059357494",
- "https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/dom%20(5).jpg?v=1691263838668"
- ];
- /* You can paste links to your profession images here - replacing the existing ones.
- Important - there must always be 5 links */
- const professions = [
- "https://cdn.glitch.global/de89cf25-4e3d-4dd7-a9e6-9a5a1fd2e5fb/praca%20(1).png?v=1691228542339",
- "https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/praca%20(2).png?v=1691057240824",
- "https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/praca%20(3).png?v=1691057241531",
- "https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/praca%20(4).png?v=1691057238814",
- "https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/praca%20(5).png?v=1691057239496"
- ];
- /* You can paste links to your vehicle images here - replacing the existing ones.
- Important - there must always be 5 links */
- const vehicles = [
- "https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/pojazd%20(1).jpg?v=1690059358456",
- "https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/pojazd%20(2).png?v=1691057288446",
- "https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/pojazd%20(3).png?v=1691057297634",
- "https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/pojazd%20(4).jpg?v=1690059359924",
- "https://cdn.glitch.global/9c825c16-b4c3-4f2d-a2d2-51f3624f6303/pojazd%20(5).jpg?v=1690059360429"
- ];
- const screenAnim = [
- { transform: "rotate(0) scale(1)", filter: "brightness(0%)"},
- { transform: "rotate(360deg) scale(0)" , filter: "brightness(5000%)" },
- ];
- const screenTiming = {
- duration: 1000,
- iterations: 1,
- };
- const image = document.querySelector("#screen");
- let imageCounter = Math.floor(Math.random() * 5);
- let currentState = 0;
- function newGame(){
- currentState = 0;
- var selectValue = Array.from(document.getElementsByName("questions")).find(radio => radio.checked);
- var questionNumber = selectValue.value;
- if (questionNumber == 0) image.src = professions[imageCounter];
- if (questionNumber == 1) image.src = houses[imageCounter];
- if (questionNumber == 2) image.src = vehicles[imageCounter];
- document.querySelector("#button").disabled = false;
- }
- document.querySelector("#button").addEventListener("click", function () {
- /* Replace the image randomization with the following two lines */
- imageCounter++;
- if (imageCounter >= 5) imageCounter = 0;
- document.querySelector("#button").disabled = true;
- image.animate(screenAnim, screenTiming)
- setTimeout(newGame, 850);
- });
Add Comment
Please, Sign In to add comment