diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 816672e..1ec36e7 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -13,4 +13,163 @@ *= require_tree . *= require_self */ -@import "bootstrap/scss/bootstrap"; \ No newline at end of file +// @import "bootstrap/scss/bootstrap"; + +@import 'materialize-css/dist/css/materialize'; +@import url('https://fonts.googleapis.com/css?family=Arvo'); + +.section { + display: none; + padding: 2rem; + + @media screen and (min-width: 768px) { + padding: 4rem; + } + + @supports(display: grid) { + display: block; + } +} + +h1 { + font-size: 2rem; + margin: 0 0 1.5em; +} + +.grid { + display: grid; + grid-gap: 30px; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + grid-auto-rows: 150px; + grid-auto-flow: row dense; +} + +.item { + position: relative; + display: flex; + flex-direction: column; + justify-content: flex-end; + box-sizing: border-box; + background: #0c9a9a; + color: #fff; + grid-column-start: auto; + grid-row-start: auto; + color: #fff; + background: url('https://images.unsplash.com/photo-1470124182917-cc6e71b22ecc?dpr=2&auto=format&fit=crop&w=1500&h=1000&q=80&cs=tinysrgb&crop='); + background-size: cover; + background-position: center; + box-shadow: -2px 2px 10px 0px rgba(#444, 0.4); + transition: transform 0.3s ease-in-out; + cursor: pointer; + counter-increment: item-counter; + + &:nth-of-type(2n) { + background-image: url('https://res.cloudinary.com/elijjaaahhhh/image/upload/v1589651559/nick-fewings-8YhMxwhuyQM-unsplash_bskdde.jpg'); + } + + &:nth-of-type(3n) { + background-image: url('https://images.unsplash.com/photo-1422255198496-21531f12a6e8?dpr=2&auto=format&fit=crop&w=1500&h=996&q=80&cs=tinysrgb&crop='); + } + + &:nth-of-type(4n) { + background-image: url('https://images.unsplash.com/photo-1490914327627-9fe8d52f4d90?dpr=2&auto=format&fit=crop&w=1500&h=2250&q=80&cs=tinysrgb&crop='); + } + + &:nth-of-type(5n) { + background-image: url('https://images.unsplash.com/photo-1476097297040-79e9e1603142?dpr=2&auto=format&fit=crop&w=1500&h=1000&q=80&cs=tinysrgb&crop='); + } + + &:nth-of-type(6n) { + background-image: url('https://images.unsplash.com/photo-1464652149449-f3b8538144aa?dpr=2&auto=format&fit=crop&w=1500&h=1000&q=80&cs=tinysrgb&crop='); + } + + &:after { + content: ''; + position: absolute; + width: 100%; + height: 100%; + background-color: black; + opacity: 0.3; + transition: opacity 0.3s ease-in-out; + } + + &:hover { + transform: scale(1.05); + + &:after { + opacity: 0; + } + } + + &--medium { + grid-row-end: span 2; + } + + &--large { + grid-row-end: span 2; + } + + &__details { + position: relative; + z-index: 1; + padding: 15px; + color: #444; + background: #fff; + text-transform: lowercase; + letter-spacing: 1px; + color: #828282; + } +} + +.top-rated img { + // height: 350px; + width: 100%; +} + +.con { + margin: 5px 30px; +} + + +// .bg-img { +// /* The image used */ +// background-image: url("https://res.cloudinary.com/elijjaaahhhh/image/upload/v1589667374/main_kgnuev.jpg"); + +// min-height: 80vh; + +// /* Center and scale the image nicely */ +// background-position: center; +// background-repeat: no-repeat; +// background-size: cover; + +// /* Needed to position the navbar */ +// position: relative; +// } + +// /* Position the navbar container inside the image */ +// .containe { +// position: absolute; +// margin: 20px; +// width: auto; +// } + +// /* The navbar */ +// .topnav { +// overflow: hidden; +// // background-color: #333; +// } + +// /* Navbar links */ +// .topnav a { +// // float: left; +// color: #f2f2f2; +// text-align: center; +// padding: 14px 16px; +// text-decoration: none; +// font-size: 17px; +// } + +// .topnav a:hover { +// background-color: #ddd; +// color: black; +// } \ No newline at end of file diff --git a/app/assets/stylesheets/welcome.scss b/app/assets/stylesheets/welcome.scss new file mode 100644 index 0000000..5042f7d --- /dev/null +++ b/app/assets/stylesheets/welcome.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the welcome controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: https://sass-lang.com/ diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb new file mode 100644 index 0000000..1f90d31 --- /dev/null +++ b/app/controllers/orders_controller.rb @@ -0,0 +1,15 @@ +class OrdersController < ApplicationController + def index + @orders = Order.all + # @order_item = current_order.order_items.new + end + + def show + @order = Order.find(params[:id]) + end + private + + def product_params + params.require(:order).permit(:title, :description, :price) + end +end diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb new file mode 100644 index 0000000..300ec66 --- /dev/null +++ b/app/controllers/welcome_controller.rb @@ -0,0 +1,10 @@ +class WelcomeController < ApplicationController + def home + end + + def about_us + end + + def contact_us + end +end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb new file mode 100644 index 0000000..eeead45 --- /dev/null +++ b/app/helpers/welcome_helper.rb @@ -0,0 +1,2 @@ +module WelcomeHelper +end diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 7559d97..3ab8905 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -2,15 +2,35 @@ // present in this directory. You're encouraged to place your actual application logic in // a relevant structure within app/javascript and only use these pack files to reference // that code so it'll be compiled. -import 'bootstrap' +// import 'bootstrap' +import '../stylesheets/application' +import 'materialize-css/dist/js/materialize' + require("@rails/ujs").start() require("turbolinks").start() require("@rails/activestorage").start() require("channels") - +require("jquery") // Uncomment to copy all static images under ../images to the output folder and reference // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) // or the `imagePath` JavaScript helper below. // // const images = require.context('../images', true) // const imagePath = (name) => images(name, true) +$(document).on('turbolinks:load', function () { + $('.carousel').carousel({ + interval: 3000 + }) + + $('.sidenav').sidenav(); + + // $('.slider').slider(); + + $(".slider").slider({ + indicators: false, + height: 500, + transition: 500, + interval: 6000, + }); + +}); \ No newline at end of file diff --git a/app/javascript/stylesheets/application.scss b/app/javascript/stylesheets/application.scss new file mode 100644 index 0000000..ef07096 --- /dev/null +++ b/app/javascript/stylesheets/application.scss @@ -0,0 +1 @@ +// @import 'materialize-css/dist/css/materialize'; \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 74828c5..06e2d19 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,15 +1,65 @@ -
+ +