Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
177 changes: 177 additions & 0 deletions Anatoly Shlom/flex/css/flex.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
/* Приводим браузерные стили в порядок */
@import url('normalize.css');
/* Добавляем необходимый шрифт*/
@import url('https://fonts.googleapis.com/css?family=Lato:300,400,700');
* {
font-family: 'Lato', sans-serif;
font-weight: 300;
color: #ffffff;
padding: 0;
margin: 0;
}
/*Добавляем фон и немножко кросбраузерности)*/
html {
background: url("../img/bg.png") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
/*оформляем сам виджет*/
.widget {
background: no-repeat;
background-image: url("../img/main_bg.png");
background-size: cover;
margin: 7% 11% 7% 11%;
padding: 10% 0 0 0;
}
/*верхняя часть виджета*/
@media (max-width: 600px) {
.widget-data {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
}
@media only screen and (min-width: 600px) {
.widget-data {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: flex-start;
margin: 0 10% 0 0;
}
}
/*секция с текущей датой*/
@media only screen and (min-width: 600px) {
.current-date {
margin: 20px 20px 0 0 ;
}
}
.current-date__week-day {
font-size: 30px;
}
.current-date__day {
font-size: 14px;
}
/*секция с температурой,локацией,ветром*/
.weather-block {
display: table-cell;
text-align: center;
}
.weather-block__temperature {
font-size: 92px;
font-weight: 700;
}
.weather-block__location {
font-size: 22px;
}
.wind-block {
display: flex;
flex-direction: row;
justify-content: center;
align-items: flex-end;
}
.wind-block__speed {
font-size: 29px;
font-weight: 400;
}
.wind-block__speed-format {
font-size: 14px;
font-weight: 400;
padding: 0 0 3px 0;
/*три пикселя выше нужны что бы стояли на одной линии значение и единицы измерения
Верю в то что это баг шрифта, а не мои кривые руки)*/
}
/* Оформляем навбар*/
.nav-block {
background: rgba(0, 0, 0, 0.5);
margin: 10% 0 0 0;
}
@media (max-width: 600px) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you didn't use screen here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought i don't have to, because this conditions influence only mobile version

ul {
list-style: none;
margin: 0 20px 0 20px;
padding-left: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
}
ul li {
font-size: 14px;
}
.nav-block__arrow-box {
display: flex;
justify-content: center;
}
.nav-block__divider_active {
padding-top: 3px;
padding-bottom: 3px;
border-top: 1px solid;
display: flex;
flex-direction: row;
justify-content: space-around;
}
.nav-block__divider_disable {
display: flex;
flex-direction: row;
justify-content: space-around;
}
.nav-block__icon {
height: 20px;
margin-left: 20%;
margin-right: 20%;
align-self: center;
}
.nav-block__date {
width: 100px;
align-self: center;
}
.nav-block__temp {
margin-left: auto;
text-align: right;
width: 33%;
align-self: center;
}
.nav-block__arrow_up {
-o-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
.nav-block__arrow_down {
-o-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
}
@media only screen and (min-width: 600px) {
ul {
list-style: none;
margin: 0;
padding-left: 0;
display: flex;
align-items: center;
justify-content: center;
}
ul li {
font-size: 14px;
display: table-cell;
text-align: center;
width: 16%;
}
ul li p {
margin: 10px;
}
.nav-block__icon {
height: 25px;
}
.nav-block__divider_active {
padding-left: 3px;
border-left: 1px solid;
}
}
194 changes: 194 additions & 0 deletions Anatoly Shlom/flex/css/flex.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@

/* Приводим браузерные стили в порядок */
@import url('normalize.css');

/* Добавляем необходимый шрифт*/
@import url('https://fonts.googleapis.com/css?family=Lato:300,400,700');
* {
font-family: 'Lato', sans-serif;
font-weight: 300;
color: #ffffff;
padding: 0;
margin: 0;
}

/*Добавляем фон и немножко кросбраузерности)*/
html {
background: url("../img/bg.png") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

/*оформляем сам виджет*/
.widget {
background: no-repeat;
background-image: url("../img/main_bg.png");
background-size: cover;
margin: 7% 11% 7% 11%;
padding: 10% 0 0 0;
}

/*верхняя часть виджета*/
@media (max-width: 600px) {
.widget-data {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
}
@media only screen and (min-width: 600px) {
.widget-data {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: flex-start;
margin:0 10% 0 0;
}
}
/*секция с текущей датой*/
@media only screen and (min-width: 600px) {
.current-date {
margin: 20px 20px 0 0 ;
}
}
.current-date__week-day {
font-size: 30px;
}
.current-date__day {
font-size: 14px;
}

/*секция с температурой,локацией,ветром*/
.weather-block {
display: table-cell;
text-align: center;

&__temperature {
font-size: 92px;
font-weight: 700;
}
&__location {
font-size: 22px;
}
}
.wind-block {
display: flex;
flex-direction: row;
justify-content: center;
align-items: flex-end;
}

.wind-block__speed {
font-size: 29px;
font-weight: 400;
}
.wind-block__speed-format {
Copy link
Copy Markdown
Collaborator

@DanilRostov DanilRostov Jul 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preprocessor allows you to write it like so:

.wind-block {
    font-size: 29px;
    font-weight: 400;

    &__speed {
         ...
     }

    &__speed-format {
        ...
    }
}

By this way you wouldn't rename all styles when you decided to change name of the block

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats really awesome feature!! Thank you!!

font-size: 14px;
font-weight: 400;
padding: 0 0 3px 0;
/*три пикселя выше нужны что бы стояли на одной линии значение и единицы измерения
Верю в то что это баг шрифта, а не мои кривые руки)*/
}


/* Оформляем навбар*/

.nav-block {
background:rgba(0,0,0,0.5);
margin: 10% 0 0 0;
}

@media (max-width: 600px) {
ul {
list-style: none;
margin: 0 20px 0 20px;
padding-left: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
li {
font-size: 14px;

}
}

.nav-block__arrow-box {
display:flex;
justify-content: center;
}
.nav-block__divider_active {
padding-top: 3px;
padding-bottom: 3px;
border-top: 1px solid;
display: flex;
flex-direction: row;
justify-content: space-around;

}
.nav-block__divider_disable {
display: flex;
flex-direction: row;
justify-content: space-around;

}
.nav-block__icon {
height: 20px;
margin-left: 20%;
margin-right: 20%;
align-self: center;
}
.nav-block__date {
width: 100px;
align-self: center;
}
.nav-block__temp {
margin-left: auto;
text-align: right;
width: 33%;
align-self: center;
}
.nav-block__arrow_up {
-o-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
.nav-block__arrow_down {
-o-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
}

@media only screen and (min-width: 600px) {
ul {
list-style: none;
margin: 0;
padding-left: 0;
display: flex;
align-items: center;
justify-content: center;
li {
font-size: 14px;
display: table-cell;
text-align: center;
width:16%;
p {
margin: 10px;
}
}
}
.nav-block__icon {
height: 25px;
}
.nav-block__divider_active{
padding-left: 3px;
border-left: 1px solid;
}
}
Loading