Added official app banner
parent
182fbc78b4
commit
7c5246d8d3
|
@ -17,4 +17,5 @@
|
|||
//= require nprogress
|
||||
//= require nprogress-turbolinks
|
||||
//= require mods
|
||||
//= require official_app_banner
|
||||
//= require_tree ./inputs
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
banner = document.getElementById('official-app-banner')
|
||||
button = banner.querySelector('button')
|
||||
|
||||
|
||||
showBanner = -> banner.style.display = 'block'
|
||||
hideBanner = -> banner.style.display = 'none'
|
||||
|
||||
timeSinceLastDismissed = new Date().valueOf() - localStorage['dismissed-banner']
|
||||
|
||||
if !localStorage['dismissed-banner'] or timeSinceLastDismissed > 1000*60*60 # 1 hour
|
||||
showBanner()
|
||||
button.addEventListener 'click', ->
|
||||
localStorage['dismissed-banner'] = new Date().valueOf()
|
||||
hideBanner()
|
|
@ -46,6 +46,8 @@
|
|||
@import "static"
|
||||
@import "errors"
|
||||
|
||||
@import "official_app_banner"
|
||||
|
||||
$nprogress-color: $color-orange
|
||||
$nprogress-height: 5px
|
||||
$nprogress-zindex: 10100
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
#official-app-banner
|
||||
display: none
|
||||
position: absolute
|
||||
left: 0
|
||||
right: 0
|
||||
padding: $base-line-size 0
|
||||
background: rgba($color-orange, 0.75)
|
||||
box-shadow: 0 5px 15px rgba(#000, 0.5)
|
||||
text-align: center
|
||||
font-size: $font-x-larger
|
||||
line-height: $base-line-size*2
|
||||
color: white
|
||||
text-shadow: 0 2px 0 rgba(#000, 0.8)
|
||||
z-index: 9999
|
||||
a
|
||||
color: $color-blue
|
||||
button
|
||||
padding: $base-line-size/2
|
||||
background: $color-blue
|
|
@ -8,6 +8,11 @@
|
|||
%link(rel="shortcut icon" href="/favicon.ico?v=2")
|
||||
= render partial: 'layouts/google_analytics'
|
||||
%body{class: body_controller_classes}
|
||||
#official-app-banner
|
||||
Hey! The official Factorio mods app is up and running!<br/>
|
||||
Stop using this one and go to <a href="http://mods.factorio.com">http://mods.factorio.com</a><br/>
|
||||
This app will be decomissioned soon! Thanks for your support!<br/>
|
||||
<button class='btn'>I understand, hide this message</button>
|
||||
.page-wrap
|
||||
.container
|
||||
= render partial: 'layouts/header'
|
||||
|
|
Loading…
Reference in New Issue