From b48d16a7b03e284d71ee5e8749bd5452ec86b3c1 Mon Sep 17 00:00:00 2001 From: Konsttakis <56228227+Konsttakis@users.noreply.github.com> Date: Tue, 2 Jan 2024 13:39:54 +0200 Subject: [PATCH 1/5] Centered logo / Character hover Centered logo in home screen and changed hovers so when someone hovers on one the other don't change in size. Also hid scrollbar so it doesn't change other container's size randomly --- characters.css | 149 ++++++++++++++++ home-page.css | 473 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 622 insertions(+) create mode 100644 characters.css create mode 100644 home-page.css diff --git a/characters.css b/characters.css new file mode 100644 index 0000000..d7f45cb --- /dev/null +++ b/characters.css @@ -0,0 +1,149 @@ +* { + box-sizing: border-box; +} + +/* Added this so the scrollbar doesn't appear, messing the width of icons */ +html { + overflow-y: hidden; +} + + +body { + margin: 0%; + background-image: url('../image/background-for-game.png'); + background-repeat: no-repeat; + background-size: cover; + font-family: 'Pacifico', cursive; +} + +h1 { + margin-top: -12%; + text-align: center; + font-size: 100px; + color: rgb(204, 137, 13); + text-shadow: 7px 4px black; +} + +.back { + width: 5%; + display: inline-block; + float: right; + opacity: 0.5; +} + +.logo { + margin-top: -4%; + margin-left: 40%; + margin-right: 40%; + width: 20%; +} + +.character_photos { + display: flex; + height: 80%; + width: 95%; + justify-content: space-evenly; +} + +.hero { + opacity: 0.5; + margin-top: -2%; +} + +header { + margin-bottom: 4%; +} + +.choose_your_hero { + margin-top: 9%; +} + +/* Changed the 3 hovers so when you hover over a characther +the other characters don't change in size */ +#hero1:hover { + transform: scale(1.2,1.2); +} + +#hero2:hover { + transform: scale(1.2,1.2); +} + +#hero3:hover { + transform: scale(1.2,1.2); +} + + +@media only screen and (max-width: 1485px) { + .logo { + margin-left: 35%; + margin-right: 35%; + width: 25%; + } +} + +@media only screen and (max-width: 1273px) { + .logo { + margin-left: 31%; + margin-right: 31%; + width: 25%; + } +} + +@media only screen and (max-width: 1085px) { + .logo { + margin-left: 29%; + margin-right: 29%; + width: 29%; + } +} + +@media only screen and (max-width: 900px) { + .logo { + margin-left: 30%; + margin-right: 30%; + width: 25%; + } +} + +@media only screen and (max-width: 600px) { + .home { + width: 10%; + } + + .back { + width: 10%; + } + + h1 { + margin-top: -30%; + font-size: 80px; + } + + .hero { + width: 40%; + margin-left: 32%; + } + + #hero1:hover { + width: 35%; + opacity: 1; + } + + #hero2:hover { + width: 35%; + opacity: 1; + } + + #hero3:hover { + width: 33%; + opacity: 1; + } + + .character_photos { + flex-direction: column-reverse; + } + + .logo { + display: none; + } +} diff --git a/home-page.css b/home-page.css new file mode 100644 index 0000000..56ab11e --- /dev/null +++ b/home-page.css @@ -0,0 +1,473 @@ +* { + box-sizing: border-box; +} + +/* Added this so the scrollbar doesn't appear, messing the width of icons */ +html { + overflow-y: hidden; +} + +body { + margin: 0%; + background-image: url('../image/background-for-game.png'); + background-repeat: no-repeat; + background-size: cover; + text-align: center; + font-family: 'Pacifico', cursive; +} + +form { + text-align: center; +} + +.main-heading { + text-align: center; + font-size: 8.5em; + margin-top: 0%; + margin-right: 20%; + background-image: linear-gradient( + magenta, + magenta, + #31a2ff, + rgb(138, 12, 65) + ); + background-size: 100%; + -webkit-background-clip: text; + -moz-background-clip: text; + -webkit-text-fill-color: transparent; + -moz-text-fill-color: transparent; +} +.icy-tower-wrap{ + position: absolute; + bottom: 0; + left: 0; + z-index: -1; + margin: auto; + width: 100vw; + align-items: center; +} +.icy-tower-img{ + width: 60vw; + margin-inline: 20vw; +} + +@media screen and (max-width: 1200px) { + .main-heading { + font-size: 6em; + } +} + +@media screen and (max-width: 1000px) { + .main-heading { + margin-right: auto; + } +} + +@media screen and (max-width: 700px) { + .main-heading { + font-size: 4em; + } +} + +.hide { + display: none; +} + +#login { + float: right; + margin-right: 4%; + margin-top: 2%; +} + +#sign-in { + margin-bottom: 2%; +} + +/* Changed margin so logo is at the center */ +.container { + margin: 35%; + margin-top: 0%; + position: relative; +} + +.form { + width: 27%; + background-color: white; + color: black; + border: 3px solid #31a2ff; + margin-top: -7%; + margin-left: 37%; + z-index: 99; + align-self: center; + z-index: 99; + position: fixed; +} + +@media screen and (max-width: 1200px) { + .form { + width: 47%; + margin-left: 25%; + } +} + +@media screen and (max-width: 600px) { + .form { + width: 96%; + margin-left: 2%; + } +} + +.form input { + width: 96%; + padding: 3%; + margin: 0.5% 1% 0px 1%; + border: none; + background: #bfb8b8; +} + +.form label { + font-size: 1.5em; +} + +.submit { + width: 96%; + border: none; + margin: 0.5% 1% 0px 1%; + padding: 3.5%; + background: linear-gradient(magenta, #31a2ff, rgb(138, 12, 65)); + color: white; + font-size: 1.8em; +} + +.form input :focus { + background-color: #625b5b; + outline: none; +} + +.form h2 { + font-size: 1.6em; +} + +.row { + display: flex; + flex-wrap: wrap; + padding: 0 4px; +} + +.message { + color: red; +} + +.error-img { + width: 16px; + height: 16px; +} + +#error-massage { + float: left; + color: red; + text-align: left; + margin: 0; +} + +.image { + flex: 50%; + max-width: 50%; + padding: 0 4px; +} + +@media screen and (max-width: 700px) { + .image { + flex: 100%; + max-width: 100%; + } +} + +.container img { + border-radius: 30px; + width: 450px; + height: 350px; +} + +@media screen and (max-width: 1150px) { + .container img { + width: 350px; + } +} + +@media screen and (max-width: 900px) { + .container img { + width: 280px; + height: 250px; + } +} + +@media screen and (max-width: 700px) { + .container img { + width: 450px; + height: 350px; + } +} + +#open-form { + margin-top: 2%; + margin-left: 2%; + float: left; + min-width: 100px; + height: 50px; + border-radius: 30px; + border: 1px solid #ccc; + color: #315bff; + outline: none; + font-size: 20px; + background: white; + font-family: 'Pacifico', cursive; +} +#open-form:hover{ + transform: scale(1.1); +} + +#hello-user { + margin-top: 2%; + margin-left: 2%; + float: left; + min-width: 100px; + height: 82px; + border-radius: 10px; + border: 1px solid #ccc; + color: #315bff; + outline: none; + font-size: 20px; + background: white; +} + +.change-form { + color: #315bff; + border: 1px solid #ccc; + border-radius: 30px; + height: 29px; + font-family: 'Pacifico', cursive; + font-size: 1.1em; +} + +.btn-close { + border: none; + position: absolute; + top: 14px; + left: 14px; + display: block; + width: 28px; + height: 28px; + background: url(../image/close-window.png) no-repeat; + font-family: 'Pacifico', cursive; +} +#close-modal { + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; +} +#you-must-login { + display: none; + font-size: 1.7em; + background-image: url('../image/background-for-game.png'); + position: fixed; + width: 25%; + margin-top: 15%; + z-index: 99; + padding: 20px; + border: 1px solid #888; + border-radius: 40px; + margin-right: 42.5%; + margin-left: 42.5%; +} + +.rainbow-text{ + z-index: 50; + position: relative; + color: #000; + background: #fff; + mix-blend-mode: multiply; + overflow: hidden; + font-size: 8.5em; + /* text-shadow: 0 2px 4px rgba(0,0,0,0.5); */ + padding: 2px 4px 6px; + margin: -2px -4px -6px; + font-weight: bold; /* Added to make the text bold */ + opacity: 8000000; /* Adjust the opacity value as needed */ +} +.rainbow-text::before{ + content: ""; + position: absolute; + top:0;right:0;bottom:0;left:-100%; + background: white repeating-linear-gradient(90deg, #14ffe9 0%, #ffc800 16.66666%, #ff00e0 33.33333%, #14ffe9 50.0%); + mix-blend-mode: screen; + pointer-events: none; + animation: move 1s linear infinite; +} + +@keyframes move{ + 0%{transform: translateX(0);} + 100%{transform: translateX(50%);} +} + +@supports not (mix-blend-mode: multiply) { + .rainbow-text{ + -webkit-text-fill-color: transparent; + background-clip: text !important; + background: white repeating-linear-gradient(90deg, #14ffe9, #ffc800, #ff00e0, #14ffe9); + text-shadow: none; + } + .rainbow-text::before{ content: none; } +} + +.icy-img:hover{ + + animation: shake 0.5s infinite; + animation-timing-function: ease-in-out; +} + + +@keyframes shake { + 0% { + transform: translate(1px, 1px) rotate(0deg); + } + 10% { + transform: translate(2px, -2px) rotate(-1deg); + } + 20% { + transform: translate(3px, 0px) rotate(1deg); + } + 30% { + transform: translate(-4px, 2px) rotate(0deg); + } + 40% { + transform: translate(5px, -1px) rotate(1deg); + } + 50% { + transform: translate(6px, 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(0deg); + } +} +:root { + --color-background: #31037d; + --axis-x: 1px; + --axis-y: 1rem; + --delay: 10; + --color-black: #000; + --color-white: #fff; + --color-orange: #d49c3d; + --color-red: #d14b3d; + --color-violet: #cf52eb; + --color-blue: #44a3f7; + --color-green: #5acb3c; + --color-yellow: #debf40; + --color-foreground: var(--color-white); + --font-name: Righteous; +} +.c-rainbow { + counter-reset: rainbow; + position: relative; + display: flex; + list-style: none; + padding: 0; + margin: 0; + z-index: 5; + box-sizing: border-box; +} + +/* Changed margins so the logo is centered */ +.c-rainbow__layer { + --text-color: var(--color-foreground); + counter-increment: rainbow; + font-size: 3rem; + color: var(--text-color); + text-shadow: -1px -1px 0 var(--color-black), 1px -1px 0 var(--color-black), -1px 1px 0 var(--color-black), 1px 1px 0 var(--color-black), 4px 4px 0 rgba(0, 0, 0, .2); + animation: rainbow 1.5s ease-in-out infinite; + font-size: 150px; + /* margin: 15px; */ + margin-left: 400px; + margin-top: 10px; +} +.c-rainbow__layer:nth-child(1) { + animation-delay: calc(1 / var(--delay) * 1s); + left: calc(var(--axis-x) * 1); + z-index: -10; +} +.c-rainbow__layer:nth-child(2) { + animation-delay: calc(2 / var(--delay) * 1s); + left: calc(var(--axis-x) * 2); + z-index: -20; +} +.c-rainbow__layer:nth-child(3) { + animation-delay: calc(3 / var(--delay) * 1s); + left: calc(var(--axis-x) * 3); + z-index: -30; +} +.c-rainbow__layer:nth-child(4) { + animation-delay: calc(4 / var(--delay) * 1s); + left: calc(var(--axis-x) * 4); + z-index: -40; +} +.c-rainbow__layer:nth-child(5) { + animation-delay: calc(5 / var(--delay) * 1s); + left: calc(var(--axis-x) * 5); + z-index: -50; +} +.c-rainbow__layer:nth-child(6) { + animation-delay: calc(6 / var(--delay) * 1s); + left: calc(var(--axis-x) * 6); + z-index: -60; +} +.c-rainbow__layer:nth-child(7) { + animation-delay: calc(7 / var(--delay) * 1s); + left: calc(var(--axis-x) * 7); + z-index: -70; +} +.c-rainbow__layer:not(:first-child) { + position: absolute; + top: 0; +} +.c-rainbow__layer--white { + --text-color: var(--color-white); +} +.c-rainbow__layer--orange { + --text-color: var(--color-orange); +} +.c-rainbow__layer--red { + --text-color: var(--color-red); +} +.c-rainbow__layer--violet { + --text-color: var(--color-violet); +} +.c-rainbow__layer--blue { + --text-color: var(--color-blue); +} +.c-rainbow__layer--green { + --text-color: var(--color-green); +} +.c-rainbow__layer--yellow { + --text-color: var(--color-yellow); +} +@keyframes rainbow { + 0%, 100% { + transform: translatey(var(--axis-y)); + } + 50% { + transform: translatey(calc(var(--axis-y) * -1)); + } +} From 3d42c35b0306869b19eb0b3eda21d72f89bd5805 Mon Sep 17 00:00:00 2001 From: Konsttakis <56228227+Konsttakis@users.noreply.github.com> Date: Wed, 3 Jan 2024 15:57:49 +0200 Subject: [PATCH 2/5] Add files via upload --- css/characters.css | 18 +++-- css/home-page.css | 143 ++++++++++++++++-------------------- css/instructions.css | 2 +- html/characters.html | 2 +- html/difficulty-levels.html | 2 +- html/game-scores.html | 2 +- html/home-page.html | 8 +- html/icy-tower-home.html | 2 +- html/iframe-hello-user.html | 2 +- html/instructions.html | 2 +- html/tower.html | 74 +++++++++---------- js/login-sign-in.js | 14 ++-- js/tower.js | 33 +++++---- 13 files changed, 148 insertions(+), 156 deletions(-) diff --git a/css/characters.css b/css/characters.css index ae669fc..d7f45cb 100644 --- a/css/characters.css +++ b/css/characters.css @@ -2,6 +2,12 @@ box-sizing: border-box; } +/* Added this so the scrollbar doesn't appear, messing the width of icons */ +html { + overflow-y: hidden; +} + + body { margin: 0%; background-image: url('../image/background-for-game.png'); @@ -52,21 +58,21 @@ header { margin-top: 9%; } +/* Changed the 3 hovers so when you hover over a characther +the other characters don't change in size */ #hero1:hover { - width: 15%; - opacity: 1; + transform: scale(1.2,1.2); } #hero2:hover { - width: 15%; - opacity: 1; + transform: scale(1.2,1.2); } #hero3:hover { - width: 12%; - opacity: 1; + transform: scale(1.2,1.2); } + @media only screen and (max-width: 1485px) { .logo { margin-left: 35%; diff --git a/css/home-page.css b/css/home-page.css index 7c9e1b9..56ab11e 100644 --- a/css/home-page.css +++ b/css/home-page.css @@ -2,6 +2,11 @@ box-sizing: border-box; } +/* Added this so the scrollbar doesn't appear, messing the width of icons */ +html { + overflow-y: hidden; +} + body { margin: 0%; background-image: url('../image/background-for-game.png'); @@ -32,18 +37,18 @@ form { -webkit-text-fill-color: transparent; -moz-text-fill-color: transparent; } -.icy-tower-wrap { - position: absolute; - bottom: 0; - left: 0; - z-index: -1; - margin: auto; - width: 100vw; - align-items: center; +.icy-tower-wrap{ + position: absolute; + bottom: 0; + left: 0; + z-index: -1; + margin: auto; + width: 100vw; + align-items: center; } -.icy-tower-img { - width: 60vw; - margin-inline: 20vw; +.icy-tower-img{ + width: 60vw; + margin-inline: 20vw; } @media screen and (max-width: 1200px) { @@ -78,8 +83,9 @@ form { margin-bottom: 2%; } +/* Changed margin so logo is at the center */ .container { - margin: 10%; + margin: 35%; margin-top: 0%; position: relative; } @@ -217,7 +223,7 @@ form { background: white; font-family: 'Pacifico', cursive; } -#open-form:hover { +#open-form:hover{ transform: scale(1.1); } @@ -276,12 +282,12 @@ form { margin-left: 42.5%; } -.rainbow-text { +.rainbow-text{ z-index: 50; - position: relative; - color: #000; - background: #fff; - mix-blend-mode: multiply; + position: relative; + color: #000; + background: #fff; + mix-blend-mode: multiply; overflow: hidden; font-size: 8.5em; /* text-shadow: 0 2px 4px rgba(0,0,0,0.5); */ @@ -290,86 +296,71 @@ form { font-weight: bold; /* Added to make the text bold */ opacity: 8000000; /* Adjust the opacity value as needed */ } -.rainbow-text::before { - content: ''; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: -100%; - background: white - repeating-linear-gradient( - 90deg, - #14ffe9 0%, - #ffc800 16.66666%, - #ff00e0 33.33333%, - #14ffe9 50% - ); - mix-blend-mode: screen; - pointer-events: none; +.rainbow-text::before{ + content: ""; + position: absolute; + top:0;right:0;bottom:0;left:-100%; + background: white repeating-linear-gradient(90deg, #14ffe9 0%, #ffc800 16.66666%, #ff00e0 33.33333%, #14ffe9 50.0%); + mix-blend-mode: screen; + pointer-events: none; animation: move 1s linear infinite; } -@keyframes move { - 0% { - transform: translateX(0); - } - 100% { - transform: translateX(50%); - } +@keyframes move{ + 0%{transform: translateX(0);} + 100%{transform: translateX(50%);} } @supports not (mix-blend-mode: multiply) { - .rainbow-text { - -webkit-text-fill-color: transparent; - background-clip: text !important; - background: white - repeating-linear-gradient(90deg, #14ffe9, #ffc800, #ff00e0, #14ffe9); + .rainbow-text{ + -webkit-text-fill-color: transparent; + background-clip: text !important; + background: white repeating-linear-gradient(90deg, #14ffe9, #ffc800, #ff00e0, #14ffe9); text-shadow: none; - } - .rainbow-text::before { - content: none; - } + } + .rainbow-text::before{ content: none; } } -.icy-img:hover { - animation: shake 0.5s infinite; - animation-timing-function: ease-in-out; +.icy-img:hover{ + + animation: shake 0.5s infinite; + animation-timing-function: ease-in-out; } + @keyframes shake { 0% { - transform: translate(1px, 1px) rotate(0deg); + transform: translate(1px, 1px) rotate(0deg); } 10% { - transform: translate(2px, -2px) rotate(-1deg); + transform: translate(2px, -2px) rotate(-1deg); } 20% { - transform: translate(3px, 0px) rotate(1deg); + transform: translate(3px, 0px) rotate(1deg); } 30% { - transform: translate(-4px, 2px) rotate(0deg); + transform: translate(-4px, 2px) rotate(0deg); } 40% { - transform: translate(5px, -1px) rotate(1deg); + transform: translate(5px, -1px) rotate(1deg); } 50% { - transform: translate(6px, 2px) rotate(-1deg); + transform: translate(6px, 2px) rotate(-1deg); } 60% { - transform: translate(-3px, 1px) rotate(0deg); + transform: translate(-3px, 1px) rotate(0deg); } 70% { - transform: translate(3px, 1px) rotate(-1deg); + transform: translate(3px, 1px) rotate(-1deg); } 80% { - transform: translate(-1px, -1px) rotate(1deg); + transform: translate(-1px, -1px) rotate(1deg); } 90% { - transform: translate(1px, 2px) rotate(0deg); + transform: translate(1px, 2px) rotate(0deg); } 100% { - transform: translate(1px, -2px) rotate(0deg); + transform: translate(1px, -2px) rotate(0deg); } } :root { @@ -398,21 +389,18 @@ form { z-index: 5; box-sizing: border-box; } + +/* Changed margins so the logo is centered */ .c-rainbow__layer { --text-color: var(--color-foreground); counter-increment: rainbow; font-size: 3rem; color: var(--text-color); - text-shadow: - -1px -1px 0 var(--color-black), - 1px -1px 0 var(--color-black), - -1px 1px 0 var(--color-black), - 1px 1px 0 var(--color-black), - 4px 4px 0 rgba(0, 0, 0, 0.2); + text-shadow: -1px -1px 0 var(--color-black), 1px -1px 0 var(--color-black), -1px 1px 0 var(--color-black), 1px 1px 0 var(--color-black), 4px 4px 0 rgba(0, 0, 0, .2); animation: rainbow 1.5s ease-in-out infinite; font-size: 150px; /* margin: 15px; */ - margin-left: 110px; + margin-left: 400px; margin-top: 10px; } .c-rainbow__layer:nth-child(1) { @@ -476,11 +464,10 @@ form { --text-color: var(--color-yellow); } @keyframes rainbow { - 0%, - 100% { - transform: translatey(var(--axis-y)); - } + 0%, 100% { + transform: translatey(var(--axis-y)); + } 50% { - transform: translatey(calc(var(--axis-y) * -1)); - } + transform: translatey(calc(var(--axis-y) * -1)); + } } diff --git a/css/instructions.css b/css/instructions.css index 3b8652b..d033d94 100644 --- a/css/instructions.css +++ b/css/instructions.css @@ -50,7 +50,7 @@ body { #explanation1 { margin-top: -33%; - margin-left: 2%; + margin-left: 2% } #explanation2 { diff --git a/html/characters.html b/html/characters.html index c3eab31..f78a2be 100644 --- a/html/characters.html +++ b/html/characters.html @@ -9,7 +9,7 @@ rel="stylesheet" /> - +