23
23
</section >
24
24
25
25
<section class =" container__mid" >
26
- <iframe id =" appframe" src =" https://johnnyb-lab.robonomics.academy" sandbox =" allow-forms allow-scripts allow-same-origin" />
27
- <!-- <iframe id="appframe" src="https://johnnyb-lab.robonomics.academy" sandbox="allow-forms allow-scripts allow-same-origin" referrerpolicy="strict-origin-when-cross-origin" scrolling="no" /> -->
26
+ <div class =" iframecontainer" >
27
+ <div class =" iframecontrols" >
28
+ <a href =" javascript:;" @click.prevent =" expand" v-if =" !expanded" >Expand application</a >
29
+ <a href =" javascript:;" @click.prevent =" collapse" v-if =" expanded" >Collapse application</a >
30
+ </div >
31
+ <iframe id =" appframe" src =" https://johnnyb-lab.robonomics.academy" sandbox =" allow-forms allow-scripts allow-same-origin" />
32
+ <!-- <iframe id="appframe" src="https://johnnyb-lab.robonomics.academy" sandbox="allow-forms allow-scripts allow-same-origin" referrerpolicy="strict-origin-when-cross-origin" scrolling="no" /> -->
33
+ </div >
28
34
</section >
29
35
</Layout >
30
36
</template >
@@ -37,6 +43,12 @@ export default {
37
43
MetaInfo : () => import (' ~/components/MetaInfo.vue' )
38
44
},
39
45
46
+ data () {
47
+ return {
48
+ expanded: false ,
49
+ }
50
+ },
51
+
40
52
methods: {
41
53
resizeIframe () {
42
54
if (typeof document !== ' undefined' ) {
@@ -52,6 +64,22 @@ export default {
52
64
// console.log(e);
53
65
}
54
66
}
67
+ },
68
+
69
+ expand () {
70
+ const iframe = document .querySelector (" .iframecontainer" );
71
+ if (iframe) {
72
+ iframe .classList .add (' expanded' );
73
+ this .expanded = true ;
74
+ }
75
+ },
76
+
77
+ collapse () {
78
+ const iframe = document .querySelector (" .iframecontainer" );
79
+ if (iframe) {
80
+ iframe .classList .remove (' expanded' );
81
+ this .expanded = false ;
82
+ }
55
83
}
56
84
},
57
85
@@ -74,4 +102,39 @@ iframe {
74
102
height : 1100px ;
75
103
border : 0 ;
76
104
}
105
+
106
+ .iframecontainer {
107
+ position : relative ;
108
+ }
109
+
110
+ .iframecontainer.expanded {
111
+ position : fixed ;
112
+ top : 100px ;
113
+ left : 0 ;
114
+ right : 0 ;
115
+ bottom : 0 ;
116
+ height : calc (100vh - 30px );
117
+ z-index : 100 ;
118
+ }
119
+
120
+ .iframecontainer.expanded iframe {
121
+ position : absolute ;
122
+ top : 40px ;
123
+ left : 0 ;
124
+ right : 0 ;
125
+ bottom : 0 ;
126
+ height : calc (100% - 110px );
127
+ }
128
+
129
+ .iframecontrols {
130
+ text-align : right ;
131
+ }
132
+
133
+ .iframecontrols a {
134
+ display : inline-block ;
135
+ background : var (--color-main );
136
+ padding : 5px 20px ;
137
+ color : var (--color-text );
138
+ font-weight : bold ;
139
+ }
77
140
</style >
0 commit comments