Skip to content

Commit ca5c08c

Browse files
committed
minor changes to examples
1 parent 66fa311 commit ca5c08c

File tree

6 files changed

+34
-1
lines changed

6 files changed

+34
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ Custom Eelement for Open-API spec viewing
1414

1515
## Documentation
1616
[CHeck out the usage and examples](https://mrin9.github.io/RapiDoc/)
17+
18+
19+
## Roadmap
20+
- Allow replacing logo
21+
- Provide a console to try out the APIs
22+
- Enable OAuth, HTTP and Token based Authentication process

docs/example1.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
<meta charset="utf-8">
44
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
55
<script type="text/javascript" src="rapidoc-min.js"></script>
6+
<style>
7+
rapi-doc{
8+
width:100%;
9+
}
10+
</style>
611
</head>
712
<body>
813
<rapi-doc spec-url="https://api.apis.guru/v2/specs/bitbucket.org/2.0/swagger.json"> </rapi-doc>

docs/example2.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
<meta charset="utf-8">
44
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
55
<script type="text/javascript" src="rapidoc-min.js"></script>
6+
<style>
7+
rapi-doc{
8+
width:100%;
9+
}
10+
</style>
611
</head>
712
<body>
813
<rapi-doc spec-url="https://api.apis.guru/v2/specs/bitbucket.org/2.0/swagger.json" theme="dark"> </rapi-doc>

docs/example3.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22
<head>
33
<script type="text/javascript" src="rapidoc-min.js"></script>
44
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
5+
<style>
6+
rapi-doc{
7+
width:100%;
8+
}
9+
</style>
510
</head>
611
<body>
712
<rapi-doc
813
spec-url="https://api.apis.guru/v2/specs/bitbucket.org/2.0/swagger.json"
914
header-color="#2d87e2"
15+
primary-color="#2d87e2"
1016
theme="dark"
1117
> </rapi-doc>
1218
</body>

docs/example4.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
<head>
33
<script type="text/javascript" src="rapidoc-min.js"></script>
44
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
5+
<style>
6+
rapi-doc{
7+
width:100%;
8+
}
9+
</style>
510
</head>
611
<body>
712

docs/example5.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
cursor:pointer;
1717
outline:none;
1818
}
19+
rapi-doc{
20+
width:100%;
21+
}
1922
</style>
2023
<script type="text/javascript" src="rapidoc-min.js"></script>
2124
<script>
@@ -24,11 +27,14 @@
2427
}
2528
function changeAttr(attr){
2629
let arr=[];
30+
let rand = Math.floor(Math.random() * 10);
31+
2732
if (attr==="heading-text"){
2833
arr = ['SPIDER-MAN', "IRON-MAN", "BLACK-PANTHER", "RapiDoc", "SUPER-MAN", "BAT-MAN", "JOKER", "WONDER-WOMAN", "SUPER-GIRL", "CAT-WOMAN", "LARA-CROFT"];
2934
}
3035
else if (attr==="header-color"){
3136
arr = ['#2d87e2', "#ff6961", "#34A853", "#FBBC05", "#66757F", "#FFFFFF", "#3B5998", "#8B9DC3", "#7CBB00", "#7B0099", " #FF9900"];
37+
getRapiDoc().setAttribute('primary-color', arr[rand] );
3238
}
3339
else if(attr==="spec-url"){
3440
arr = [
@@ -48,7 +54,7 @@
4854
else{
4955
return;
5056
}
51-
getRapiDoc().setAttribute(attr, arr[Math.floor(Math.random() * 10)] );
57+
getRapiDoc().setAttribute(attr, arr[rand] );
5258
}
5359

5460
function changeLayout(){

0 commit comments

Comments
 (0)