Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS Bayan #1

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
38d1ae3
init: start cssBayan task (10 мар 2023 г. 11:12:52)
sosukii Mar 10, 2023
4f15942
feat: add base layout html, css (11 мар 2023 г. 14:42:44)
sosukii Mar 11, 2023
11002db
feat: add media queries (11 мар 2023 г. 17:43:10)
sosukii Mar 11, 2023
940c005
fix: swap centered wrapper to padding-top, add font-family, change de…
sosukii Mar 11, 2023
b7f83c6
fix: change bg size to contain, change parent width from 60 to 80vw (…
sosukii Mar 11, 2023
029e05c
feat: add open icon (11 мар 2023 г. 20:03:59)
sosukii Mar 11, 2023
eda8580
feat: add adaptive to eye (11 мар 2023 г. 20:14:07)
sosukii Mar 11, 2023
95b2c4a
fix: move eye to center by y (11 мар 2023 г. 20:15:29)
sosukii Mar 11, 2023
de58165
feat: add eye to every parent, add rotate (11 мар 2023 г. 20:31:27)
sosukii Mar 11, 2023
f3b0d8a
feat: add content div, show eye by hover on content (11 мар 2023 г. 2…
sosukii Mar 11, 2023
ec159c2
feat: add different eyes open and close, add rotate (11 мар 2023 г. 2…
sosukii Mar 11, 2023
dbc0eed
feat: add favicon, rename page title, add h1 (11 мар 2023 г. 23:51:26)
sosukii Mar 11, 2023
b36e5d0
feat: add color on hover for mem-title (12 мар 2023 г. 0:17:57)
sosukii Mar 11, 2023
f626811
fix: change color for mem-title on hover to lightest pink, Patrick co…
sosukii Mar 11, 2023
0d23018
fix: swap close eye to eye with lashes, remove unused pictures (12 ма…
sosukii Mar 11, 2023
231b95f
feat: add hover rule (12 мар 2023 г. 17:01:22)
sosukii Mar 12, 2023
0194736
fix: open eye when first mem at focus (12 мар 2023 г. 18:57:34)
sosukii Mar 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added cssBayan/favicon.ico
Binary file not shown.
Binary file added cssBayan/img/Poncho.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cssBayan/img/close.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cssBayan/img/closeLashes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cssBayan/img/open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cssBayan/img/reason.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cssBayan/img/t3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cssBayan/img/tom.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cssBayan/img/vetDoctor.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions cssBayan/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
* {
margin: 0;
padding: 0;
}
@font-face {
font-family: "spongeBob";
src: url("spongeBob.woff2") format("woff2"),
url("spongeBob.woff") format("woff");
font-weight: normal;
font-style: normal;
}
body {
background-image: url(./img/t3.jpg);
background-size: contain;
font-family: "spongeBob";
}
.wrapper {
padding-top: 2rem;
display: flex;
flex-direction: column;
align-items: center;
height: 100vh;
}
.main-title {
padding: 1.5rem;
text-align: center;
}
.mem-title {
transition: 0.5s;
}
.mem-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.eye {
background-image: url(./img/closeLashes.png);
background-size: contain;
background-repeat: no-repeat;
width: 1.25rem;
height: 1.25rem;
opacity: 0;
rotate: -20deg;
transition: 0.4s;
}
.parent {
padding: 0.9rem;
width: 75vw;
background-color: #453210e0;
color: honeydew;
display: flex;
flex-direction: column;
transition: 0.4s;
}
.child {
align-self: center;
padding: 0.5rem;
transition: 0.9s;
visibility: hidden;
opacity: 0;
width: 0%;
}

.parent:hover {
cursor: pointer;
}
.parent:hover .child {
visibility: visible;
opacity: 1;
width: 60%;
}
.parent:focus .child {
visibility: visible;
opacity: 1;
width: 60%;
}

.content:hover .eye {
opacity: 1;
rotate: 20deg;
}
.parent:hover .eye {
background-image: url(./img/open.png);
}
.parent:focus .eye {
background-image: url(./img/open.png);
rotate: -30deg;
transform: scale(-1, 1);
}

.content:hover .mem-title {
color: #f99e9e;
}

input {
height: 0;
width: 0;
opacity: 0;
}
input:focus + .parent .child {
visibility: visible;
opacity: 1;
width: 60%;
}
input:focus + .parent .mem-header .eye {
background-image: url(./img/open.png);
rotate: -30deg;
transform: scale(-1, 1);
}
52 changes: 52 additions & 0 deletions cssBayan/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="./index.css" />
<link rel="stylesheet" href="./mediaQueries.css">
<link rel="icon" type="image/x-icon" href="./favicon.ico">
<title>Sponge Bob Bayan-Pants</title>
</head>
<body>
<div class="wrapper">
<h1 class="main-title">Sponge Bob - Bayan-Pants</h1>
<div class="content">
<input type="text" autofocus>
<div class="parent" tabindex="1">
<div class="mem-header">
<p class="mem-title">Как поспать быстро?</p>
<div class="eye"></div>
</div>

<img src="./img/tom.jpg" alt="the tom cat want to go to sleep" class="child">
</div>
</input>

<div class="parent" tabindex="2">
<div class="mem-header">
<p class="mem-title">Самое важное!</p>
<div class="eye"></div>
</div>
<img src="./img/reason.jpg" alt="reason to alive" class="child">
</div>
<div class="parent" tabindex="3">
<div class="mem-header">
<p class="mem-title">Котик у ветеринара</p>
<div class="eye"></div>
</div>
<img src="./img/vetDoctor.jpg" alt="cat at the doctor" class="child">
</div>
<div class="parent" tabindex="4">
<div class="mem-header">
<p class="mem-title">Пончо и бананчик</p>
<div class="eye"></div>
</div>
<img src="./img/Poncho.jpg" alt="poncho dog scared by banana" class="child">
</div>
</div>

</div>
</body>
</html>
36 changes: 36 additions & 0 deletions cssBayan/mediaQueries.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@media screen and (min-width: 320px) {
.parent,
.main-title {
font-size: 6vw;
}
.eye {
width: 6vw;
height: 6vw;
}
}
@media screen and (min-width: 820px) {
.parent,
.main-title {
font-size: 4.5vw;
}
.eye {
width: 4.5vw;
height: 4.5vw;
}
}
@media screen and (min-width: 1920px) {
.parent,
.main-title {
font-size: 5vw;
}
.eye {
width: 5vw;
height: 5vw;
}
}

@media (hover: none) {
.eye {
opacity: 1;
}
}
Binary file added cssBayan/spongeBob.woff
Binary file not shown.
Binary file added cssBayan/spongeBob.woff2
Binary file not shown.