diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..40979b4 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,6 @@ +RewriteEngine On +RewriteBase / +RewriteRule ^index\.html$ - [L] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule . /index.html [L] \ No newline at end of file diff --git a/public/index.html b/public/index.html index 7dbb056..6c17468 100644 --- a/public/index.html +++ b/public/index.html @@ -5,43 +5,33 @@ - + + - + - - React App + + Danovin -
- + diff --git a/public/manifest.json b/public/manifest.json index 080d6c7..5dee3bb 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -5,17 +5,20 @@ { "src": "favicon.ico", "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" + "type": "image/x-icon", + "purpose": "any maskable" }, { "src": "logo192.png", "type": "image/png", - "sizes": "192x192" + "sizes": "192x192", + "purpose": "any maskable" }, { - "src": "logo512.png", + "src": "logo.png", "type": "image/png", - "sizes": "512x512" + "sizes": "512x512", + "purpose": "any maskable" } ], "start_url": ".", diff --git a/public/offline.html b/public/offline.html new file mode 100644 index 0000000..c5eb5d7 --- /dev/null +++ b/public/offline.html @@ -0,0 +1,45 @@ + + + + + + + + دعوت + + + + +
+

+ لطفا اتصال به شبکه را چک کنید. +

+
+ + + \ No newline at end of file diff --git a/public/serviceworker.js b/public/serviceworker.js new file mode 100644 index 0000000..d0afef9 --- /dev/null +++ b/public/serviceworker.js @@ -0,0 +1,42 @@ +const CACHE_NAME = "version-1"; +const urlsToCache = ['index.html', 'offline.html']; + +const self = this; + +//Install SW +self.addEventListener('install', (event) => { + event.waitUntil( + caches.open(CACHE_NAME) + .then((cache) => { + console.log('Opened cache'); + + return cache.addAll(urlsToCache); + }) + ) +}); + +//Listen for requests +self.addEventListener('fetch', (event) => { + event.respondWith( + caches.match(event.request) + .then(() => { + return fetch(event.request) + .catch(() => caches.match('offline.html')); + }) + ); +}); +//Activate the SW +self.addEventListener('activate', (event) => { + const cacheWhiteList = []; + cacheWhiteList.push(CACHE_NAME); + + event.waitUntil( + caches.keys().then((cacheNames) => Promise.all( + cacheNames.map((cacheName) => { + if (!cacheWhiteList.includes(cacheName)) { + return caches.delete(cacheName); + } + }) + )) + ) +}); \ No newline at end of file diff --git a/src/views/About/index.js b/src/views/About/index.js index 5205732..76b8d04 100644 --- a/src/views/About/index.js +++ b/src/views/About/index.js @@ -16,9 +16,9 @@ const maxMobileSize = 650; const fontSize = { desktop: { h1: window.innerWidth > maxDesktopSize ? 30 : window.innerWidth / 40, - p: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 80, + p: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 80, h2: window.innerWidth > maxDesktopSize ? 20 : window.innerWidth / 70, - li: window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 80, + li: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 80, }, mobile: { h1: window.innerWidth > maxMobileSize ? 30 : window.innerWidth / 18, diff --git a/src/views/Contact/index.js b/src/views/Contact/index.js index 174f671..92755b8 100644 --- a/src/views/Contact/index.js +++ b/src/views/Contact/index.js @@ -16,7 +16,7 @@ const maxMobileSize = 550; const fontSize = { desktop: { h1: window.innerWidth > maxDesktopSize ? 30 : window.innerWidth / 40, - p : window.innerWidth > maxDesktopSize ? 16: window.innerWidth / 80, + p : window.innerWidth > maxDesktopSize ? 14: window.innerWidth / 80, span : window.innerWidth > maxDesktopSize ? 16: window.innerWidth / 80, } } diff --git a/src/views/Contact/index.scss b/src/views/Contact/index.scss index bbc9489..d99b050 100644 --- a/src/views/Contact/index.scss +++ b/src/views/Contact/index.scss @@ -21,7 +21,6 @@ border-color: #cecece !important; border-width: 1px !important; color: green !important; - font-size: calc(100vw / 85) !important; border-radius: 10px !important; } @@ -53,7 +52,6 @@ background-color: white; max-width: 120px; text-align: center; - font-size: calc(100vw / 85) !important; color: #797979 !important; letter-spacing: -1px; } @@ -114,13 +112,11 @@ border: 1px solid #cecece !important; text-align: center !important; border-radius: 10px !important; - font-size: calc(100vw / 85); color: #76797e !important; &:focus { background-color: white !important; } option { - font-size: calc(100vw / 80) !important; padding: 5px !important; } } diff --git a/src/views/Home/HomeSlider/Blog/index.js b/src/views/Home/HomeSlider/Blog/index.js index ea38c3b..880a9af 100644 --- a/src/views/Home/HomeSlider/Blog/index.js +++ b/src/views/Home/HomeSlider/Blog/index.js @@ -2,6 +2,17 @@ import React, { Component } from 'react'; import {Link} from 'react-router-dom'; import './index.scss'; + +const maxDesktopSize = 1250; + +const fontSize = { + desktop : { + h1: window.innerWidth > maxDesktopSize ? 20 : window.innerWidth / 80, + h2: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 95, + span: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 110, + a: window.innerWidth > maxDesktopSize ? 15 : window.innerWidth / 90, + } +} export default class Simple extends Component { render() { const { height, data } = this.props; @@ -15,19 +26,19 @@ export default class Simple extends Component { }}>
{data.title} -

{data.title}

-

{data.subTitle}

+

{data.title}

+

{data.subTitle}

{/* */}
- مطالعه کامل در {data.duration} - تاریخ انتشار {data.data} + مطالعه کامل در {data.duration} + تاریخ انتشار {data.data}
- {data.buttonText} + {data.buttonText}
- {data.category.name} + {data.category.name}
: null } diff --git a/src/views/Home/HomeSlider/Blog/index.scss b/src/views/Home/HomeSlider/Blog/index.scss index afd3f11..31f82fb 100644 --- a/src/views/Home/HomeSlider/Blog/index.scss +++ b/src/views/Home/HomeSlider/Blog/index.scss @@ -15,13 +15,11 @@ h1 { font-family: numeralBold; margin-top: 15px; - font-size: calc(100vw / 80); color: #6f7074; } h2 { font-family: numeralLight; margin-top: 5px; - font-size: calc(100vw / 100); color: #a5a5a5; } &__category{ @@ -32,7 +30,6 @@ color: white; padding: 5px 7px; border-radius: 5px; - font-size: calc(100vw / 120); } &__footer { @@ -46,14 +43,12 @@ color: #02733c; text-decoration: none; border-radius: 5px; - font-size: calc(100vw / 120); &:hover{ color: #02733c; } } span{ font-family: numeralLight; - font-size: calc(100vw / 120); color: #a5a5a5; letter-spacing: -1px; }