diff --git a/assets/css/_raleway.scss b/assets/css/_raleway.scss index 999ca77..b1c8c10 100644 --- a/assets/css/_raleway.scss +++ b/assets/css/_raleway.scss @@ -3,7 +3,8 @@ font-style: normal; font-weight: 300; src: local('Raleway Light'), local('Raleway-Light'), url('../fonts/Raleway-Thin.ttf') format('ttf'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, + U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { @@ -11,7 +12,8 @@ font-style: normal; font-weight: 400; src: local('Raleway'), local('Raleway-Regular'), url('../fonts/Raleway-Regular.ttf') format('ttf'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, + U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { @@ -19,5 +21,6 @@ font-style: normal; font-weight: 300; src: local('Raleway Light'), local('Raleway-Bold'), url('../fonts/Raleway-Bold.ttf') format('ttf'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, + U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } diff --git a/assets/css/_shared.scss b/assets/css/_shared.scss index 6540b80..4e15dcb 100644 --- a/assets/css/_shared.scss +++ b/assets/css/_shared.scss @@ -1,8 +1,8 @@ -@import "shared/langpicker"; -@import "shared/sharebuttons"; -@import "shared/footer"; -@import "shared/video-player"; -@import "shared/navigation"; +@import 'shared/langpicker'; +@import 'shared/sharebuttons'; +@import 'shared/footer'; +@import 'shared/video-player'; +@import 'shared/navigation'; html { height: 100vh; @@ -85,15 +85,25 @@ h6 { flex-grow: 1; } - .label { color: white; padding: 6px; border-radius: 13px; } -.success {background-color: #4CAF50;} /* Green */ -.info {background-color: #2196F3;} /* Blue */ -.warning {background-color: #ff9800;} /* Orange */ -.danger {background-color: #f44336;} /* Red */ -.other {background-color: #e7e7e7; color: black;} /* Gray */ +.success { + background-color: #4caf50; +} /* Green */ +.info { + background-color: #2196f3; +} /* Blue */ +.warning { + background-color: #ff9800; +} /* Orange */ +.danger { + background-color: #f44336; +} /* Red */ +.other { + background-color: #e7e7e7; + color: black; +} /* Gray */ diff --git a/assets/css/_variables.scss b/assets/css/_variables.scss index b58d4c8..9dce9de 100644 --- a/assets/css/_variables.scss +++ b/assets/css/_variables.scss @@ -1,18 +1,18 @@ -@import "~bootstrap/scss/bootstrap-grid"; +@import '~bootstrap/scss/bootstrap-grid'; // nav implementation -@import "~bootstrap/scss/mixins/_hover"; -@import "~bootstrap/scss/mixins/_border-radius"; -@import "~bootstrap/scss/_nav"; -@import "~bootstrap/scss/utilities/_position"; -@import "~bootstrap/scss/mixins/_grid-framework"; +@import '~bootstrap/scss/mixins/_hover'; +@import '~bootstrap/scss/mixins/_border-radius'; +@import '~bootstrap/scss/_nav'; +@import '~bootstrap/scss/utilities/_position'; +@import '~bootstrap/scss/mixins/_grid-framework'; -@import "raleway"; +@import 'raleway'; $background: #12233f; $text: #fafafa; $accent1: #ffbf00; -$accent2: #142E4D; +$accent2: #142e4d; $accent3: #b9d6f2; $text_invert: $background; diff --git a/assets/css/app.scss b/assets/css/app.scss index cf749f9..66f5700 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -1,25 +1,38 @@ -@import "_variables"; -@import "_shared"; -@import "~flag-icon-css/sass/flag-icon"; +@import '_variables'; +@import '_shared'; +@import '~flag-icon-css/sass/flag-icon'; //@import "~font-awesome/scss/font-awesome"; -@import "~font-awesome/scss/variables"; -@import "~font-awesome/scss/core"; -@import "~font-awesome/scss/path"; +@import '~font-awesome/scss/variables'; +@import '~font-awesome/scss/core'; +@import '~font-awesome/scss/path'; //@import "~font-awesome/scss/icons"; -.#{$fa-css-prefix}-facebook-square:before { content: $fa-var-facebook-square; } -.#{$fa-css-prefix}-share-square:before { content: $fa-var-share-square; } -.#{$fa-css-prefix}-twitter:before { content: $fa-var-twitter; } -.#{$fa-css-prefix}-twitter-square:before { content: $fa-var-twitter-square; } -.#{$fa-css-prefix}-google-plus-square:before { content: $fa-var-google-plus-square; } -.#{$fa-css-prefix}-instagram:before { content: $fa-var-instagram; } -.#{$fa-css-prefix}-envelope:before { content: $fa-var-envelope; } - +.#{$fa-css-prefix}-facebook-square:before { + content: $fa-var-facebook-square; +} +.#{$fa-css-prefix}-share-square:before { + content: $fa-var-share-square; +} +.#{$fa-css-prefix}-twitter:before { + content: $fa-var-twitter; +} +.#{$fa-css-prefix}-twitter-square:before { + content: $fa-var-twitter-square; +} +.#{$fa-css-prefix}-google-plus-square:before { + content: $fa-var-google-plus-square; +} +.#{$fa-css-prefix}-instagram:before { + content: $fa-var-instagram; +} +.#{$fa-css-prefix}-envelope:before { + content: $fa-var-envelope; +} // PAGES -@import "pages/landing"; +@import 'pages/landing'; //@import "pages/responsive-video"; -@import "pages/imprint"; -@import "pages/gallery"; -@import "pages/about"; -@import "pages/mep"; +@import 'pages/imprint'; +@import 'pages/gallery'; +@import 'pages/about'; +@import 'pages/mep'; diff --git a/assets/css/easteregg.scss b/assets/css/easteregg.scss index d960ed3..9269248 100644 --- a/assets/css/easteregg.scss +++ b/assets/css/easteregg.scss @@ -3,7 +3,7 @@ } img { - content: url("./img/easteregg/neigschaut.png"); + content: url('./img/easteregg/neigschaut.png'); } .header-wrapper .header .title-wrapper { @@ -11,19 +11,19 @@ img { } .title-wrapper { - content: url("./img/easteregg/banner.png") !important; + content: url('./img/easteregg/banner.png') !important; } #particleCanvas { pointer-events: none; z-index: 99; - position: fixed; - margin: auto; - left: 0; - right: 0; - top: 0; + position: fixed; + margin: auto; + left: 0; + right: 0; + top: 0; bottom: 0; width: 100%; height: 100%; - //background: rgba(30, 30, 50, 1); -} \ No newline at end of file + //background: rgba(30, 30, 50, 1); +} diff --git a/assets/css/pages/about.scss b/assets/css/pages/about.scss index d740f30..582fe51 100644 --- a/assets/css/pages/about.scss +++ b/assets/css/pages/about.scss @@ -1,15 +1,15 @@ -.about-heading{ +.about-heading { font-size: 26px; margin-top: 0; margin-bottom: 7px; } -p.about-text{ +p.about-text { font-style: italic; a { color: $accent1; } - a:hover{ + a:hover { color: $text; } } diff --git a/assets/css/pages/gallery.scss b/assets/css/pages/gallery.scss index 7f3e7d0..70f9679 100644 --- a/assets/css/pages/gallery.scss +++ b/assets/css/pages/gallery.scss @@ -1,4 +1,4 @@ -.section-gallery{ +.section-gallery { .title { margin: 0; font-size: 3.4em; @@ -9,7 +9,8 @@ } } .gallery-grid { - .gallery, .grid-sizer { + .gallery, + .grid-sizer { width: 20%; } .gallery { @@ -34,7 +35,7 @@ } } - .flag-icon{ + .flag-icon { position: absolute; top: 5px; right: 5px; @@ -49,11 +50,11 @@ } } - @media all and (max-width: 1200px) { - .section-gallery{ + .section-gallery { .gallery-grid { - .grid-sizer, .gallery { + .grid-sizer, + .gallery { width: 30%; } } @@ -63,7 +64,8 @@ @media all and (max-width: 768px) { .section-gallery { .gallery-grid { - .grid-sizer, .gallery { + .grid-sizer, + .gallery { width: 47%; } } @@ -73,7 +75,8 @@ @media all and (max-width: 462px) { .section-gallery { .gallery-grid { - .grid-sizer, .gallery { + .grid-sizer, + .gallery { width: 100%; } } diff --git a/assets/css/pages/imprint.scss b/assets/css/pages/imprint.scss index 45338d2..97b27f0 100644 --- a/assets/css/pages/imprint.scss +++ b/assets/css/pages/imprint.scss @@ -4,6 +4,6 @@ } .imprint-eu-link:hover { - color: #FFF; + color: #fff; text-decoration: none; } diff --git a/assets/css/pages/landing.scss b/assets/css/pages/landing.scss index 31a3b10..729ae0c 100644 --- a/assets/css/pages/landing.scss +++ b/assets/css/pages/landing.scss @@ -1,10 +1,10 @@ -@import "landing/header"; -@import "landing/article-thirteen"; -@import "landing/what-do"; -@import "landing/graphic-box"; -@import "landing/countdown"; -@import "landing/image-split"; -@import "landing/petition"; -@import "landing/video"; -@import "landing/twitter-feed"; -@import "landing/map"; +@import 'landing/header'; +@import 'landing/article-thirteen'; +@import 'landing/what-do'; +@import 'landing/graphic-box'; +@import 'landing/countdown'; +@import 'landing/image-split'; +@import 'landing/petition'; +@import 'landing/video'; +@import 'landing/twitter-feed'; +@import 'landing/map'; diff --git a/assets/css/pages/landing/countdown.scss b/assets/css/pages/landing/countdown.scss index cf2158f..945bf3d 100644 --- a/assets/css/pages/landing/countdown.scss +++ b/assets/css/pages/landing/countdown.scss @@ -1,52 +1,54 @@ .countdown { - margin-bottom: $vertical-space; - margin-top: $vertical-space; + margin-bottom: $vertical-space; + margin-top: $vertical-space; - .d-flex { - align-items: center; + .d-flex { + align-items: center; - @include media-breakpoint-down(md) { - //flex-direction: column-reverse; - } - } - - .timer { - justify-content: center; - - @include media-breakpoint-down(md) { - margin: 30px 0; + @include media-breakpoint-down(md) { + //flex-direction: column-reverse; + } } - .countdown-output { - transform: skew(-3deg, 0.5deg); + .timer { + justify-content: center; - .ccount { - font-size: 4em; - padding: 15px 25px; - flex-direction: column; - background-color: $text; - color: $background; - - @include media-breakpoint-down(sm) { - font-size: 3em; + @include media-breakpoint-down(md) { + margin: 30px 0; } - } - - .days, .hours, .minutes { - transform: skew(3deg, 0.5deg); - margin: 5px 0; - font-weight: bold; - .ndays, - .nhours, - .nminutes { - font-weight: 500; + .countdown-output { + transform: skew(-3deg, 0.5deg); + + .ccount { + font-size: 4em; + padding: 15px 25px; + flex-direction: column; + background-color: $text; + color: $background; + + @include media-breakpoint-down(sm) { + font-size: 3em; + } + } + + .days, + .hours, + .minutes { + transform: skew(3deg, 0.5deg); + margin: 5px 0; + font-weight: bold; + + .ndays, + .nhours, + .nminutes { + font-weight: 500; + } + } } - } - } - .cexpired { - visibility: hidden; + .cexpired { + visibility: hidden; + } } - } } diff --git a/assets/css/pages/landing/graphic-box.scss b/assets/css/pages/landing/graphic-box.scss index 8997b1e..bd99892 100644 --- a/assets/css/pages/landing/graphic-box.scss +++ b/assets/css/pages/landing/graphic-box.scss @@ -1,22 +1,22 @@ .graphic-box { - .voxel-wrapper { - justify-content: center; - text-align: center; - max-width: 100%; - .voxel { - max-width: 60%; - @include media-breakpoint-down(sm) { - max-width: 90%; - } + .voxel-wrapper { + justify-content: center; + text-align: center; + max-width: 100%; + .voxel { + max-width: 60%; + @include media-breakpoint-down(sm) { + max-width: 90%; + } + } } - } - .text { - margin-top: 3rem; - .title { + .text { + margin-top: 3rem; + .title { + } + .container { + padding: 0; + } } - .container { - padding: 0; - } - } } diff --git a/assets/css/pages/landing/header.scss b/assets/css/pages/landing/header.scss index b0db9ad..723ddb5 100644 --- a/assets/css/pages/landing/header.scss +++ b/assets/css/pages/landing/header.scss @@ -10,7 +10,7 @@ .title-wrapper { background-color: $text; padding: 4px 12px; - transform: skew(-3deg, 0.5deg) translate3d(0,0,0); + transform: skew(-3deg, 0.5deg) translate3d(0, 0, 0); text-align: center; a { text-decoration: none; @@ -47,7 +47,6 @@ .internet { margin-left: -6px; } - } .description { @@ -86,17 +85,17 @@ font-size: 2.5em; text-decoration: none; animation-name: fade-in; - animation-duration: .5s; + animation-duration: 0.5s; animation-fill-mode: forwards; transition: color 0.5s ease; } @keyframes fade-in { 0% { - opacity: 0 + opacity: 0; } 100% { - opacity: 1 + opacity: 1; } } #social-button { @@ -116,29 +115,30 @@ .share-button { position: relative; z-index: 999; - width:6em; - height:2em; - line-height:2em; + width: 6em; + height: 2em; + line-height: 2em; } .social-toggle { color: white; transition: color 0.5s ease; - display:block; - font-size:90%; - text-align:center; + display: block; + font-size: 90%; + text-align: center; } .social-toggle:hover { color: #ffbf00; } - .no-js .social-toggle, .no-js .social-toggle:hover { + .no-js .social-toggle, + .no-js .social-toggle:hover { cursor: default; - border:none; - background:transparent; - color:rgb(200,200,200); - pointer-events:none; + border: none; + background: transparent; + color: rgb(200, 200, 200); + pointer-events: none; } .social-networks { @@ -148,8 +148,8 @@ -webkit-transform: scale(0) translateY(+105px); transform: scale(0) translateY(+105px); opacity: 0; - -webkit-transition: all .3s ease; - transition: all .3s ease; + -webkit-transition: all 0.3s ease; + transition: all 0.3s ease; margin-left: -45%; -webkit-backface-visibility: hidden; } @@ -162,16 +162,17 @@ background: #6cdfea; } - .social-networks.open-menu, .no-js .social-networks { + .social-networks.open-menu, + .no-js .social-networks { -webkit-transform: scale(1) translateY(+10px); transform: scale(1) translateY(+10px); - opacity:1; + opacity: 1; } .social-networks ul { - position:relative; - top:0; - left:0; + position: relative; + top: 0; + left: 0; width: 180px; height: 40px; color: #fff; @@ -182,7 +183,7 @@ } .social-networks ul:after { - content: ''; + content: ''; display: block; width: 0; height: 0; @@ -193,7 +194,8 @@ border-right: 12px solid transparent; } - .social-networks.open-menu ul:after, .no-js .social-networks ul:after { + .social-networks.open-menu ul:after, + .no-js .social-networks ul:after { margin: -10px auto; border-bottom: 12px solid #3b5998; } @@ -206,22 +208,22 @@ float: left; display: block; height: 40px; - line-height:40px; + line-height: 40px; position: relative; z-index: 2; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; - transition: all .3s ease; + transition: all 0.3s ease; } .share-button a { - text-decoration:none; + text-decoration: none; } .social-networks a { - display:block; - color:white; + display: block; + color: white; } } @@ -231,8 +233,8 @@ } } -@media (max-width: 768px){ - .header-wrapper .header{ +@media (max-width: 768px) { + .header-wrapper .header { padding: 25px 0; } } diff --git a/assets/css/pages/landing/image-split.scss b/assets/css/pages/landing/image-split.scss index e439e98..bc1c002 100644 --- a/assets/css/pages/landing/image-split.scss +++ b/assets/css/pages/landing/image-split.scss @@ -1,17 +1,16 @@ .image-split { - margin-top: $vertical-space; + margin-top: $vertical-space; - .d-flex { - align-items: center; - .image-wrapper { - max-width: 100%; - text-align: center; - .watcheye { - border-radius: 25px; - max-width: 50%; - height: auto; - } + .d-flex { + align-items: center; + .image-wrapper { + max-width: 100%; + text-align: center; + .watcheye { + border-radius: 25px; + max-width: 50%; + height: auto; + } + } } - } - } diff --git a/assets/css/pages/landing/map.scss b/assets/css/pages/landing/map.scss index 443a378..5cb8986 100644 --- a/assets/css/pages/landing/map.scss +++ b/assets/css/pages/landing/map.scss @@ -1,44 +1,44 @@ $maxHeight: 450px; .map-container { - margin-top: 3rem; - - > .row { - margin-top: 15px; - } - - .map { - height: $maxHeight; - border-radius: 5px; - overflow: hidden; - box-shadow: 0 5px 3px 0 #0c182c; - - iframe { - display: block; - border: 0; - width: 100%; - height: 100%; - } + margin-top: 3rem; - .loader { - display: none; + > .row { + margin-top: 15px; } - &.map-loader { - display: flex; - justify-content: center; - align-items: center; - box-shadow: none; - font-size: 4em; - color: lighten($background, 20); - - iframe { - display: none; - } - - .fa-spinner { - display: inline; - } + .map { + height: $maxHeight; + border-radius: 5px; + overflow: hidden; + box-shadow: 0 5px 3px 0 #0c182c; + + iframe { + display: block; + border: 0; + width: 100%; + height: 100%; + } + + .loader { + display: none; + } + + &.map-loader { + display: flex; + justify-content: center; + align-items: center; + box-shadow: none; + font-size: 4em; + color: lighten($background, 20); + + iframe { + display: none; + } + + .fa-spinner { + display: inline; + } + } } - } } diff --git a/assets/css/pages/landing/twitter-feed.scss b/assets/css/pages/landing/twitter-feed.scss index d639bef..65bc4f4 100644 --- a/assets/css/pages/landing/twitter-feed.scss +++ b/assets/css/pages/landing/twitter-feed.scss @@ -137,7 +137,7 @@ } .post-right > .post-header > .profile-name > .post-time:before { - content: ' \00b7' + content: ' \00b7'; } .post-right > .post-header { diff --git a/assets/css/pages/landing/what-do.scss b/assets/css/pages/landing/what-do.scss index c7d4495..dc8d238 100644 --- a/assets/css/pages/landing/what-do.scss +++ b/assets/css/pages/landing/what-do.scss @@ -55,7 +55,7 @@ background-color: #ffbf00; color: #000; font-size: inherit; - padding: .5em; + padding: 0.5em; padding-right: 2.5em; border: 0; margin: 0; @@ -68,19 +68,19 @@ .custom-dropdown::before, .custom-dropdown::after { - content: ""; + content: ''; position: absolute; pointer-events: none; } .custom-dropdown::after { - content: "\25BC"; + content: '\25BC'; height: 1em; - font-size: .625em; + font-size: 0.625em; line-height: 1; right: 1.2em; top: 50%; - margin-top: -.5em; + margin-top: -0.5em; } .custom-dropdown::before { @@ -92,32 +92,34 @@ } .custom-dropdown select[disabled] { - color: rgba(0, 0, 0, .3); + color: rgba(0, 0, 0, 0.3); } .custom-dropdown select[disabled]::after { - color: rgba(0, 0, 0, .1); + color: rgba(0, 0, 0, 0.1); } .custom-dropdown::before { - background-color: rgba(0, 0, 0, .15); + background-color: rgba(0, 0, 0, 0.15); } .custom-dropdown::after { - color: rgba(0, 0, 0, .4); + color: rgba(0, 0, 0, 0.4); } a { - cursor: pointer!important; + cursor: pointer !important; } - p, span, li { - font-family: "Raleway", sans-serif!important; + p, + span, + li { + font-family: 'Raleway', sans-serif !important; } h3 { - margin-top: 15px!important; - margin-bottom: 15px!important; + margin-top: 15px !important; + margin-bottom: 15px !important; } .acf-rpw-title { @@ -129,29 +131,29 @@ } .essb_links .essb_link_twitter a { - box-shadow: none!important; + box-shadow: none !important; cursor: pointer; color: white; padding: 0; } .essb_links .essb_link_twitter a:hover { - background-color: transparent!important; + background-color: transparent !important; } .essb_link_twitter { position: absolute; bottom: 30px; - background: #1da1f2; - -moz-border-radius: 70px; - -webkit-border-radius: 70px; + background: #1da1f2; + -moz-border-radius: 70px; + -webkit-border-radius: 70px; border-radius: 70px; width: 100px; height: 100px; } .essb_icon_twitter { - background-image: url("../../../static/mep/white-twitter-512.png"); + background-image: url('../../../static/mep/white-twitter-512.png'); background-size: cover; height: 20px; width: 20px; @@ -172,7 +174,7 @@ background: none; height: 100%; position: relative; - background: #FAFAFA; + background: #fafafa; margin: 0; } @@ -237,10 +239,10 @@ } figure.effect-oscar .essb_icon_twitter { - font-size: 40px!important; + font-size: 40px !important; width: 40px; height: 40px; - background-image: url("../../../static/mep/white-twitter-512.png"); + background-image: url('../../../static/mep/white-twitter-512.png'); background-size: cover; top: 20%; position: absolute; @@ -249,11 +251,11 @@ } figure.effect-oscar .essb_links .essb_icon:before { - font-size: 40px!important; + font-size: 40px !important; } figure.effect-oscar .essb_network_name { - font-size: 20px!important; + font-size: 20px !important; position: absolute; top: 60%; left: 50%; @@ -297,7 +299,7 @@ } .mep-content { - order: 1!important; + order: 1 !important; flex-basis: 25%; position: relative; overflow: visible; @@ -309,14 +311,14 @@ } .mep-authorinfo { - order: 2!important; + order: 2 !important; flex-basis: 75%; text-align: right; width: 100%; text-align: left; display: flex; padding-top: 0; - color: #000!important; + color: #000 !important; } .grouped-author-text { @@ -346,7 +348,7 @@ background: none; height: 100%; position: relative; - background: #FAFAFA; + background: #fafafa; } figure.effect-oscar .mep-main { @@ -355,7 +357,8 @@ transition: opacity 0.35s; } - figure.effect-oscar figcaption::before, figure.effect-oscar .mep-social { + figure.effect-oscar figcaption::before, + figure.effect-oscar .mep-social { opacity: 0; -webkit-transition: opacity 0.35s, -webkit-transform 0.35s; transition: opacity 0.35s, transform 0.35s; @@ -363,7 +366,8 @@ transform: scale(0); } - figure.effect-oscar:hover figcaption::before, figure.effect-oscar:hover .mep-social { + figure.effect-oscar:hover figcaption::before, + figure.effect-oscar:hover .mep-social { opacity: 1; -webkit-transform: scale(1); transform: scale(1); @@ -382,9 +386,9 @@ margin-right: auto; display: inline-block; bottom: 0; - background: #1da1f2; - -moz-border-radius: 70px; - -webkit-border-radius: 70px; + background: #1da1f2; + -moz-border-radius: 70px; + -webkit-border-radius: 70px; border-radius: 70px; vertical-align: top; } @@ -399,39 +403,41 @@ } .essb_link_mep .essb_link_twitter { - height: 60px!important; - width: 60px!important; + height: 60px !important; + width: 60px !important; background-image: none; } @media only screen and (min-width: 1300px) { - p, li { - font-size: 17px!important; - line-height: 28px!important; + p, + li { + font-size: 17px !important; + line-height: 28px !important; } } @media only screen and (min-width: 1300px) and (max-width: 1600px) { - p, li { - font-size: 16px!important; - line-height: 20px!important; - line-height: 28px!important; + p, + li { + font-size: 16px !important; + line-height: 20px !important; + line-height: 28px !important; } .essb_link_twitter { - width: 90px!important; + width: 90px !important; } } @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) and (-webkit-min-device-pixel-ratio: 1) { .mep-grid .mep-main { - background-position: left top!important; + background-position: left top !important; } } @media only screen and (min-device-width: 1024px) and (max-device-width: 1366px) and (orientation: landscape) and (-webkit-min-device-pixel-ratio: 1.5) { .mep-grid .mep-main { - background-position: left top!important; + background-position: left top !important; } } @@ -446,20 +452,21 @@ } @media only screen and (min-width: 481px) and (max-width: 768px) { - p, li { - font-size: 16px!important; - line-height: 20px!important; - line-height: 28px!important; + p, + li { + font-size: 16px !important; + line-height: 20px !important; + line-height: 28px !important; } .mep-item { - width: 100%!important; - max-width: none!important; + width: 100% !important; + max-width: none !important; flex: 1 1 100% !important; } .mep-main { - flex-direction: column!important; + flex-direction: column !important; } } @@ -471,16 +478,16 @@ } .essb_link_twitter { - width: 90px!important; + width: 90px !important; } .mep-item { - width: 100%!important; - max-width: none!important; + width: 100% !important; + max-width: none !important; } .mep-main { - flex-direction: column!important; + flex-direction: column !important; } } } diff --git a/assets/css/pages/mep.scss b/assets/css/pages/mep.scss index e6d1798..ab988f8 100644 --- a/assets/css/pages/mep.scss +++ b/assets/css/pages/mep.scss @@ -20,17 +20,17 @@ transition-delay: 750ms; } -.small-h{ +.small-h { color: $accent1; width: 45px; } -.text-highlighted{ +.text-highlighted { color: $accent1; font-weight: bold; } -.smaller-icon{ +.smaller-icon { width: 75%; display: block; margin-left: auto; @@ -51,8 +51,8 @@ } } -.img-box{ - &:hover{ +.img-box { + &:hover { opacity: 0.95; } } diff --git a/assets/css/pages/responsive-video.scss b/assets/css/pages/responsive-video.scss index 2d7aadf..c494882 100644 --- a/assets/css/pages/responsive-video.scss +++ b/assets/css/pages/responsive-video.scss @@ -1,33 +1,34 @@ .responsive-video { - position: relative; - padding-bottom: 56.25%; /* Default for 1600x900 videos 16:9 ratio*/ - padding-top: 0px; - height: 0; - overflow: hidden; + position: relative; + padding-bottom: 56.25%; /* Default for 1600x900 videos 16:9 ratio*/ + padding-top: 0px; + height: 0; + overflow: hidden; - iframe, .consent { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - - &.hidden { - visibility: hidden; + iframe, + .consent { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + + &.hidden { + visibility: hidden; + } } - } - .consent { - display: flex; - align-items: center; - justify-content: center; - background: $background_invert; - color: $background; + .consent { + display: flex; + align-items: center; + justify-content: center; + background: $background_invert; + color: $background; - .item { - width: 85%; - max-width: 800px; - min-width: 250px; + .item { + width: 85%; + max-width: 800px; + min-width: 250px; + } } - } -} \ No newline at end of file +} diff --git a/assets/css/shared/footer.scss b/assets/css/shared/footer.scss index 700ef68..3c77d29 100644 --- a/assets/css/shared/footer.scss +++ b/assets/css/shared/footer.scss @@ -25,7 +25,7 @@ text-align: center !important; > a { - margin: .5em !important; + margin: 0.5em !important; line-height: 2.5em; } } @@ -33,7 +33,7 @@ .address { order: 2; margin: 2em 0; - font-size: .8em; + font-size: 0.8em; } .copyright { diff --git a/assets/css/shared/langpicker.scss b/assets/css/shared/langpicker.scss index 9db567e..c0e628c 100644 --- a/assets/css/shared/langpicker.scss +++ b/assets/css/shared/langpicker.scss @@ -1,9 +1,9 @@ @keyframes fade-in { 0% { - opacity: 0 + opacity: 0; } 100% { - opacity: 1 + opacity: 1; } } @@ -37,7 +37,7 @@ right: 0px; top: 17px; transition: transform 0.25s ease-in-out; - transform: rotate(0) translate3d(0,0,0); + transform: rotate(0) translate3d(0, 0, 0); } } @@ -63,7 +63,7 @@ width: 25px; height: 25px; animation-name: fade-in; - animation-duration: .5s; + animation-duration: 0.5s; animation-fill-mode: forwards; filter: grayscale(32%); transition: all 0.5s ease; @@ -77,7 +77,7 @@ &.open { .language-trigger:after { - transform: rotate(180deg) translate3d(0,0,0); + transform: rotate(180deg) translate3d(0, 0, 0); } .dropdown { @@ -86,7 +86,7 @@ } } - .nav-item .nav-link{ + .nav-item .nav-link { padding: 0; } } diff --git a/assets/css/shared/navigation.scss b/assets/css/shared/navigation.scss index f526fc8..093e942 100644 --- a/assets/css/shared/navigation.scss +++ b/assets/css/shared/navigation.scss @@ -1,4 +1,5 @@ -nav, .navbar{ +nav, +.navbar { height: 55px; background-color: $background; box-shadow: 0 2px 2px -2px #161618; diff --git a/assets/css/shared/sharebuttons.scss b/assets/css/shared/sharebuttons.scss index 28b3baf..c4ce611 100644 --- a/assets/css/shared/sharebuttons.scss +++ b/assets/css/shared/sharebuttons.scss @@ -13,7 +13,7 @@ padding-right: 5px; font-size: 1.2em; animation-name: fade-in; - animation-duration: .5s; + animation-duration: 0.5s; animation-fill-mode: forwards; } @@ -21,17 +21,17 @@ color: white; text-decoration: none; animation-name: fade-in; - animation-duration: .5s; + animation-duration: 0.5s; animation-fill-mode: forwards; transition: color 0.5s ease; } @keyframes fade-in { 0% { - opacity: 0 + opacity: 0; } 100% { - opacity: 1 + opacity: 1; } } diff --git a/assets/css/shared/video-player.scss b/assets/css/shared/video-player.scss index c4ed22f..85def33 100644 --- a/assets/css/shared/video-player.scss +++ b/assets/css/shared/video-player.scss @@ -1,37 +1,37 @@ -@import "~video.js/src/css/vjs"; +@import '~video.js/src/css/vjs'; .video-player { - .video-js { - max-width: 100%; - width: auto !important; + .video-js { + max-width: 100%; + width: auto !important; - @include media-breakpoint-up(xl) { - height: 625px; - } - @include media-breakpoint-only(lg) { - height: 525px; - } - @include media-breakpoint-only(md) { - height: 390px; - } - @include media-breakpoint-only(sm) { - height: 285px; - } - @include media-breakpoint-only(xs) { - height: 280px; - } + @include media-breakpoint-up(xl) { + height: 625px; + } + @include media-breakpoint-only(lg) { + height: 525px; + } + @include media-breakpoint-only(md) { + height: 390px; + } + @include media-breakpoint-only(sm) { + height: 285px; + } + @include media-breakpoint-only(xs) { + height: 280px; + } - &.vjs-fullscreen { - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - } + &.vjs-fullscreen { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + } - .vjs-play-progress:before, - .vjs-volume-level:before { - top: -0.63em; + .vjs-play-progress:before, + .vjs-volume-level:before { + top: -0.63em; + } } - } } diff --git a/assets/js/app.js b/assets/js/app.js index d859075..1e49489 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -1,26 +1,25 @@ -"use strict"; +'use strict'; (function($) { - $(".language-trigger").click(function() { - $('.langdropdown').toggleClass('open'); - }); + $('.language-trigger').click(function() { + $('.langdropdown').toggleClass('open'); + }); - $('.social-toggle').on('click', function() { - $('.social-networks').toggleClass('open-menu'); - }); + $('.social-toggle').on('click', function() { + $('.social-networks').toggleClass('open-menu'); + }); })(jQuery); - import cheet from 'cheet.js'; -let stylesheet = $("link[data-href]"); -let js = $("script[data-src]"); -cheet('s c h m u s e r', function () { - stylesheet.attr('href',stylesheet.data('href')); - js.attr('src', js.data('src')); +let stylesheet = $('link[data-href]'); +let js = $('script[data-src]'); +cheet('s c h m u s e r', function() { + stylesheet.attr('href', stylesheet.data('href')); + js.attr('src', js.data('src')); cheet('m i e s e r', function() { stylesheet.remove(); window.removeEasteregg(); js.remove(); - }) + }); }); import './pages/landing.js'; diff --git a/assets/js/components/Cookie.js b/assets/js/components/Cookie.js index ed35c30..2e4cd0f 100644 --- a/assets/js/components/Cookie.js +++ b/assets/js/components/Cookie.js @@ -1,39 +1,39 @@ class Cookie { - constructor(name) { - this.cname = name; - } - - read() { - let name = this.cname + "="; - let decodedCookie = decodeURIComponent(document.cookie); - let ca = decodedCookie.split(';'); - for(let i = 0; i { - element = jQuery(element); - element.find('.consent') - .removeClass('hidden'); - element.find('.consent-btn') - .on('click', event => { - event.preventDefault(); - event.stopImmediatePropagation(); + _setupConsent() { + jQuery.each(jQuery(this.selector).not('[data-responsive-video-activated]'), (index, element) => { + element = jQuery(element); + element.find('.consent').removeClass('hidden'); + element.find('.consent-btn').on('click', event => { + event.preventDefault(); + event.stopImmediatePropagation(); - this.giveConsent(); - }); - }); - } + this.giveConsent(); + }); + }); + } - hasGivenConsent() { - let item = null; + hasGivenConsent() { + let item = null; - if(window.sessionStorage) { - item = window.sessionStorage.getItem(this.cacheName); - } else { - item = new Cookie(this.cacheName).read(); - } + if (window.sessionStorage) { + item = window.sessionStorage.getItem(this.cacheName); + } else { + item = new Cookie(this.cacheName).read(); + } - return item === null - ? false - : item; - } + return item === null ? false : item; + } - giveConsent() { - if(window.sessionStorage) { - window.sessionStorage.setItem(this.cacheName, true); - } else { - new Cookie(this.cacheName).write('true', false); - } + giveConsent() { + if (window.sessionStorage) { + window.sessionStorage.setItem(this.cacheName, true); + } else { + new Cookie(this.cacheName).write('true', false); + } - this.switchToVideo(); - } + this.switchToVideo(); + } - switchToVideo() { - jQuery(this.selector) - .each((index, element) => { - element = jQuery(element); - element.find('iframe') - .attr('src', element.data('video-src')) - .removeClass('hidden'); - element.find('.consent') - .remove(); - }); - } + switchToVideo() { + jQuery(this.selector).each((index, element) => { + element = jQuery(element); + element + .find('iframe') + .attr('src', element.data('video-src')) + .removeClass('hidden'); + element.find('.consent').remove(); + }); + } } -export default ResponsiveVideo; \ No newline at end of file +export default ResponsiveVideo; diff --git a/assets/js/easteregg/index.js b/assets/js/easteregg/index.js index 9c7726f..7588b6e 100644 --- a/assets/js/easteregg/index.js +++ b/assets/js/easteregg/index.js @@ -7,7 +7,7 @@ window.removeEasteregg = () => { let audio = new Audio('./build/static/easteregg/yee.mp3'); audio.play(); -$(document).on('click', function () { +$(document).on('click', function() { audio.play(); }); @@ -23,9 +23,8 @@ var rainStrength = 1; var img = new Image(); img.src = './build/static/easteregg/minus.png'; - function initCanvas() { - ctx = document.getElementById("particleCanvas").getContext("2d"); + ctx = document.getElementById('particleCanvas').getContext('2d'); window.addEventListener('resize', resizeCanvas, false); resizeCanvas(); } @@ -47,23 +46,23 @@ function Raindrops() { } Raindrops.prototype.addDrop = function() { - this.x = (Math.random() * (cW + 100)) - 100; + this.x = Math.random() * (cW + 100) - 100; this.y = 0; - this.s = (Math.random() * 7) + 2; + this.s = Math.random() * 7 + 2; this.drops.push({ x: this.x, y: this.y, velY: 2, speed: this.s, - life: 1 + life: 1, }); }; Raindrops.prototype.render = function() { for (var i = 0; i < rainStrength; i++) { this.addDrop(); - }; + } ctx.save(); @@ -74,12 +73,12 @@ Raindrops.prototype.render = function() { for (var i = 0; i < this.drops.length; i++) { var drop = this.drops[i]; - + ctx.drawImage(img, drop.x, drop.y, 18, 18); drop.y += drop.speed * 2; drop.x += 2; - }; - ctx.restore(); + } + ctx.restore(); }; function init() { @@ -88,7 +87,7 @@ function init() { } function render() { - raindrops.render(); + raindrops.render(); } function loop() { @@ -97,4 +96,4 @@ function loop() { } initCanvas(); -init(); \ No newline at end of file +init(); diff --git a/assets/js/pages/gallery.js b/assets/js/pages/gallery.js index 4f12e21..bc7c36c 100644 --- a/assets/js/pages/gallery.js +++ b/assets/js/pages/gallery.js @@ -2,47 +2,45 @@ import Masonry from 'masonry-layout'; function debounce(func, wait, immediate) { let timeout; - return function () { + return function() { let context = this, - args = arguments; - let later = function () { + args = arguments; + let later = function() { timeout = null; - if(!immediate) { + if (!immediate) { func.apply(context, args); } }; let callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); - if(callNow) { + if (callNow) { func.apply(context, args); } }; -}; +} -jQuery(document) - .ready(function () { - if($('.gallery-grid').length < 1) { - return; - } +jQuery(document).ready(function() { + if ($('.gallery-grid').length < 1) { + return; + } - const gallery = new Masonry('.gallery-grid', { - itemSelector: '.gallery', - columnWidth: '.grid-sizer', - percentPosition: true, - gutter: 25, - }); + const gallery = new Masonry('.gallery-grid', { + itemSelector: '.gallery', + columnWidth: '.grid-sizer', + percentPosition: true, + gutter: 25, + }); - const refreshLayout = debounce(function () { - gallery.layout(); - }, 100); + const refreshLayout = debounce(function() { + gallery.layout(); + }, 100); - jQuery(".gallery-grid img") - .one("load", refreshLayout) - .each(function (index, element) { - if(element.complete) { - jQuery(element) - .trigger('load'); - } - }); - }); + jQuery('.gallery-grid img') + .one('load', refreshLayout) + .each(function(index, element) { + if (element.complete) { + jQuery(element).trigger('load'); + } + }); +}); diff --git a/assets/js/pages/landing/map.js b/assets/js/pages/landing/map.js index 27ff3f8..c68d67d 100644 --- a/assets/js/pages/landing/map.js +++ b/assets/js/pages/landing/map.js @@ -1,7 +1,7 @@ export default class Map { constructor() { this.mapContainer = document.getElementById('map'); - if(this.mapContainer === null) { + if (this.mapContainer === null) { return; } this.frameContainer = this.mapContainer.getElementsByTagName('iframe')[0]; diff --git a/assets/js/pages/landing/tweets.js b/assets/js/pages/landing/tweets.js index f8a89de..81506b3 100644 --- a/assets/js/pages/landing/tweets.js +++ b/assets/js/pages/landing/tweets.js @@ -1,33 +1,46 @@ import moment from 'moment'; -function makeTemplate(element){ - moment.locale(window.location.pathname === '/' ? 'en' : window.location.pathname.substring(1,3)); - return '
'+ - '
'+ - ''+ - '
'+ - '
'+ - '
'+ - '
'+ - //'' + element.user.name + ''+ - '@' + element.user.screen_name + ''+ - ' ' + moment(new Date(element.created_at)).fromNow() + ''+ - '
'+ - '
'+ - '
'+ - element.text - .replace(/(https?:\/\/[0-9a-zA-z\.-\/]+)/gi,'$1') - .replace(/(lobbyist[a-zA-Z]+)/gi,'$1') - .replace(/#([a-zA-Z0-9]+)/gi,'#$1') - .replace(/@([a-zA-Z0-9._]+)/gi,'@$1') + - '
'+ - '
'+ - '
' - +function makeTemplate(element) { + moment.locale(window.location.pathname === '/' ? 'en' : window.location.pathname.substring(1, 3)); + return ( + '
' + + '
' + + '' + + '
' + + '
' + + '
' + + '
' + + //'' + element.user.name + ''+ + '@' + + element.user.screen_name + + '' + + ' ' + + moment(new Date(element.created_at)).fromNow() + + '' + + '
' + + '
' + + '
' + + element.text + .replace( + /(https?:\/\/[0-9a-zA-z\.-\/]+)/gi, + '$1' + ) + .replace(/(lobbyist[a-zA-Z]+)/gi, '$1') + .replace(/#([a-zA-Z0-9]+)/gi, '#$1') + .replace(/@([a-zA-Z0-9._]+)/gi, '@$1') + + '
' + + '
' + + '
' + ); } (function($) { - /** * Copyright 2012, Digital Fusion * Licensed under the MIT license. @@ -40,7 +53,6 @@ function makeTemplate(element){ */ $.fn.visible = function(partial) { - var $t = $(this), $w = $(window), viewTop = $w.scrollTop(), @@ -50,10 +62,8 @@ function makeTemplate(element){ compareTop = partial === true ? _bottom : _top, compareBottom = partial === true ? _top : _bottom; - return ((compareBottom <= viewBottom) && (compareTop >= viewTop)); - + return compareBottom <= viewBottom && compareTop >= viewTop; }; - })(jQuery); function black(element, text) { @@ -69,39 +79,39 @@ function black(element, text) { } function checkBlacks() { - $(".blacked-on-visible").each(function(i, elem) { + $('.blacked-on-visible').each(function(i, elem) { var el = $(elem); if (el.visible(true)) { - el.attr('class', "blacked"); + el.attr('class', 'blacked'); } }); } - -function contains(id){ - return $("#" + id).length != 0; +function contains(id) { + return $('#' + id).length != 0; } - function updateTweets() { - $.get("/tweets", function(data) { - data = data.sort(function(a,b){ - if(a != null && b != null) { - return a.id - b.id; + $.get('/tweets', function(data) { + data = data.sort(function(a, b) { + if (a != null && b != null) { + return a.id - b.id; } }); let inserted = 0; - data = data.slice(0, 6); + data = data.slice(0, 6); data.forEach(function(element) { - if(element !== null && !contains(element.id) && inserted < 1) - { - inserted ++; + if (element !== null && !contains(element.id) && inserted < 1) { + inserted++; $('#tweets').prepend(makeTemplate(element)); } }); - if($('#tweets').children().length > 6) - $('#tweets').children().last().remove(); + if ($('#tweets').children().length > 6) + $('#tweets') + .children() + .last() + .remove(); checkBlacks(); }); } @@ -110,7 +120,9 @@ $(window).scroll(function(event) { checkBlacks(); }); -setInterval(function(){updateTweets();}, 20000); +setInterval(function() { + updateTweets(); +}, 20000); $(document).ready(function() { checkBlacks(); diff --git a/assets/js/pages/landing/typer.js b/assets/js/pages/landing/typer.js index 4c098d7..100fbb4 100644 --- a/assets/js/pages/landing/typer.js +++ b/assets/js/pages/landing/typer.js @@ -1,6 +1,6 @@ 'use strict'; import Typed from 'typed.js'; -$( document ).ready(function() { +$(document).ready(function() { document.getElementById('typed-strings').style = ''; var typed = new Typed('#typed', { stringsElement: '#typed-strings', @@ -11,6 +11,6 @@ $( document ).ready(function() { // time before backspacing backDelay: 500, // loop - loop: true + loop: true, }); }); diff --git a/assets/js/pages/landing/whatdo.js b/assets/js/pages/landing/whatdo.js index 90f7d91..e9ded19 100644 --- a/assets/js/pages/landing/whatdo.js +++ b/assets/js/pages/landing/whatdo.js @@ -1,5 +1,5 @@ -$("#country-sel").change(function(){ +$('#country-sel').change(function() { var selVal = $(this).val(); - $(".mep-item").css("display", "none"); - $("." + selVal.toLowerCase().replace(/\s/g, "")).css("display", "block"); + $('.mep-item').css('display', 'none'); + $('.' + selVal.toLowerCase().replace(/\s/g, '')).css('display', 'block'); }); diff --git a/config/bundles.php b/config/bundles.php index eced934..b8f7149 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -1,10 +1,10 @@ ['all' => true], - Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true], - Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], - Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], - Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], - Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], -]; +return array( + Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => array('all' => true), + Symfony\Bundle\WebServerBundle\WebServerBundle::class => array('dev' => true), + Symfony\Bundle\MakerBundle\MakerBundle::class => array('dev' => true), + Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => array('all' => true), + Symfony\Bundle\TwigBundle\TwigBundle::class => array('all' => true), + Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => array('dev' => true, 'test' => true), +); diff --git a/config/routes.php b/config/routes.php index dbcf995..a04801f 100644 --- a/config/routes.php +++ b/config/routes.php @@ -4,53 +4,53 @@ use Symfony\Component\Routing\RouteCollection; $routes = new RouteCollection(); -$routes->add('index', new Route('/{_locale}', [ +$routes->add('index', new Route('/{_locale}', array( '_controller' => 'App\\Controller\\IndexController::index', - '_locale' => 'en_GB', -], [ + '_locale' => 'en_GB', +), array( '_locale' => implode('|', \App\EventSubscriber\getAvailableLanguages()), -])); +))); -$routes->add('imprint', new Route('/{_locale}/imprint', [ +$routes->add('imprint', new Route('/{_locale}/imprint', array( '_controller' => 'App\\Controller\\IndexController::imprint', - '_locale' => 'en_GB', -], [ + '_locale' => 'en_GB', +), array( '_locale' => implode('|', \App\EventSubscriber\getAvailableLanguages()), -])); +))); -$routes->add('privacy', new Route('/{_locale}/privacy', [ +$routes->add('privacy', new Route('/{_locale}/privacy', array( '_controller' => 'App\\Controller\\IndexController::privacy', - '_locale' => 'en_GB', -], [ + '_locale' => 'en_GB', +), array( '_locale' => implode('|', \App\EventSubscriber\getAvailableLanguages()), -])); +))); -$routes->add('about', new Route('/{_locale}/about', [ +$routes->add('about', new Route('/{_locale}/about', array( '_controller' => 'App\\Controller\\IndexController::about', - '_locale' => 'en_GB', -], [ + '_locale' => 'en_GB', +), array( '_locale' => implode('|', \App\EventSubscriber\getAvailableLanguages()), -])); +))); -$routes->add('gallery', new Route('/{_locale}/gallery', [ +$routes->add('gallery', new Route('/{_locale}/gallery', array( '_controller' => 'App\\Controller\\IndexController::gallery', - '_locale' => 'en_GB', -], [ + '_locale' => 'en_GB', +), array( '_locale' => implode('|', \App\EventSubscriber\getAvailableLanguages()), -])); +))); -$routes->add('mep', new Route('/{_locale}/contact-your-mep', [ +$routes->add('mep', new Route('/{_locale}/contact-your-mep', array( '_controller' => 'App\\Controller\\IndexController::mep', - '_locale' => 'en_GB', -], [ + '_locale' => 'en_GB', +), array( '_locale' => implode('|', \App\EventSubscriber\getAvailableLanguages()), -])); +))); -$routes->add('resources', new Route('/{_locale}/resources', [ +$routes->add('resources', new Route('/{_locale}/resources', array( '_controller' => 'App\\Controller\\IndexController::resources', - '_locale' => 'en_GB', -], [ + '_locale' => 'en_GB', +), array( '_locale' => implode('|', \App\EventSubscriber\getAvailableLanguages()), -])); +))); return $routes; diff --git a/public/index.php b/public/index.php index 39d82f7..18b004f 100644 --- a/public/index.php +++ b/public/index.php @@ -36,7 +36,7 @@ $kernel = new Kernel($env, $debug); $request = Request::createFromGlobals(); -if ($env === 'prod') { +if ('prod' === $env) { $kernel = new CacheKernel($kernel, new \Symfony\Component\HttpKernel\HttpCache\Store(__DIR__.'/../var/cache/kernel/')); } diff --git a/src/Controller/IndexController.php b/src/Controller/IndexController.php index 69c904a..e90bfbd 100644 --- a/src/Controller/IndexController.php +++ b/src/Controller/IndexController.php @@ -64,7 +64,7 @@ public function privacy(): Response */ public function gallery(): Response { - return $this->render('gallery/index.html.twig', ['images' => $this->galleryService->getGallery()]); + return $this->render('gallery/index.html.twig', array('images' => $this->galleryService->getGallery())); } /** diff --git a/src/EventSubscriber/AvailableLocalesSubscriber.php b/src/EventSubscriber/AvailableLocalesSubscriber.php index 89b9ed6..bfb1004 100644 --- a/src/EventSubscriber/AvailableLocalesSubscriber.php +++ b/src/EventSubscriber/AvailableLocalesSubscriber.php @@ -31,7 +31,7 @@ public function onKernelRequest(GetResponseEvent $event) // detect users language form browser $this->setVisitorLanguage($event, $languages); - $codes = []; + $codes = array(); foreach ($languages as $language) { $parts = explode('_', $language); $codes[$language] = $parts; @@ -42,9 +42,9 @@ public function onKernelRequest(GetResponseEvent $event) public static function getSubscribedEvents() { - return [ + return array( 'kernel.request' => 'onKernelRequest', - ]; + ); } private function setVisitorLanguage(GetResponseEvent $event, array $languages) @@ -65,19 +65,19 @@ private function setVisitorLanguage(GetResponseEvent $event, array $languages) function getAvailableLanguages() { - $languageOrder = []; + $languageOrder = array(); if (isset($_SERVER['LANG_ORDER'])) { $languageOrder = explode(',', $_SERVER['LANG_ORDER']); } $translationFiles = scandir(__DIR__.'/../../translations', SCANDIR_SORT_NONE); - $languages = []; - $otherLangs = []; + $languages = array(); + $otherLangs = array(); foreach ($translationFiles as $file) { $parts = explode('.', $file); - if (\count($parts) !== 3) { + if (3 !== \count($parts)) { continue; } diff --git a/src/Kernel.php b/src/Kernel.php index cd6f6ea..f76b776 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -44,14 +44,14 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa $container->setParameter('container.dumper.inline_class_loader', true); $confDir = $this->getProjectDir().'/config'; - if (!isset($_SERVER['REDIS_HOST']) || $_SERVER['REDIS_HOST'] === null || !isset($_SERVER['REDIS_PORT']) || $_SERVER['REDIS_PORT'] === null) { - $container->addAliases([ + if (!isset($_SERVER['REDIS_HOST']) || null === $_SERVER['REDIS_HOST'] || !isset($_SERVER['REDIS_PORT']) || null === $_SERVER['REDIS_PORT']) { + $container->addAliases(array( 'App\Services\CacheServiceInterface' => 'App\Services\NullCacheService', - ]); + )); } else { - $container->addAliases([ + $container->addAliases(array( 'App\Services\CacheServiceInterface' => 'App\Services\RedisCacheService', - ]); + )); } $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob'); diff --git a/src/Services/GalleryService.php b/src/Services/GalleryService.php index ba70814..2c49dff 100644 --- a/src/Services/GalleryService.php +++ b/src/Services/GalleryService.php @@ -30,26 +30,26 @@ public function getGallery(): array if (!is_dir($base) && !mkdir($base) && !is_dir($base)) { error_log('Could not create Basefolder for Images'); - return []; + return array(); } if (!is_dir($files)) { error_log('Could not find Files Folder'); - return []; + return array(); } if (!is_dir($preview) && !mkdir($preview) && !is_dir($preview)) { error_log('Could not create Preview Folder'); - return []; + return array(); } $finder = new Finder(); $finder->files()->depth('< 3')->name('/\.(png|jpg)$/i')->in($files); - $galleryImages = []; + $galleryImages = array(); foreach ($finder as $file) { $name = $file->getFilename(); @@ -59,16 +59,16 @@ public function getGallery(): array if (!file_exists($preview.$thumb)) { $writeReturn = $this->resizeImage($file->getRealPath(), $preview.$thumb); - if ($writeReturn === false) { + if (false === $writeReturn) { error_log('Could not write File: '.$file->getRealPath()); } } - $galleryImages[] = [ - 'name' => sprintf('%s/%s', $langcode, $name), - 'thumb' => $thumb, + $galleryImages[] = array( + 'name' => sprintf('%s/%s', $langcode, $name), + 'thumb' => $thumb, 'langcode' => $langcode, - ]; + ); } return $galleryImages; diff --git a/src/Services/NullCacheService.php b/src/Services/NullCacheService.php index a4c4e6b..a71b1cc 100644 --- a/src/Services/NullCacheService.php +++ b/src/Services/NullCacheService.php @@ -4,7 +4,7 @@ class NullCacheService implements CacheServiceInterface { - private $content = []; + private $content = array(); public function set(string $key, string $value): void { @@ -23,7 +23,7 @@ public function has(string $key): bool public function search(string $key, $limit = 0): array { - $found = []; + $found = array(); $hasWildCard = strpos($key, '*'); foreach ($this->content as $iKey => $iValue) { @@ -31,7 +31,7 @@ public function search(string $key, $limit = 0): array $found[] = $iKey; } - if ($hasWildCard !== false && strpos($iKey, substr($key, 0, -1)) !== false) { + if (false !== $hasWildCard && false !== strpos($iKey, substr($key, 0, -1))) { $found[] = $iKey; } } @@ -41,7 +41,7 @@ public function search(string $key, $limit = 0): array public function flush(): void { - $this->content = []; + $this->content = array(); } public function deleteWildcard(string $key): void @@ -52,7 +52,7 @@ public function deleteWildcard(string $key): void unset($this->content[$iKey]); } - if ($hasWildCard !== false && strpos($iKey, substr($key, 0, -1)) !== false) { + if (false !== $hasWildCard && false !== strpos($iKey, substr($key, 0, -1))) { unset($this->content[$iKey]); } } diff --git a/src/Services/RedisCacheService.php b/src/Services/RedisCacheService.php index d55b18c..09420ef 100644 --- a/src/Services/RedisCacheService.php +++ b/src/Services/RedisCacheService.php @@ -16,15 +16,15 @@ class RedisCacheService implements CacheServiceInterface */ public function __construct() { - if (!isset($_SERVER['REDIS_HOST']) || $_SERVER['REDIS_HOST'] === null) { + if (!isset($_SERVER['REDIS_HOST']) || null === $_SERVER['REDIS_HOST']) { return; } - $redis = new Client([ + $redis = new Client(array( 'scheme' => 'tcp', - 'host' => $_SERVER['REDIS_HOST'], - 'port' => $_SERVER['REDIS_PORT'], - ]); + 'host' => $_SERVER['REDIS_HOST'], + 'port' => $_SERVER['REDIS_PORT'], + )); $this->redis = $redis; } @@ -47,19 +47,19 @@ public function has(string $key): bool public function search(string $key, $limit = 0): array { $iterator = 0; - $found = []; + $found = array(); do { - $result = $this->redis->scan($iterator, ['MATCH '.$key]); + $result = $this->redis->scan($iterator, array('MATCH '.$key)); $iterator = (int) $result[0]; unset($result[0]); $found[] = $result[1]; - if ($limit !== 0 && \count($found) * 10 > $limit) { + if (0 !== $limit && \count($found) * 10 > $limit) { break; } - } while ($iterator !== 0); + } while (0 !== $iterator); $found = array_merge(...$found); diff --git a/src/Services/TweetService.php b/src/Services/TweetService.php index 5bb9ab1..a05bb7d 100644 --- a/src/Services/TweetService.php +++ b/src/Services/TweetService.php @@ -7,10 +7,12 @@ class TweetService { private $twitterOAuth; + /** * @var CacheServiceInterface */ private $cache; + /** * @var bool */ @@ -23,7 +25,7 @@ class TweetService */ public function __construct(CacheServiceInterface $cache) { - if (!isset($_SERVER['OAUTH_KEY'], $_SERVER['OAUTH_SECRET']) || $_SERVER['OAUTH_KEY'] === null || $_SERVER['OAUTH_SECRET'] === null) { + if (!isset($_SERVER['OAUTH_KEY'], $_SERVER['OAUTH_SECRET']) || null === $_SERVER['OAUTH_KEY'] || null === $_SERVER['OAUTH_SECRET']) { return; } @@ -42,7 +44,7 @@ public function loadLatestTweets(): void $fiveMinAgo = new \DateTime('5min ago'); if ($this->cache->has('lastTweetLoad')) { - $lastTweetLoad = unserialize($this->cache->get('lastTweetLoad'), ['allowed_classes' => [\DateTime::class]]); + $lastTweetLoad = unserialize($this->cache->get('lastTweetLoad'), array('allowed_classes' => array(\DateTime::class))); } if ($lastTweetLoad->getTimestamp() > $fiveMinAgo->getTimestamp()) { @@ -51,13 +53,13 @@ public function loadLatestTweets(): void $this->deleteAllTweets(); - if (!isset($_SERVER['TWITTER_SEARCH']) || $_SERVER['TWITTER_SEARCH'] === null) { + if (!isset($_SERVER['TWITTER_SEARCH']) || null === $_SERVER['TWITTER_SEARCH']) { return; } - $result = $this->twitterOAuth->get('search/tweets', ['q' => $_SERVER['TWITTER_SEARCH'], 'count' => 100]); + $result = $this->twitterOAuth->get('search/tweets', array('q' => $_SERVER['TWITTER_SEARCH'], 'count' => 100)); - if (property_exists($result, 'errors') && $result->errors !== null) { + if (property_exists($result, 'errors') && null !== $result->errors) { $this->cache->set('lastTweetLoad', serialize(new \DateTime('now'))); return; @@ -68,7 +70,7 @@ public function loadLatestTweets(): void $hasItem = $this->cache->has($tweetKey); - if ($hasItem === true) { + if (true === $hasItem) { break; } @@ -80,8 +82,8 @@ public function loadLatestTweets(): void public function getTweets($limit = 15): array { - if ($this->enabled === false) { - return []; + if (false === $this->enabled) { + return array(); } if ($this->cache instanceof NullCacheService) { @@ -90,7 +92,7 @@ public function getTweets($limit = 15): array $found = $this->cache->search('tweet_*', $limit); - $tweets = []; + $tweets = array(); foreach ($found as $tweet) { $tweets[] = json_decode($this->cache->get($tweet)); } diff --git a/webpack.config.js b/webpack.config.js index d7c91b4..239ffdd 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -20,23 +20,25 @@ Encore // uncomment if you use Sass/SCSS files .enableSassLoader() - .addPlugin(new CopyWebpackPlugin([ - { - from: './assets/static', to: 'static' - } - ])) + .addPlugin( + new CopyWebpackPlugin([ + { + from: './assets/static', + to: 'static', + }, + ]) + ) // uncomment for legacy applications that require $/jQuery as a global variable - .autoProvidejQuery() -; + .autoProvidejQuery(); let config = Encore.getWebpackConfig(); -if(process.env.DOCKER) { - config.watchOptions = { - aggregateTimeout: 300, - poll: 1000 - }; +if (process.env.DOCKER) { + config.watchOptions = { + aggregateTimeout: 300, + poll: 1000, + }; } module.exports = config;