Browse Source

Merge branch 'master' of https://github.com/rdrew/lmmi_journal_theme

dependabot/npm_and_yarn/acorn-5.7.4
Rob Drew 6 years ago
parent
commit
bd1d08c291
  1. 8
      .gitignore
  2. 1
      .nvmrc
  3. 137
      css/style.css
  4. 119
      gulpfile.js
  5. BIN
      img/DS2_2648.jpg
  6. 0
      img/test.txt
  7. 49
      js/js.js
  8. 5
      lmmi_journal.libraries.yml
  9. 9204
      package-lock.json
  10. 27
      package.json
  11. BIN
      src/img/DS2_2648.jpg
  12. 49
      src/js/js.js
  13. 31
      src/scss/_article-title-banner.scss
  14. 17
      src/scss/_lp-hero.scss
  15. 29
      src/scss/_lp-preview-grid.scss
  16. 101
      src/scss/style.scss

8
.gitignore vendored

@ -0,0 +1,8 @@
# Ignore the node modules folder (created by 'npm install').
node_modules
# We absolutely don't want to have the .sass-cache in git.
.sass-cache
.DS_Store
*.swo

1
.nvmrc

@ -0,0 +1 @@
10.10.0

137
css/style.css

File diff suppressed because one or more lines are too long

119
gulpfile.js

@ -1,58 +1,89 @@
var gulp = require('gulp'),
plumber = require('gulp-plumber'),
rename = require('gulp-rename');
'use strict';
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var imagemin = require('gulp-imagemin');
var plumber = require('gulp-plumber');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps = require('gulp-sourcemaps');
var concat = require('gulp-concat');
var imagemin = require('gulp-imagemin'),
cache = require('gulp-cache');
var sass = require('gulp-sass');
var browserSync = require('browser-sync');
//var cache = require('gulp-cache');
//===================
// Browsersync Proxy
//===================
gulp.task('browser-sync', function() {
browserSync({
server: {
baseDir: "./"
}
});
browserSync.init({
proxy: "https://lmmijournal.researchspaces.ca",
serveStatic: ['.'],
files: ['./css/style.css','./js/js.js'],
plugins: ['bs-rewrite-rules'],
rewriteRules: [
{
match: '/themes/custom/lmmi_journal',
replace: ''
}
]
});
});
gulp.task('bs-reload', function () {
browserSync.reload();
});
gulp.task('images', function(){
gulp.src('src/img/**/*')
.pipe(cache(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true })))
.pipe(gulp.dest('img/'));
//====================
// Sass Compilation
//===================
gulp.task('sass', function () {
return gulp.src('./src/scss/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./css'));
});
gulp.task('styles', function(){
gulp.src(['src/scss/**/*.scss'])
.pipe(plumber({
errorHandler: function (error) {
console.log(error.message);
this.emit('end');
}}))
.pipe(sass())
.pipe(autoprefixer('last 2 versions'))
.pipe(gulp.dest('css/'))
.pipe(browserSync.reload({stream:true}))
//====================
// JS Concatination
//===================
gulp.task('js', function () {
gulp.src('./src/js/*.js') // path to your files
.pipe(concat('js.js')) // concat and name it "concat.js"
.pipe(gulp.dest('./js/'));
});
gulp.task('scripts', function(){
return gulp.src('src/js/**/*.js')
.pipe(plumber({
errorHandler: function (error) {
console.log(error.message);
this.emit('end');
}}))
.pipe(concat('main.js'))
.pipe(gulp.dest('js/'))
.pipe(browserSync.reload({stream:true}))
//====================
// Image Optimization
//===================
gulp.task('images', function(){
gulp.src('src/img/**/*')
//.pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))
.pipe(imagemin([
imagemin.jpegtran({progressive: true}),
imagemin.optipng({optimizationLevel: 5}),
imagemin.svgo({
plugins: [
{removeViewBox: true},
{cleanupIDs: false}
]
})
]))
.pipe(gulp.dest('img/'));
});
gulp.task('default', ['browser-sync'], function(){
gulp.watch("src/scss/**/*.scss", ['styles']);
gulp.watch("src/js/**/*.js", ['scripts']);
gulp.watch("*.html", ['bs-reload']);
//==================
// Default Gulp Task
//=================
gulp.task ('default',['browser-sync'], function(){
//watch sass folder and compile changes
gulp.watch('src/scss/**/*.scss', ['sass']);
//watch js folder and compile changes
gulp.watch('src/js/**/*.js', ['js']);
//watch image folder and optimize
gulp.watch('src/img/**/*', ['images']);
});

BIN
img/DS2_2648.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 KiB

After

Width:  |  Height:  |  Size: 822 KiB

0
img/test.txt

49
js/js.js

@ -0,0 +1,49 @@
(function ($, Drupal) {
Drupal.behaviors.myAwesomeJs = {
attach: function attach(context, settings) {
//js goes here
}
};
})(jQuery, Drupal);

5
lmmi_journal.libraries.yml

@ -2,6 +2,11 @@ global-styling:
css:
theme:
css/style.css: {weight: 160, preprocess: FALSE}
js:
js/js.js: {}
dependencies:
- core/jquery
fonts:
version: VERSION

9204
package-lock.json generated

File diff suppressed because it is too large Load Diff

27
package.json

@ -1,22 +1,23 @@
{
"name": "Quench",
"name": "bs",
"version": "1.0.0",
"description": "A Gulp file and project generator.",
"main": "gulpfile.js",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Quench",
"author": "",
"license": "ISC",
"devDependencies": {
"browser-sync": "2.6.5",
"gulp-autoprefixer": "2.1.0",
"gulp-cache": "0.2.8",
"gulp-concat": "2.5.2",
"gulp-imagemin": "2.2.1",
"gulp-plumber": "1.0.0",
"gulp-rename": "1.2.2",
"gulp-sass": "1.3.3",
"gulp": "3.8.11"
"browser-sync": "^2.24.7",
"bs-rewrite-rules": "^2.1.2",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^6.0.0",
"gulp-cache": "^1.0.2",
"gulp-concat": "^2.6.1",
"gulp-imagemin": "^4.1.0",
"gulp-plumber": "^1.2.0",
"gulp-sass": "^4.0.1",
"gulp-sourcemaps": "^2.6.4"
}
}

BIN
src/img/DS2_2648.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

49
src/js/js.js

@ -0,0 +1,49 @@
(function ($, Drupal) {
Drupal.behaviors.myAwesomeJs = {
attach: function attach(context, settings) {
//js goes here
}
};
})(jQuery, Drupal);

31
src/scss/_article-title-banner.scss

@ -0,0 +1,31 @@
.article-title-banner {
//display:none;
border: 1px solid #ccc;
}
.field--name-field-journal-article-abstract .field__label {
font-size: 2rem;
}
.node--type-journal-article {
.field--name-body figure {
margin-left: initial;
margin-right: initial;
float: left;
img {
border: 1px solid #ccc;
padding: 4px;
width: 200px;
float: left;
margin-right: 1rem;
margin-top: 1rem;
}
}
a[id^="footnote"] {
border: 1px solid #5d5d5d;
background: #5d5d5d;
color: #fff;
border-radius: 4px;
text-decoration: none;
padding: 2px 4px;
font-size:1.2rem;
}
}

17
src/scss/_lp-hero.scss

@ -0,0 +1,17 @@
/*==========Landing Page Hero Image===========*/
.hero {
background: blue;
background: url(../img/DS2_2648.jpg);
background-size: cover;
background-repeat: no-repeat;
background-position: center;
position: relative;
height: 250px;
display: flex;
align-items: center;
}

29
src/scss/_lp-preview-grid.scss

@ -0,0 +1,29 @@
/*====lp article preview cards==================*/
.preview-card__grid-row {
display: flex;
justify-content: space-between;
}
.preview-card {
box-shadow: 0 2px 14px rgba(100, 100, 100, 0.1), 0 2px 2px rgba(100, 100, 100, 0.1);
border: 1px solid #e4e4e4;
}
.preview-card {
margin: 0 1em 2em 1em;
height: 250px
}
.preview-card:last-child {
margin: 0 0 2em 1em;
}
.preview-card:first-child {
margin: 0 1em 2rem 0;
}
.preview-card__caption {
margin: 10px;
}

101
src/scss/style.scss

@ -0,0 +1,101 @@
//imports
@import 'lp-preview-grid';
@import 'lp-hero';
@import 'article-title-banner';
/*on-scroll menu */
.fixed-header-enabled.onscroll .header-container ul.menu {
text-align: right;
}
/*================================================*/
/*change header title fontsize*/
.col-md-12 .site-name a {
font-size: 40px;
}
.header-top__container {
padding: 60px 0 55px;
}
/*change padding above content*/
.main-content__section, .sidebar__section {
padding: 60px 0 70px;
}
/*modify issue info on landing page*/
.path-frontpage .layout.layout--twocol-bricks {
display: block;
}
.path-frontpage .block-region-second-above {
display: flex;
justify-content: flex-start;
font-size: 1.8rem;
}
.path-frontpage .block-region-second-above > * {
margin-right: 1rem;
display:flex;
}
.path-frontpage .block-region-second-above > .block-entity-fieldnodetitle::after{
content: ",";
}
.path-frontpage .block-region-second-above > .block-entity-fieldnodefield-issue-year::after{
content: ",";
}
.path-frontpage .block-region-second-above .field--name-field-issue-number {
display:flex;
}
/*tweak images added to articles*/
details#journal-article-text-tab img,
.path-frontpage .node--view-mode-teaser img {
border: 1px solid #ccc;
padding: 4px;
width: 200px;
float: left;
margin-right: 1rem;
margin-top: 1rem;
}
.field__label {
/*font-family: 'Merriweather', Georgia, Times New Roman, Serif;*/
/*font-family: 'Merriweather', Georgia, Times New Roman, Serif;*/
/*font-family: 'Merriweather', Georgia, Times New Roman, Serif;*/
font-family: 'Libre Baskerville', serif;
}
.field--name-field-issue-number .field__label {
font-family: inherit;
font-weight: initial;
}
.path-frontpage .node--view-mode-teaser {
padding: 0 0 30px 0;
margin-bottom: 30px;
}
.logo {
width:110px;
}
/*headings*/
.hff-01 h1,
.hff-01 h2,
.hff-01 h3,
.hff-01 h4,
.hff-01 h5,
.hff-01 h6,
.hff-01 .tp-caption__title,
.hff-01 .tp-caption__subtitle,
.sff-01 .site-name,
.slff-01 .site-slogan,
.hff-01 .nav-tab__title {
font-family: 'Libre Baskerville', Georgia, Times New Roman, Serif;
}
.site-name {
font-size:12rem;
}
Loading…
Cancel
Save