Skip to content

Commit

Permalink
Filter scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
ayush013 committed Jul 12, 2022
1 parent 9ba28d6 commit ee0eded
Show file tree
Hide file tree
Showing 11 changed files with 18,368 additions and 3 deletions.
11 changes: 11 additions & 0 deletions filter/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Filter</title>
</head>

<body></body>
</html>
13,688 changes: 13,688 additions & 0 deletions filter/package-lock.json

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions filter/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "media-scroller-gui-challenge",
"version": "1.0.0",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --config webpack.prod.js",
"start": "webpack serve --open --config webpack.dev.js",
"serve:prod": "webpack serve --open --config webpack.prod.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"autoprefixer": "^10.2.5",
"css-loader": "^5.2.4",
"html-loader": "^2.1.2",
"html-webpack-plugin": "^5.3.1",
"mini-css-extract-plugin": "^1.6.0",
"node-sass": "^6.0.0",
"sass-loader": "^11.0.1",
"style-loader": "^2.0.0",
"webpack": "^5.36.2",
"webpack-cli": "^4.7.0",
"webpack-dev-server": "^3.11.2"
}
}
Empty file added filter/src/app/.gitkeep
Empty file.
Empty file added filter/src/assets/.gitkeep
Empty file.
11 changes: 11 additions & 0 deletions filter/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import "./style.css";
const API = "https://picsum.photos/v2/list";

fetch(API)
.then((r) => r.json())
.then((list) => {
// const mediaTemplates = list.map(mapMediaToTemplate);
// const fragment = new DocumentFragment();
// mediaTemplates.forEach((template) => fragment.appendChild(template));
// mediaScroller.appendChild(fragment);
});
51 changes: 51 additions & 0 deletions filter/src/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* Basic reset */
@layer reset {
html {
font-size: 16px;
}

html,
body {
margin: 0;
padding: 0;
box-sizing: border-box;
}

:root {
--bg-light: white;
--bg-dark: rgb(2, 20, 20);
--bg: var(--bg-light);
}

body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
font-size: 1rem;
font-weight: 400;
min-height: 100vh;
color: black;
background-color: var(--bg);
padding: 2rem;
}

*,
*::after,
*::before {
box-sizing: inherit;
margin: 0;
padding: 0;
}
}


@media (prefers-color-scheme: dark) {
body {
color: white;
}

:root {
color-scheme: dark;
--bg: var(--bg-dark);
}

}
38 changes: 38 additions & 0 deletions filter/webpack.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
entry: './src/index.js',
mode: 'development',
devtool: 'inline-source-map',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
clean: true,
},
devServer: {
contentBase: './dist',
},
module: {
rules: [
{
test: /\.html$/,
loader: 'html-loader',
},
{
test: /\.(svg|png|jpg|gif)$/,
type: 'asset/resource'
},
{
test: /\.(scss|css)$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
}
],
},
plugins: [
new HtmlWebpackPlugin({
title: 'Scaffold - Development',
template: 'index.html'
}),
],
};
39 changes: 39 additions & 0 deletions filter/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

module.exports = {
entry: './src/index.js',
mode: 'production',
output: {
filename: '[name].[contenthash].js',
path: path.resolve(__dirname, 'dist'),
clean: true,
},
optimization: {
runtimeChunk: 'single',
},
module: {
rules: [
{
test: /\.html$/,
loader: 'html-loader',
},
{
test: /\.(svg|png|jpg|gif)$/,
type: 'asset/resource'
},
{
test: /\.(scss|css)$/,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
},
],
},
plugins: [
new MiniCssExtractPlugin({ filename: '[name].[contenthash].css' }),
new HtmlWebpackPlugin({
title: 'Scafold - Production',
template: 'index.html'
}),
],
};
Loading

0 comments on commit ee0eded

Please sign in to comment.