diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 3c3629e..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/counter.json b/counter.json new file mode 100644 index 0000000..c227083 --- /dev/null +++ b/counter.json @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/economy.json b/economy.json deleted file mode 100644 index d3562d0..0000000 --- a/economy.json +++ /dev/null @@ -1,31 +0,0 @@ -[ - "مسکن", - "مشتری", - "وام", - "سهام", - "شرکت", - "حقوق", - "درآمد", - "صنعت", - "تجارت", - "یورو", - "ریال", - "دلار", - "قیمت", - "خرید", - "بورس", - "پول", - "بانک", - "اقتصاد", - "کالا", - "گمرک", - "سهامداران", - "تورم", - "سود", - "هر اونس طلا", - "رکود", - "نرخ", - "نفت", - "عمران", - "بیمه" -] \ No newline at end of file diff --git a/geographic.json b/geographic.json deleted file mode 100644 index 2e129c8..0000000 --- a/geographic.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - "کوه", - "زلزله", - "اختر شناسی", - "پدیده های انسانی", - "خاک", - "توپوگرافی", - "سیل", - "جغرافیا", - "آتشفشان", - "دانش نقشه برداری", - "عصر کاوش", - "آب و هوا", - "گردباد", - "ابن فضلان", - "پدیده های طبیعی", - "موقعیت", - "جنگل", - "اورست", - "نیم کره ی شمالی", - "قله", - "رود", - "محیط زیست", - "بوم", - "جغرافی دان", - "اقیانوس", - "وارونگی هوا", - "آبشار", - "اقلیم شناسی", - "گسل", - "سهند" -] \ No newline at end of file diff --git a/history.json b/history.json deleted file mode 100644 index 8813b76..0000000 --- a/history.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - "تاریخ", - "پادشاه", - "تمدن", - "انسان اولیه", - "انقلاب", - "کودتا", - "کوروش", - "کشف قاره آمریکا", - "فبیله", - "آتشکده", - "قوم مایا", - "قرن", - "اشکانیان", - "معماری سلوکیان", - "گذشته", - "بانو آرتا", - "عصر مسیحیت", - "مادها", - "کاخ هترا", - "نهضت پرنی ها", - "شاهنشاهی", - "قیام", - "امپراطور روم", - "ساسانیان", - "داریوش", - "معاصر", - "سپهبد سورنا", - "تبار ایرانی", - "شاهنامه فردوسی", - "سزار" -] \ No newline at end of file diff --git a/ipsum.js b/ipsum.js index cc66a8d..5c3b07e 100644 --- a/ipsum.js +++ b/ipsum.js @@ -1,7 +1,11 @@ var express = require('express'), - app = express(); - -app.use(express.static(__dirname + '/ipsum', {maxAge: 60*60*24*7})); + app = express(), + server = require('http').Server(app), + io = require('socket.io')(server), + fs = require('fs'), + counter = require('./counter.json'); + +app.use(express.static(__dirname + '/client', {maxAge: 60*60*24*7})); module.exports.app = app; @@ -38,13 +42,7 @@ var stretch = function stretch(a, n) { var general = require('./general.json'); var dictionary = { 'design': require('./design.json'), - 'news': require('./news.json'), - 'economy': require('./economy.json'), - 'sporty': require('./sporty.json'), - 'social': require('./social.json'), - 'sanitary': require('./sanitary.json'), - 'history': require('./history.json'), - 'geographic': require('./geographic.json') + 'news': require('./news.json') }; var normal = 'لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است. چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد. کتابهای زیادی در شصت و سه درصد گذشته، حال و آینده شناخت فراوان جامعه و متخصصان را می طلبد تا با نرم افزارها شناخت بیستری را برای طراحان رایانه ای و فرهنگ پیشرو در زبان فارسی ایجاد کرد. در این صورت می توان امید داشت که تمام و دشواری موجود در ارائه راهکارها و شرایط سخت تایپ به پایان رسد وزمان مورد نیاز شامل حروفچینی دستاوردهای اصلی و جوابگوی سوالات پیوسته اهل دنیای موجود طراحی اساسا مورد استفاده قرار گیرد.'; @@ -93,8 +91,14 @@ function loremipsum(data) { } } function go(url) { - var req = url.split('/'); - return loremipsum(req.slice(1)); + var ipsum = loremipsum(url.split('/').slice(1)); + counter += ipsum.split(' ').length; + fs.writeFileSync('counter.json', counter); + io.emit('counter', counter); + return ipsum; } -app.listen(8888); +/* COUNTER */ +io.on('connection', function(socket) { + socket.emit('counter', counter); +}); diff --git a/ipsum/css/main.css b/ipsum/css/main.css index e22a900..2c94c9c 100644 --- a/ipsum/css/main.css +++ b/ipsum/css/main.css @@ -510,3 +510,11 @@ a[href="#"].running { background-color: rgba(255, 255, 255, 0.2); color: white; } + +.counter { + position: absolute; + left: 1rem; + bottom: 1rem; + padding: 1.5rem; + font-size: 2rem; +} diff --git a/ipsum/css/main.less b/ipsum/css/main.less index 619142c..fd7757b 100644 --- a/ipsum/css/main.less +++ b/ipsum/css/main.less @@ -191,3 +191,12 @@ a[href="#"].running { background-color: rgba(255, 255, 255, 0.2); color: white; } + +.counter { + position: absolute; + left: 1rem; + bottom: 1rem; + padding: 1.5rem; + font-size: 2rem; +} + diff --git a/ipsum/index.html b/ipsum/index.html index e241bc4..add1ea8 100644 --- a/ipsum/index.html +++ b/ipsum/index.html @@ -16,15 +16,10 @@
دسته بندی