Skip to content

Commit 04d0356

Browse files
added styles
1 parent 59da420 commit 04d0356

18 files changed

+323
-52
lines changed

node_modules/.yarn-integrity

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pythia-frontend/.env

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
VUE_APP_MORALIS_SERVER_URL = https://fkb8lv8amgpn.usemoralis.com:2053/server
2-
VUE_APP_MORALIS_APPLICATION_ID = S7c4GCnEMaj1Te6w2BYDZaXmP8Dwy0Nt84a73FEf
3-
CONTRACT_ADDRESS =
1+

pythia-frontend/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# pythia-frontend
2+
3+
## Project setup
4+
```
5+
yarn install
6+
```
7+
8+
### Compiles and hot-reloads for development
9+
```
10+
yarn serve
11+
```
12+
13+
### Compiles and minifies for production
14+
```
15+
yarn build
16+
```
17+
18+
### Lints and fixes files
19+
```
20+
yarn lint
21+
```
22+
23+
### Customize configuration
24+
See [Configuration Reference](https://cli.vuejs.org/config/).

pythia-frontend/src/App.vue

+38-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,43 @@
11

22
<template>
3-
<LoginUi />
4-
<CreateMarket />
3+
<router-view/>
54
</template>
65

7-
<script>
8-
import LoginUi from './components/LoginUi.vue'
9-
import CreateMarket from './components/CreateMarket.vue'
6+
<style>
7+
html, body {
8+
margin: 0;
9+
height: 100%;
10+
background-color: #1c1c1c;
11+
background-image: linear-gradient(151deg, #393939 20%, #1c1c1c 74%);
12+
}
1013
11-
export default {
12-
name: 'App',
13-
components: {
14-
LoginUi,
15-
CreateMarket
16-
}
17-
}
18-
</script>
14+
input {
15+
background: #454545;
16+
border: none;
17+
border-radius: 5px;
18+
box-shadow: 0.5px 0.5px 5px #121212;
19+
padding: 7px;
20+
}
21+
22+
input:focus{
23+
outline: 1.5px;
24+
outline-color: #2968a7;
25+
outline-style: solid;
26+
}
27+
28+
textarea {
29+
background: #454545;
30+
border: none;
31+
border-radius: 5px;
32+
box-shadow: 0.5px 0.5px 5px #121212;
33+
padding: 7px;
34+
font-size: 14px;
35+
}
36+
37+
38+
textarea:focus{
39+
outline: 1.5px;
40+
outline-color: #2968a7;
41+
outline-style: solid;
42+
}
43+
</style>

pythia-frontend/src/assets/logo.png

-6.69 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Moralis from '../main.js'
2+
3+
export let saveMarket = async(params) => {
4+
const Market = Moralis.Object.extend('Markets');
5+
const market = new Market();
6+
market.set('MarketId', params.marketId);
7+
market.set('MarketName', params.marketName);
8+
market.set('MarketDescription', params.marketDescription);
9+
await market.save();
10+
}

pythia-frontend/src/components/CreateMarket.vue

+51-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
<template>
2-
<input type="number" required v-model='sharesOwned[0]'/>
3-
<input type="number" required v-model='sharesOwned[1]'/>
4-
<input type="number" required v-model='moneyWaged[0]'/>
5-
<input type="number" required v-model='moneyWaged[1]'/>
6-
<input type="text" required v-model='priceFeedAddress'/>
7-
<input type="number" required v-model='strikePrice' />
8-
<input type="number" required v-model='resolutionDate' />
9-
<input type="number" required v-model='wageDeadline'/>
10-
<button @click="createMarket">Create Market</button>
11-
<button @click="approve">approve</button>
2+
<div class="flex-container">
3+
<div class="grid">
4+
<input type="text" class='long-input'>
5+
<input type="text" class='long-input' required v-model='priceFeedAddress'/>
6+
<input type="number" class='long-input' required v-model='strikePrice' />
7+
<input type="number" required v-model='resolutionDate' />
8+
<input type="number" required v-model='wageDeadline'/>
9+
<input type="number" required v-model='sharesOwned[0]'/>
10+
<input type="number" required v-model='sharesOwned[1]'/>
11+
<input type="number" required v-model='moneyWaged[0]'/>
12+
<input type="number" required v-model='moneyWaged[1]'/>
13+
<textarea class='long-input text-area'></textarea>
14+
<button @click="createMarket" class="submit-button">Create Market</button>
15+
</div>
16+
</div>
1217
</template>
1318

1419
<script>
15-
import { _createMarket, _getMarketInfo} from '../ContractFunctions.js';
20+
import { _createMarket, _getMarketInfo} from '../contract-functions/ContractFunctions.js';
1621
1722
export default {
1823
data() {
@@ -43,4 +48,39 @@ export default {
4348
</script>
4449

4550
<style scoped>
51+
52+
.flex-container {
53+
display: flex;
54+
justify-content: center;
55+
}
56+
.grid {
57+
display: grid;
58+
row-gap: 10px;
59+
column-gap: 5px;
60+
grid-template-columns: repeat(2, minmax(120px, 150px));
61+
grid-template-rows: repeat(9, 1fr);
62+
}
63+
64+
.long-input {
65+
grid-column-start: 1;
66+
grid-column-end: 3;
67+
}
68+
69+
.text-area {
70+
grid-row-start: 7;
71+
grid-row-end: 9;
72+
}
73+
74+
.submit-button {
75+
grid-column-start: 2;
76+
grid-column-end: 3;
77+
border: none;
78+
border-radius: 15px;
79+
background-color: #2968a7;
80+
color:#e1e1e1;
81+
box-shadow: 1px 1px 8px #121212;
82+
}
83+
.submit-button:hover{
84+
background-color: #1f5082;
85+
}
4686
</style>
+27-13
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,50 @@
11
<template>
2-
<button v-if="!isAuthenticated" @click="logIn">Connect Wallet</button>
3-
<button v-if="isAuthenticated" @click="logOut">Disconnect</button>
2+
<button v-if="!user" @click="logIn" class="login-button">Connect Wallet</button>
3+
<button v-if="user" @click="logOut" class="login-button">Disconnect</button>
44
</template>
55

66
<script>
77
import Moralis from '../main.js';
88
99
export default {
10-
data() {
11-
return {
12-
isAuthenticated: false
13-
};
10+
data(){
11+
return {
12+
user: Moralis.User.current()
13+
}
1414
},
1515
methods: {
1616
async logIn(){
17-
let user;
1817
try{
19-
user = await Moralis.authenticate();
20-
this.isAuthenticated = true;
21-
this.userAddress = user.get("ethAddress");
18+
await Moralis.authenticate();
19+
this.user = Moralis.User.current();
2220
} catch(error){
2321
console.error(error);
2422
}
2523
},
2624
async logOut(){
2725
await Moralis.User.logOut();
28-
this.isAuthenticated = false;
29-
console.log("logged out");
26+
this.user = Moralis.User.current();
27+
console.log('logged out');
28+
3029
}
31-
}
30+
},
31+
3232
};
3333
</script>
3434

3535
<style scoped>
36+
37+
.login-button {
38+
background-color: #3ac4b4;
39+
color:#121212;
40+
border:none;
41+
border-radius: 25px;
42+
box-shadow: 1px 1px 8px #121212;
43+
font-size: 12px;
44+
padding: 8px;
45+
}
46+
47+
.login-button:hover{
48+
background-color: #32978b;
49+
}
3650
</style>
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<template>
2+
<div>
3+
<router-link to="/"></router-link>
4+
</div>
5+
</template>
6+
7+
<script>
8+
import { _wageMoney, _getMarketInfo} from '../contract-functions/ContractFunctions.js';
9+
10+
export default {
11+
data() {
12+
return {
13+
moneyWaged: [0, 0],
14+
marketId: '0'
15+
};
16+
},
17+
methods: {
18+
async wageMoney() {
19+
const params = {
20+
_moneyWaged: this.moneyWaged,
21+
_marketId: this.marketId,
22+
};
23+
await _wageMoney(params);
24+
await _getMarketInfo(this.marketId);
25+
},
26+
}
27+
}
28+
</script>
29+
30+
<style scoped>
31+
</style>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<template>
2+
<div>
3+
<input type="number" required v-model='moneyWaged[0]'/>
4+
<input type="number" required v-model='moneyWaged[1]'/>
5+
<button @click="wageMoney">Wage Money</button>
6+
</div>
7+
</template>
8+
9+
<script>
10+
import {_wageMoney} from '../contract-functions/ContractFunctions.js';
11+
12+
export default {
13+
data() {
14+
return {
15+
moneyWaged: [0, 0],
16+
};
17+
},
18+
methods: {
19+
getMarketId(){
20+
return this.$route.params.marketId.toString();
21+
},
22+
async wageMoney() {
23+
const params = {
24+
_moneyToWage: this.moneyWaged,
25+
_marketId: this.getMarketId()
26+
};
27+
await _wageMoney(params);
28+
},
29+
},
30+
31+
}
32+
</script>
33+
34+
<style scoped>
35+
</style>

pythia-frontend/src/config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export const serverUrl = 'https://fkb8lv8amgpn.usemoralis.com:2053/server';
2-
export const appId = 'S7c4GCnEMaj1Te6w2BYDZaXmP8Dwy0Nt84a73FEf';
1+
export const serverUrl = 'https://uj5tozevki90.usemoralis.com:2053/server';
2+
export const appId = 'cKC95YPjyNN8qvLLqEEeGiYZwwc1qRZd8MqoBegb';
33
export const marketsABI = [
44
{
55
"inputs": [
@@ -349,7 +349,7 @@ export const marketsABI = [
349349
"type": "function"
350350
}
351351
];
352-
export const marketsAddress = '0x0C0411a068b63fca3160e370Da4D7521Ac248e3D';
352+
export const marketsAddress = '0x5F80929D42372De47a8d2b921960Bb5509C5D3Bc';
353353
export const ERC20ABI = [
354354
{
355355
"anonymous": false,

0 commit comments

Comments
 (0)