Skip to content

Commit

Permalink
ghpages
Browse files Browse the repository at this point in the history
  • Loading branch information
nsharma123 committed Jun 28, 2024
1 parent dda1e99 commit 4753e96
Show file tree
Hide file tree
Showing 8 changed files with 1,738 additions and 202 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 20
node-version: 16.x

- name: Install dependencies
run: yarn install
Expand Down
1 change: 1 addition & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@
</td>
<td class="searchParam">
<label><input type="checkbox" name="search" value="Search Param" />Search Param</label>
</td>
<td>
<label class="ia-button"><button class="pageChangedEvent">Page Change Event</button></label>
</td>
Expand Down
1,144 changes: 1,144 additions & 0 deletions ghpages/assets/main.13a904ba.js

Large diffs are not rendered by default.

183 changes: 183 additions & 0 deletions ghpages/demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<!doctype html>
<html lang="en-GB">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
html {
font-size: 10px;
/* This is to match petabox's base font size */
}
body {
margin: 0;
text-align: center;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
#demo {
height: 100px;
}
ia-book-actions {
--white: #fff;
--black: #000;
--primaryBGColor: var(--black);
--secondaryBGColor: #222;
--tertiaryBGColor: #333;
--primaryTextColor: var(--white);
--primaryCTAFill: #194880;
--primaryCTABorder: #c5d1df;
--secondaryCTAFill: #333;
--secondaryCTABorder: #999;
--secondaryCTAFillRGB: 51, 51, 51;
--primaryErrorCTAFill: #e51c26;
--primaryErrorCTABorder: #f8c6c8;
--primaryCTAFillRGB: 25, 72, 128;
--primaryErrorCTAFillRGB: 229, 28, 38;
--primaryDisableCTAFill: #767676;
}

fieldset {
width: fit-content;
margin-top: 50px;
}
fieldset legend {
text-align: left;
font-size: 12px;
}
td {
color: white;
font-size: 14px;
border-radius: 5%;
display: table-cell;
text-align: initial;
margin: 5px 0;
width: max-content;
display: block;
}
label {
padding: 10px;
display: block;
cursor: pointer;
margin: 2px;
background: #4e545a;
border-radius: 10px;
}
input[type="radio"], input[type="checkbox"] {
margin-top: 0;
vertical-align: middle;
}

.initial td {
float: left;
margin: 2px;
}

fieldset {
display: inline-grid;
}

.action-button button {
padding: 6px;
cursor: pointer;
border: 2px solid #194880;
border-radius: 10px;
}

body.modal-manager-open {
overflow: hidden;
}

modal-manager[mode='closed'] {
display: none;
}
</style>
<script type="module" crossorigin src="assets/main.13a904ba.js"></script>
</head>

<body>
<ia-book-actions></ia-book-actions>



<div>
<fieldset>
<legend>Dev testing for book title bar</legend>
<table class="initial">
<tr>
<td class="titleBar">
<label><input type="checkbox" name="title" value="title" />Title Bar</label>
</td>
<td class="searchParam">
<label><input type="checkbox" name="search" value="Search Param" />Search Param</label>
</td>
<td>
<label class="ia-button"><button class="pageChangedEvent">Page Change Event</button></label>
</td>
</tr>
</table>
</fieldset>

<fieldset>
<legend>Dev testing for book action bar</legend>
<table class="initial">
<tr colspan='5'>
<td class="errorEnable"><label><input type="checkbox" name="errorEnable" value="errorEnable" />Do you want to see error response?</label></td>
</tr>
<tr>
<td class="userState">
<label><input type="checkbox" name="user" value="isAdmin" />isAdmin</label>
<label><input type="checkbox" name="user" value="isLoggedIn" />isLoggedIn</label>
</td>
<td class="printDisabled">
<label><input type="checkbox" name="is_printdisabled" value="is_printdisabled" />is_printdisabled</label>
<label><input type="checkbox" name="user_is_printdisabled" value="user_is_printdisabled" />user_is_printdisabled</label>
</td>
<td class="availableToBrowse">
<label><input type="radio" name="browse" value="available_to_browse" />available_to_browse</label>
<label><input type="radio" name="browse" value="user_has_browsed" />user_has_browsed</label>
<label><input type="radio" name="browse" value="browsingExpired" />browsingExpired</label>
</td>
<td class="availableToBorrow">
<label><input type="radio" name="borrow" value="available_to_borrow" />available_to_borrow</label>
<label><input type="radio" name="borrow" value="user_on_waitlist" />user_on_waitlist</label>
<label><input type="radio" name="borrow" value="user_can_claim_waitlist" />user_can_claim_waitlist</label>
<label><input type="radio" name="borrow" value="available_to_waitlist" />available_to_waitlist</label>
<label><input type="radio" name="borrow" value="user_has_borrowed" />user_has_borrowed</label>
</td>
<td class="purchase">
<label><input type="checkbox" name="purchase" value="purchase" />purchase</label>
</td>

<td class="reflect">
<input type="button" style="padding: 10px;
background: #194880;
color: white;
font-weight: bold; display: none" name="purchase" value="Reflect" />
</td>
</tr>
<tr>
<td>
<fieldset style="margin-top: 10px;">
<legend style="color: black;">controls for browsed book</legend>
<table aria-hidden="true">
<tbody><tr>
<td class="action-button">
<button id="show_warning_modal">When Browsing (`user_has_browsed`),<br> show Warning Modal</button>
</td>
<td class="action-button">
<button id="show_expired_modal">While Browsing (`user_has_browsed`),<br> Expire book & show its modal</button>
</td>
<td class="action-button">
<button id="resync_timer">While Browsing (`user_has_browsed`),<br> resync timer</button>
</td>
</tr>
</tbody></table>
</fieldset>
</td>
</tr>
</table>
</fieldset>
</div>
<modal-manager></modal-manager>
</body>
</html>
7 changes: 7 additions & 0 deletions ghpages/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"demo/index.html": {
"file": "assets/main.13a904ba.js",
"src": "demo/index.html",
"isEntry": true
}
}
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@
},
"scripts": {
"start": "web-dev-server",
"prepare:ghpages": "rimraf ghpages && yarn run prepare && vite build",
"prepare": "rimraf dist && husky install",
"lint": "eslint --ext .js,.html . --ignore-path .gitignore && prettier \"**/*.js\" --check --ignore-path .gitignore",
"format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.js\" --write --ignore-path .gitignore",
"test": "yarn run lint && yarn test:fast",
"test:fast": "web-test-runner --coverage --playwright --browsers chromium firefox webkit",
"test:watch": "web-test-runner --watch --playwright --browsers chromium firefox webkit"
"test:watch": "web-test-runner --watch --playwright --browsers chromium firefox webkit",
"deploy": "yarn run deploy:run -e $(git branch --show-current)",
"deploy:run": "yarn run prepare:ghpages && touch ghpages/.nojekyll && yarn run deploy:gh",
"deploy:gh": "gh-pages -t -d ghpages -m \"Build for $(git log --pretty=format:\"%h %an %ai %s\" -n1) [skip ci]\""
},
"dependencies": {
"@internetarchive/icon-info": "^1.2.6",
Expand All @@ -38,10 +43,13 @@
"eslint-plugin-lit": "^1.3.0",
"eslint-plugin-lit-a11y": "^1.0.1",
"eslint-plugin-wc": "^1.3.0",
"husky": "^1.0.0",
"gh-pages": "^4.0.0",
"husky": "^7.0.0",
"lint-staged": "^10.0.0",
"prettier": "^2.0.4",
"sinon": "^13.0.2"
"sinon": "^13.0.2",
"vite": "^2.9.9",
"rimraf": "^3.0.2"
},
"eslintConfig": {
"extends": [
Expand Down
22 changes: 22 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { defineConfig } from 'vite';
import { resolve } from 'path';

// https://vitejs.dev/config/
export default defineConfig({
base: '',
build: {
outDir: 'ghpages',
manifest: true,
rollupOptions: {
input: {
main: resolve(__dirname, 'demo/index.html'),
},
},
},
server: {
host: true,
port: 8080,
open: true,
cors: true,
},
});
Loading

0 comments on commit 4753e96

Please sign in to comment.