diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb new file mode 100644 index 00000000..70c5fa19 --- /dev/null +++ b/app/controllers/pages_controller.rb @@ -0,0 +1,5 @@ +class PagesController < ApplicationController + before_action :skip_authorization + def czechers + end +end diff --git a/app/helpers/pages_helper.rb b/app/helpers/pages_helper.rb new file mode 100644 index 00000000..2c057fd0 --- /dev/null +++ b/app/helpers/pages_helper.rb @@ -0,0 +1,2 @@ +module PagesHelper +end diff --git a/app/views/pages/czechers.html.haml b/app/views/pages/czechers.html.haml new file mode 100644 index 00000000..56745961 --- /dev/null +++ b/app/views/pages/czechers.html.haml @@ -0,0 +1,142 @@ +%h1{style: "padding-left: 0.5em;"} Czechers + +:css + .board { + position: relative; + margin-top: 1em; + margin-bottom: 1em; + display: grid; + grid-template-columns: repeat(8, 80px); + grid-template-rows: repeat(8, 80px); + gap: 1px; + } + .cell { + width: 80px; + height: 80px; + background-color: white; + } + .cell:nth-child(2n+1):nth-child(-n+8), + .cell:nth-child(2n):nth-child(n+9):nth-child(-n+16), + .cell:nth-child(2n+1):nth-child(n+17):nth-child(-n+24), + .cell:nth-child(2n):nth-child(n+25):nth-child(-n+32), + .cell:nth-child(2n+1):nth-child(n+33):nth-child(-n+40), + .cell:nth-child(2n):nth-child(n+41):nth-child(-n+48), + .cell:nth-child(2n+1):nth-child(n+49):nth-child(-n+56), + .cell:nth-child(2n):nth-child(n+57):nth-child(-n+64) { + background-color: black; + } + .czecher-piece { + border-radius: 5em; + width: 50px; + outline: 2px #cccccc solid; + position: absolute; + z-index: 100; + } + + .czecher-piece:active { + outline: 2px #00ffff solid; + } + +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 182px; top: 912px;"} +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 262px; top: 912px;"} +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 343px; top: 912px;"} +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 424px; top: 912px;"} +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 505px; top: 912px;"} +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 586px; top: 912px;"} +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 667px; top: 912px;"} +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 748px; top: 912px;"} + +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 182px; top: 993px;"} +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 262px; top: 993px;"} +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 343px; top: 993px;"} +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 424px; top: 993px;"} +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 505px; top: 993px;"} +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 586px; top: 993px;"} +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 667px; top: 993px;"} +%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 748px; top: 993px;"} + + +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 181px; top: 1480px;"} +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 261px; top: 1480px;"} +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 342px; top: 1480px;"} +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 423px; top: 1480px;"} +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 504px; top: 1480px;"} +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 585px; top: 1480px;"} +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 666px; top: 1480px;"} +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 747px; top: 1480px;"} + +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 181px; top: 1399px;"} +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 261px; top: 1399px; outline: 2px #00ffff solid;"} +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 342px; top: 1399px;"} +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 423px; top: 1399px;"} +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 504px; top: 1399px;"} +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 585px; top: 1399px;"} +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 666px; top: 1399px;"} +%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 747px; top: 1399px;"} + + +.board + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell{style: "background: #EFFA8D;"} + .cell + .cell{style: "background: #EFFA8D;"} + .cell + .cell + .cell + .cell + .cell + .cell + .cell{style: "background: #B5FFFF;"} + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell + .cell diff --git a/config/routes.rb b/config/routes.rb index a8ed9378..b74bac9e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,5 @@ Rails.application.routes.draw do + get 'pages/czechers' resources :metapurses do member do get 'data' diff --git a/public/czech-logo-dip20.png b/public/czech-logo-dip20.png new file mode 100755 index 00000000..9c4669f7 Binary files /dev/null and b/public/czech-logo-dip20.png differ diff --git a/public/tendy-logo-icrc1.jpg b/public/tendy-logo-icrc1.jpg new file mode 100755 index 00000000..c781ee29 Binary files /dev/null and b/public/tendy-logo-icrc1.jpg differ diff --git a/spec/helpers/pages_helper_spec.rb b/spec/helpers/pages_helper_spec.rb new file mode 100644 index 00000000..29609410 --- /dev/null +++ b/spec/helpers/pages_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the PagesHelper. For example: +# +# describe PagesHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe PagesHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/requests/pages_spec.rb b/spec/requests/pages_spec.rb new file mode 100644 index 00000000..0b80326d --- /dev/null +++ b/spec/requests/pages_spec.rb @@ -0,0 +1,11 @@ +require 'rails_helper' + +RSpec.describe "Pages", type: :request do + describe "GET /czechers" do + it "returns http success" do + get "/pages/czechers" + expect(response).to have_http_status(:success) + end + end + +end diff --git a/spec/views/pages/czechers.html.haml_spec.rb b/spec/views/pages/czechers.html.haml_spec.rb new file mode 100644 index 00000000..4d7d8b5f --- /dev/null +++ b/spec/views/pages/czechers.html.haml_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe "pages/czechers.html.haml", type: :view do + pending "add some examples to (or delete) #{__FILE__}" +end