|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <meta name="viewport" content="width=device-width"> |
| 6 | + <title>Doraemon Friendship Results</title> |
| 7 | + <header> |
| 8 | + <h1 id="title"> doreamonfacts </h1> |
| 9 | + <nav> |
| 10 | + <ul> |
| 11 | + <li><a href="index.html">Home</a></li> |
| 12 | + <li><a href="doreamonregister.html">Register</a></li> |
| 13 | + <li><a href="doreamonmedia.html">Doreamon Media</a></li> |
| 14 | + <li><a href="doreamonmarking.html">Doreamon Form</a></li> |
| 15 | + <li><a href="gadgets.html">Doreamon Gadget</a></li> |
| 16 | + </ul> |
| 17 | + |
| 18 | + </nav> |
| 19 | + </header> |
| 20 | + <link rel="stylesheet" href="style.css"> |
| 21 | + <style> |
| 22 | + body { text-align: center; padding: 20px; font-family: "Comic Sans MS", cursive; } |
| 23 | + h1 { color: lightblue; text-shadow: 2px 2px skyblue; } |
| 24 | + .result { background: white; border: 5px solid lightblue; border-radius: 15px; padding: 20px; display: inline-block; box-shadow: 0 0 15px skyblue; margin-top: 20px; } |
| 25 | + .result p { font-size: 1.2em; margin: 10px 0; } |
| 26 | + .score { font-size: 1.5em; color: darkblue; font-weight: bold; } |
| 27 | + label { display: block; margin: 5px 0; } |
| 28 | + button { margin: 5px; padding: 8px 15px; border-radius: 8px; border: none; cursor: pointer; font-weight: bold; background: lightblue; color: white; } |
| 29 | + button:hover { background: skyblue; } |
| 30 | + </style> |
| 31 | +</head> |
| 32 | +<body> |
| 33 | + |
| 34 | +<h1>🎉 Doraemon Friendship Form 🎉</h1> |
| 35 | + |
| 36 | +<div class="result"> |
| 37 | + <label>Name: <input type="text" id="name"></label> |
| 38 | + |
| 39 | + <label>Favourite Doraemon Character: |
| 40 | + <select id="character"> |
| 41 | + <option value="Doraemon">Doraemon</option> |
| 42 | + <option value="Nobita">Nobita</option> |
| 43 | + <option value="Shizuka">Shizuka</option> |
| 44 | + <option value="Gian">Gian</option> |
| 45 | + <option value="Suneo">Suneo</option> |
| 46 | + </select> |
| 47 | + </label> |
| 48 | + |
| 49 | + <label>Favourite Gadget: |
| 50 | + <select id="gadget"> |
| 51 | + <option value="Anywhere Door">Anywhere Door</option> |
| 52 | + <option value="Time Machine">Time Machine</option> |
| 53 | + <option value="Take-Copter">Take-Copter</option> |
| 54 | + <option value="Small Light">Small Light</option> |
| 55 | + </select> |
| 56 | + </label> |
| 57 | + |
| 58 | + <label>Do you like Doraemon?</label> |
| 59 | + <label><input type="radio" name="like" value="Yes"> Yes</label> |
| 60 | + <label><input type="radio" name="like" value="Very Much"> Very Much</label> |
| 61 | + |
| 62 | + <label>Favourite Episode Type:</label> |
| 63 | + <label><input type="checkbox" class="episode" value="Funny"> Funny</label> |
| 64 | + <label><input type="checkbox" class="episode" value="Adventure"> Adventure</label> |
| 65 | + <label><input type="checkbox" class="episode" value="Emotional"> Emotional</label> |
| 66 | + |
| 67 | + <br><br> |
| 68 | + <button onclick="calculateScore()">Submit</button> |
| 69 | + <button onclick="setWorst()">Worst Result</button> |
| 70 | + <button onclick="setBest()">Best Result</button> |
| 71 | + <button onclick="goBack()">Back</button> |
| 72 | +</div> |
| 73 | + |
| 74 | +<div class="result" id="output" style="display:none;"> |
| 75 | + <p><strong>Doraemon Friend Score:</strong> <span id="friendScore" class="score"></span>/100</p> |
| 76 | + <p><strong>How much Shizuka likes you:</strong> <span id="shizukaScore" class="score"></span>%</p> |
| 77 | +</div> |
| 78 | + |
| 79 | +<script> |
| 80 | +function calculateScore() { |
| 81 | + let name = document.getElementById('name').value || "Unknown"; |
| 82 | + let character = document.getElementById('character').value; |
| 83 | + let gadget = document.getElementById('gadget').value; |
| 84 | + let like = document.querySelector('input[name="like"]:checked')?.value || "No"; |
| 85 | + |
| 86 | + let episodes = Array.from(document.querySelectorAll('.episode:checked')).map(e => e.value); |
| 87 | + |
| 88 | + // Calculate score |
| 89 | + let score = 0; |
| 90 | + if(like === "Yes") score += 20; |
| 91 | + if(like === "Very Much") score += 40; |
| 92 | + if(character === "Doraemon") score += 20; |
| 93 | + if(character === "Shizuka") score += 10; |
| 94 | + score += Math.min(episodes.length * 10, 30); |
| 95 | + score = Math.min(score, 100); |
| 96 | + |
| 97 | + let shizukaLike = Math.min(Math.round(score * 0.7 + Math.random() * 30), 100); |
| 98 | + |
| 99 | + // Display results |
| 100 | + document.getElementById('friendScore').textContent = score; |
| 101 | + document.getElementById('shizukaScore').textContent = shizukaLike; |
| 102 | + document.getElementById('output').style.display = "block"; |
| 103 | +} |
| 104 | + |
| 105 | +// Set form to worst possible result |
| 106 | +function setWorst() { |
| 107 | + document.getElementById('name').value = ""; |
| 108 | + document.getElementById('character').value = "Nobita"; |
| 109 | + document.getElementById('gadget').value = "Anywhere Door"; |
| 110 | + document.querySelectorAll('input[name="like"]').forEach(r => r.checked = false); |
| 111 | + document.querySelectorAll('.episode').forEach(c => c.checked = false); |
| 112 | + calculateScore(); |
| 113 | +} |
| 114 | + |
| 115 | +// Set form to best possible result |
| 116 | +function setBest() { |
| 117 | + document.getElementById('name').value = "Best Friend"; |
| 118 | + document.getElementById('character').value = "Doraemon"; |
| 119 | + document.getElementById('gadget').value = "Anywhere Door"; |
| 120 | + document.querySelector('input[name="like"][value="Very Much"]').checked = true; |
| 121 | + document.querySelectorAll('.episode').forEach(c => c.checked = true); |
| 122 | + calculateScore(); |
| 123 | +} |
| 124 | + |
| 125 | +// Go back to index.html |
| 126 | +function goBack() { |
| 127 | + window.location.href = "index.html"; |
| 128 | +} |
| 129 | +</script> |
| 130 | + |
| 131 | +</body> |
| 132 | +</html> |
0 commit comments